Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added pt-PT translation #21

Open
wants to merge 33 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
40d9af2
Added pt-PT translation
redglory Jan 19, 2015
d267f93
new jquery-ui syntax "jquery-ui/datepicker"
redglory Feb 11, 2015
65ea513
spree and spree_auth_devise bump to ~> 2.4
redglory Feb 11, 2015
b8553bc
Adjust to spree 3-0-stable
redglory Feb 16, 2015
8fd8658
Adjust to spree 3-0-stable
redglory Feb 16, 2015
5b30a32
Adjust to spree 3-0-stable
redglory Feb 16, 2015
c5f0c89
Adjust to spree 3-0-stable
redglory Feb 16, 2015
9d9af44
Adjust to spree 3-0-stable
redglory Feb 16, 2015
fd24e48
Adjust to spree 3-0-stable
redglory Feb 16, 2015
13f2fb5
i18n locale for Portugal is 'pt' and not 'pt-PT'
redglory Feb 16, 2015
361cc81
i18n locale for Portugal is 'pt' and not 'pt-PT'
redglory Feb 16, 2015
d05779e
Adjust to spree 3-0-stable
redglory Feb 18, 2015
b779fb6
replace '-' with '_' in 'spree-bank-transfer'
redglory Feb 18, 2015
81bd380
changed assets directory references
redglory Jun 25, 2015
0d5011a
fix sidebar configuration menu
redglory Jul 9, 2015
6039949
Adjust to new backend bootstrap theme and fix toggle_navitagion.js.erb
redglory Jul 10, 2015
340285e
i18n locale for Portugal is 'pt' and not 'pt-PT'
redglory Feb 16, 2015
e45ff02
i18n locale for Portugal is 'pt' and not 'pt-PT'
redglory Feb 16, 2015
48b4a64
changed assets directory references
redglory Jun 25, 2015
949db2e
fix sidebar configuration menu
redglory Jul 9, 2015
7287334
Adjust to new backend bootstrap theme and fix toggle_navitagion.js.erb
redglory Jul 10, 2015
e020d12
merge some 3-0-stable fixes to master
redglory Jul 10, 2015
e9a520b
Adjust gemspec to depend on spree 3.1.0
redglory Jul 10, 2015
abc79a5
Adjusted gemfile, versionfile to spree master branch
redglory Jul 10, 2015
457c837
erb to slim
redglory Jul 15, 2015
234d9fa
localize datepicker and fixed hide/show bank payment form javascript
redglory Jul 28, 2015
c60f34a
pushed 3-1-stable
redglory Aug 5, 2016
1559a90
merge 3-1-stable with master
redglory Feb 18, 2017
7893518
added verion 'master'
redglory Feb 18, 2017
a54192b
spree_core dependant of '>= 3.1.0, < 4.0'
redglory Feb 18, 2017
775b87d
updated jquery_ui/datepicker source
redglory Sep 24, 2017
bd58396
fixed before_filter
redglory Nov 25, 2018
2d9476f
bump version
redglory Nov 25, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
source 'https://rubygems.org'

# Provides basic authentication functionality for testing parts of your engine
gem 'spree', '~> 2.3.0'
gem 'spree_auth_devise', github: 'spree/spree_auth_devise', branch: '2-3-stable'
version = 'master'
gem 'spree', github: 'spree/spree', version
gem 'spree_auth_devise', github: 'spree/spree_auth_devise', branch: version

gem 'mysql2'

group :assets do
gem 'coffee-rails', '4.0.1'
gem 'coffee-rails', '~> 4.0.0'
gem 'sass-rails', '~> 4.0.2'
end

group :test do
gem 'minitest'
gem 'rspec-rails', '~> 2.10'
gem 'rspec-rails', '~> 3.3'
gem 'shoulda-matchers', '2.2.0'
gem 'simplecov', :require => false
gem 'database_cleaner'
Expand Down
11 changes: 0 additions & 11 deletions Versionfile

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,21 +1,29 @@
//= require jquery.ui.datepicker
//= require jquery-ui/widgets/datepicker

$(document).ready(function() {
$('#banktransfer_instructions').click(function(event) {
$('#banktransfer_instructions').on("click", function(event) {
newwindow = window.open($(this).attr('href'), 'bank transfer', 'left=20,top=20,width=650,height=750,toolbar=0,resizable=0,scrollbars=1');
if (window.focus) {
newwindow.focus();
}
return false;
});

$('[name="payment[deposited_on]"]').datepicker({dateFormat: '<%= Spree.t(:js_format, :scope => "date_picker", :default => "yy/mm/dd") %>'});
var options = $.extend(
{}, // empty object
$.datepicker.regional['<%= I18n.default_locale %>'], // I18n locale
{dateFormat: '<%= Spree.t(:js_format, :scope => "date_picker", :default => "yy/mm/dd") %>',
firstDay: '<%= Spree.t(:first_day, :scope => "date_picker", :default => "0") %>'}
);
$.datepicker.setDefaults(options);
$('[name="payment[deposited_on]"]').datepicker();

$('.add_bt_details').click(function() {
$('.add_bt_details').on("click", function() {
$(this).hide();
$('.bt_payment_form').show();
});

$('.bt_payment_form input[type="submit"]').click(function(event) {
$('.bt_payment_form input[type="submit"]').on("click", function(event) {
var empty_fields = $('.required_field').filter(function() { return !$(this).val().trim().length }), empty_fields_names = []
if ($(empty_fields).length) {
$(empty_fields).each(function() {
Expand All @@ -27,4 +35,5 @@ $(document).ready(function() {
return false;
}
});
});
});

Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
/*
*= require jquery.ui.datepicker
*= require jquery-ui
*= require jquery-ui/datepicker
*/

.ui-datepicker {
width: 18em; /* fix calendar width */
padding: .2em .2em 0;
}
.bt_payment_form { margin-left: -10px; }
.bt_payment_form table { border-collapse: inherit; }
.bt_payment_form [type="submit"] { margin-left: 10px; }
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/spree/payments_controller.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Spree
class PaymentsController < Spree::StoreController
before_filter :authenticate_spree_user!
before_filter :find_payment
before_action :authenticate_spree_user!
before_action :find_payment

def update
payment_details = PaymentDetails.new(@payment, payment_params)
Expand Down
Binary file removed app/helpers/.DS_Store
Binary file not shown.
Binary file removed app/helpers/spree/.DS_Store
Binary file not shown.
4 changes: 4 additions & 0 deletions app/helpers/spree/admin/banks_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ def action_to_toggle_bank_status(bank)
bank.active? ? Spree.t(:deactivate) : Spree.t(:activate)
end

def action_text_to_toggle_bank_status(bank)
bank.active? ? 'remove-sign' : 'ok-sign'
end

end
end
end
21 changes: 21 additions & 0 deletions app/helpers/spree/admin/navigation_helper_decorator.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module Spree
module Admin
module NavigationHelper

def link_to_with_icon(icon_name, text, url, options = {})
options[:class] = (options[:class].to_s + " icon-link with-tip action-#{icon_name}").strip
options[:class] += ' no-text' if options[:no_text]
options[:title] = text if options[:no_text]
text = options[:no_text] ? '' : raw("<span class='text'>#{text}</span>")
text = text.gsub('\'', '"')
options.delete(:no_text)
if icon_name
icon = content_tag(:span, '', class: "icon icon-#{icon_name}")
text.insert(0, icon + ' ')
end
link_to(text.html_safe, url, options)
end

end
end
end
Binary file removed app/models/.DS_Store
Binary file not shown.
Binary file removed app/models/spree/.DS_Store
Binary file not shown.
29 changes: 1 addition & 28 deletions app/overrides/add_bank_details_form_to_order_show.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,5 @@
:virtual_path => 'spree/shared/_order_details',
:name => 'add_bank_details_form_to_order_show',
:insert_bottom => ".payment-info",
:text => %q{
<% if bank_transfer_payment = @order.payments.from_bank_transfer.first %>
<% unless bank_transfer_payment.details_submitted? %>
<br>
<%= link_to Spree.t(:add_details), "javascript:void(0);", :class => 'button add_bt_details' %>
<% end %>
<%= form_for bank_transfer_payment, :html => { :class => "bt_payment_form #{bank_transfer_payment.details_submitted? ? '' : 'hidden'}" } do |f| %>
<table>
<tr>
<td><%= Spree.t(:deposited_on) %></td><td><%= f.text_field :deposited_on, :disabled => bank_transfer_payment.details_submitted?, :class => 'required_field', 'field-name' => 'Deposited on' %></td>
</tr>
<tr>
<td><%= Spree.t(:bank_name) %></td><td><%= f.text_field :bank_name, :disabled => bank_transfer_payment.details_submitted?, :class => 'required_field', 'field-name' => 'Bank name' %></td>
</tr>
<tr>
<td><%= Spree.t(:account_no) %></td><td><%= f.text_field :account_no, :disabled => bank_transfer_payment.details_submitted?, :class => 'required_field', 'field-name' => 'Account No.' %></td>
</tr>
<tr>
<td><%= Spree.t(:transaction_reference_no) %></td><td><%= f.text_field :transaction_reference_no, :disabled => bank_transfer_payment.details_submitted?, :class => 'required_field', 'field-name' => 'Transaction Reference No.' %></td>
</tr>
</table>
<br>
<% unless bank_transfer_payment.details_submitted? %>
<%= f.submit "Submit", :confirm => Spree.t(:confirm_details_submit) %>
<% end %>
<% end %>
<% end %>
}
:partial => "spree/orders/bank_transfer_form"
)
4 changes: 2 additions & 2 deletions app/overrides/add_banks_to_admin_configuration_sidebar.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Deface::Override.new(
:virtual_path => 'spree/admin/shared/_configuration_menu',
:virtual_path => 'spree/admin/shared/sub_menu/_configuration',
:name => 'add_banks_to_admin_configuration_sidebar',
:insert_bottom => "[data-hook='admin_configurations_sidebar_menu']",
:text => %q{
<%= configurations_sidebar_menu_item Spree.t(:banks), admin_banks_path %>
<%= configurations_sidebar_menu_item(Spree.t(:banks), admin_banks_path) %>
}
)
Binary file removed app/views/.DS_Store
Binary file not shown.
45 changes: 20 additions & 25 deletions app/views/spree/admin/banks/_form.html.erb
Original file line number Diff line number Diff line change
@@ -1,31 +1,26 @@
<%= render :partial => 'spree/shared/error_messages', :locals => { :target => @bank } %>
<div data-hook="admin_banks_form_fields">
<div class="row">
<%= f.field_container :name, :class => ['form-group'] do %>
<%= f.label :name, Spree.t(:name) %> <span class="required">*</span><br />
<%= f.error_message_on :name, :class => 'fullwidth title' %>
<%= f.text_field :name, :class => 'form-control' %>
<% end %>

<%= form_for [:admin, @bank] do |f| %>
<div data-hook="admin_inside_bank_form" class="row">
<div class="alpha five columns">
<%= f.field_container :name do %>
<%= f.label :name, Spree.t(:name) %> <span class="required">*</span><br />
<%= f.error_message_on :name, :class => 'fullwidth title' %>
<%= f.text_field :name, :class => 'fullwidth' %>
<% end %>

<%= f.field_container :account_no do %>
<%= f.label :account_no, Spree.t(:account_no) %><span class="required">*</span><br />
<%= f.text_field :account_no, :class => 'fullwidth' %>
<% end %>
<%= f.field_container :account_no, :class => ['form-group'] do %>
<%= f.label :account_no, Spree.t(:account_no) %><span class="required">*</span><br />
<%= f.text_field :account_no, :class => 'form-control' %>
<% end %>

<%= f.field_container :additional_details do %>
<%= f.label :additional_details, Spree.t(:additional_details) %><br />
<%= f.text_area :additional_details, :rows => 10, :class => 'fullwidth' %>
<% end %>
<%= f.field_container :additional_details, :class => ['form-group'] do %>
<%= f.label :additional_details, Spree.t(:additional_details) %><br />
<%= f.text_area :additional_details, :rows => 10, :class => 'form-control' %>
<% end %>

<%= f.field_container :active do %>
<%= f.field_container :active, :class => ['checkbox'] do %>
<%= f.label :active do %>
<%= f.check_box :active %>
<%= f.label :active, Spree.t(:active) %>
<%= Spree.t(:active) %>
<% end %>

<%= f.submit %>

</div>
<% end %>
</div>
<% end %>
</div>
16 changes: 14 additions & 2 deletions app/views/spree/admin/banks/edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,2 +1,14 @@
<h1><%= Spree.t(:edit_bank) %></h1>
<%= render :partial => 'form' %>
<% content_for :page_title do %>
<%= Spree.t(:editing_resource, resource: Spree::Bank.model_name.human) %> / <%= @bank.name %>
<% end %>

<%= render :partial => 'spree/admin/shared/error_messages', :locals => { :target => @bank } %>

<%= form_for @bank, :url => admin_bank_path(@bank) do |f| %>
<fieldset>
<%= render :partial => 'form', :locals => { :f => f } %>
<div data-hook="buttons" class="actions">
<%= button Spree.t('actions.update'), 'save' %>
</div>
</fieldset>
<% end %>
69 changes: 41 additions & 28 deletions app/views/spree/admin/banks/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,37 +1,50 @@
<%= render :partial => 'spree/admin/shared/configuration_menu' %>
<%= render :partial => 'spree/admin/shared/sub_menu/configuration' %>

<% content_for :page_title do %>
<%= Spree.t(:listing_banks) %>
<%= plural_resource_name(Spree::Bank) %>
<% end %>

<% content_for :page_actions do %>
<li>
<%= button_link_to Spree.t(:new_bank), new_admin_bank_path %>
</li>
<%= button_link_to Spree.t(:new_bank), new_object_url, :class => "btn-success", :icon => 'add', :id => 'admin_new_bank_link' %>
<% end %>

<%= paginate @banks %>
<% if @banks.any? %>

<table class='index'>
<thead>
<tr>
<th><%= Spree.t(:bank_name) %></th>
<th><%= Spree.t(:account_no) %></th>
<th><%= Spree.t(:additional_details) %></th>
<th><%= Spree.t(:status) %></th>
</tr>
</thead>

<tbody>
<% @banks.each do |bank| %>
<tr class="<%= cycle('odd', 'even') %>">
<td class="align-center"><%= bank.name %></td>
<td class="align-center"><%= bank.account_no %></td>
<td class="align-center"><%= bank.additional_details %></td>
<td class="align-center" id='active-status-<%= bank.id %>'><%= bank_status(bank) %></td>
<td class="actions"><%= link_to action_to_toggle_bank_status(bank), toggle_activation_admin_bank_path(bank), :remote => true, :method => :put %></td>
<td class="actions"><%= link_to_edit bank, :no_text => true, :class => 'edit' %></td>
<table class="table" id='listing_banks'>
<thead>
<tr data-hook="admin_banks_index_headers">
<th><%= Spree.t(:bank_name) %></th>
<th><%= Spree.t(:account_no) %></th>
<th><%= Spree.t(:additional_details) %></th>
<th><%= Spree.t(:status) %></th>
</tr>
<% end %>
</tbody>
</table>
</thead>
<tbody>
<% @banks.each do |bank|%>
<tr id="<%= spree_dom_id bank %>" data-hook="admin_banks_index_rows">
<td><%= bank.name %></td>
<td><%= bank.account_no %></td>
<td><%= bank.additional_details %></td>
<td id='active-status-<%= bank.id %>'><%= bank_status(bank) %></td>
<td data-hook="admin_banks_index_row_status" id='toggle-status-<%= bank.id %>' class="actions actions-2 text-right">
<% action_class = bank.active ? "btn-danger" : "btn-success" %>
<% btn_class = 'btn ' + action_class + ' btn-sm' %>
<% status = bank.active ? "active" : "inactive" %>
<% bank_id = 'bank-' + bank[:id].to_s %>
<%= link_to_with_icon(action_text_to_toggle_bank_status(bank), action_to_toggle_bank_status(bank), toggle_activation_admin_bank_path(bank), {:class => btn_class, :id => bank_id, :rel => status, :remote => true, :method => :put}) %>
</td>
<td data-hook="admin_banks_index_row_actions" class="actions actions-2 text-right">
<%= link_to_edit(bank, :no_text => true) if can? :edit, bank %>
<%= link_to_delete(bank, :no_text => true) if can? :delete, bank %>
</td>
</tr>
<% end %>
</tbody>
</table>

<% else %>
<div class="alert alert-info no-objects-found">
<%= Spree.t(:no_resource_found, resource: plural_resource_name(Spree::Bank)) %>,
<%= link_to(Spree.t(:add_one), new_object_url) if can? :create, Spree::Bank %>!
</div>
<% end %>
15 changes: 10 additions & 5 deletions app/views/spree/admin/banks/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
<%= render :partial => 'spree/admin/shared/configuration_menu' %>
<%= render :partial => 'spree/admin/shared/sub_menu/configuration' %>

<% content_for :page_title do %>
<%= Spree.t(:new_bank) %>
<% end %>

<% content_for :page_actions do %>
<li>
<%= button_link_to Spree.t(:back_to_banks_list), admin_banks_path, :icon => 'icon-arrow-left' %>
</li>
<%= link_to_with_icon 'arrow-left', Spree.t(:back_to_banks_list), admin_banks_path, :class => 'btn btn-primary' %>
<% end %>

<%= render :partial => 'form' %>
<%= render :partial => 'spree/admin/shared/error_messages', :locals => { :target => @bank } %>

<%= form_for [:admin, @bank] do |f| %>
<fieldset>
<%= render :partial => 'form', :locals => { :f => f } %>
<%= render :partial => 'spree/admin/shared/new_resource_links' %>
</fieldset>
<% end %>
6 changes: 5 additions & 1 deletion app/views/spree/admin/banks/toggle_activation.js.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
<% if @success %>
$('#active-status-<%= @bank.id %>').text('<%= bank_status(@bank) %>')
$('a[href="<%= toggle_activation_admin_bank_path(@bank) %>"]').text('<%= action_to_toggle_bank_status(@bank) %>')
<% action_class = @bank.active ? "btn-danger" : "btn-success" %>
<% btn_class = "btn " + action_class + " btn-sm" %>
<% status = @bank.active ? "active" : "inactive" %>
<% bank_id = "bank-" + @bank[:id].to_s %>
$('#toggle-status-<%= @bank.id %>').html('<%= link_to_with_icon(action_text_to_toggle_bank_status(@bank), action_to_toggle_bank_status(@bank), toggle_activation_admin_bank_path(@bank), {:class => btn_class, :id => bank_id, :rel => status, :remote => true, :method => :put}) %>')
<% else %>
alert('<%= @bank.errors.full_messages.to_sentence %>')
<% end %>
Binary file removed app/views/spree/checkout/.DS_Store
Binary file not shown.
16 changes: 0 additions & 16 deletions app/views/spree/checkout/payment/_banktransfer.html.erb

This file was deleted.

Loading