From 2a2f8f3531ae797515bf664623c76072d2ff20a3 Mon Sep 17 00:00:00 2001 From: Edem Date: Sat, 12 Dec 2015 16:58:42 +0100 Subject: [PATCH 01/40] admin entreprise_group are translated! --- .../enterprise_groups/_form_about.html.haml | 3 ++- .../enterprise_groups/_form_address.html.haml | 20 +++++++------- .../enterprise_groups/_form_images.html.haml | 12 +++++---- .../_form_primary_details.html.haml | 7 ++--- .../enterprise_groups/_form_users.html.haml | 7 ++--- .../enterprise_groups/_form_web.html.haml | 7 ++--- .../admin/enterprise_groups/index.html.haml | 14 ++++++---- .../enterprise_relationships/index.html.haml | 2 +- config/locales/en.yml | 26 +++++++++++++++++++ 9 files changed, 67 insertions(+), 31 deletions(-) diff --git a/app/views/admin/enterprise_groups/_form_about.html.haml b/app/views/admin/enterprise_groups/_form_about.html.haml index a29fde22cd..2c2ba59464 100644 --- a/app/views/admin/enterprise_groups/_form_about.html.haml +++ b/app/views/admin/enterprise_groups/_form_about.html.haml @@ -1,5 +1,6 @@ %fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='About'" } } - %legend About + %legend + = t 'admin_entreprise_groups_about' = f.field_container :long_description do %text-angular{'id' => 'enterprise_group_long_description', 'name' => 'enterprise_group[long_description]', 'class' => 'text-angular', 'ta-toolbar' => "[['h1','h2','h3','h4','p'],['bold','italics','underline','clear'],['insertLink']]"} diff --git a/app/views/admin/enterprise_groups/_form_address.html.haml b/app/views/admin/enterprise_groups/_form_address.html.haml index 12bb7ef315..a161c1d619 100644 --- a/app/views/admin/enterprise_groups/_form_address.html.haml +++ b/app/views/admin/enterprise_groups/_form_address.html.haml @@ -1,11 +1,12 @@ = f.fields_for :address do |af| %fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='Contact'" } } - %legend Contact + %legend + = t 'admin_entreprise_groups_contact' .row .alpha.three.columns = af.label :phone .omega.eight.columns - = af.text_field :phone, { placeholder: "eg. 98 7654 3210"} + = af.text_field :phone, { placeholder: t(:admin_entreprise_groups_contact_phone_placeholder)} .row .alpha.three.columns = f.label :email @@ -15,7 +16,7 @@ .three.columns.alpha = af.label :address1 .eight.columns.omega - = af.text_field :address1, { placeholder: "eg. 123 High Street"} + = af.text_field :address1, { placeholder: t(:admin_entreprise_groups_contact_address1_placeholder)} .row .alpha.three.columns = af.label :address2 @@ -23,18 +24,17 @@ = af.text_field :address2 .row .three.columns.alpha - = af.label :city, 'Suburb' + = af.label :city, t(:admin_entreprise_groups_contact_city) \/ - = af.label :zipcode, 'Postcode' + = af.label :zipcode, t(:admin_entreprise_groups_contact_zipcode) .four.columns - = af.text_field :city, { placeholder: "eg. Northcote"} + = af.text_field :city, { placeholder: t(:admin_entreprise_groups_contact_city_placeholder)} .four.columns.omega - = af.text_field :zipcode, { placeholder: "eg. 3070"} + = af.text_field :zipcode, { placeholder: t(:admin_entreprise_groups_contact_zipcode_placeholder)} .row .three.columns.alpha - = af.label :state_id, 'State' - \/ - = af.label :country_id, 'Country' + = af.label :state_id, t(:admin_entreprise_groups_contact_state_id) + = af.label :country_id, t(:admin_entreprise_groups_contact_country_id) .four.columns = af.collection_select :state_id, af.object.country.states, :id, :name, {}, :class => "select2 fullwidth" .four.columns.omega diff --git a/app/views/admin/enterprise_groups/_form_images.html.haml b/app/views/admin/enterprise_groups/_form_images.html.haml index 49169851c3..681c6c42b9 100644 --- a/app/views/admin/enterprise_groups/_form_images.html.haml +++ b/app/views/admin/enterprise_groups/_form_images.html.haml @@ -1,18 +1,20 @@ %fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='Images'" } } - %legend Images + %legend + = t 'admin_entreprise_groups_images' .row .alpha.three.columns = f.label :logo, class: 'with-tip', 'data-powertip' => 'This is the logo' - .with-tip{'data-powertip' => 'This is the logo'} + .with-tip{'data-powertip' => t(:admin_entreprise_groups_data_powertip_logo)} %a What's this? .omega.eight.columns = image_tag @object.logo.url if @object.logo.present? = f.file_field :logo .row .alpha.three.columns - = f.label :promo_image, class: 'with-tip', 'data-powertip' => 'This image is displayed at the top of the Group profile' - .with-tip{'data-powertip' => 'This image is displayed at the top of the Group profile'} - %a What's this? + = f.label :promo_image, class: 'with-tip', 'data-powertip' => t(:admin_entreprise_groups_data_powertip_promo_image) + .with-tip{'data-powertip' => t(:admin_entreprise_groups_data_powertip_promo_image_tip)} + %a + = t 'admin_entreprise_groups_what_s_this' .omega.eight.columns = image_tag @object.promo_image.url if @object.promo_image.present? = f.file_field :promo_image diff --git a/app/views/admin/enterprise_groups/_form_primary_details.html.haml b/app/views/admin/enterprise_groups/_form_primary_details.html.haml index d57333626f..6785d88ada 100644 --- a/app/views/admin/enterprise_groups/_form_primary_details.html.haml +++ b/app/views/admin/enterprise_groups/_form_primary_details.html.haml @@ -1,5 +1,6 @@ %fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='Primary Details'" } } - %legend Primary Details + %legend + = t "admin_entreprise_groups_primary_details" = f.field_container :name do = f.label :name %br/ @@ -11,12 +12,12 @@ = f.text_field :description = f.field_container :on_front_page do - = f.label :on_front_page, 'On front page?' + = f.label :on_front_page, t(:admin_entreprise_groups_on_front_page) %br/ = f.check_box :on_front_page = f.field_container :enterprise_ids do - = f.label :enterprise_ids, 'Enterprises' + = f.label :enterprise_ids, t(:admin_entreprise_groups_entreprise) %br/ = f.collection_select :enterprise_ids, @enterprises, :id, :name, {}, {class: "select2 fullwidth", multiple: true} diff --git a/app/views/admin/enterprise_groups/_form_users.html.haml b/app/views/admin/enterprise_groups/_form_users.html.haml index 0a8a5dd635..dada532af6 100644 --- a/app/views/admin/enterprise_groups/_form_users.html.haml +++ b/app/views/admin/enterprise_groups/_form_users.html.haml @@ -2,9 +2,10 @@ %legend Users .row .three.columns.alpha - =f.label :owner_id, 'Owner' - .with-tip{'data-powertip' => "The primary user responsible for this group."} - %a What's this? + =f.label :owner_id, t(:admin_entreprise_groups_owner) + .with-tip{'data-powertip' => t(:admin_entreprise_groups_data_powertip)} + %a + = t 'admin_entreprise_groups_what_s_this' .eight.columns.omega - if spree_current_user.admin? = f.hidden_field :owner_id, diff --git a/app/views/admin/enterprise_groups/_form_web.html.haml b/app/views/admin/enterprise_groups/_form_web.html.haml index 42638d94c6..4d20f9d2fd 100644 --- a/app/views/admin/enterprise_groups/_form_web.html.haml +++ b/app/views/admin/enterprise_groups/_form_web.html.haml @@ -1,10 +1,11 @@ %fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='Web'" } } - %legend Web Resources + %legend + = t 'admin_entreprise_groups_web' .row .alpha.three.columns = f.label :website .omega.eight.columns - = f.text_field :website, { placeholder: "eg. www.truffles.com"} + = f.text_field :website, { placeholder: t(:admin_entreprise_groups_web_website_placeholder)} .row .alpha.three.columns = f.label :facebook, 'Facebook' @@ -24,4 +25,4 @@ .alpha.three.columns = f.label :twitter .omega.eight.columns - = f.text_field :twitter, { placeholder: "eg. @the_prof" } + = f.text_field :twitter, { placeholder: t(:admin_entreprise_groups_web_twitter) } diff --git a/app/views/admin/enterprise_groups/index.html.haml b/app/views/admin/enterprise_groups/index.html.haml index 13bc19e364..932695201f 100644 --- a/app/views/admin/enterprise_groups/index.html.haml +++ b/app/views/admin/enterprise_groups/index.html.haml @@ -1,5 +1,5 @@ = content_for :page_title do - Enterprise Groups + = t 'admin_entreprise_groups' = content_for :page_actions do %li#new_enterprise_group_link @@ -8,11 +8,15 @@ %table.index#listing_enterprise_groups %thead %tr - %th Name + %th + = t 'admin_entreprise_groups_name' - if spree_current_user.admin? - %th Owner - %th On front page? - %th Enterprises + %th + = t 'admin_entreprise_groups_owner' + %th + = t 'admin_entreprise_groups_on_front_page' + %th + = t 'admin_entreprise_groups_entreprise' %th.actions %tbody diff --git a/app/views/admin/enterprise_relationships/index.html.haml b/app/views/admin/enterprise_relationships/index.html.haml index 40fbdbc415..15d26dcf66 100644 --- a/app/views/admin/enterprise_relationships/index.html.haml +++ b/app/views/admin/enterprise_relationships/index.html.haml @@ -1,5 +1,5 @@ - content_for :page_title do - Enterprise Relationships + = t 'admin_entreprise_relationships' = render 'admin/shared/enterprises_sub_menu' diff --git a/config/locales/en.yml b/config/locales/en.yml index c9df13af92..f6d745ca1d 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -658,3 +658,29 @@ Please follow the instructions there to make your enterprise visible on the Open price_graph: "Price graph" included_tax: "Included tax" remove_tax: "Remove tax" + admin_entreprise_relationships: "Enterprise Relationships" + admin_entreprise_groups: "Enterprise Groups" + admin_entreprise_groups_name: "Name" + admin_entreprise_groups_owner: "Owner" + admin_entreprise_groups_on_front_page: "On front page ?" + admin_entreprise_groups_entreprise: "Enterprises" + admin_entreprise_groups_primary_details: "Primary Details" + admin_entreprise_groups_data_powertip: "The primary user responsible for this group." + admin_entreprise_groups_data_powertip_logo: "This is the logo" + admin_entreprise_groups_data_powertip_promo_image: "This image is displayed at the top of the Group profile" + admin_entreprise_groups_data_powertip_promo_image_tip: "This image is displayed at the top of the Group profile" + admin_entreprise_groups_what_s_this: "What's this ?" + admin_entreprise_groups_about: "About" + admin_entreprise_groups_images: "Images" + admin_entreprise_groups_contact: "Contact" + admin_entreprise_groups_contact_phone_placeholder: "eg. 98 7654 3210" + admin_entreprise_groups_contact_address1_placeholder: "eg. 123 High Street" + admin_entreprise_groups_contact_city: "Suburb" + admin_entreprise_groups_contact_city_placeholder: "eg. Northcote" + admin_entreprise_groups_contact_zipcode: "Postcode" + admin_entreprise_groups_contact_zipcode_placeholder: "eg. 3070" + admin_entreprise_groups_contact_state_id: "State" + admin_entreprise_groups_contact_country_id: "Country" + admin_entreprise_groups_web: "Web Resources" + admin_entreprise_groups_web_twitter: "eg. @the_prof" + admin_entreprise_groups_web_website_placeholder: "eg. www.truffles.com" \ No newline at end of file From b58306aad8436e77e07e95f350b9357911390036 Mon Sep 17 00:00:00 2001 From: apprenti Date: Sat, 12 Dec 2015 17:00:41 +0100 Subject: [PATCH 02/40] my first translations --- .../admin/enterprise_fees/index.html.haml | 22 ++++++++----- .../admin/enterprise_roles/index.html.haml | 2 +- app/views/admin/order_cycles/edit.html.haml | 3 +- app/views/admin/order_cycles/index.html.haml | 31 ++++++++++++------- app/views/admin/order_cycles/new.html.haml | 3 +- .../order_cycles/set_coordinator.html.haml | 3 +- .../admin/producer_properties/index.html.haml | 2 +- config/locales/en.yml | 22 +++++++++++-- 8 files changed, 61 insertions(+), 27 deletions(-) diff --git a/app/views/admin/enterprise_fees/index.html.haml b/app/views/admin/enterprise_fees/index.html.haml index 08199d4c4a..42966bd6be 100644 --- a/app/views/admin/enterprise_fees/index.html.haml +++ b/app/views/admin/enterprise_fees/index.html.haml @@ -1,5 +1,5 @@ = content_for :page_title do - Enterprise Fees + =t :Enterprise_Fees = ng_form_for @enterprise_fee_set, :url => main_app.bulk_update_admin_enterprise_fees_path, :html => {'ng-app' => 'enterprise_fees', 'ng-controller' => 'AdminEnterpriseFeesCtrl'} do |enterprise_fee_set_form| = hidden_field_tag 'enterprise_id', @enterprise.id if @enterprise @@ -10,12 +10,18 @@ %table.index#listing_enterprise_fees %thead %tr - %th Enterprise - %th Fee Type - %th Name - %th Tax Category - %th Calculator - %th Calculator values + %th + =t'Enterprise' + %th + =t'fee_type' + %th + =t'name' + %th + =t'tax_category' + %th + =t'calculator' + %th + =t'calculator_values' %th.actions %tbody = enterprise_fee_set_form.ng_fields_for :collection do |f| @@ -30,4 +36,4 @@ %td{'ng-bind-html-unsafe-compiled' => 'enterprise_fee.calculator_settings'} %td.actions{'spree-delete-resource' => "1"} - = enterprise_fee_set_form.submit 'Update' + = enterprise_fee_set_form.submit t(:update) diff --git a/app/views/admin/enterprise_roles/index.html.haml b/app/views/admin/enterprise_roles/index.html.haml index a6e0985a99..45d8115597 100644 --- a/app/views/admin/enterprise_roles/index.html.haml +++ b/app/views/admin/enterprise_roles/index.html.haml @@ -1,5 +1,5 @@ - content_for :page_title do - Roles + =t :roles = render 'admin/shared/users_sub_menu' diff --git a/app/views/admin/order_cycles/edit.html.haml b/app/views/admin/order_cycles/edit.html.haml index 12dc6238ae..ed9b713d2c 100644 --- a/app/views/admin/order_cycles/edit.html.haml +++ b/app/views/admin/order_cycles/edit.html.haml @@ -4,7 +4,8 @@ = button_to "Notify producers", main_app.notify_producers_admin_order_cycle_path, :id => 'admin_notify_producers', :confirm => 'Are you sure?' -%h1 Edit Order Cycle +%h1 + =t'edit_order_cycle' - ng_controller = order_cycles_simple_form ? 'AdminSimpleEditOrderCycleCtrl' : 'AdminEditOrderCycleCtrl' diff --git a/app/views/admin/order_cycles/index.html.haml b/app/views/admin/order_cycles/index.html.haml index e39fdde12a..91f267a7d7 100644 --- a/app/views/admin/order_cycles/index.html.haml +++ b/app/views/admin/order_cycles/index.html.haml @@ -1,15 +1,15 @@ = content_for :page_title do - Order Cycles + = t :admin_order_cycles = content_for :page_actions do %li#new_order_cycle_link - = button_link_to "New Order Cycle", main_app.new_admin_order_cycle_path, :icon => 'icon-plus', :id => 'admin_new_order_cycle_link' + = button_link_to t(:new_order_cycle), main_app.new_admin_order_cycle_path, :icon => 'icon-plus', :id => 'admin_new_order_cycle_link' - if @show_more %li - = button_link_to "Show less", main_app.admin_order_cycles_path + = button_link_to t(:label_less), main_app.admin_order_cycles_path - else %li - = button_link_to "Show more", main_app.admin_order_cycles_path(params: { show_more: true }) + = button_link_to t(:label_more), main_app.admin_order_cycles_path(params: { show_more: true }) = form_for @order_cycle_set, :url => main_app.bulk_update_admin_order_cycles_path do |f| %table.index#listing_order_cycles @@ -28,14 +28,21 @@ %thead %tr - %th Name - %th Open - %th Close + %th + =t'name' + %th + =t'open' + %th + =t'close' - unless order_cycles_simple_index - %th Supplier - %th Coordinator - %th Distributors - %th Products + %th + =t'supplier' + %th + =t'coordinator' + %th + =t'distributors' + %th + =t'products' %th.actions %th.actions %th.actions @@ -44,4 +51,4 @@ = f.fields_for :collection do |order_cycle_form| = render 'admin/order_cycles/row', order_cycle_form: order_cycle_form - = f.submit 'Update' + = f.submit t(:update) diff --git a/app/views/admin/order_cycles/new.html.haml b/app/views/admin/order_cycles/new.html.haml index 460f2e08ca..4c0bee9e5a 100644 --- a/app/views/admin/order_cycles/new.html.haml +++ b/app/views/admin/order_cycles/new.html.haml @@ -1,4 +1,5 @@ -%h1 New Order Cycle +%h1 + =t'new_order_cycle' - ng_controller = order_cycles_simple_form ? 'AdminSimpleCreateOrderCycleCtrl' : 'AdminCreateOrderCycleCtrl' = admin_inject_order_cycle_instance diff --git a/app/views/admin/order_cycles/set_coordinator.html.haml b/app/views/admin/order_cycles/set_coordinator.html.haml index f2663cbfd2..1a31235f24 100644 --- a/app/views/admin/order_cycles/set_coordinator.html.haml +++ b/app/views/admin/order_cycles/set_coordinator.html.haml @@ -1,4 +1,5 @@ -%h4.text-center Select a coordinator for your order cycle +%h4.text-center + =t'select_a_coordinator_for_your_order_cycle' %br diff --git a/app/views/admin/producer_properties/index.html.haml b/app/views/admin/producer_properties/index.html.haml index d8eac9e816..d898860cb1 100644 --- a/app/views/admin/producer_properties/index.html.haml +++ b/app/views/admin/producer_properties/index.html.haml @@ -6,7 +6,7 @@ - content_for :page_actions do %ul.tollbar.inline-menu %li - = link_to_add_fields 'Add Producer Property', 'tbody#producer_properties', class: 'icon-plus button' + = link_to_add_fields t(:add_producer_property), 'tbody#producer_properties', class: 'icon-plus button' = render 'spree/shared/error_messages', target: @enterprise diff --git a/config/locales/en.yml b/config/locales/en.yml index f6d745ca1d..4198ede74b 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -96,7 +96,7 @@ en: label_administration: "Administration" label_admin: "Admin" label_account: "Account" - label_more: "More" + label_more: "Show more" label_less: "Show less" items: "items" @@ -683,4 +683,22 @@ Please follow the instructions there to make your enterprise visible on the Open admin_entreprise_groups_contact_country_id: "Country" admin_entreprise_groups_web: "Web Resources" admin_entreprise_groups_web_twitter: "eg. @the_prof" - admin_entreprise_groups_web_website_placeholder: "eg. www.truffles.com" \ No newline at end of file + admin_entreprise_groups_web_website_placeholder: "eg. www.truffles.com" + admin_order_cycles: "Admin Order Cycles" + open: "Open" + close: "Close" + supplier: "Supplier" + coordinator: "Coordinator" + distributor: "Distributor" + product: "Products" + enterprise_fees: "Enterprise Fees" + fee_type: "Fee Type" + tax_category: "Tax Category" + calculator: "Calculator" + calculator_values: "Calculator values" + new_order_cycles: "New Order Cycles" + select_a_coordinator_for_your_order_cycle: "select a coordinator for your order cycle" + edit_order_cycle: "Edit Order Cycle" + roles: "Roles" + update: "Update" + add_producer_property: "Add producer property" From 8fa293f561c602552b8dd6a6984e7d60900925e5 Mon Sep 17 00:00:00 2001 From: julienFR88 Date: Sat, 12 Dec 2015 17:25:28 +0100 Subject: [PATCH 03/40] my admin interface translations --- .../edit.html.haml | 50 +++++++++++-------- app/views/admin/customers/index.html.haml | 12 +++-- .../variant_overrides/_actions.html.haml | 2 +- .../admin/variant_overrides/_header.html.haml | 2 +- .../variant_overrides/_hub_choice.html.haml | 4 +- .../variant_overrides/_products.html.haml | 8 +-- config/locales/en.yml | 29 +++++++++++ 7 files changed, 75 insertions(+), 32 deletions(-) diff --git a/app/views/admin/accounts_and_billing_settings/edit.html.haml b/app/views/admin/accounts_and_billing_settings/edit.html.haml index 71fac1fd28..434ad6884c 100644 --- a/app/views/admin/accounts_and_billing_settings/edit.html.haml +++ b/app/views/admin/accounts_and_billing_settings/edit.html.haml @@ -8,9 +8,10 @@ -# - month_options = (0...12).map { |i| Time.zone.now.beginning_of_month - i.months }.map{ |t| [t.strftime("%b %Y"), t.strftime("%b %Y %z")]} %fieldset.no-border-bottom - %legend Settings + %legend + =t :admin_settings = form_for @settings, as: :settings, url: main_app.admin_accounts_and_billing_settings_path, :method => :put do |f| - .row{ ng: { app: 'admin.accounts_and_billing_settings' } } + .row{ ng: { app: t(:admin_accounts_and_billing) } } .twelve.columns.alpha.omega .field = f.label :accounts_distributor_id, t(:accounts_administration_distributor) @@ -23,26 +24,32 @@ .row .six.columns.alpha %fieldset.no-border-bottom - %legend Update Invoices + %legend + =t :update_invoice = f.check_box :auto_update_invoices - = f.label :auto_update_invoices, "Auto-update invoices nightly at 1:00am" + = f.label :auto_update_invoices, + t(:auto_finalise_invoices) .six.columns.omega %fieldset.no-border-bottom - %legend Finalise Invoices + %legend + =t :finalise_invoice = f.check_box :auto_finalize_invoices - = f.label :auto_finalize_invoices, "Auto-finalise invoices monthly on the 2nd at 1:30am" + = f.label :auto_finalize_invoices, + t(:auto_update_invoices) .row .twelve.columns.alpha.omega.form-buttons{"data-hook" => "buttons"} = button t(:update), 'icon-refresh', value: "update" %fieldset.no-border-bottom - %legend Manually Run Tasks + %legend + =t :manually_run_task .row .six.columns.alpha.step.text-center .form-buttons{"data-hook" => "buttons"} - =link_to_with_icon "icon-undo", "Update User Invoices", + =link_to_with_icon "icon-undo", + t(:update_user_invoices) , main_app.start_job_admin_accounts_and_billing_settings_path(job: { name: "update_account_invoices" }), class: "button fullwidth" @@ -51,22 +58,22 @@ - if @update_account_invoices_job %p.text-center - if @update_account_invoices_job.run_at < Time.zone.now - %strong In Progress + =t :in_progress %br - Started at: + =t :started_at - else - %strong Queued + %strong + =t :queued %br - Scheduled for: + =t :Scheduled_for = @update_account_invoices_job.run_at - else %p.explanation - Use this button to immediately update invoices for the month to date for each enterprise user in the system. This task can be set up to run automatically every night. - + =t :update_user_invoice_explained .six.columns.omega.step.text-center .form-buttons{"data-hook" => "buttons"} - =link_to_with_icon "icon-ok-sign", "Finalise User Invoices", + =link_to_with_icon "icon-ok-sign", t(:finalise_user_invoice ), main_app.start_job_admin_accounts_and_billing_settings_path(job: { name: "finalize_account_invoices" }), class: "button fullwidth" @@ -75,14 +82,17 @@ - if @finalize_account_invoices_job %p.text-center - if @finalize_account_invoices_job.run_at < Time.zone.now - %strong In Progress + %strong + =t :in_progress %br - Started at: + =t :started_at - else - %strong Queued + %strong + =t :queued %br - Scheduled for: + =t :scheduled_for = @finalize_account_invoices_job.run_at - else %p.explanation - Use this button to finalize all invoices in the system for the previous calendar month. This task can be set up to run automatically once a month. + =t :finalise_user_invoice_explained + diff --git a/app/views/admin/customers/index.html.haml b/app/views/admin/customers/index.html.haml index 66790a34df..170ace343e 100644 --- a/app/views/admin/customers/index.html.haml +++ b/app/views/admin/customers/index.html.haml @@ -1,12 +1,14 @@ - content_for :page_title do - %h1.page-title Customers + %h1.page-title + =t :customers = admin_inject_shops %div{ ng: { app: 'admin.customers', controller: 'customersCtrl' } } .row{ ng: { hide: "loaded() && filteredCustomers.length > 0" } } .five.columns.alpha - %h3 Please select a Hub: + %h3 + =t :please_select_hub .four.columns %select.select2.fullwidth#shop_id{ 'ng-model' => 'shop.id', name: 'shop_id', 'ng-options' => 'shop.id as shop.name for shop in shops' } .seven.columns.omega   @@ -34,9 +36,11 @@ .row{ 'ng-if' => 'shop && !loaded()' } .sixteen.columns.alpha#loading %img.spinner{ src: "/assets/spinning-circles.svg" } - %h1 LOADING CUSTOMERS + %h1 + =t :loading_customers .row{ :class => "sixteen columns alpha", 'ng-show' => 'loaded() && filteredCustomers.length == 0'} - %h1#no_results No customers found. + %h1#no_results + =t :no_customers_found .row{ ng: { show: "loaded() && filteredCustomers.length > 0" } } diff --git a/app/views/admin/variant_overrides/_actions.html.haml b/app/views/admin/variant_overrides/_actions.html.haml index 0ae6f8b96b..8fea8b6838 100644 --- a/app/views/admin/variant_overrides/_actions.html.haml +++ b/app/views/admin/variant_overrides/_actions.html.haml @@ -1,4 +1,4 @@ .row - %input.four.columns.alpha{type: 'button', value: 'Save Changes', 'ng-click' => 'update()'} + %input.four.columns.alpha{type: 'button', value: t(:save_changes), 'ng-click' => 'update()'} .twelve.columns.omega = render 'spree/admin/shared/status_message' diff --git a/app/views/admin/variant_overrides/_header.html.haml b/app/views/admin/variant_overrides/_header.html.haml index 7b4a38db47..06334855b5 100644 --- a/app/views/admin/variant_overrides/_header.html.haml +++ b/app/views/admin/variant_overrides/_header.html.haml @@ -1,4 +1,4 @@ - content_for :page_title do - Override Product Details + =t :override_product_details = render :partial => 'spree/admin/shared/product_sub_menu' diff --git a/app/views/admin/variant_overrides/_hub_choice.html.haml b/app/views/admin/variant_overrides/_hub_choice.html.haml index aa0f7ab738..c7b19458e1 100644 --- a/app/views/admin/variant_overrides/_hub_choice.html.haml +++ b/app/views/admin/variant_overrides/_hub_choice.html.haml @@ -1,7 +1,7 @@ .row .two.columns.alpha - Hub + =t :hub .four.columns %select.select2.fullwidth#hub_id{ 'ng-model' => 'hub_id', name: 'hub_id', 'ng-options' => 'hub.id as hub.name for hub in hubs' } .ten.columns.omega - %input{ type: 'button', value: 'Go', 'ng-click' => 'selectHub()' } + %input{ type: 'button', value: t(:go), 'ng-click' => 'selectHub()' } diff --git a/app/views/admin/variant_overrides/_products.html.haml b/app/views/admin/variant_overrides/_products.html.haml index cf11e8ac5d..4ee3644798 100644 --- a/app/views/admin/variant_overrides/_products.html.haml +++ b/app/views/admin/variant_overrides/_products.html.haml @@ -1,10 +1,10 @@ %table.index.bulk{ng: {show: 'hub'}} %thead %tr - %th Producer - %th Product - %th Price - %th On hand + %th t(:producer) + %th t(:product) + %th t(:price) + %th t(:on_hand) %tbody{ng: {repeat: 'product in products | hubPermissions:hubPermissions:hub.id'}} = render 'admin/variant_overrides/products_product' = render 'admin/variant_overrides/products_variants' diff --git a/config/locales/en.yml b/config/locales/en.yml index 4198ede74b..1d9f7a6120 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -702,3 +702,32 @@ Please follow the instructions there to make your enterprise visible on the Open roles: "Roles" update: "Update" add_producer_property: "Add producer property" + admin_settings: "Settings" + update_invoice: "Update Invoices" + finalise_invoice: "Finalise Invoices" + finalise_user_invoice: "Finalise User Invoice" + finalise_user_invoice_explained: "Use this button to finalize all invoices in the system for the previous calendar month. This task can be set up to run automatically once a month." + manually_run_task: "Manually Run Task " + update_user_invoices: "Update User Invoices" + update_user_invoice_explained: "Use this button to immediately update invoices for the month to date for each enterprise user in the system. This task can be set up to run automatically every night." + auto_finalise_invoices: "Auto-finalise invoices monthly on the 2nd at 1:30am" + auto_update_invoices: "Auto-update invoices nightly at 1:00am" + in_progress: "In Progress" + started_at: "Started at" + queued: "Queued" + scheduled_for: "Scheduled for" + customers: "Customers" + please_select_hub: "Please select a Hub" + loading_customers: "Loading Customers" + no_customers_found: "No customers found" + go: "Go" + hub: "Hub" + accounts_administration_distributor: "accounts administration distributor" + override_product_details: "Override Product Details" + admin_accounts_and_billing: "admin.accounts_and_billing_settings" + producer: "Producer" + product: "Product" + price: "Price" + on_hand: "On hand" + save_changes: "Save changes" + update_action: "update()" From d2ec4fcf88eb2478e7d7728a6ed188ea4a38c39c Mon Sep 17 00:00:00 2001 From: Edem Date: Sun, 13 Dec 2015 17:06:49 +0100 Subject: [PATCH 04/40] Everything string translated in admin/entreprise_relationships --- .../_enterprise_relationship.html.haml | 3 ++- app/views/admin/enterprise_relationships/_form.html.haml | 6 +++--- .../admin/enterprise_relationships/_search_input.html.haml | 2 +- config/locales/en.yml | 7 ++++++- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/app/views/admin/enterprise_relationships/_enterprise_relationship.html.haml b/app/views/admin/enterprise_relationships/_enterprise_relationship.html.haml index 996bc487d8..b4e865f083 100644 --- a/app/views/admin/enterprise_relationships/_enterprise_relationship.html.haml +++ b/app/views/admin/enterprise_relationships/_enterprise_relationship.html.haml @@ -1,6 +1,7 @@ %tr{"ng-repeat" => "enterprise_relationship in EnterpriseRelationships.enterprise_relationships | keywords:query"} %td {{ enterprise_relationship.parent_name }} - %td permits + %td + = t 'admin_entreprise_relationships_permits' %td {{ enterprise_relationship.child_name }} %td %ul diff --git a/app/views/admin/enterprise_relationships/_form.html.haml b/app/views/admin/enterprise_relationships/_form.html.haml index 433f9f4ca0..300b096424 100644 --- a/app/views/admin/enterprise_relationships/_form.html.haml +++ b/app/views/admin/enterprise_relationships/_form.html.haml @@ -3,17 +3,17 @@ %select{name: "enterprise_relationship_parent_id", "ng-model" => "parent_id", "ng-options" => "e.id as e.name for e in Enterprises.my_enterprises"} %td - permits + = t 'admin_entreprise_relationships_permits' %td %select{name: "enterprise_relationship_child_id", "ng-model" => "child_id", "ng-options" => "e.id as e.name for e in Enterprises.all_enterprises"} %td %label %input{type: "checkbox", ng: {checked: "allPermissionsChecked()", click: "checkAllPermissions()"}} - Everything + = t 'admin_entreprise_relationships_everything' %div{"ng-repeat" => "permission in EnterpriseRelationships.all_permissions"} %label %input{type: "checkbox", "ng-model" => "permissions[permission]"} to {{ EnterpriseRelationships.permission_presentation(permission) }} %td.actions - %input{type: "button", value: "Create", "ng-click" => "create()"} + %input{type: "button", value: t(:admin_entreprise_relationships_button_create), "ng-click" => "create()"} .errors {{ EnterpriseRelationships.create_errors }} diff --git a/app/views/admin/enterprise_relationships/_search_input.html.haml b/app/views/admin/enterprise_relationships/_search_input.html.haml index b8bcbc62c6..350089dc4f 100644 --- a/app/views/admin/enterprise_relationships/_search_input.html.haml +++ b/app/views/admin/enterprise_relationships/_search_input.html.haml @@ -1,4 +1,4 @@ -%input.search{"ng-model" => "query", "placeholder" => "Search"} +%input.search{"ng-model" => "query", "placeholder" => t(:admin_entreprise_relationships_seach_placeholder)} %label{ng: {repeat: "permission in EnterpriseRelationships.all_permissions"}} %input{type: "checkbox", ng: {click: "$parent.query = toggleKeyword($parent.query, permission)"}} diff --git a/config/locales/en.yml b/config/locales/en.yml index 1d9f7a6120..7e1274739c 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -659,6 +659,10 @@ Please follow the instructions there to make your enterprise visible on the Open included_tax: "Included tax" remove_tax: "Remove tax" admin_entreprise_relationships: "Enterprise Relationships" + admin_entreprise_relationships_everything: "Everything" + admin_entreprise_relationships_permits: "permits" + admin_entreprise_relationships_seach_placeholder: "Search" + admin_entreprise_relationships_button_create: "Create" admin_entreprise_groups: "Enterprise Groups" admin_entreprise_groups_name: "Name" admin_entreprise_groups_owner: "Owner" @@ -669,7 +673,6 @@ Please follow the instructions there to make your enterprise visible on the Open admin_entreprise_groups_data_powertip_logo: "This is the logo" admin_entreprise_groups_data_powertip_promo_image: "This image is displayed at the top of the Group profile" admin_entreprise_groups_data_powertip_promo_image_tip: "This image is displayed at the top of the Group profile" - admin_entreprise_groups_what_s_this: "What's this ?" admin_entreprise_groups_about: "About" admin_entreprise_groups_images: "Images" admin_entreprise_groups_contact: "Contact" @@ -684,6 +687,7 @@ Please follow the instructions there to make your enterprise visible on the Open admin_entreprise_groups_web: "Web Resources" admin_entreprise_groups_web_twitter: "eg. @the_prof" admin_entreprise_groups_web_website_placeholder: "eg. www.truffles.com" +<<<<<<< HEAD admin_order_cycles: "Admin Order Cycles" open: "Open" close: "Close" @@ -731,3 +735,4 @@ Please follow the instructions there to make your enterprise visible on the Open on_hand: "On hand" save_changes: "Save changes" update_action: "update()" + admin_entreprise_groups_what_s_this: "What's this ?" From 8ccf527e01dd0366469d30298f948b23fe71fc56 Mon Sep 17 00:00:00 2001 From: Edem Date: Wed, 16 Dec 2015 19:00:25 +0100 Subject: [PATCH 05/40] all strings in app/views/spree/admin/overview/* translated! --- .../overview/_enterprises_footer.html.haml | 2 +- .../overview/_enterprises_header.html.haml | 8 ++-- .../overview/_enterprises_hubs_tab.html.haml | 9 ++-- .../overview/_enterprises_none.html.haml | 5 ++- .../_enterprises_producers_tab.html.haml | 12 ++++-- .../overview/_enterprises_tabs.html.haml | 6 ++- .../admin/overview/_order_cycles.html.haml | 15 ++++--- .../spree/admin/overview/_products.html.haml | 15 ++++--- .../multi_enterprise_dashboard.html.haml | 3 +- .../single_enterprise_dashboard.html.haml | 38 +++++++++-------- config/locales/en.yml | 42 ++++++++++++++++++- 11 files changed, 107 insertions(+), 48 deletions(-) diff --git a/app/views/spree/admin/overview/_enterprises_footer.html.haml b/app/views/spree/admin/overview/_enterprises_footer.html.haml index c61add38f5..c704dfef64 100644 --- a/app/views/spree/admin/overview/_enterprises_footer.html.haml +++ b/app/views/spree/admin/overview/_enterprises_footer.html.haml @@ -1,3 +1,3 @@ %a.sixteen.columns.alpha.button.bottom.blue{ href: "#{main_app.admin_enterprises_path}" } - MANAGE MY ENTERPRISES + = t "spree_admin_overview_enterprises_footer" %span.icon-arrow-right diff --git a/app/views/spree/admin/overview/_enterprises_header.html.haml b/app/views/spree/admin/overview/_enterprises_header.html.haml index fcc7d269f2..6ed4ae8d65 100644 --- a/app/views/spree/admin/overview/_enterprises_header.html.haml +++ b/app/views/spree/admin/overview/_enterprises_header.html.haml @@ -1,8 +1,10 @@ %div.header.sixteen.columns.alpha{ :class => "#{@enterprises.count > 0 ? "" : "red"}"} - %h3.thirteen.columns.alpha My Enterprises + %h3.thirteen.columns.alpha + = t "spree_admin_overview_enterprises_header" - if @enterprises.any? - if spree_current_user.can_own_more_enterprises? %a.three.columns.omega.icon-plus.button.blue.white-bottom{ href: "#{main_app.new_admin_enterprise_path}" } - CREATE NEW + = t "spree_admin_enterprises_create_new" - else - %a.with-tip{ title: "Enterprises are Producers and/or Hubs and are the basic unit of organisation within the Open Food Network." } What's this? + %a.with-tip{ title: "Enterprises are Producers and/or Hubs and are the basic unit of organisation within the Open Food Network." } + = t "admin_enterprise_groups_what_s_this" diff --git a/app/views/spree/admin/overview/_enterprises_hubs_tab.html.haml b/app/views/spree/admin/overview/_enterprises_hubs_tab.html.haml index cb177f9fb3..91deb6f1cc 100644 --- a/app/views/spree/admin/overview/_enterprises_hubs_tab.html.haml +++ b/app/views/spree/admin/overview/_enterprises_hubs_tab.html.haml @@ -1,12 +1,15 @@ %div.hubs_tab{ ng: { show: "activeTab == 'hubs'"} } %div.sixteen.columns.alpha.list-title - %span.five.columns.alpha Name + %span.five.columns.alpha + = t "spree_admin_enterprises_hubs_name" - if can? :admin, Spree::PaymentMethod %span.centered.three.columns Payment Methods - if can? :admin, Spree::ShippingMethod - %span.centered.three.columns Shipping Methods + %span.centered.three.columns + = t "spree_admin_enterprises_shipping_methods" - if can? :admin, EnterpriseFee - %span.centered.three.columns Enterprise Fees + %span.centered.three.columns + = t "spree_admin_enterprises_fees" %div.sixteen.columns.alpha.list - @enterprises.is_distributor.each do |enterprise| %a.sixteen.columns.alpha.list-item{ class: "#{cycle('odd','even')}", href: "#{main_app.edit_admin_enterprise_path(enterprise)}" } diff --git a/app/views/spree/admin/overview/_enterprises_none.html.haml b/app/views/spree/admin/overview/_enterprises_none.html.haml index c1428a6863..72cd90df1a 100644 --- a/app/views/spree/admin/overview/_enterprises_none.html.haml +++ b/app/views/spree/admin/overview/_enterprises_none.html.haml @@ -1,7 +1,8 @@ %div.sixteen.columns.alpha.list-item.red - %span.text.fifteen.columns.alpha You don't have any enterprises yet. + %span.text.fifteen.columns.alpha + = t "spree_admin_enterprises_none_text" %span.one.columns.omega %span.icon-remove-sign %a.sixteen.columns.alpha.button.bottom.red{ href: "#{main_app.new_admin_enterprise_path}" } - CREATE A NEW ENTERPRISE + = t "spree_admin_enterprises_none_create_a_new_enterprise" %span.icon-arrow-right diff --git a/app/views/spree/admin/overview/_enterprises_producers_tab.html.haml b/app/views/spree/admin/overview/_enterprises_producers_tab.html.haml index d5cad103b7..7ff6c8b911 100644 --- a/app/views/spree/admin/overview/_enterprises_producers_tab.html.haml +++ b/app/views/spree/admin/overview/_enterprises_producers_tab.html.haml @@ -1,11 +1,15 @@ %div.producers_tab{ ng: { show: "activeTab == 'producers'"} } %div.list-title.sixteen.columns.alpha - %span.five.columns.alpha Name + %span.five.columns.alpha + = t "spree_admin_enterprises_producers_name" - if can? :admin, Spree::Product - %span.centered.three.columns Total Products - %span.centered.three.columns Active Products + %span.centered.three.columns + = t "spree_admin_enterprises_producers_total_products" + %span.centered.three.columns + = t "spree_admin_enterprises_producers_active_products" - if can? :admin, OrderCycle - %span.centered.three.columns Products in OCs + %span.centered.three.columns + = t "spree_admin_enterprises_producers_order_cycles" %div.sixteen.columns.alpha.list - @enterprises.is_primary_producer.each do |enterprise| %a.sixteen.columns.alpha.list-item{ class: "#{cycle('odd','even')}", href: "#{main_app.edit_admin_enterprise_path(enterprise)}" } diff --git a/app/views/spree/admin/overview/_enterprises_tabs.html.haml b/app/views/spree/admin/overview/_enterprises_tabs.html.haml index f6e5413786..1124c90f30 100644 --- a/app/views/spree/admin/overview/_enterprises_tabs.html.haml +++ b/app/views/spree/admin/overview/_enterprises_tabs.html.haml @@ -1,3 +1,5 @@ %div.sixteen.columns.alpha.tabs - %div.dashboard_tab.eight.columns.alpha.blue{ ng: { class: "{selected: activeTab == 'hubs'}", click: "activeTab = 'hubs'" } } HUBS - %div.dashboard_tab.eight.columns.omega.blue{ ng: { class: "{selected: activeTab == 'producers'}", click: "activeTab = 'producers'" } } PRODUCERS + %div.dashboard_tab.eight.columns.alpha.blue{ ng: { class: "{selected: activeTab == 'hubs'}", click: "activeTab = 'hubs'" } } + = t "spree_admin_enterprises_tabs_hubs" + %div.dashboard_tab.eight.columns.omega.blue{ ng: { class: "{selected: activeTab == 'producers'}", click: "activeTab = 'producers'" } } + = t "spree_admin_enterprises_tabs_producers" diff --git a/app/views/spree/admin/overview/_order_cycles.html.haml b/app/views/spree/admin/overview/_order_cycles.html.haml index c1b7f90276..b39d8a706f 100644 --- a/app/views/spree/admin/overview/_order_cycles.html.haml +++ b/app/views/spree/admin/overview/_order_cycles.html.haml @@ -1,11 +1,13 @@ %div.dashboard_item.seven.columns.omega#order_cycles %div.header.seven.columns.alpha{ :class => "#{@order_cycle_count > 0 ? "" : "orange"}"} - %h3.four.columns.alpha Order Cycles + %h3.four.columns.alpha + = t "spree_admin_order_cycles" - if @order_cycle_count > 0 %a.three.columns.omega.icon-plus.button.blue{ href: "#{main_app.new_admin_order_cycle_path}" } - CREATE NEW + = t "spree_admin_enterprises_create_new" - else - %a.with-tip{ title: "Order cycles determine when and where your products are available to customers." } What's this? + %a.with-tip{ title: t(:spree_admin_order_cycles_tip) } + = t "admin_entreprise_groups_what_s_this" %div.seven.columns.alpha.list - if @order_cycle_count > 0 %div.seven.columns.alpha.list-item @@ -14,13 +16,14 @@ %span.one.column.omega %span.icon-ok-sign %a.seven.columns.alpha.button.bottom.blue{ href: "#{main_app.admin_order_cycles_path}" } - MANAGE ORDER CYCLES + = t "spree_admin_enterprises_producers_manage_order_cycles" %span.icon-arrow-right - else %div.seven.columns.alpha.list-item.orange - %span.six.columns.alpha You don't have any active order cycles. + %span.six.columns.alpha + = t "spree_admin_enterprises_producers_orders_cycle_text" %span.one.column.omega %span.icon-warning-sign %a.seven.columns.alpha.button.bottom.orange{ href: "#{main_app.admin_order_cycles_path}" } - MANAGE ORDER CYCLES + = t "spree_admin_enterprises_producers_manage_order_cycles" %span.icon-arrow-right \ No newline at end of file diff --git a/app/views/spree/admin/overview/_products.html.haml b/app/views/spree/admin/overview/_products.html.haml index 988e779398..0b62e945d0 100644 --- a/app/views/spree/admin/overview/_products.html.haml +++ b/app/views/spree/admin/overview/_products.html.haml @@ -1,11 +1,13 @@ %div.dashboard_item.seven.columns.alpha#products %div.header.seven.columns.alpha{ :class => "#{@product_count > 0 ? "" : "red"}"} - %h3.four.columns.alpha Products + %h3.four.columns.alpha + = t "products" - if @product_count > 0 %a.three.columns.omega.icon-plus.button.blue{ href: "#{new_admin_product_path}" } - CREATE NEW + = t "spree_admin_enterprises_create_new" - else - %a.with-tip{ title: "The products that you sell through the Open Food Network." } What's this? + %a.with-tip{ title: "The products that you sell through the Open Food Network." } + = t "admin_entreprise_groups_what_s_this" %div.seven.columns.alpha.list - if @product_count > 0 %div.seven.columns.alpha.list-item @@ -14,13 +16,14 @@ %span.one.column.omega %span.icon-ok-sign %a.seven.columns.alpha.button.bottom.blue{ href: "#{bulk_edit_admin_products_path}" } - MANAGE PRODUCTS + = t "spree_admin_enterprises_producers_manage_products" %span.icon-arrow-right - else %div.seven.columns.alpha.list-item.red - %span.six.columns.alpha You don't have any active products. + %span.six.columns.alpha + = t "spree_admin_enterprises_any_active_products_text" %span.one.column.omega %span.icon-remove-sign %a.seven.columns.alpha.button.bottom.red{ href: "#{new_admin_product_path}" } - CREATE A NEW PRODUCT + = t "spree_admin_enterprises_create_new_product" %span.icon-arrow-right \ No newline at end of file diff --git a/app/views/spree/admin/overview/multi_enterprise_dashboard.html.haml b/app/views/spree/admin/overview/multi_enterprise_dashboard.html.haml index 420196d3ce..6e1b43fce2 100644 --- a/app/views/spree/admin/overview/multi_enterprise_dashboard.html.haml +++ b/app/views/spree/admin/overview/multi_enterprise_dashboard.html.haml @@ -2,7 +2,8 @@ = render 'admin/shared/user_guide_link' -%h1{ :style => 'margin-bottom: 30px'} Dashboard +%h1{ :style => 'margin-bottom: 30px'} + = t "dashbord" - if @enterprises.unconfirmed.any? diff --git a/app/views/spree/admin/overview/single_enterprise_dashboard.html.haml b/app/views/spree/admin/overview/single_enterprise_dashboard.html.haml index 3998f736de..119c907678 100644 --- a/app/views/spree/admin/overview/single_enterprise_dashboard.html.haml +++ b/app/views/spree/admin/overview/single_enterprise_dashboard.html.haml @@ -19,7 +19,7 @@ } #package_button %button#toggle_type{ onClick: 'toggleType()' } - Change Package + = t "change_package" %i.icon-chevron-down @@ -29,17 +29,17 @@ - if @enterprise.confirmed_at.nil? .alert-box - Please confirm the email address for + = t "spree_admin_single_enterprise_alert_mail_confirmation" %strong= "#{@enterprise.name}." - We've sent an email to + t(:spree_admin_single_enterprise_alert_mail_sent) %strong= "#{@enterprise.email}." - = link_to('Resend', main_app.enterprise_confirmation_path(enterprise: { id: @enterprise.id, email: @enterprise.email } ), method: :post) + = link_to(t('resend'), main_app.enterprise_confirmation_path(enterprise: { id: @enterprise.id, email: @enterprise.email } ), method: :post) %a.close{ href: "#" } × - if !@enterprise.visible .alert-box - %strong Hint: - To allow people to find you, turn on your visibility under - %strong= "Manage #{@enterprise.name}." + %strong + = t "spree_admin_single_enterprise_hint" + %strong= "#{t('manage')} #{@enterprise.name}." %a.close{ href: "#" } × .row @@ -47,14 +47,15 @@ .header %h3 %span.icon-map-marker - Your profile live - %p on the Open Food Network map + = t "your_profil_live" + %p + = t "on_ofn_map" .list /-# Can we pass an anchor here to zoom to our enterprise? %a.button.bottom{href: main_app.map_path, target: '_blank'} - See + = t "see" = @enterprise.name - live + = t "live" %span.icon-arrow-right .two.columns   @@ -63,11 +64,12 @@ .header %h3 %span.icon-edit - Edit profile details - %p Change your profile description, images, etc. + = t "edit_profile_details" + %p + = t "edit_profile_details_etc" .list %a.button.bottom{href: main_app.edit_admin_enterprise_path(@enterprise)} - Manage + = t "manage" = @enterprise.name %span.icon-arrow-right @@ -77,10 +79,10 @@ .header %h3 %span.icon-th-large - Add & manage products + = t 'add_and_manage_products' .list %a.button.bottom{href: bulk_edit_admin_products_path} - Manage products + = t 'manage_products' %span.icon-arrow-right .two.columns @@ -91,8 +93,8 @@ .header %h3 %span.icon-shopping-cart - Add & manage order cycles + = t 'add_and_manage_order_cycles' .list %a.button.bottom{href: main_app.admin_order_cycles_path} - Manage order cycles + = t 'manage_order_cycles' %span.icon-arrow-right diff --git a/config/locales/en.yml b/config/locales/en.yml index 7e1274739c..1ccd46d5d7 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -687,7 +687,6 @@ Please follow the instructions there to make your enterprise visible on the Open admin_entreprise_groups_web: "Web Resources" admin_entreprise_groups_web_twitter: "eg. @the_prof" admin_entreprise_groups_web_website_placeholder: "eg. www.truffles.com" -<<<<<<< HEAD admin_order_cycles: "Admin Order Cycles" open: "Open" close: "Close" @@ -734,5 +733,44 @@ Please follow the instructions there to make your enterprise visible on the Open price: "Price" on_hand: "On hand" save_changes: "Save changes" - update_action: "update()" + update_action: "update()" #FIXME admin_entreprise_groups_what_s_this: "What's this ?" + spree_admin_overview_enterprises_header: "My Enterprises" + spree_admin_overview_enterprises_footer: "MANAGE MY ENTERPRISES" + spree_admin_enterprises_hubs_name: "Name" + spree_admin_enterprises_create_new: "CREATE NEW" + spree_admin_enterprises_shipping_methods: "Shipping Methods" + spree_admin_enterprises_fees: "Enterprise Fees" + spree_admin_enterprises_none_create_a_new_enterprise: "CREATE A NEW ENTERPRISE" + spree_admin_enterprises_none_text: "You don't have any enterprises yet" + spree_admin_enterprises_producers_name: "Name" + spree_admin_enterprises_producers_total_products: "Total Products" + spree_admin_enterprises_producers_active_products: "Active Products" + spree_admin_enterprises_producers_order_cycles: "Products in OCs" + spree_admin_enterprises_producers_order_cycles_title: "" + spree_admin_enterprises_tabs_hubs: "HUBS" + spree_admin_enterprises_tabs_producers: "PRODUCERS" + spree_admin_enterprises_producers_manage_order_cycles: "MANAGE ORDER CYCLES" + spree_admin_enterprises_producers_manage_products: "MANAGE PRODUCTS" + spree_admin_enterprises_producers_orders_cycle_text: "You don't have any active order cycles." + spree_admin_enterprises_any_active_products_text: "You don't have any active products." + spree_admin_enterprises_create_new_product: "CREATE A NEW PRODUCT" + spree_admin_order_cycles: "Order Cycles" + spree_admin_order_cycles_tip: "Order cycles determine when and where your products are available to customers." + dashbord: "Dashboard" + spree_admin_single_enterprise_alert_mail_confirmation: "Please confirm the email address for" + spree_admin_single_enterprise_alert_mail_sent: "We've sent an email to" + change_package: "Change Package" + spree_admin_single_enterprise_hint: "Hint: To allow people to find you, turn on your visibility under" + your_profil_live: "Your profile live" + on_ofn_map: "on the Open Food Network map" + see: "See" + live: "live" + manage: "Manage" + resend: "Resend" + add_and_manage_products: "Add & manage products" + add_and_manage_order_cycles: "Add & manage order cycles" + manage_order_cycles: "Manage order cycles" + manage_products: "Manage products" + edit_profile_details: "Edit profile details" + edit_profile_details_etc: "Change your profile description, images, etc." From 6cd7fbb455d3fb0f866dd5178ff4dfef7682016f Mon Sep 17 00:00:00 2001 From: Edem Date: Thu, 17 Dec 2015 13:53:06 +0100 Subject: [PATCH 06/40] all string translated in admin bulk orders management --- .../admin/orders/bulk_management.html.haml | 69 ++++++++++++------- config/locales/en.yml | 16 +++++ 2 files changed, 61 insertions(+), 24 deletions(-) diff --git a/app/views/spree/admin/orders/bulk_management.html.haml b/app/views/spree/admin/orders/bulk_management.html.haml index dbcf9c97fd..cc7c0f171a 100644 --- a/app/views/spree/admin/orders/bulk_management.html.haml +++ b/app/views/spree/admin/orders/bulk_management.html.haml @@ -1,6 +1,8 @@ - content_for :page_title do - %h1.page-title Bulk Order Management - %a.with-tip{ 'data-powertip' => "Use this page to alter product quantities across multiple orders. Products may also be removed from orders entirely, if required." } What's this? + %h1.page-title + = t "bulk_order_management" + %a.with-tip{ 'data-powertip' => "Use this page to alter product quantities across multiple orders. Products may also be removed from orders entirely, if required." } + = t "admin_entreprise_groups_what_s_this" = render :partial => 'spree/admin/shared/order_sub_menu' @@ -8,16 +10,19 @@ %save-bar{ save: "submit()", saving: 'saving', dirty: "bulk_order_form.$dirty" } .filters{ :class => "sixteen columns alpha" } .date_filter{ :class => "two columns alpha" } - %label{ :for => 'start_date_filter' }Start Date + %label{ :for => 'start_date_filter' } + = t "start_date" %br %input{ :class => "two columns alpha", :type => "text", :id => 'start_date_filter', 'ng-model' => 'startDate', 'datepicker' => "startDate", 'confirm-change' => "confirmRefresh()", 'ng-change' => 'refreshData()' } .date_filter{ :class => "two columns" } - %label{ :for => 'end_date_filter' }End Date + %label{ :for => 'end_date_filter' } + = t "end_date" %br %input{ :class => "two columns alpha", :type => "text", :id => 'end_date_filter', 'ng-model' => 'endDate', 'datepicker' => "endDate", 'confirm-change' => "confirmRefresh()", 'ng-change' => 'refreshData()' } .one.column   .filter_select{ :class => "three columns" } - %label{ :for => 'supplier_filter' }Producer + %label{ :for => 'supplier_filter' } + = t "producer" %br %select{ :class => "three columns alpha", :id => 'supplier_filter', 'select2-min-search' => 5, 'ng-model' => 'supplierFilter', 'ng-options' => 's.id as s.name for s in suppliers' } .filter_select{ :class => "three columns" } @@ -25,7 +30,8 @@ %br %select{ :class => "three columns alpha", :id => 'distributor_filter', 'select2-min-search' => 5, 'ng-model' => 'distributorFilter', 'ng-options' => 'd.id as d.name for d in distributors'} .filter_select{ :class => "three columns" } - %label{ :for => 'order_cycle_filter' }Order Cycle + %label{ :for => 'order_cycle_filter' } + = t "order_cycle" %br %select{ :class => "three columns alpha", :id => 'order_cycle_filter', 'select2-min-search' => 5, 'ng-model' => 'orderCycleFilter', 'ng-options' => 'oc.id as oc.name for oc in orderCycles', 'confirm-change' => "confirmRefresh()", 'ng-change' => 'refreshData()'} .filter_clear{ :class => "two columns omega" } @@ -48,28 +54,33 @@ .row .one.column.alpha   .two.columns - %span.two.columns Group Buy Unit Size + %span.two.columns + = t "group_buy_unit_size" %span.two.columns {{ formattedValueWithUnitName( selectedUnitsProduct.group_buy_unit_size, selectedUnitsProduct, selectedUnitsVariant ) }} .one.column   .two.columns - %span.two.columns Total Quantity Ordered + %span.two.columns + = t "total_qtt_ordered" %span.two.columns {{ formattedValueWithUnitName( sumUnitValues(), selectedUnitsProduct, selectedUnitsVariant ) }} .one.column   .two.columns - %span.two.columns Max Quantity Ordered + %span.two.columns + = t "max_qtt_ordered" %span.two.columns {{ formattedValueWithUnitName( sumMaxUnitValues(), selectedUnitsProduct, selectedUnitsVariant ) }} .one.column   .two.columns - %span.two.columns Current Fulfilled Units + %span.two.columns + = t "current_fulfilled_units" %span.two.columns {{ fulfilled(sumUnitValues()) }} .one.column   .two.columns - %span.two.columns Max Fulfilled Units + %span.two.columns + = t "max_fulfilled_units" %span.two.columns {{ fulfilled(sumMaxUnitValues()) }} .one.column.omega   %div{ :class => "eight columns alpha", 'ng-hide' => 'allFinalWeightVolumesPresent()' } %span{ :class => "eight columns alpha", style: 'color:red' } - WARNING: Some variants do not have a unit value + = t "bulk_management_warning" %hr{ :class => "sixteen columns alpha", :style => "margin-bottom: 15px" } %div{ 'ng-hide' => 'RequestMonitor.loading || lineItems.length == 0' } .controls{ :class => "sixteen columns alpha", :style => "margin-bottom: 15px;" } @@ -77,7 +88,8 @@ %input{ :class => "fullwidth", :type => "text", :id => 'quick_search', 'ng-model' => 'quickSearch', :placeholder => 'Quick Search' } %div{ :class => "three columns" } %div.ofn_drop_down{ 'ng-controller' => "DropDownCtrl", :id => "bulk_actions_dropdown", 'ofn-drop-down' => true } - %span{ :class => 'icon-check' }   Actions + %span{ :class => 'icon-check' } + = t "action" %span{ 'ng-class' => "expanded && 'icon-caret-up' || !expanded && 'icon-caret-down'" } %div.menu{ 'ng-show' => "expanded" } %div.menu_item{ :class => "three columns alpha", 'ng-repeat' => "action in bulkActions", 'ng-click' => "$eval(action.callback)(filteredLineItems)", 'ofn-close-on-click' => true } @@ -95,7 +107,8 @@ %img.spinner{ src: "/assets/spinning-circles.svg" } %h1 LOADING ORDERS %div{ :class => "sixteen columns alpha", 'ng-show' => '!RequestMonitor.loading && filteredLineItems.length == 0'} - %h1#no_results No orders found. + %h1#no_results + = t "no_orders_found" %div{ 'ng-hide' => 'RequestMonitor.loading || filteredLineItems.length == 0' } %form{ name: 'bulk_order_form' } %table.index#listing_orders.bulk{ :class => "sixteen columns alpha" } @@ -104,13 +117,17 @@ %th.bulk %input{ :type => "checkbox", :name => 'toggle_bulk', 'ng-click' => 'toggleAllCheckboxes()', 'ng-checked' => "allBoxesChecked()" } %th.order_no{ 'ng-show' => 'columns.order_no.visible' } - %a{ :href => '', 'ng-click' => "predicate = 'order.number'; reverse = !reverse" } Order No. + %a{ :href => '', 'ng-click' => "predicate = 'order.number'; reverse = !reverse" } + = t "order_no" %th.full_name{ 'ng-show' => 'columns.full_name.visible' } - %a{ :href => '', 'ng-click' => "predicate = 'order.full_name'; reverse = !reverse" } Name + %a{ :href => '', 'ng-click' => "predicate = 'order.full_name'; reverse = !reverse" } + = t "name" %th.email{ 'ng-show' => 'columns.email.visible' } - %a{ :href => '', 'ng-click' => "predicate = 'order.email'; reverse = !reverse" } Email + %a{ :href => '', 'ng-click' => "predicate = 'order.email'; reverse = !reverse" } + = t "email" %th.phone{ 'ng-show' => 'columns.phone.visible' } - %a{ :href => '', 'ng-click' => "predicate = 'order.phone'; reverse = !reverse" } Phone + %a{ :href => '', 'ng-click' => "predicate = 'order.phone'; reverse = !reverse" } + = t "phone" %th.date{ 'ng-show' => 'columns.order_date.visible' } %a{ :href => '', 'ng-click' => "predicate = 'order.completed_at'; reverse = !reverse" } Order Date %th.producer{ 'ng-show' => 'columns.producer.visible' } @@ -121,13 +138,17 @@ %a{ :href => '', 'ng-click' => "predicate = 'order.distributor.name'; reverse = !reverse" } Hub %th.variant{ 'ng-show' => 'columns.variant.visible' } %a{ :href => '', 'ng-click' => "predicate = 'units_variant.full_name'; reverse = !reverse" } Product: Unit - %th.quantity{ 'ng-show' => 'columns.quantity.visible' } Quantity - %th.max{ 'ng-show' => 'columns.max.visible' } Max - %th.final_weight_volume{ 'ng-show' => 'columns.final_weight_volume.visible' } Weight/Volume - %th.price{ 'ng-show' => 'columns.price.visible' } Price + %th.quantity{ 'ng-show' => 'columns.quantity.visible' } + = t "products_quantity" + %th.max{ 'ng-show' => 'columns.max.visible' } + = t "shop_variant_quantity_max" + %th.final_weight_volume{ 'ng-show' => 'columns.final_weight_volume.visible' } + = t "weight_volume" + %th.price{ 'ng-show' => 'columns.price.visible' } + = t "products_price" %th.actions %th.actions - Ask?  + = t "ask" %input{ :type => 'checkbox', 'ng-model' => "confirmDelete" } %tr.line_item{ 'ng-repeat' => "line_item in filteredLineItems = ( lineItems | filter:quickSearch | selectFilter:supplierFilter:distributorFilter:orderCycleFilter | variantFilter:selectedUnitsProduct:selectedUnitsVariant:sharedResource | orderBy:predicate:reverse )", 'ng-class-even' => "'even'", 'ng-class-odd' => "'odd'", :id => "li_{{line_item.id}}" } %td.bulk @@ -143,7 +164,7 @@ %td.variant{ 'ng-show' => 'columns.variant.visible' } %a{ :href => '#', 'ng-click' => "setSelectedUnitsVariant(line_item.units_product,line_item.units_variant)" } {{ line_item.units_variant.full_name }} %td.quantity{ 'ng-show' => 'columns.quantity.visible' } - %input.show-dirty{ :type => 'number', :name => 'quantity', :id => 'quantity', ng: { model: "line_item.quantity", change: "updateOnQuantity(line_item)", required: "true", class: '{"update-error": line_item.errors.quantity}' }, min: 1, step: 1 } + %input.show-dirty{ :type => 'number', :name => 'quantity', :id => 'quantity', ng: { model: "line_item.quantity", change: "updateOnQuantity(line_item)", required: "true", class: '{"update-error": line_item.errors.quantity}' }, min: 1, t(:step): 1 } %span.error{ ng: { bind: 'line_item.errors.quantity' } } %td.max{ 'ng-show' => 'columns.max.visible' } {{ line_item.max_quantity }} %td.final_weight_volume{ 'ng-show' => 'columns.final_weight_volume.visible' } diff --git a/config/locales/en.yml b/config/locales/en.yml index 1ccd46d5d7..3205b3cab5 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -774,3 +774,19 @@ Please follow the instructions there to make your enterprise visible on the Open manage_products: "Manage products" edit_profile_details: "Edit profile details" edit_profile_details_etc: "Change your profile description, images, etc." + bulk_order_management: "Bulk Order Management" + start_date: "Start Date" + end_date: "End Date" + order_cycle: "Order Cycle" + group_buy_unit_size: "Group Buy Unit Size" + total_qtt_ordered: "Total Quantity Ordered" + max_qtt_ordered: "Max Quantity Ordered" + current_fulfilled_units: "Current Fulfilled Units" + max_fulfilled_units: "Max Fulfilled Units" + bulk_management_warning: "WARNING: Some variants do not have a unit value" + action: "   Actions" + ask: "Ask? " + no_orders_found: "No orders found." + order_no: "Order No." + weight_volume: "Weight/Volume" + step: "step" From 5290d0be6b26580ede32d37e3813e03baff74957 Mon Sep 17 00:00:00 2001 From: julienFR88 Date: Wed, 16 Dec 2015 19:37:43 +0100 Subject: [PATCH 07/40] add translation in /cache/code/ofn/openfoodnetwork/app/views/spree/admin --- .../spree/admin/reports/customers.html.haml | 12 ++--- .../reports/order_cycle_management.html.haml | 10 ++-- .../reports/orders_and_distributors.html.haml | 4 +- .../reports/orders_and_fulfillment.html.haml | 10 ++-- .../spree/admin/reports/packing.html.haml | 12 ++--- .../spree/admin/reports/payments.html.haml | 12 ++--- .../reports/products_and_inventory.html.haml | 12 ++--- .../spree/admin/reports/sales_tax.html.haml | 6 +-- .../reports/users_and_enterprises.html.haml | 6 +-- .../admin/reports/xero_invoices.html.haml | 16 +++---- .../shared/_address_form_simple.html.haml | 28 ++++++----- .../admin/shared/_hubs_sidebar.html.haml | 9 ++-- .../shared/_trial_progress_bar.html.haml | 4 +- .../spree/admin/variants/_autocomplete.js.erb | 4 +- config/locales/en.yml | 48 ++++++++++++++++++- 15 files changed, 122 insertions(+), 71 deletions(-) diff --git a/app/views/spree/admin/reports/customers.html.haml b/app/views/spree/admin/reports/customers.html.haml index aef51702a6..4b7004536c 100644 --- a/app/views/spree/admin/reports/customers.html.haml +++ b/app/views/spree/admin/reports/customers.html.haml @@ -2,30 +2,30 @@ %br .row .four.columns.alpha - = label_tag nil, "Distributor: " + = label_tag nil, t(:reports_customers_distributor) = select_tag(:distributor_id, options_from_collection_for_select(@distributors, :id, :name, params[:distributor_id]), {:include_blank => true, :class => "select2 fullwidth"}) .four.columns - = label_tag nil, "Supplier: " + = label_tag nil, t(:reports_customers_supplier) = select_tag(:supplier_id, options_from_collection_for_select(@suppliers, :id, :name, params[:supplier_id]), {:include_blank => true, :class => "select2 fullwidth"}) .six.columns - = label_tag nil, "Order Cycle: " + = label_tag nil, t(:reports_customers_cycle) = select_tag(:order_cycle_id, options_for_select(report_order_cycle_options(@order_cycles), params[:order_cycle_id]), {:include_blank => true, :class => "select2 fullwidth"}) - = label_tag nil, "Report Type: " + = label_tag nil, t(:reports_customers_type) = select_tag(:report_type, options_for_select(@report_types, @report_type)) %br %br = check_box_tag :csv - = label_tag :csv, "Download as csv" + = label_tag :csv, t(:report_customers_csv) %br = button t(:search) @@ -33,7 +33,7 @@ %br %table#listing_customers.index %thead - %tr{'data-hook' => "orders_header"} + %tr{'data-hook' => "orders_header" } - @report.header.each do |heading| %th=heading %tbody diff --git a/app/views/spree/admin/reports/order_cycle_management.html.haml b/app/views/spree/admin/reports/order_cycle_management.html.haml index 5ab379a669..09ac6f76bb 100644 --- a/app/views/spree/admin/reports/order_cycle_management.html.haml +++ b/app/views/spree/admin/reports/order_cycle_management.html.haml @@ -2,16 +2,16 @@ = render 'date_range_form', f: f .row - .alpha.two.columns= label_tag nil, "Hubs: " + .alpha.two.columns= label_tag nil, t(:report_hubs) .omega.fourteen.columns= f.collection_select(:distributor_id_in, @distributors, :id, :name, {}, {class: "select2 fullwidth", multiple: true}) .row - .alpha.two.columns= label_tag nil, "Order Cycles: " + .alpha.two.columns= label_tag nil, t(:reports_customers_cycle) .omega.fourteen.columns = f.select(:order_cycle_id_in, report_order_cycle_options(@order_cycles), {selected: params[:q][:order_cycle_id_in]}, {class: "select2 fullwidth", multiple: true}) .row - .alpha.two.columns= label_tag nil, "Payment Methods: " + .alpha.two.columns= label_tag nil, t(:report_payment) .omega.fourteen.columns= select_tag(:payment_method_in, options_for_select(report_payment_method_options(@report.orders), params[:payment_method_in]), {class: "select2 fullwidth", multiple: true}) .row @@ -24,7 +24,7 @@ .row = check_box_tag :csv - = label_tag :csv, "Download as csv" + = label_tag :csv, t(:report_customers_csv) .row = button t(:search) @@ -33,7 +33,7 @@ %br %table#listing_ocm_orders.index %thead - %tr{'data-hook' => "orders_header"} + %tr{'data-hook' => "orders_header" } - @report.header.each do |heading| %th=heading %tbody diff --git a/app/views/spree/admin/reports/orders_and_distributors.html.haml b/app/views/spree/admin/reports/orders_and_distributors.html.haml index 23baad395e..9d733cc995 100644 --- a/app/views/spree/admin/reports/orders_and_distributors.html.haml +++ b/app/views/spree/admin/reports/orders_and_distributors.html.haml @@ -2,7 +2,7 @@ = render 'date_range_form', f: f = check_box_tag :csv - = label_tag :csv, "Download as csv" + = label_tag :csv, t(:report_customers_csv) %br = button t(:search) @@ -10,7 +10,7 @@ %br %table#listing_orders.index %thead - %tr{'data-hook' => "orders_header"} + %tr{'data-hook' => t(:report_customers_header)} - @report.header.each do |heading| %th=heading %tbody diff --git a/app/views/spree/admin/reports/orders_and_fulfillment.html.haml b/app/views/spree/admin/reports/orders_and_fulfillment.html.haml index 2465fe0ff2..15ad6458cd 100644 --- a/app/views/spree/admin/reports/orders_and_fulfillment.html.haml +++ b/app/views/spree/admin/reports/orders_and_fulfillment.html.haml @@ -2,25 +2,25 @@ = render 'date_range_form', f: f .row - .alpha.two.columns= label_tag nil, "Hubs: " + .alpha.two.columns= label_tag nil, t(:report_hubs) .omega.fourteen.columns= f.collection_select(:distributor_id_in, @distributors, :id, :name, {}, {class: "select2 fullwidth", multiple: true}) .row - .alpha.two.columns= label_tag nil, "Producers: " + .alpha.two.columns= label_tag nil, t(:report_producers) .omega.fourteen.columns= select_tag(:supplier_id_in, options_from_collection_for_select(@suppliers, :id, :name, params[:supplier_id_in]), {class: "select2 fullwidth", multiple: true}) .row - .alpha.two.columns= label_tag nil, "Order Cycles: " + .alpha.two.columns= label_tag nil, t(:reports_customers_cycle) .omega.fourteen.columns = f.select(:order_cycle_id_in, report_order_cycle_options(@order_cycles), {selected: params[:q][:order_cycle_id_in]}, {class: "select2 fullwidth", multiple: true}) .row - .alpha.two.columns= label_tag nil, "Report Type: " + .alpha.two.columns= label_tag nil, t(:report_type) .omega.fourteen.columns= select_tag(:report_type, options_for_select(@report_types, @report_type)) .row = check_box_tag :csv - = label_tag :csv, "Download as csv" + = label_tag :csv, t(:report_customers_csv) .row = button t(:search) diff --git a/app/views/spree/admin/reports/packing.html.haml b/app/views/spree/admin/reports/packing.html.haml index 2aa8d8c8b9..d419f9a7cb 100644 --- a/app/views/spree/admin/reports/packing.html.haml +++ b/app/views/spree/admin/reports/packing.html.haml @@ -2,25 +2,25 @@ = render 'date_range_form', f: f .row - .alpha.two.columns= label_tag nil, "Hubs: " + .alpha.two.columns= label_tag nil, t(:report_hubs) .omega.fourteen.columns= f.collection_select(:distributor_id_in, @distributors, :id, :name, {}, {class: "select2 fullwidth", multiple: true}) .row - .alpha.two.columns= label_tag nil, "Producers: " + .alpha.two.columns= label_tag nil, t(:report_producers) .omega.fourteen.columns= select_tag(:supplier_id_in, options_from_collection_for_select(@suppliers, :id, :name, params[:supplier_id_in]), {class: "select2 fullwidth", multiple: true}) .row - .alpha.two.columns= label_tag nil, "Order Cycles: " + .alpha.two.columns= label_tag nil, t(:report_customers_cycle) .omega.fourteen.columns = f.select(:order_cycle_id_in, report_order_cycle_options(@order_cycles), {selected: params[:q][:order_cycle_id_in]}, {class: "select2 fullwidth", multiple: true}) .row - .alpha.two.columns= label_tag nil, "Report Type: " + .alpha.two.columns= label_tag nil, t(:report_type) .omega.fourteen.columns= select_tag(:report_type, options_for_select(@report_types, @report_type)) .row = check_box_tag :csv - = label_tag :csv, "Download as csv" + = label_tag :csv, t(:report_customers_csv) .row = button t(:search) @@ -29,7 +29,7 @@ %br %table#listing_orders.index %thead - %tr{'data-hook' => "orders_header"} + %tr{'data-hook' => "orders_header" } - @report.header.each do |heading| %th=heading %tbody diff --git a/app/views/spree/admin/reports/payments.html.haml b/app/views/spree/admin/reports/payments.html.haml index 909846f47f..3269267a06 100644 --- a/app/views/spree/admin/reports/payments.html.haml +++ b/app/views/spree/admin/reports/payments.html.haml @@ -3,15 +3,15 @@ .row .four.columns.alpha - = label_tag nil, "Distributor: " - = f.collection_select(:distributor_id_eq, @distributors, :id, :name, {:include_blank => 'All'}, {:class => "select2 fullwidth"}) - = label_tag nil, "Report Type: " + = label_tag nil, t(:report_distributor) + = f.collection_select(:distributor_id_eq, @distributors, :id, :name, {:include_blank => t(:report_all)}, {:class => "select2 fullwidth"}) + = label_tag nil, t(:report_customers_type) %br - = select_tag(:report_type, options_for_select([['Payments By Type',:payments_by_payment_type],['Itemised Payment Totals',:itemised_payment_totals],['Payment Totals',:payment_totals]], @report_type)) + = select_tag(:report_type, options_for_select([[t(:report_payment_by),:payments_by_payment_type],[t(:report_itemised_payment,:itemised_payment_totals],[t(:report_payment_totals,:payment_totals]], @report_type)) %br %br = check_box_tag :csv - = label_tag :csv, "Download as csv" + = label_tag :csv, t(:report_customers_csv) %br %br = button t(:search) @@ -19,7 +19,7 @@ %br %table#listing_orders.index %thead - %tr{'data-hook' => "orders_header"} + %tr{'data-hook' => "orders_header" } - @report.header.each do |heading| %th=heading %tbody diff --git a/app/views/spree/admin/reports/products_and_inventory.html.haml b/app/views/spree/admin/reports/products_and_inventory.html.haml index c3470e6047..53ad6649ee 100644 --- a/app/views/spree/admin/reports/products_and_inventory.html.haml +++ b/app/views/spree/admin/reports/products_and_inventory.html.haml @@ -2,40 +2,40 @@ %br .row .four.columns.alpha - = label_tag nil, "Distributor: " + = label_tag nil, t(:report_distributor) = select_tag(:distributor_id, options_from_collection_for_select(@distributors, :id, :name, params[:distributor_id]), {:include_blank => true, :class => "select2 fullwidth"}) .four.columns - = label_tag nil, "Supplier: " + = label_tag nil, t(:reports_customers_supplier) = select_tag(:supplier_id, options_from_collection_for_select(@suppliers, :id, :name, params[:supplier_id]), {:include_blank => true, :class => "select2 fullwidth"}) .six.columns - = label_tag nil, "Order Cycle: " + = label_tag nil, t(:report_order_cycle) = select_tag(:order_cycle_id, options_for_select(report_order_cycle_options(@order_cycles), params[:order_cycle_id]), {:include_blank => true, :class => "select2 fullwidth"}) - = label_tag nil, "Report Type: " + = label_tag nil, t(:report_type) %br = select_tag(:report_type, options_for_select(@report_types, params[:report_type])) %br %br = check_box_tag :csv - = label_tag :csv, "Download as csv" + = label_tag :csv, t(:report_customers_csv) %br = button t(:search) %br %br %table#listing_products.index %thead - %tr{'data-hook' => "products_header"} + %tr{'data-hook' => "products_header" } - @report.header.each do |heading| %th=heading %tbody diff --git a/app/views/spree/admin/reports/sales_tax.html.haml b/app/views/spree/admin/reports/sales_tax.html.haml index b0a115a74b..c91617cc6a 100644 --- a/app/views/spree/admin/reports/sales_tax.html.haml +++ b/app/views/spree/admin/reports/sales_tax.html.haml @@ -3,10 +3,10 @@ .row .four.columns.alpha - = label_tag nil, "Distributor:" + = label_tag nil, t(:report_distributor) = f.collection_select(:distributor_id_eq, @distributors, :id, :name, {:include_blank => 'All'}, {:class => "select2 fullwidth"}) = check_box_tag :csv - = label_tag :csv, "Download as csv" + = label_tag :csv, t(:report_customers_csv) %br = button t(:search) @@ -14,7 +14,7 @@ %br %table#listing_orders.index %thead - %tr{'data-hook' => "orders_header"} + %tr{'data-hook' => "orders_header" } - @report.header.each do |heading| %th= heading %tbody diff --git a/app/views/spree/admin/reports/users_and_enterprises.html.haml b/app/views/spree/admin/reports/users_and_enterprises.html.haml index 6820ee04b1..1b57373c38 100644 --- a/app/views/spree/admin/reports/users_and_enterprises.html.haml +++ b/app/views/spree/admin/reports/users_and_enterprises.html.haml @@ -1,10 +1,10 @@ = form_tag spree.users_and_enterprises_admin_reports_url do |f| .row - .alpha.two.columns= label_tag nil, "Enterprises: " + .alpha.two.columns= label_tag nil, t(:report_entreprises) .omega.fourteen.columns= select_tag(:enterprise_id_in, options_from_collection_for_select(Enterprise.all, :id, :name, params[:enterprise_id_in].andand.split(",")), {class: "select2 fullwidth", multiple: true}) .row - .alpha.two.columns= label_tag nil, "Users: " + .alpha.two.columns= label_tag nil, t(:report_users) .omega.fourteen.columns= select_tag(:user_id_in, options_from_collection_for_select(Spree::User.all, :id, :email, params[:user_id_in].andand.split(",")), {class: "select2 fullwidth", multiple: true}) -# Might need this later if we add different kinds of reports @@ -14,7 +14,7 @@ .row = check_box_tag :csv - = label_tag :csv, "Download as csv" + = label_tag :csv, t(:report_customers_csv) .row = button t(:search) %br diff --git a/app/views/spree/admin/reports/xero_invoices.html.haml b/app/views/spree/admin/reports/xero_invoices.html.haml index eca51fed4f..8669089f81 100644 --- a/app/views/spree/admin/reports/xero_invoices.html.haml +++ b/app/views/spree/admin/reports/xero_invoices.html.haml @@ -2,31 +2,31 @@ = render 'date_range_form', f: f .row - .four.columns.alpha= label_tag :report_type, "Report Type: " + .four.columns.alpha= label_tag :report_type, t(:report_type) .four.columns.omega= select_tag :report_type, options_for_select(xero_report_types, params[:report_type]), {include_blank: false, class: "select2 fullwidth"} .row - .four.columns.alpha= label_tag nil, "Hub: " + .four.columns.alpha= label_tag nil, t(:report_hubs) .four.columns.omega= f.collection_select(:distributor_id_eq, @distributors, :id, :name, {:include_blank => 'All'}, {:class => "select2 fullwidth"}) .row - .four.columns.alpha= label_tag nil, "Order Cycle: " + .four.columns.alpha= label_tag nil, t(:report_order_cycle) .four.columns.omega= f.select(:order_cycle_id_eq, options_for_select(report_order_cycle_options(@order_cycles), params[:q][:order_cycle_id_eq]), {:include_blank => true}, {:class => "select2 fullwidth"}) .row - .four.columns.alpha= label_tag :initial_invoice_number, "Initial invoice number:" + .four.columns.alpha= label_tag :initial_invoice_number, t(:initial_invoice_number) .twelve.columns.omega= text_field_tag :initial_invoice_number, params[:initial_invoice_number] .row - .four.columns.alpha= label_tag :invoice_date, "Invoice date:" + .four.columns.alpha= label_tag :invoice_date, t(:invoice_date) .twelve.columns.omega= text_field_tag :invoice_date, params[:invoice_date], class: 'datetimepicker' .row - .four.columns.alpha= label_tag :due_date, "Due date:" + .four.columns.alpha= label_tag :due_date, t(:due_date) .twelve.columns.omega= text_field_tag :due_date, params[:due_date], class: 'datetimepicker' .row - .four.columns.alpha= label_tag :account_code, "Account code:" + .four.columns.alpha= label_tag :account_code, t(:account_code) .twelve.columns.omega= text_field_tag :account_code, params[:account_code] .row - .four.columns.alpha= label_tag :csv, "Download as CSV:" + .four.columns.alpha= label_tag :csv, t(:report_customers_csv) .twelve.columns.omega= check_box_tag :csv .row .four.columns.alpha= button t(:search) diff --git a/app/views/spree/admin/shared/_address_form_simple.html.haml b/app/views/spree/admin/shared/_address_form_simple.html.haml index 3b8f756d88..36f49bf384 100644 --- a/app/views/spree/admin/shared/_address_form_simple.html.haml +++ b/app/views/spree/admin/shared/_address_form_simple.html.haml @@ -1,18 +1,24 @@ %tr{"data-hook" => "address1"} - %td Address: + %td + = t(:admin_shared_address_1): %td= f.text_field :address1 -%tr{"data-hook" => "address2"} - %td Address (cont.): +%tr{"data-hook" => "address2" } + %td + = t(:admin_shared_address_2): %td= f.text_field :address2 -%tr{"data-hook" => "city"} - %td City: +%tr{"data-hook" => "city" } + %td + = t(:admin_share_city): %td= f.text_field :city -%tr{"data-hook" => "zipcode"} - %td Postcode: +%tr{"data-hook" => "zipcode" } + %td + = t(:admin_share_zipcode): %td= f.text_field :zipcode -%tr{"data-hook" => "country"} - %td Country: +%tr{"data-hook" => "country" } + %td + = t(:admin_share_country): %td= f.collection_select(:country_id, available_countries, :id, :name) -%tr{"data-hook" => "state"} - %td State: +%tr{"data-hook" => "state" } + %td + = t(:admin_share_state): %td= f.collection_select(:state_id, f.object.country.states, :id, :name) diff --git a/app/views/spree/admin/shared/_hubs_sidebar.html.haml b/app/views/spree/admin/shared/_hubs_sidebar.html.haml index 23c536402b..25cdd89685 100644 --- a/app/views/spree/admin/shared/_hubs_sidebar.html.haml +++ b/app/views/spree/admin/shared/_hubs_sidebar.html.haml @@ -1,8 +1,8 @@ - hubs_color = @hubs.count > 0 ? "blue" : "red" -- hubs_color = 'red' if (controller.action_name == 'create' || controller.action_name == 'update') && @object.errors.full_messages.include?("At least one hub must be selected") +- hubs_color = 'red' if (controller.action_name == 'create' || controller.action_name == 'update') && @object.errors.full_messages.include?(t(:hub_sidebar_at_least)) .sidebar_item.omega.four.columns#hubs .four.columns.alpha.header{ class: "#{hubs_color}" } - %span.four.columns.alpha.centered Hubs + %span.four.columns.alpha.centered t(:hub_sidebar_hubs) .four.columns.alpha.list{ class: "#{hubs_color}" } - if @hubs.count > 0 = hidden_field klass, :distributor_ids, :multiple => true, value: nil @@ -17,9 +17,10 @@ %span.icon-arrow-right - else .four.columns.alpha.list-item - %span.three.columns.alpha None Available + %span.three.columns.alpha + t(:hub_sidebar_none_available) %span.one.column.omega %span.icon-remove-sign %a.four.columns.alpha.button{ href: "#{main_app.admin_enterprises_path}", class: "#{hubs_color}" } - MANAGE + t(:hub_sidebar_manage) %span.icon-arrow-right diff --git a/app/views/spree/admin/shared/_trial_progress_bar.html.haml b/app/views/spree/admin/shared/_trial_progress_bar.html.haml index abffdbd6ad..999dd9a13f 100644 --- a/app/views/spree/admin/shared/_trial_progress_bar.html.haml +++ b/app/views/spree/admin/shared/_trial_progress_bar.html.haml @@ -1,7 +1,7 @@ - if enterprise -if shop_trial_in_progress?(enterprise) #trial_progress_bar - = "Your shopfront trial expires in #{remaining_trial_days(enterprise)}." + = t(:shop_trial_in_progress) -elsif shop_trial_expired?(enterprise) #trial_progress_bar - = "Good news! We have decided to extend shopfront trials until further notice (probably around March 2015)." \ No newline at end of file + = t(:shop_trial_expired) \ No newline at end of file diff --git a/app/views/spree/admin/variants/_autocomplete.js.erb b/app/views/spree/admin/variants/_autocomplete.js.erb index 7b52c0a716..11940b4104 100644 --- a/app/views/spree/admin/variants/_autocomplete.js.erb +++ b/app/views/spree/admin/variants/_autocomplete.js.erb @@ -16,8 +16,8 @@
  • Producer: {{variant.producer_name}}
    • -
    • {{t 'sku'}}: {{variant.sku}}
    • -
    • {{t 'on_hand' }}: {{variant.count_on_hand}}
    • +
    • {{t(:admin_variants_sku:)}}: {{variant.sku}}
    • +
    • {{t(admin_variants_on_hand:) }}: {{variant.count_on_hand}}
    {{#if variant.option_values}} diff --git a/config/locales/en.yml b/config/locales/en.yml index 3205b3cab5..cd4af0f08b 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -646,7 +646,7 @@ Please follow the instructions there to make your enterprise visible on the Open shop_variant_quantity_max: "max" contact: "Contact" follow: "Follow" - shop_for_products_html: "Shop for %{enterprise} products at:" + shop_for_products_html: "Shop for %{enterprise} products at:" #FIXME change_shop: "Change shop to:" shop_at: "Shop now at:" price_breakdown: "Full price breakdown" @@ -727,7 +727,7 @@ Please follow the instructions there to make your enterprise visible on the Open hub: "Hub" accounts_administration_distributor: "accounts administration distributor" override_product_details: "Override Product Details" - admin_accounts_and_billing: "admin.accounts_and_billing_settings" + admin_accounts_and_billing: "admin.accounts_and_billing_settings" #FIXME producer: "Producer" product: "Product" price: "Price" @@ -790,3 +790,47 @@ Please follow the instructions there to make your enterprise visible on the Open order_no: "Order No." weight_volume: "Weight/Volume" step: "step" + remove_tax: "Remove tax" + admin_variants_on_hand: "on hand" + admin_variants_sku: "sku" + tax_settings: "tax settings" + products_require_tax_category: "products require tax category" + update: "update" + admin_shared_address_1: "Address" + admin_shared_address_2: "Address (cont.)" + admin_share_city: "City" + admin_share_zipcode: "Postcode" + admin_share_country: "Country" + admin_share_state: "State" + hub_sidebar_hubs: "Hubs" + hub_sidebar_none_available: "None Available" + hub_sidebar_manage: "Manage" + hub_sidebar_at_least: "At least one hub must be selected" + hub_sidebar_blue: "blue" + hub_sidebar_red: "red" + shop_trial_in_progress: "Your shopfront trial expires in #{remaining_trial_days(enterprise)}." #FIXME + shop_trial_expired: "Good news! We have decided to extend shopfront trials until further notice (probably around March 2015)." #FIXME + reports_customers_distributor: "Distributor" + reports_customers_supplier: "Supplier" + reports_customers_cycle: "Order Cycle" + report_customers_type: "Report Type" + report_customers_csv: "Download as csv" + report_customers_header: "orders header" + report_producers: "Producers: " + report_type: "Report Type: " + report_hubs: "Hubs: " + report_payment: "Payment Methods: " + report_distributor: "Distributor: " + report_payment_by: 'Payments By Type' + report_itemised_payment: 'Itemised Payment Totals' + report_payment_totals: 'Payment Totals' + report_all: 'all' + report_order_cycle: "Order Cycle: " + report_product_header: "products_header" + report_order_header: "orders_header" + report_entreprises: "Enterprises: " + report_users: "Users: " + initial_invoice_number: "Initial invoice number:" + invoice_date: "Invoice date:" + due_date: "Due date:" + account_code: "Account code:" From 8a390dd2374257b227e4582b358490b4ed827b72 Mon Sep 17 00:00:00 2001 From: elf Pavlik Date: Sat, 19 Dec 2015 11:05:04 +0100 Subject: [PATCH 08/40] fixing test failing after i18n changes --- .../accounts_and_billing_settings/edit.html.haml | 2 +- app/views/admin/order_cycles/edit.html.haml | 4 ++-- app/views/admin/order_cycles/new.html.haml | 4 ++-- .../admin/order_cycles/set_coordinator.html.haml | 4 ++-- .../admin/variant_overrides/_products.html.haml | 12 ++++++++---- .../spree/admin/orders/bulk_management.html.haml | 2 +- .../spree/admin/overview/_unconfirmed.html.haml | 4 ++-- .../overview/single_enterprise_dashboard.html.haml | 2 +- app/views/spree/admin/reports/payments.html.haml | 2 +- app/views/spree/admin/variants/_autocomplete.js.erb | 4 ++-- config/locales/en.yml | 12 +++++------- 11 files changed, 27 insertions(+), 25 deletions(-) diff --git a/app/views/admin/accounts_and_billing_settings/edit.html.haml b/app/views/admin/accounts_and_billing_settings/edit.html.haml index 434ad6884c..7a74a59120 100644 --- a/app/views/admin/accounts_and_billing_settings/edit.html.haml +++ b/app/views/admin/accounts_and_billing_settings/edit.html.haml @@ -73,7 +73,7 @@ .six.columns.omega.step.text-center .form-buttons{"data-hook" => "buttons"} - =link_to_with_icon "icon-ok-sign", t(:finalise_user_invoice ), + =link_to_with_icon "icon-ok-sign", t(:finalise_user_invoices ), main_app.start_job_admin_accounts_and_billing_settings_path(job: { name: "finalize_account_invoices" }), class: "button fullwidth" diff --git a/app/views/admin/order_cycles/edit.html.haml b/app/views/admin/order_cycles/edit.html.haml index ed9b713d2c..81496bcdb8 100644 --- a/app/views/admin/order_cycles/edit.html.haml +++ b/app/views/admin/order_cycles/edit.html.haml @@ -4,8 +4,8 @@ = button_to "Notify producers", main_app.notify_producers_admin_order_cycle_path, :id => 'admin_notify_producers', :confirm => 'Are you sure?' -%h1 - =t'edit_order_cycle' +%h1 + =t'edit_order_cycle' - ng_controller = order_cycles_simple_form ? 'AdminSimpleEditOrderCycleCtrl' : 'AdminEditOrderCycleCtrl' diff --git a/app/views/admin/order_cycles/new.html.haml b/app/views/admin/order_cycles/new.html.haml index 4c0bee9e5a..a257bf3c0b 100644 --- a/app/views/admin/order_cycles/new.html.haml +++ b/app/views/admin/order_cycles/new.html.haml @@ -1,5 +1,5 @@ -%h1 - =t'new_order_cycle' +%h1 + =t'new_order_cycle' - ng_controller = order_cycles_simple_form ? 'AdminSimpleCreateOrderCycleCtrl' : 'AdminCreateOrderCycleCtrl' = admin_inject_order_cycle_instance diff --git a/app/views/admin/order_cycles/set_coordinator.html.haml b/app/views/admin/order_cycles/set_coordinator.html.haml index 1a31235f24..0216edee54 100644 --- a/app/views/admin/order_cycles/set_coordinator.html.haml +++ b/app/views/admin/order_cycles/set_coordinator.html.haml @@ -1,5 +1,5 @@ %h4.text-center - =t'select_a_coordinator_for_your_order_cycle' + =t'select_a_coordinator_for_your_order_cycle' %br @@ -10,7 +10,7 @@ .ten.columns = select_tag :coordinator_id, options_for_select(permitted_coordinating_enterprise_options_for(@order_cycle)), { 'required' => true, class: 'select2 fullwidth'} .two.columns.alpha - = f.submit "Continue >" + = f.submit "#{t(:continue)} >" .two.columns.omega   diff --git a/app/views/admin/variant_overrides/_products.html.haml b/app/views/admin/variant_overrides/_products.html.haml index 4ee3644798..a2241dca39 100644 --- a/app/views/admin/variant_overrides/_products.html.haml +++ b/app/views/admin/variant_overrides/_products.html.haml @@ -1,10 +1,14 @@ %table.index.bulk{ng: {show: 'hub'}} %thead %tr - %th t(:producer) - %th t(:product) - %th t(:price) - %th t(:on_hand) + %th + = t(:producer) + %th + = t(:product) + %th + = t(:price) + %th + = t(:on_hand) %tbody{ng: {repeat: 'product in products | hubPermissions:hubPermissions:hub.id'}} = render 'admin/variant_overrides/products_product' = render 'admin/variant_overrides/products_variants' diff --git a/app/views/spree/admin/orders/bulk_management.html.haml b/app/views/spree/admin/orders/bulk_management.html.haml index cc7c0f171a..d81bff9b86 100644 --- a/app/views/spree/admin/orders/bulk_management.html.haml +++ b/app/views/spree/admin/orders/bulk_management.html.haml @@ -164,7 +164,7 @@ %td.variant{ 'ng-show' => 'columns.variant.visible' } %a{ :href => '#', 'ng-click' => "setSelectedUnitsVariant(line_item.units_product,line_item.units_variant)" } {{ line_item.units_variant.full_name }} %td.quantity{ 'ng-show' => 'columns.quantity.visible' } - %input.show-dirty{ :type => 'number', :name => 'quantity', :id => 'quantity', ng: { model: "line_item.quantity", change: "updateOnQuantity(line_item)", required: "true", class: '{"update-error": line_item.errors.quantity}' }, min: 1, t(:step): 1 } + %input.show-dirty{ :type => 'number', :name => 'quantity', :id => 'quantity', ng: { model: "line_item.quantity", change: "updateOnQuantity(line_item)", required: "true", class: '{"update-error": line_item.errors.quantity}' }, min: 1, step: 1 } %span.error{ ng: { bind: 'line_item.errors.quantity' } } %td.max{ 'ng-show' => 'columns.max.visible' } {{ line_item.max_quantity }} %td.final_weight_volume{ 'ng-show' => 'columns.final_weight_volume.visible' } diff --git a/app/views/spree/admin/overview/_unconfirmed.html.haml b/app/views/spree/admin/overview/_unconfirmed.html.haml index 05c4df2a0d..5ff0e17a84 100644 --- a/app/views/spree/admin/overview/_unconfirmed.html.haml +++ b/app/views/spree/admin/overview/_unconfirmed.html.haml @@ -1,4 +1,4 @@ - @enterprises.unconfirmed.each do |enterprise| .alert - %h6= "Action Required: Please confirm the email address for #{enterprise.name}." - %span.message= "We've sent a confirmation email to #{enterprise.email}, so please check there for further instructions. Thanks!" \ No newline at end of file + %h6= "#{t :spree_admin_overview_action_required}: #{t :spree_admin_single_enterprise_alert_mail_confirmation} #{enterprise.name}." + %span.message= "#{t :spree_admin_single_enterprise_alert_mail_sent} #{enterprise.email}. #{t :spree_admin_overview_check_your_inbox}" diff --git a/app/views/spree/admin/overview/single_enterprise_dashboard.html.haml b/app/views/spree/admin/overview/single_enterprise_dashboard.html.haml index 119c907678..14bc30e23b 100644 --- a/app/views/spree/admin/overview/single_enterprise_dashboard.html.haml +++ b/app/views/spree/admin/overview/single_enterprise_dashboard.html.haml @@ -31,7 +31,7 @@ .alert-box = t "spree_admin_single_enterprise_alert_mail_confirmation" %strong= "#{@enterprise.name}." - t(:spree_admin_single_enterprise_alert_mail_sent) + = t(:spree_admin_single_enterprise_alert_mail_sent) %strong= "#{@enterprise.email}." = link_to(t('resend'), main_app.enterprise_confirmation_path(enterprise: { id: @enterprise.id, email: @enterprise.email } ), method: :post) %a.close{ href: "#" } × diff --git a/app/views/spree/admin/reports/payments.html.haml b/app/views/spree/admin/reports/payments.html.haml index 3269267a06..a0e8f1d1d8 100644 --- a/app/views/spree/admin/reports/payments.html.haml +++ b/app/views/spree/admin/reports/payments.html.haml @@ -7,7 +7,7 @@ = f.collection_select(:distributor_id_eq, @distributors, :id, :name, {:include_blank => t(:report_all)}, {:class => "select2 fullwidth"}) = label_tag nil, t(:report_customers_type) %br - = select_tag(:report_type, options_for_select([[t(:report_payment_by),:payments_by_payment_type],[t(:report_itemised_payment,:itemised_payment_totals],[t(:report_payment_totals,:payment_totals]], @report_type)) + = select_tag(:report_type, options_for_select([[t(:report_payment_by),:payments_by_payment_type],[t(:report_itemised_payment),:itemised_payment_totals],[t(:report_payment_totals),:payment_totals]], @report_type)) %br %br = check_box_tag :csv diff --git a/app/views/spree/admin/variants/_autocomplete.js.erb b/app/views/spree/admin/variants/_autocomplete.js.erb index 11940b4104..41b0e84550 100644 --- a/app/views/spree/admin/variants/_autocomplete.js.erb +++ b/app/views/spree/admin/variants/_autocomplete.js.erb @@ -16,8 +16,8 @@
  • Producer: {{variant.producer_name}}
    • -
    • {{t(:admin_variants_sku:)}}: {{variant.sku}}
    • -
    • {{t(admin_variants_on_hand:) }}: {{variant.count_on_hand}}
    • +
    • {{t 'sku'}}: {{variant.sku}}
    • +
    • {{t 'on_hand'}}: {{variant.count_on_hand}}
    {{#if variant.option_values}} diff --git a/config/locales/en.yml b/config/locales/en.yml index cd4af0f08b..9eafa25770 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -708,7 +708,7 @@ Please follow the instructions there to make your enterprise visible on the Open admin_settings: "Settings" update_invoice: "Update Invoices" finalise_invoice: "Finalise Invoices" - finalise_user_invoice: "Finalise User Invoice" + finalise_user_invoices: "Finalise User Invoices" finalise_user_invoice_explained: "Use this button to finalize all invoices in the system for the previous calendar month. This task can be set up to run automatically once a month." manually_run_task: "Manually Run Task " update_user_invoices: "Update User Invoices" @@ -732,7 +732,7 @@ Please follow the instructions there to make your enterprise visible on the Open product: "Product" price: "Price" on_hand: "On hand" - save_changes: "Save changes" + save_changes: "Save Changes" update_action: "update()" #FIXME admin_entreprise_groups_what_s_this: "What's this ?" spree_admin_overview_enterprises_header: "My Enterprises" @@ -760,6 +760,8 @@ Please follow the instructions there to make your enterprise visible on the Open dashbord: "Dashboard" spree_admin_single_enterprise_alert_mail_confirmation: "Please confirm the email address for" spree_admin_single_enterprise_alert_mail_sent: "We've sent an email to" + spree_admin_overview_action_required: "Action Required" + spree_admin_overview_check_your_inbox: "Please check you inbox for furher instructions. Thanks!" change_package: "Change Package" spree_admin_single_enterprise_hint: "Hint: To allow people to find you, turn on your visibility under" your_profil_live: "Your profile live" @@ -789,13 +791,9 @@ Please follow the instructions there to make your enterprise visible on the Open no_orders_found: "No orders found." order_no: "Order No." weight_volume: "Weight/Volume" - step: "step" remove_tax: "Remove tax" - admin_variants_on_hand: "on hand" - admin_variants_sku: "sku" - tax_settings: "tax settings" + tax_settings: "Tax Settings" products_require_tax_category: "products require tax category" - update: "update" admin_shared_address_1: "Address" admin_shared_address_2: "Address (cont.)" admin_share_city: "City" From ec6962ea2c86c31f7baea8756c4924371af193a7 Mon Sep 17 00:00:00 2001 From: Florian Vallen Date: Sun, 13 Dec 2015 18:18:09 +0100 Subject: [PATCH 09/40] Implements i18n translation for admin interface it takes the i18n.js files from darkswarm. This should be changed later and added to the shared js folder. At best, the namespacing for yml files should work just as they work together with ruby, so general: sure: sure? should point to t(general.sure) --- app/assets/javascripts/admin/all.js | 3 +++ app/assets/javascripts/admin/filters/translate.js.coffee | 8 ++++++++ 2 files changed, 11 insertions(+) create mode 100644 app/assets/javascripts/admin/filters/translate.js.coffee diff --git a/app/assets/javascripts/admin/all.js b/app/assets/javascripts/admin/all.js index c0fa530626..c33ac741bd 100644 --- a/app/assets/javascripts/admin/all.js +++ b/app/assets/javascripts/admin/all.js @@ -42,5 +42,8 @@ //= require textAngular.min.js //= require textAngular-sanitize.min.js //= require ../shared/bindonce.min.js +//= require darkswarm/i18n.js +//= require darkswarm/i18n.translate.js + //= require_tree . diff --git a/app/assets/javascripts/admin/filters/translate.js.coffee b/app/assets/javascripts/admin/filters/translate.js.coffee new file mode 100644 index 0000000000..0fc0aa052d --- /dev/null +++ b/app/assets/javascripts/admin/filters/translate.js.coffee @@ -0,0 +1,8 @@ +angular.module('ofn.admin').filter "translate", -> + (key, options) -> + t(key, options) + +angular.module('ofn.admin').filter "t", -> + (key, options) -> + t(key, options) + From 7192f12a49304cd5f47aa0dff03d7453f8671972 Mon Sep 17 00:00:00 2001 From: Florian Vallen Date: Sun, 13 Dec 2015 18:18:33 +0100 Subject: [PATCH 10/40] first js translation for admin interface --- .../admin/controllers/enterprise_roles_controller.js.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/javascripts/admin/controllers/enterprise_roles_controller.js.coffee b/app/assets/javascripts/admin/controllers/enterprise_roles_controller.js.coffee index 026913a263..71d0097c6b 100644 --- a/app/assets/javascripts/admin/controllers/enterprise_roles_controller.js.coffee +++ b/app/assets/javascripts/admin/controllers/enterprise_roles_controller.js.coffee @@ -7,5 +7,5 @@ angular.module("ofn.admin").controller "AdminEnterpriseRolesCtrl", ($scope, Ente $scope.EnterpriseRoles.create($scope.user_id, $scope.enterprise_id) $scope.delete = (enterprise_role) -> - if confirm("Are you sure?") + if confirm(t('are_you_sure')) $scope.EnterpriseRoles.delete enterprise_role From 69ab1132015cac2640add8ca29f88f7c7480b500 Mon Sep 17 00:00:00 2001 From: ludivinecp Date: Mon, 14 Dec 2015 19:49:45 +0100 Subject: [PATCH 11/40] translations in app/assets/javascripts/admin/ --- .../admin/bulk_product_update.js.coffee | 56 +++++++++---------- .../javascripts/admin/enterprise_fees.js | 2 +- config/locales/en.yml | 29 +++++++++- 3 files changed, 57 insertions(+), 30 deletions(-) diff --git a/app/assets/javascripts/admin/bulk_product_update.js.coffee b/app/assets/javascripts/admin/bulk_product_update.js.coffee index b3d24f00c0..345e9105a7 100644 --- a/app/assets/javascripts/admin/bulk_product_update.js.coffee +++ b/app/assets/javascripts/admin/bulk_product_update.js.coffee @@ -4,32 +4,32 @@ angular.module("ofn.admin").controller "AdminProductEditCtrl", ($scope, $timeout $scope.StatusMessage = StatusMessage $scope.columns = Columns.setColumns - producer: {name: "Producer", visible: true} - sku: {name: "SKU", visible: false} - name: {name: "Name", visible: true} - unit: {name: "Unit", visible: true} - price: {name: "Price", visible: true} - on_hand: {name: "On Hand", visible: true} - on_demand: {name: "On Demand", visible: false} - category: {name: "Category", visible: false} - tax_category: {name: "Tax Category", visible: false} - inherits_properties: {name: "Inherits Properties?", visible: false} - available_on: {name: "Available On", visible: false} + producer: {name: t("label_producers"), visible: true} + sku: {name: t("products_sku"), visible: false} + name: {name: t("products_name"), visible: true} + unit: {name: t("products_unit"), visible: true} + price: {name: t("products_price"), visible: true} + on_hand: {name: t("products_on_hand"), visible: true} + on_demand: {name: t("products_on_demand"), visible: false} + category: {name: t("products_category"), visible: false} + tax_category: {name: t("products_tax_category"), visible: false} + inherits_properties: {name: t("products_inherits_properties"), visible: false} + available_on: {name: t("products_available_on"), visible: false} $scope.variant_unit_options = VariantUnitManager.variantUnitOptions() $scope.filterableColumns = [ - { name: "Producer", db_column: "producer_name" }, - { name: "Name", db_column: "name" } + { name: t("label_producers"), db_column: "producer_name" }, + { name: t("name"), db_column: "name" } ] $scope.filterTypes = [ - { name: "Equals", predicate: "eq" }, - { name: "Contains", predicate: "cont" } + { name: t("equals"), predicate: "eq" }, + { name: t("contains"), predicate: "cont" } ] $scope.optionTabs = - filters: { title: "Filter Products", visible: false } + filters: { title: t("filter_products"), visible: false } $scope.producers = producers @@ -105,7 +105,7 @@ angular.module("ofn.admin").controller "AdminProductEditCtrl", ($scope, $timeout $scope.categoryFilter = "0" $scope.editWarn = (product, variant) -> - if (DirtyProducts.count() > 0 and confirm("Unsaved changes will be lost. Continue anyway?")) or (DirtyProducts.count() == 0) + if (DirtyProducts.count() > 0 and confirm(t("unsaved_changes_confirmation"))) or (DirtyProducts.count() == 0) window.location = "/admin/products/" + product.permalink_live + ((if variant then "/variants/" + variant.id else "")) + "/edit" @@ -150,14 +150,14 @@ angular.module("ofn.admin").controller "AdminProductEditCtrl", ($scope, $timeout if !$scope.variantSaved(variant) $scope.removeVariant(product, variant) else - if confirm("Are you sure?") + if confirm(t("are_you_sure")) $http( method: "DELETE" url: "/api/products/" + product.permalink_live + "/variants/" + variant.id + "/soft_delete" ).success (data) -> $scope.removeVariant(product, variant) else - alert("The last variant cannot be deleted!") + alert(t("delete_product_variant")) $scope.removeVariant = (product, variant) -> product.variants.splice product.variants.indexOf(variant), 1 @@ -194,7 +194,7 @@ angular.module("ofn.admin").controller "AdminProductEditCtrl", ($scope, $timeout if productsToSubmit.length > 0 $scope.updateProducts productsToSubmit # Don't submit an empty list else - StatusMessage.display 'alert', 'No changes to save.' + StatusMessage.display 'alert', t("products_change") $scope.updateProducts = (productsToSubmit) -> @@ -212,10 +212,10 @@ angular.module("ofn.admin").controller "AdminProductEditCtrl", ($scope, $timeout ).error (data, status) -> if status == 400 && data.errors? && data.errors.length > 0 errors = error + "\n" for error in data.errors - alert "Saving failed with the following error(s):\n" + errors - $scope.displayFailure "Save failed due to invalid data" + alert t("products_update_error") + errors + $scope.displayFailure t("products_update_error") else - $scope.displayFailure "Server returned with error status: " + status + $scope.displayFailure t("products_update_error_data") + status $scope.packProduct = (product) -> @@ -253,21 +253,21 @@ angular.module("ofn.admin").controller "AdminProductEditCtrl", ($scope, $timeout $scope.displayUpdating = -> - StatusMessage.display 'progress', 'Saving...' + StatusMessage.display 'progress', t("saving") $scope.displaySuccess = -> - StatusMessage.display 'success', 'Changes saved.' + StatusMessage.display 'success',t("products_changes_saved") $scope.displayFailure = (failMessage) -> - StatusMessage.display 'failure', "Saving failed. #{failMessage}" + StatusMessage.display 'failure', t("products_update_error_msg") + "#{failMessage}" $scope.displayDirtyProducts = -> if DirtyProducts.count() > 0 - message = if DirtyProducts.count() == 1 then "one product" else DirtyProducts.count() + " products" - StatusMessage.display 'notice', "Changes to #{message} remain unsaved." + message = if DirtyProducts.count() == 1 then t("one_product") else DirtyProducts.count() + t("products") + StatusMessage.display 'notice', t("changes_to") + "#{message}" + t("remain_unsaved.") else StatusMessage.clear() diff --git a/app/assets/javascripts/admin/enterprise_fees.js b/app/assets/javascripts/admin/enterprise_fees.js index b815cd4266..7aafc25df9 100644 --- a/app/assets/javascripts/admin/enterprise_fees.js +++ b/app/assets/javascripts/admin/enterprise_fees.js @@ -34,7 +34,7 @@ angular.module('enterprise_fees', []) return function(scope, element, attrs) { if(scope.enterprise_fee.id) { var url = "/admin/enterprise_fees/" + scope.enterprise_fee.id - var html = ''; + var html = ''; //var html = 'Delete Delete'; element.append(html); } diff --git a/config/locales/en.yml b/config/locales/en.yml index 9eafa25770..f8a71b874b 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -324,6 +324,11 @@ See the %{link} to find out more about %{sitename}'s features and to start using products_cart_empty: "Cart empty" products_edit_cart: "Edit your cart" products_from: from + products_change: "No changes to save" + products_update_error: "Saving failed with the following error(s):" + products_update_error_msg: "Saving failed." + products_update_error_data: "Save failed due to invalid data:" + products_changes_saved: "Changes saved." search_no_results_html: "Sorry, no results found for %{query}. Try another search?" @@ -337,6 +342,7 @@ See the %{link} to find out more about %{sitename}'s features and to start using groups_search: "Search name or keyword" groups_no_groups: "No groups found" groups_about: "About Us" + groups_producers: "Our producers" groups_hubs: "Our hubs" groups_contact_web: Contact @@ -430,7 +436,16 @@ See the %{link} to find out more about %{sitename}'s features and to start using products_variant: Variant products_quantity: Quantity products_availabel: Available? - products_price: Price + products_price: "Price" + products_sku: "SKU" + products_name: "name" + products_unit: "unit" + products_on_hand: "on hand" + products_on_demand: "on demand" + products_category: "category" + products_tax_category: "tax category" + products_available_on: "available on" + products_inherits_properties: "Inherits Properties ?" register_title: Register @@ -832,3 +847,15 @@ Please follow the instructions there to make your enterprise visible on the Open invoice_date: "Invoice date:" due_date: "Due date:" account_code: "Account code:" + equals: "Equals" + contains: "contains" + filter_products: "Filter Products" + delete_product_variant: "The last variant cannot be deleted!" + progress: "progress" + saving: "Saving.." + success: "success" + failure: "failure" + unsaved_changes_confirmation: "Unsaved changes will be lost. Continue anyway?" + one_product: "one product" + changes_to: "Changes to" + remain_unsaved: "remain unsaced" From e16e3fba40d4e9521054a51d683f21bf01fdb1bb Mon Sep 17 00:00:00 2001 From: victor goutay Date: Mon, 14 Dec 2015 20:30:50 +0100 Subject: [PATCH 12/40] translations in app/assets/javascripts/admin/ --- .../admin/bulk_order_management.js.coffee | 28 +++++++-------- .../line_items_controller.js.coffee | 36 +++++++++---------- config/locales/en.yml | 15 ++++++++ 3 files changed, 47 insertions(+), 32 deletions(-) diff --git a/app/assets/javascripts/admin/bulk_order_management.js.coffee b/app/assets/javascripts/admin/bulk_order_management.js.coffee index 7d0572635d..c2250954b7 100644 --- a/app/assets/javascripts/admin/bulk_order_management.js.coffee +++ b/app/assets/javascripts/admin/bulk_order_management.js.coffee @@ -12,25 +12,25 @@ angular.module("ofn.admin").controller "AdminOrderMgmtCtrl", [ $scope.startDate = formatDate start $scope.endDate = formatDate end $scope.quickSearch = "" - $scope.bulkActions = [ { name: "Delete Selected", callback: $scope.deleteLineItems } ] + $scope.bulkActions = [ { name: t("bom_actions_delete"), callback: $scope.deleteLineItems } ] $scope.selectedBulkAction = $scope.bulkActions[0] $scope.selectedUnitsProduct = {}; $scope.selectedUnitsVariant = {}; $scope.sharedResource = false $scope.columns = Columns.setColumns - order_no: { name: "Order No.", visible: false } - full_name: { name: "Name", visible: true } - email: { name: "Email", visible: false } - phone: { name: "Phone", visible: false } - order_date: { name: "Order Date", visible: true } - producer: { name: "Producer", visible: true } - order_cycle: { name: "Order Cycle", visible: false } - hub: { name: "Hub", visible: false } - variant: { name: "Variant", visible: true } - quantity: { name: "Quantity", visible: true } - max: { name: "Max", visible: true } - final_weight_volume: { name: "Weight/Volume", visible: false } - price: { name: "Price", visible: false } + order_no: { name: t("bom_no"), visible: false } + full_name: { name: t("name"), visible: true } + email: { name: t("email"), visible: false } + phone: { name: t("phone"), visible: false } + order_date: { name: t("bom_date"), visible: true } + producer: { name: t("producer"), visible: true } + order_cycle: { name: t("bom_cycle"), visible: false } + hub: { name: t("bom_hub"), visible: false } + variant: { name: t("bom_variant"), visible: true } + quantity: { name: t("bom_quantity"), visible: true } + max: { name: t("bom_max"), visible: true } + final_weight_volume: { name: t("bom_final_weigth_volume"), visible: false } + price: { name: t("bom_price"), visible: false } $scope.initialise = -> $scope.initialiseVariables() authorise_api_reponse = "" diff --git a/app/assets/javascripts/admin/line_items/controllers/line_items_controller.js.coffee b/app/assets/javascripts/admin/line_items/controllers/line_items_controller.js.coffee index 38c7f0ba33..94e17b563c 100644 --- a/app/assets/javascripts/admin/line_items/controllers/line_items_controller.js.coffee +++ b/app/assets/javascripts/admin/line_items/controllers/line_items_controller.js.coffee @@ -6,27 +6,27 @@ angular.module("admin.lineItems").controller 'LineItemsCtrl', ($scope, $timeout, $scope.confirmDelete = true $scope.startDate = formatDate daysFromToday -7 $scope.endDate = formatDate daysFromToday 1 - $scope.bulkActions = [ { name: "Delete Selected", callback: 'deleteLineItems' } ] + $scope.bulkActions = [ { name: t("bom_actions_delete"), callback: 'deleteLineItems' } ] $scope.selectedUnitsProduct = {}; $scope.selectedUnitsVariant = {}; $scope.sharedResource = false $scope.columns = Columns.setColumns - order_no: { name: "Order No.", visible: false } - full_name: { name: "Name", visible: true } - email: { name: "Email", visible: false } - phone: { name: "Phone", visible: false } - order_date: { name: "Order Date", visible: true } - producer: { name: "Producer", visible: true } - order_cycle: { name: "Order Cycle", visible: false } - hub: { name: "Hub", visible: false } - variant: { name: "Variant", visible: true } - quantity: { name: "Quantity", visible: true } - max: { name: "Max", visible: true } - final_weight_volume: { name: "Weight/Volume", visible: false } - price: { name: "Price", visible: false } + order_no: { name: t("bom_no"), visible: false } + full_name: { name: t("name"), visible: true } + email: { name: t("email"), visible: false } + phone: { name: t("phone"), visible: false } + order_date: { name: t("bom_date"), visible: true } + producer: { name: t("producer"), visible: true } + order_cycle: { name: t("bom_cycle"), visible: false } + hub: { name: t("bom_hub"), visible: false } + variant: { name: t("bom_variant"), visible: true } + quantity: { name: t("bom_quantity"), visible: true } + max: { name: t("bom_max"), visible: true } + final_weight_volume: { name: t("bom_final_weigth_volume"), visible: false } + price: { name: t("bom_price"), visible: false } $scope.confirmRefresh = -> - LineItems.allSaved() || confirm("Unsaved changes exist and will be lost if you continue.") + LineItems.allSaved() || confirm(t("unsaved_changes_warning")) $scope.resetSelectFilters = -> $scope.distributorFilter = blankOption().id @@ -69,12 +69,12 @@ angular.module("admin.lineItems").controller 'LineItemsCtrl', ($scope, $timeout, $scope.bulk_order_form.$setPristine() $scope.saving = false ).catch -> - alert "Some errors must be resolved be before you can update orders.\nAny fields with red borders contain errors." + alert "#{t("unsaved_changes_warning")}" else - alert "Some errors must be resolved be before you can update orders.\nAny fields with red borders contain errors." + alert "#{t("unsaved_changes_warning")}" $scope.deleteLineItem = (lineItem) -> - if ($scope.confirmDelete && confirm("Are you sure?")) || !$scope.confirmDelete + if ($scope.confirmDelete && confirm(t("are_you_sure"))) || !$scope.confirmDelete LineItems.delete lineItem, => $scope.lineItems.splice $scope.lineItems.indexOf(lineItem), 1 diff --git a/config/locales/en.yml b/config/locales/en.yml index f8a71b874b..fd5460fa3a 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -221,6 +221,20 @@ en: order_payment_paypal_successful: Your payment via PayPal has been processed successfully. order_hub_info: Hub Info + bom_no: "Order no." + bom_date: "Order date" + bom_cycle: "Order cycle" + bom_quantity: "Quantity" + bom_max: "Max" + bom_hub: "Hub" + bom_variant: "Variant" + bom_final_weigth_volume: "Weight/Volume" + bom_price: "Price" + bom_actions_delete: "Delete Selected" + bom_order_error: "Some errors must be resolved before you can update orders.\nAny fields with red borders contain errors." + + unsaved_changes_warning: "Unsaved changes exist and will be lost if you continue." + products: "Products" products_in: "in %{oc}" products_at: "at %{distributor}" @@ -430,6 +444,7 @@ See the %{link} to find out more about %{sitename}'s features and to start using producers_signup_cta_headline: Join now! producers_signup_cta_action: Join now producers_signup_detail: Here's the detail. + producer: Producer products_item: Item products_description: Description From 30141bd488b969a19b4028520c91846860bb1fe2 Mon Sep 17 00:00:00 2001 From: Emmanuel Date: Mon, 14 Dec 2015 20:18:45 +0100 Subject: [PATCH 13/40] few translations in app/assets/javascripts/admin/ --- .../enterprises/controllers/enterprise_controller.js.coffee | 6 ++++-- .../controllers/enterprises_controller.js.coffee | 1 + config/locales/en.yml | 2 ++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/admin/enterprises/controllers/enterprise_controller.js.coffee b/app/assets/javascripts/admin/enterprises/controllers/enterprise_controller.js.coffee index d48f2a42f8..05c9b40f99 100644 --- a/app/assets/javascripts/admin/enterprises/controllers/enterprise_controller.js.coffee +++ b/app/assets/javascripts/admin/enterprises/controllers/enterprise_controller.js.coffee @@ -6,7 +6,7 @@ angular.module("admin.enterprises") $scope.navClear = NavigationCheck.clear $scope.pristineEmail = $scope.Enterprise.email $scope.menu = SideMenu - $scope.newManager = { id: '', email: 'Add a manager...' } + $scope.newManager = { id: '', email: (t("add_manager")) } # Provide a callback for generating warning messages displayed before leaving the page. This is passed in # from a directive "nav-check" in the page - if we pass it here it will be called in the test suite, @@ -31,4 +31,6 @@ angular.module("admin.enterprises") if (user for user in $scope.Enterprise.users when user.id == manager.id).length == 0 $scope.Enterprise.users.push manager else - alert "#{manager.email} is already a manager!" + alert ("#{manager.email}" + " " + t("is_already_manager")) + + diff --git a/app/assets/javascripts/admin/enterprises/controllers/enterprises_controller.js.coffee b/app/assets/javascripts/admin/enterprises/controllers/enterprises_controller.js.coffee index 3d8bfa6446..30710d1538 100644 --- a/app/assets/javascripts/admin/enterprises/controllers/enterprises_controller.js.coffee +++ b/app/assets/javascripts/admin/enterprises/controllers/enterprises_controller.js.coffee @@ -11,3 +11,4 @@ angular.module("admin.enterprises").controller 'enterprisesCtrl', ($scope, $q, E package: { name: "Package", visible: true } status: { name: "Status", visible: true } manage: { name: "Manage", visible: true } + diff --git a/config/locales/en.yml b/config/locales/en.yml index fd5460fa3a..02de2b816e 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -874,3 +874,5 @@ Please follow the instructions there to make your enterprise visible on the Open one_product: "one product" changes_to: "Changes to" remain_unsaved: "remain unsaced" + add_manager: "Add a manager" + is_already_manager: "is already a manager!" From ed48b691e1a17636ca9c66b4a4c557cbc925067a Mon Sep 17 00:00:00 2001 From: knopfler81 Date: Mon, 14 Dec 2015 20:20:01 +0100 Subject: [PATCH 14/40] translations in app/assets/javascripts/admin --- ...erprise_relationships_controller.js.coffee | 2 +- .../variant_overrides_controller.js.coffee | 2 +- .../side_menu_controller.js.coffee | 10 +++---- .../enterprise_controller.js.coffee | 2 +- .../side_menu_controller.js.coffee | 26 +++++++++---------- config/locales/en.yml | 17 ++++++++++++ 6 files changed, 38 insertions(+), 21 deletions(-) diff --git a/app/assets/javascripts/admin/controllers/enterprise_relationships_controller.js.coffee b/app/assets/javascripts/admin/controllers/enterprise_relationships_controller.js.coffee index 47083d443a..153acb2443 100644 --- a/app/assets/javascripts/admin/controllers/enterprise_relationships_controller.js.coffee +++ b/app/assets/javascripts/admin/controllers/enterprise_relationships_controller.js.coffee @@ -7,7 +7,7 @@ angular.module("ofn.admin").controller "AdminEnterpriseRelationshipsCtrl", ($sco $scope.EnterpriseRelationships.create($scope.parent_id, $scope.child_id, $scope.permissions) $scope.delete = (enterprise_relationship) -> - if confirm("Are you sure?") + if confirm(t("are_you_sure")) $scope.EnterpriseRelationships.delete enterprise_relationship $scope.toggleKeyword = (string, key) -> diff --git a/app/assets/javascripts/admin/controllers/variant_overrides_controller.js.coffee b/app/assets/javascripts/admin/controllers/variant_overrides_controller.js.coffee index bcc633805f..cb3197f86e 100644 --- a/app/assets/javascripts/admin/controllers/variant_overrides_controller.js.coffee +++ b/app/assets/javascripts/admin/controllers/variant_overrides_controller.js.coffee @@ -40,7 +40,7 @@ angular.module("ofn.admin").controller "AdminVariantOverridesCtrl", ($scope, $ti $scope.update = -> if DirtyVariantOverrides.count() == 0 - StatusMessage.display 'alert', 'No changes to save.' + StatusMessage.display 'alert', 'No change to save ' else StatusMessage.display 'progress', 'Saving...' DirtyVariantOverrides.save() diff --git a/app/assets/javascripts/admin/enterprise_groups/controllers/side_menu_controller.js.coffee b/app/assets/javascripts/admin/enterprise_groups/controllers/side_menu_controller.js.coffee index 7b9a8165a1..45ca04bfe7 100644 --- a/app/assets/javascripts/admin/enterprise_groups/controllers/side_menu_controller.js.coffee +++ b/app/assets/javascripts/admin/enterprise_groups/controllers/side_menu_controller.js.coffee @@ -5,11 +5,11 @@ angular.module("admin.enterprise_groups") $scope.menu.setItems [ { name: 'Primary Details', icon_class: "icon-user" } - { name: 'Users', icon_class: "icon-user" } - { name: 'About', icon_class: "icon-pencil" } - { name: 'Images', icon_class: "icon-picture" } - { name: 'Contact', icon_class: "icon-phone" } - { name: 'Web', icon_class: "icon-globe" } + { name: (t('users')), icon_class: "icon-user" } + { name: (t('about')), icon_class: "icon-pencil" } + { name: (t('images')), icon_class: "icon-picture" } + { name: (t('contact')), icon_class: "icon-phone" } + { name: (t('web')), icon_class: "icon-globe" } ] $scope.select(0) diff --git a/app/assets/javascripts/admin/enterprises/controllers/enterprise_controller.js.coffee b/app/assets/javascripts/admin/enterprises/controllers/enterprise_controller.js.coffee index 05c9b40f99..34b4f99ca2 100644 --- a/app/assets/javascripts/admin/enterprises/controllers/enterprise_controller.js.coffee +++ b/app/assets/javascripts/admin/enterprises/controllers/enterprise_controller.js.coffee @@ -6,7 +6,7 @@ angular.module("admin.enterprises") $scope.navClear = NavigationCheck.clear $scope.pristineEmail = $scope.Enterprise.email $scope.menu = SideMenu - $scope.newManager = { id: '', email: (t("add_manager")) } + $scope.newManager = { id: '', email: (t('add_manager')) } # Provide a callback for generating warning messages displayed before leaving the page. This is passed in # from a directive "nav-check" in the page - if we pass it here it will be called in the test suite, diff --git a/app/assets/javascripts/admin/enterprises/controllers/side_menu_controller.js.coffee b/app/assets/javascripts/admin/enterprises/controllers/side_menu_controller.js.coffee index 45a5d068a4..71c03adbd0 100644 --- a/app/assets/javascripts/admin/enterprises/controllers/side_menu_controller.js.coffee +++ b/app/assets/javascripts/admin/enterprises/controllers/side_menu_controller.js.coffee @@ -5,19 +5,19 @@ angular.module("admin.enterprises") $scope.select = SideMenu.select $scope.menu.setItems [ - { name: 'Primary Details', icon_class: "icon-home" } - { name: 'Users', icon_class: "icon-user" } - { name: 'Address', icon_class: "icon-map-marker" } - { name: 'Contact', icon_class: "icon-phone" } - { name: 'Social', icon_class: "icon-twitter" } - { name: 'About', icon_class: "icon-pencil" } - { name: 'Business Details', icon_class: "icon-briefcase" } - { name: 'Images', icon_class: "icon-picture" } - { name: "Properties", icon_class: "icon-tags", show: "showProperties()" } - { name: "Shipping Methods", icon_class: "icon-truck", show: "showShippingMethods()" } - { name: "Payment Methods", icon_class: "icon-money", show: "showPaymentMethods()" } - { name: "Enterprise Fees", icon_class: "icon-tasks", show: "showEnterpriseFees()" } - { name: "Shop Preferences", icon_class: "icon-shopping-cart", show: "showShopPreferences()" } + { name: (t('primary_details')), icon_class: "icon-home" } + { name: (t('users')), icon_class: "icon-user" } + { name: (t('address')), icon_class: "icon-map-marker" } + { name: (t('contact')), icon_class: "icon-phone" } + { name: (t('social')), icon_class: "icon-twitter" } + { name: (t('about')), icon_class: "icon-pencil" } + { name: (t('business_details')), icon_class: "icon-briefcase" } + { name: (t('images')), icon_class: "icon-picture" } + { name: (t("properties")), icon_class: "icon-tags", show: "showProperties()" } + { name: (t("shipping_methods")), icon_class: "icon-truck", show: "showShippingMethods()" } + { name: (t("payment_methods")), icon_class: "icon-money", show: "showPaymentMethods()" } + { name: (t("enterprise_fees")), icon_class: "icon-tasks", show: "showEnterpriseFees()" } + { name: (t("shop_preferences")), icon_class: "icon-shopping-cart", show: "showShopPreferences()" } ] $scope.select(0) diff --git a/config/locales/en.yml b/config/locales/en.yml index 02de2b816e..b9c32d72f5 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -876,3 +876,20 @@ Please follow the instructions there to make your enterprise visible on the Open remain_unsaved: "remain unsaced" add_manager: "Add a manager" is_already_manager: "is already a manager!" + no_change_to_save: " No change to save" + add_manager: "Add a manager" + users: "Users" + about: "About" + images: "Images" + contact: "Contact" + web: "Web" + primary_details: "Primary Details" + adrdress: "Address" + contact: "Contact" + social: "Social" + business_details: "Business Details" + properties: "Properties" + shipping_methods: "Shipping Methods" + payment_methods: "Payment Methods" + enterprise_fees: "Enterprise Fees" + shop_preferences: "Shop Preferences" From 2a4f3f9ae4fca3300a3c679c64500bcae5f8580c Mon Sep 17 00:00:00 2001 From: elf Pavlik Date: Mon, 21 Dec 2015 06:52:30 +0100 Subject: [PATCH 15/40] making test pass --- .../admin/bulk_product_update.js.coffee | 2 +- .../products/bulk_edit/_filters.html.haml | 6 ++++-- config/locales/en.yml | 21 ++++++++++--------- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/app/assets/javascripts/admin/bulk_product_update.js.coffee b/app/assets/javascripts/admin/bulk_product_update.js.coffee index 345e9105a7..289e4fdf80 100644 --- a/app/assets/javascripts/admin/bulk_product_update.js.coffee +++ b/app/assets/javascripts/admin/bulk_product_update.js.coffee @@ -4,7 +4,7 @@ angular.module("ofn.admin").controller "AdminProductEditCtrl", ($scope, $timeout $scope.StatusMessage = StatusMessage $scope.columns = Columns.setColumns - producer: {name: t("label_producers"), visible: true} + producer: {name: t("products_producer"), visible: true} sku: {name: t("products_sku"), visible: false} name: {name: t("products_name"), visible: true} unit: {name: t("products_unit"), visible: true} diff --git a/app/views/spree/admin/products/bulk_edit/_filters.html.haml b/app/views/spree/admin/products/bulk_edit/_filters.html.haml index 99c1067663..cf9d01a4ae 100644 --- a/app/views/spree/admin/products/bulk_edit/_filters.html.haml +++ b/app/views/spree/admin/products/bulk_edit/_filters.html.haml @@ -4,11 +4,13 @@ %br %input.search{ :class => "four columns alpha", 'ng-model' => 'query', :name => "quick_filter", :type => 'text', 'placeholder' => 'Quick Search' } .filter_select{ :class => "four columns" } - %label{ :for => 'producer_filter' }Producer + %label{ :for => 'producer_filter' } + = t 'producer' %br %select{ :class => "four columns alpha", :id => 'producer_filter', 'ofn-select2-min-search' => 5, 'ng-model' => 'producerFilter', 'ng-options' => 'producer.id as producer.name for producer in filterProducers' } .filter_select{ :class => "four columns" } - %label{ :for => 'category_filter' }Category + %label{ :for => 'category_filter' } + = t 'category' %br %select{ :class => "four columns alpha", :id => 'category_filter', 'ofn-select2-min-search' => 5, 'ng-model' => 'categoryFilter', 'ng-options' => 'taxon.id as taxon.name for taxon in filterTaxons'} %div{ :class => "one column" }   diff --git a/config/locales/en.yml b/config/locales/en.yml index b9c32d72f5..ef8da66414 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -17,8 +17,8 @@ en: title: Open Food Network welcome_to: 'Welcome to ' search_by_name: Search by name or suburb... - producers: Aussie Producers - producers_join: Australian producers are now welcome to join the Open Food Network. + producers: Aussie Producers #FIXME + producers_join: Australian producers are now welcome to join the Open Food Network. #FIXME charges_sales_tax: Charges GST? print_invoice: "Print Invoice" send_invoice: "Send Invoice" @@ -48,12 +48,12 @@ en: invoice_column_tax: "GST" invoice_column_price: "Price" - logo: "Logo (640x130)" - logo_mobile: "Mobile logo (75x26)" - logo_mobile_svg: "Mobile logo (SVG)" + logo: "Logo (640x130)" #FIXME + logo_mobile: "Mobile logo (75x26)" #FIXME + logo_mobile_svg: "Mobile logo (SVG)" #FIXME home_hero: "Hero image" home_show_stats: "Show statistics" - footer_logo: "Logo (220x76)" + footer_logo: "Logo (220x76)" #FIXME footer_facebook_url: "Facebook URL" footer_twitter_url: "Twitter URL" footer_instagram_url: "Instagram URL" @@ -338,7 +338,7 @@ See the %{link} to find out more about %{sitename}'s features and to start using products_cart_empty: "Cart empty" products_edit_cart: "Edit your cart" products_from: from - products_change: "No changes to save" + products_change: "No changes to save." products_update_error: "Saving failed with the following error(s):" products_update_error_msg: "Saving failed." products_update_error_data: "Save failed due to invalid data:" @@ -451,16 +451,17 @@ See the %{link} to find out more about %{sitename}'s features and to start using products_variant: Variant products_quantity: Quantity products_availabel: Available? + products_producer: "Producer" products_price: "Price" products_sku: "SKU" products_name: "name" products_unit: "unit" products_on_hand: "on hand" products_on_demand: "on demand" - products_category: "category" + products_category: "Category" products_tax_category: "tax category" - products_available_on: "available on" - products_inherits_properties: "Inherits Properties ?" + products_available_on: "Available On" + products_inherits_properties: "Inherits Properties?" register_title: Register From 5e081ce3ee5c64f03784d1dc20b5d9c6c0e41a12 Mon Sep 17 00:00:00 2001 From: Emmanuel Date: Tue, 15 Dec 2015 22:40:21 +0100 Subject: [PATCH 16/40] Translations of validation messages in app/models --- app/models/customer.rb | 3 ++- app/models/enterprise_relationship.rb | 2 +- app/models/spree/product_decorator.rb | 4 ++-- config/locales/en.yml | 5 +++++ 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/app/models/customer.rb b/app/models/customer.rb index 856f7e94d7..1ab2f3ae5c 100644 --- a/app/models/customer.rb +++ b/app/models/customer.rb @@ -5,7 +5,7 @@ class Customer < ActiveRecord::Base belongs_to :user, :class_name => Spree.user_class validates :code, uniqueness: { scope: :enterprise_id, allow_blank: true, allow_nil: true } - validates :email, presence: true, uniqueness: { scope: :enterprise_id, message: "is associated with an existing customer" } + validates :email, presence: true, uniqueness: { scope: :enterprise_id, message: I18n.t('validation_msg_is_associated_with_an_exising_customer') } validates :enterprise_id, presence: true scope :of, ->(enterprise) { where(enterprise_id: enterprise) } @@ -18,3 +18,4 @@ class Customer < ActiveRecord::Base self.user = user || Spree::User.find_by_email(email) end end + diff --git a/app/models/enterprise_relationship.rb b/app/models/enterprise_relationship.rb index 8d279b2a20..f32f7faae9 100644 --- a/app/models/enterprise_relationship.rb +++ b/app/models/enterprise_relationship.rb @@ -4,7 +4,7 @@ class EnterpriseRelationship < ActiveRecord::Base has_many :permissions, class_name: 'EnterpriseRelationshipPermission', dependent: :destroy validates_presence_of :parent_id, :child_id - validates_uniqueness_of :child_id, scope: :parent_id, message: "^That relationship is already established." + validates_uniqueness_of :child_id, scope: :parent_id, message: I18n.t('validation_msg_relationship_already_established') scope :with_enterprises, joins('LEFT JOIN enterprises AS parent_enterprises ON parent_enterprises.id = enterprise_relationships.parent_id'). diff --git a/app/models/spree/product_decorator.rb b/app/models/spree/product_decorator.rb index b089c9a52b..309111fd8b 100644 --- a/app/models/spree/product_decorator.rb +++ b/app/models/spree/product_decorator.rb @@ -26,8 +26,8 @@ Spree::Product.class_eval do # validates_presence_of :variants, unless: :new_record?, message: "Product must have at least one variant" validates_presence_of :supplier - validates :primary_taxon, presence: { message: "^Product Category can't be blank" } - validates :tax_category_id, presence: { message: "^Tax Category can't be blank" }, if: "Spree::Config.products_require_tax_category" + validates :primary_taxon, presence: { message: I18n.t("validation_msg_product_category_cant_be_blank") } + validates :tax_category_id, presence: { message: I18n.t("validation_msg_tax") }, if: "Spree::Config.products_require_tax_category" validates_presence_of :variant_unit validates_presence_of :variant_unit_scale, diff --git a/config/locales/en.yml b/config/locales/en.yml index ef8da66414..8d75094e1e 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -894,3 +894,8 @@ Please follow the instructions there to make your enterprise visible on the Open payment_methods: "Payment Methods" enterprise_fees: "Enterprise Fees" shop_preferences: "Shop Preferences" + validation_msg_relationship_already_established: "^That relationship is already established." + validation_msg_at_least_one_hub: "^At least one hub must be selected" + validation_msg_product_category_cant_be_blank: "^Product Category cant be blank" + validation_msg_tax_category_cant_be_blank: "^Tax Category can't be blank" + validation_msg_is_associated_with_an_exising_customer: "is associated with an existing customer" From 614f83799e7b606c5a381dd428fae358e48deba4 Mon Sep 17 00:00:00 2001 From: Nicolas Blanc Date: Sat, 20 Feb 2016 19:23:22 +0000 Subject: [PATCH 17/40] new test 2016/02/20 --- .../line_items_controller.js.coffee | 6 ++--- app/views/admin/order_cycles/edit.html.haml | 2 +- app/views/admin/order_cycles/index.html.haml | 21 +++++---------- .../admin/orders/bulk_management.html.haml | 2 +- .../single_enterprise_dashboard.html.haml | 26 +++++++++---------- 5 files changed, 25 insertions(+), 32 deletions(-) diff --git a/app/assets/javascripts/admin/line_items/controllers/line_items_controller.js.coffee b/app/assets/javascripts/admin/line_items/controllers/line_items_controller.js.coffee index 203f7a435a..ce4ef7aa7b 100644 --- a/app/assets/javascripts/admin/line_items/controllers/line_items_controller.js.coffee +++ b/app/assets/javascripts/admin/line_items/controllers/line_items_controller.js.coffee @@ -70,12 +70,12 @@ angular.module("admin.lineItems").controller 'LineItemsCtrl', ($scope, $timeout, if $scope.bulk_order_form.$valid StatusMessage.display 'progress', "Saving..." $q.all(LineItems.saveAll()).then(-> - StatusMessage.display 'success', "All changes saved" + StatusMessage.display 'success', "All changes saved"v $scope.bulk_order_form.$setPristine() ).catch -> - StatusMessage.display 'failure', #{t("unsaved_changes_warning")} + StatusMessage.display 'failure', {t("unsaved_changes_warning")} else - StatusMessage.display 'failure', #{t("unsaved_changes_warning")} + StatusMessage.display 'failure', {t("unsaved_changes_warning")} $scope.deleteLineItem = (lineItem) -> if ($scope.confirmDelete && confirm(t("are_you_sure"))) || !$scope.confirmDelete diff --git a/app/views/admin/order_cycles/edit.html.haml b/app/views/admin/order_cycles/edit.html.haml index 81496bcdb8..fe0892c300 100644 --- a/app/views/admin/order_cycles/edit.html.haml +++ b/app/views/admin/order_cycles/edit.html.haml @@ -5,7 +5,7 @@ %h1 - =t'edit_order_cycle' + = t:edit_order_cycle - ng_controller = order_cycles_simple_form ? 'AdminSimpleEditOrderCycleCtrl' : 'AdminEditOrderCycleCtrl' diff --git a/app/views/admin/order_cycles/index.html.haml b/app/views/admin/order_cycles/index.html.haml index 91f267a7d7..de166aa4fc 100644 --- a/app/views/admin/order_cycles/index.html.haml +++ b/app/views/admin/order_cycles/index.html.haml @@ -28,21 +28,14 @@ %thead %tr - %th - =t'name' - %th - =t'open' - %th - =t'close' + %th =t :name + %th =t :open + %th =t :close - unless order_cycles_simple_index - %th - =t'supplier' - %th - =t'coordinator' - %th - =t'distributors' - %th - =t'products' + %th =t :supplier + %th =t :coordinator + %th =t :distributors + %th =t :products %th.actions %th.actions %th.actions diff --git a/app/views/spree/admin/orders/bulk_management.html.haml b/app/views/spree/admin/orders/bulk_management.html.haml index 8dda00cf1c..d11f8dffc9 100644 --- a/app/views/spree/admin/orders/bulk_management.html.haml +++ b/app/views/spree/admin/orders/bulk_management.html.haml @@ -151,7 +151,7 @@ = t "products_price" %th.actions %th.actions - = t "ask" + = t "ask"  %input{ :type => 'checkbox', 'ng-model' => "confirmDelete" } %tr.line_item{ 'ng-repeat' => "line_item in filteredLineItems = ( lineItems | filter:quickSearch | selectFilter:supplierFilter:distributorFilter:orderCycleFilter | variantFilter:selectedUnitsProduct:selectedUnitsVariant:sharedResource | orderBy:predicate:reverse )", 'ng-class-even' => "'even'", 'ng-class-odd' => "'odd'", :id => "li_{{line_item.id}}" } diff --git a/app/views/spree/admin/overview/single_enterprise_dashboard.html.haml b/app/views/spree/admin/overview/single_enterprise_dashboard.html.haml index 14bc30e23b..437d28b63c 100644 --- a/app/views/spree/admin/overview/single_enterprise_dashboard.html.haml +++ b/app/views/spree/admin/overview/single_enterprise_dashboard.html.haml @@ -19,7 +19,7 @@ } #package_button %button#toggle_type{ onClick: 'toggleType()' } - = t "change_package" + = t:change_package %i.icon-chevron-down @@ -39,7 +39,7 @@ .alert-box %strong = t "spree_admin_single_enterprise_hint" - %strong= "#{t('manage')} #{@enterprise.name}." + %strong= "#{t:manage} #{@enterprise.name}." %a.close{ href: "#" } × .row @@ -47,15 +47,15 @@ .header %h3 %span.icon-map-marker - = t "your_profil_live" + = t:your_profil_live %p - = t "on_ofn_map" + = t:on_ofn_map .list /-# Can we pass an anchor here to zoom to our enterprise? %a.button.bottom{href: main_app.map_path, target: '_blank'} - = t "see" + = t:see = @enterprise.name - = t "live" + = t:live %span.icon-arrow-right .two.columns   @@ -64,12 +64,12 @@ .header %h3 %span.icon-edit - = t "edit_profile_details" + = t:edit_profile_details %p - = t "edit_profile_details_etc" + = t:edit_profile_details_etc .list %a.button.bottom{href: main_app.edit_admin_enterprise_path(@enterprise)} - = t "manage" + = t:manage = @enterprise.name %span.icon-arrow-right @@ -79,10 +79,10 @@ .header %h3 %span.icon-th-large - = t 'add_and_manage_products' + = t:add_and_manage_products .list %a.button.bottom{href: bulk_edit_admin_products_path} - = t 'manage_products' + = t:manage_products %span.icon-arrow-right .two.columns @@ -93,8 +93,8 @@ .header %h3 %span.icon-shopping-cart - = t 'add_and_manage_order_cycles' + = t:add_and_manage_order_cycles .list %a.button.bottom{href: main_app.admin_order_cycles_path} - = t 'manage_order_cycles' + = t:manage_order_cycles %span.icon-arrow-right From 1738db9e1f23df0bd725682dda24c93ef8b5a820 Mon Sep 17 00:00:00 2001 From: Nicolas Blanc Date: Mon, 22 Feb 2016 13:00:27 +0000 Subject: [PATCH 18/40] new validation 02/22/2016 --- .../admin/bulk_product_update.js.coffee | 2 +- .../line_items_controller.js.coffee | 2 +- .../single_enterprise_dashboard.html.haml | 26 +++++++++---------- config/locales/en.yml | 2 +- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/app/assets/javascripts/admin/bulk_product_update.js.coffee b/app/assets/javascripts/admin/bulk_product_update.js.coffee index 92282ae6ba..cb337c4c47 100644 --- a/app/assets/javascripts/admin/bulk_product_update.js.coffee +++ b/app/assets/javascripts/admin/bulk_product_update.js.coffee @@ -212,7 +212,7 @@ angular.module("ofn.admin").controller "AdminProductEditCtrl", ($scope, $timeout ).error (data, status) -> if status == 400 && data.errors? && data.errors.length > 0 errors = error + "\n" for error in data.errors - alert t("products_update_error") + errors + alert t("products_update_error") + "\n" + errors $scope.displayFailure t("products_update_error") else $scope.displayFailure t("products_update_error_data") + status diff --git a/app/assets/javascripts/admin/line_items/controllers/line_items_controller.js.coffee b/app/assets/javascripts/admin/line_items/controllers/line_items_controller.js.coffee index ce4ef7aa7b..9ab0a71ecc 100644 --- a/app/assets/javascripts/admin/line_items/controllers/line_items_controller.js.coffee +++ b/app/assets/javascripts/admin/line_items/controllers/line_items_controller.js.coffee @@ -70,7 +70,7 @@ angular.module("admin.lineItems").controller 'LineItemsCtrl', ($scope, $timeout, if $scope.bulk_order_form.$valid StatusMessage.display 'progress', "Saving..." $q.all(LineItems.saveAll()).then(-> - StatusMessage.display 'success', "All changes saved"v + StatusMessage.display 'success', "All changes saved" $scope.bulk_order_form.$setPristine() ).catch -> StatusMessage.display 'failure', {t("unsaved_changes_warning")} diff --git a/app/views/spree/admin/overview/single_enterprise_dashboard.html.haml b/app/views/spree/admin/overview/single_enterprise_dashboard.html.haml index 437d28b63c..0d31d482f6 100644 --- a/app/views/spree/admin/overview/single_enterprise_dashboard.html.haml +++ b/app/views/spree/admin/overview/single_enterprise_dashboard.html.haml @@ -31,7 +31,7 @@ .alert-box = t "spree_admin_single_enterprise_alert_mail_confirmation" %strong= "#{@enterprise.name}." - = t(:spree_admin_single_enterprise_alert_mail_sent) + = t "spree_admin_single_enterprise_alert_mail_sent" %strong= "#{@enterprise.email}." = link_to(t('resend'), main_app.enterprise_confirmation_path(enterprise: { id: @enterprise.id, email: @enterprise.email } ), method: :post) %a.close{ href: "#" } × @@ -39,7 +39,7 @@ .alert-box %strong = t "spree_admin_single_enterprise_hint" - %strong= "#{t:manage} #{@enterprise.name}." + %strong= "#{t 'manage'} #{@enterprise.name}." %a.close{ href: "#" } × .row @@ -47,15 +47,15 @@ .header %h3 %span.icon-map-marker - = t:your_profil_live + = t "your_profil_live" %p - = t:on_ofn_map + = t "on_ofn_map" .list /-# Can we pass an anchor here to zoom to our enterprise? %a.button.bottom{href: main_app.map_path, target: '_blank'} - = t:see + = t "see" = @enterprise.name - = t:live + = t "live" %span.icon-arrow-right .two.columns   @@ -64,12 +64,12 @@ .header %h3 %span.icon-edit - = t:edit_profile_details + = t "edit_profile_details" %p - = t:edit_profile_details_etc + = t "edit_profile_details_etc" .list %a.button.bottom{href: main_app.edit_admin_enterprise_path(@enterprise)} - = t:manage + = t "manage" = @enterprise.name %span.icon-arrow-right @@ -79,10 +79,10 @@ .header %h3 %span.icon-th-large - = t:add_and_manage_products + = t "add_and_manage_products" .list %a.button.bottom{href: bulk_edit_admin_products_path} - = t:manage_products + = t "manage_products" %span.icon-arrow-right .two.columns @@ -93,8 +93,8 @@ .header %h3 %span.icon-shopping-cart - = t:add_and_manage_order_cycles + = t "add_and_manage_order_cycles" .list %a.button.bottom{href: main_app.admin_order_cycles_path} - = t:manage_order_cycles + = t "manage_order_cycles" %span.icon-arrow-right diff --git a/config/locales/en.yml b/config/locales/en.yml index 5b53145eda..67cfaa2bf3 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -31,7 +31,7 @@ en: welcome_to: 'Welcome to ' description: "We begin from the ground up. With farmers and growers ready to tell their stories proudly and truly. With distributors ready to connect people with products fairly and honestly. With buyers who believe that better weekly shopping decisions can…" search_by_name: Search by name or suburb... - producers: Aussie Producers #FIXME + producers: 'Australian Producers' producers_join: Australian producers are now welcome to join the Open Food Network. #FIXME charges_sales_tax: Charges GST? print_invoice: "Print Invoice" From 44508f0f1e01ad5a63fab612ef8db55f9ae2c3e0 Mon Sep 17 00:00:00 2001 From: Nicolas Blanc Date: Mon, 22 Feb 2016 13:38:19 +0000 Subject: [PATCH 19/40] new validation2 02/22/2016 --- .../line_items_controller.js.coffee | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/app/assets/javascripts/admin/line_items/controllers/line_items_controller.js.coffee b/app/assets/javascripts/admin/line_items/controllers/line_items_controller.js.coffee index 9ab0a71ecc..4a3a8c84cf 100644 --- a/app/assets/javascripts/admin/line_items/controllers/line_items_controller.js.coffee +++ b/app/assets/javascripts/admin/line_items/controllers/line_items_controller.js.coffee @@ -5,27 +5,27 @@ angular.module("admin.lineItems").controller 'LineItemsCtrl', ($scope, $timeout, $scope.confirmDelete = true $scope.startDate = formatDate daysFromToday -7 $scope.endDate = formatDate daysFromToday 1 - $scope.bulkActions = [ { name: t("bom_actions_delete"), callback: 'deleteLineItems' } ] + $scope.bulkActions = [ { name: t "bom_actions_delete", callback: 'deleteLineItems' } ] $scope.selectedUnitsProduct = {}; $scope.selectedUnitsVariant = {}; $scope.sharedResource = false $scope.columns = Columns.setColumns - order_no: { name: t("bom_no"), visible: false } - full_name: { name: t("name"), visible: true } - email: { name: t("email"), visible: false } - phone: { name: t("phone"), visible: false } - order_date: { name: t("bom_date"), visible: true } - producer: { name: t("producer"), visible: true } - order_cycle: { name: t("bom_cycle"), visible: false } - hub: { name: t("bom_hub"), visible: false } - variant: { name: t("bom_variant"), visible: true } - quantity: { name: t("bom_quantity"), visible: true } - max: { name: t("bom_max"), visible: true } - final_weight_volume: { name: t("bom_final_weigth_volume"), visible: false } - price: { name: t("bom_price"), visible: false } + order_no: { name: t "bom_no", visible: false } + full_name: { name: t "name", visible: true } + email: { name: t "email", visible: false } + phone: { name: t "phone", visible: false } + order_date: { name: t "bom_date", visible: true } + producer: { name: t "producer", visible: true } + order_cycle: { name: t "bom_cycle", visible: false } + hub: { name: t "bom_hub", visible: false } + variant: { name: t "bom_variant", visible: true } + quantity: { name: t "bom_quantity", visible: true } + max: { name: t "bom_max", visible: true } + final_weight_volume: { name: t "bom_final_weigth_volume", visible: false } + price: { name: t "bom_price", visible: false } $scope.confirmRefresh = -> - LineItems.allSaved() || confirm(t("unsaved_changes_warning")) + LineItems.allSaved() || confirm(t "unsaved_changes_warning") $scope.resetSelectFilters = -> $scope.distributorFilter = blankOption().id @@ -73,12 +73,12 @@ angular.module("admin.lineItems").controller 'LineItemsCtrl', ($scope, $timeout, StatusMessage.display 'success', "All changes saved" $scope.bulk_order_form.$setPristine() ).catch -> - StatusMessage.display 'failure', {t("unsaved_changes_warning")} + StatusMessage.display 'failure', {t "unsaved_changes_warning"} else - StatusMessage.display 'failure', {t("unsaved_changes_warning")} + StatusMessage.display 'failure', {t "unsaved_changes_warning"} $scope.deleteLineItem = (lineItem) -> - if ($scope.confirmDelete && confirm(t("are_you_sure"))) || !$scope.confirmDelete + if ($scope.confirmDelete && confirm(t "are_you_sure")) || !$scope.confirmDelete LineItems.delete lineItem, => $scope.lineItems.splice $scope.lineItems.indexOf(lineItem), 1 From c91eb9f34515e7d86cf0e64bf310283043f667c9 Mon Sep 17 00:00:00 2001 From: Nicolas Blanc Date: Mon, 22 Feb 2016 14:31:31 +0000 Subject: [PATCH 20/40] new validation3 02/22/2016 --- .../line_items/controllers/line_items_controller.js.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/admin/line_items/controllers/line_items_controller.js.coffee b/app/assets/javascripts/admin/line_items/controllers/line_items_controller.js.coffee index 4a3a8c84cf..d5b71f8c57 100644 --- a/app/assets/javascripts/admin/line_items/controllers/line_items_controller.js.coffee +++ b/app/assets/javascripts/admin/line_items/controllers/line_items_controller.js.coffee @@ -73,9 +73,9 @@ angular.module("admin.lineItems").controller 'LineItemsCtrl', ($scope, $timeout, StatusMessage.display 'success', "All changes saved" $scope.bulk_order_form.$setPristine() ).catch -> - StatusMessage.display 'failure', {t "unsaved_changes_warning"} + StatusMessage.display 'failure', t "unsaved_changes_warning" else - StatusMessage.display 'failure', {t "unsaved_changes_warning"} + StatusMessage.display 'failure', t "unsaved_changes_warning" $scope.deleteLineItem = (lineItem) -> if ($scope.confirmDelete && confirm(t "are_you_sure")) || !$scope.confirmDelete From 52d5b8936e70d9587ee62084b26a7b12d61e8400 Mon Sep 17 00:00:00 2001 From: Nicolas Blanc Date: Mon, 22 Feb 2016 14:54:31 +0000 Subject: [PATCH 21/40] new validation4 02/22/2016 --- .../spree/admin/overview/single_enterprise_dashboard.html.haml | 2 +- spec/features/admin/variant_overrides_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/spree/admin/overview/single_enterprise_dashboard.html.haml b/app/views/spree/admin/overview/single_enterprise_dashboard.html.haml index 0d31d482f6..d2b0635409 100644 --- a/app/views/spree/admin/overview/single_enterprise_dashboard.html.haml +++ b/app/views/spree/admin/overview/single_enterprise_dashboard.html.haml @@ -19,7 +19,7 @@ } #package_button %button#toggle_type{ onClick: 'toggleType()' } - = t:change_package + = t "change_package" %i.icon-chevron-down diff --git a/spec/features/admin/variant_overrides_spec.rb b/spec/features/admin/variant_overrides_spec.rb index 378afa3626..d6dad90b3f 100644 --- a/spec/features/admin/variant_overrides_spec.rb +++ b/spec/features/admin/variant_overrides_spec.rb @@ -54,7 +54,7 @@ feature %q{ end it "displays the list of products with variants" do - page.should have_table_row ['PRODUCER', 'PRODUCT', 'PRICE', 'ON HAND'] + page.should have_table_row ["PRODUCER", "PRODUCT", "PRICE", "ON HAND"] page.should have_table_row [producer.name, product.name, '', ''] page.should have_input "variant-overrides-#{variant.id}-price", placeholder: '1.23' page.should have_input "variant-overrides-#{variant.id}-count_on_hand", placeholder: '12' From 5e71790cd1d788b1f2afac26426c5e5c1d18cf39 Mon Sep 17 00:00:00 2001 From: Nicolas Blanc Date: Thu, 25 Feb 2016 11:04:21 +0000 Subject: [PATCH 22/40] new validation5 02/25/2016 --- app/views/admin/order_cycles/index.html.haml | 2 +- app/views/spree/admin/orders/bulk_management.html.haml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/admin/order_cycles/index.html.haml b/app/views/admin/order_cycles/index.html.haml index de166aa4fc..05e6a8bd38 100644 --- a/app/views/admin/order_cycles/index.html.haml +++ b/app/views/admin/order_cycles/index.html.haml @@ -44,4 +44,4 @@ = f.fields_for :collection do |order_cycle_form| = render 'admin/order_cycles/row', order_cycle_form: order_cycle_form - = f.submit t(:update) + = f.submit t :update \ No newline at end of file diff --git a/app/views/spree/admin/orders/bulk_management.html.haml b/app/views/spree/admin/orders/bulk_management.html.haml index d11f8dffc9..51b13596dd 100644 --- a/app/views/spree/admin/orders/bulk_management.html.haml +++ b/app/views/spree/admin/orders/bulk_management.html.haml @@ -151,7 +151,7 @@ = t "products_price" %th.actions %th.actions - = t "ask"  + = t("ask")  %input{ :type => 'checkbox', 'ng-model' => "confirmDelete" } %tr.line_item{ 'ng-repeat' => "line_item in filteredLineItems = ( lineItems | filter:quickSearch | selectFilter:supplierFilter:distributorFilter:orderCycleFilter | variantFilter:selectedUnitsProduct:selectedUnitsVariant:sharedResource | orderBy:predicate:reverse )", 'ng-class-even' => "'even'", 'ng-class-odd' => "'odd'", :id => "li_{{line_item.id}}" } From a8d7732a39661afe7170b9fa4031c719be8a4d80 Mon Sep 17 00:00:00 2001 From: Nicolas Blanc Date: Sun, 28 Feb 2016 19:23:26 +0000 Subject: [PATCH 23/40] elf-pavlik@ee52f1d --- app/views/admin/order_cycles/edit.html.haml | 2 +- app/views/admin/order_cycles/index.html.haml | 10 +++--- .../admin/orders/bulk_management.html.haml | 31 ++++++++++++------- config/locales/en.yml | 11 +++---- 4 files changed, 30 insertions(+), 24 deletions(-) diff --git a/app/views/admin/order_cycles/edit.html.haml b/app/views/admin/order_cycles/edit.html.haml index fe0892c300..a00935f07d 100644 --- a/app/views/admin/order_cycles/edit.html.haml +++ b/app/views/admin/order_cycles/edit.html.haml @@ -5,7 +5,7 @@ %h1 - = t:edit_order_cycle + = t :edit_order_cycle - ng_controller = order_cycles_simple_form ? 'AdminSimpleEditOrderCycleCtrl' : 'AdminEditOrderCycleCtrl' diff --git a/app/views/admin/order_cycles/index.html.haml b/app/views/admin/order_cycles/index.html.haml index d7a6745b19..d0058618a2 100644 --- a/app/views/admin/order_cycles/index.html.haml +++ b/app/views/admin/order_cycles/index.html.haml @@ -30,11 +30,11 @@ %tr %th =t :name %th =t :open - %th =t :close + %th =t :close - unless order_cycles_simple_index - %th =t :supplier - %th =t :coordinator - %th =t :distributors + %th =t :supplier + %th =t :coordinator + %th =t :distributors %th =t :products %th.actions %th.actions @@ -44,4 +44,4 @@ = f.fields_for :collection do |order_cycle_form| = render 'admin/order_cycles/row', order_cycle_form: order_cycle_form - = f.submit t :update + = f.submit t :update \ No newline at end of file diff --git a/app/views/spree/admin/orders/bulk_management.html.haml b/app/views/spree/admin/orders/bulk_management.html.haml index a63f173662..891a9decaf 100644 --- a/app/views/spree/admin/orders/bulk_management.html.haml +++ b/app/views/spree/admin/orders/bulk_management.html.haml @@ -4,7 +4,7 @@ - content_for :page_title do %h1.page-title = t "bulk_order_management" - %a{ 'ofn-with-tip' => "Use this page to alter product quantities across multiple orders. Products may also be removed from orders entirely, if required." } What's this? + %a{ 'ofn-with-tip' => "#t('bom_tip')" } = t "admin_entreprise_groups_what_s_this" %h1.page-title Bulk Order Management @@ -30,7 +30,7 @@ %br %select{ :class => "three columns alpha", :id => 'supplier_filter', 'select2-min-search' => 5, 'ng-model' => 'supplierFilter', 'ng-options' => 's.id as s.name for s in suppliers' } .filter_select{ :class => "three columns" } - %label{ :for => 'distributor_filter' }Hub + %label{ :for => 'distributor_filter' } %br %select{ :class => "three columns alpha", :id => 'distributor_filter', 'select2-min-search' => 5, 'ng-model' => 'distributorFilter', 'ng-options' => 'd.id as d.name for d in distributors'} .filter_select{ :class => "three columns" } @@ -49,7 +49,7 @@ %div.shared_resource{ :class => "four columns alpha" } %span{ :class => 'three columns alpha' } %input{ type: 'checkbox', :id => 'shared_resource', 'ng-model' => 'sharedResource'} - Shared Resource? + = t "bom_shared" %div{ :class => "eight columns" } %h6{ :class => "eight columns alpha", 'ng-show' => 'sharedResource', style: 'text-align: center;' } {{ selectedUnitsProduct.name + ": ALL" }} %h6{ :class => "eight columns alpha", 'ng-hide' => 'sharedResource', style: 'text-align: center;' } {{ selectedUnitsVariant.full_name }} @@ -103,7 +103,7 @@ %div{ :class => "seven columns" }   %div{ :class => "three columns omega" } %div.ofn_drop_down{ 'ng-controller' => "DropDownCtrl", :id => "columns_dropdown", 'ofn-drop-down' => true, :style => 'float:right;' } - %span{ :class => 'icon-reorder' }   Columns + %span{ :class => 'icon-reorder' } %span{ 'ng-class' => "expanded && 'icon-caret-up' || !expanded && 'icon-caret-down'" } %div.menu{ 'ng-show' => "expanded" } %div.menu_item{ :class => "three columns alpha", 'ng-repeat' => "column in columns", 'ofn-toggle-column' => true } @@ -111,10 +111,12 @@ %span{ :class => 'two columns omega' } {{column.name }} %div.sixteen.columns.alpha#loading{ 'ng-if' => 'RequestMonitor.loading' } %img.spinner{ src: "/assets/spinning-circles.svg" } - %h1 LOADING ORDERS + %h1 + =t "bom_loading" %div{ :class => "sixteen columns alpha", 'ng-show' => '!RequestMonitor.loading && filteredLineItems.length == 0'} - %h1#no_results No orders found. + %h1#no_results + = t "bom_no_results" %div{ 'ng-hide' => 'RequestMonitor.loading || filteredLineItems.length == 0' } %form{ name: 'bulk_order_form' } @@ -136,15 +138,20 @@ %a{ :href => '', 'ng-click' => "predicate = 'order.phone'; reverse = !reverse" } = t "phone" %th.date{ 'ng-show' => 'columns.order_date.visible' } - %a{ :href => '', 'ng-click' => "predicate = 'order.completed_at'; reverse = !reverse" } Order Date + %a{ :href => '', 'ng-click' => "predicate = 'order.completed_at'; reverse = !reverse" } + =t "bom_date" %th.producer{ 'ng-show' => 'columns.producer.visible' } - %a{ :href => '', 'ng-click' => "predicate = 'supplier.name'; reverse = !reverse" } Producer + %a{ :href => '', 'ng-click' => "predicate = 'supplier.name'; reverse = !reverse" } + = t "producer" %th.order_cycle{ 'ng-show' => 'columns.order_cycle.visible' } - %a{ :href => '', 'ng-click' => "predicate = 'order.order_cycle.name'; reverse = !reverse" } Order Cycle + %a{ :href => '', 'ng-click' => "predicate = 'order.order_cycle.name'; reverse = !reverse" } + = t "bom_cycle" %th.hub{ 'ng-show' => 'columns.hub.visible' } - %a{ :href => '', 'ng-click' => "predicate = 'order.distributor.name'; reverse = !reverse" } Hub + %a{ :href => '', 'ng-click' => "predicate = 'order.distributor.name'; reverse = !reverse" } + = t "bom_hub" %th.variant{ 'ng-show' => 'columns.variant.visible' } - %a{ :href => '', 'ng-click' => "predicate = 'units_variant.full_name'; reverse = !reverse" } Product: Unit + %a{ :href => '', 'ng-click' => "predicate = 'units_variant.full_name'; reverse = !reverse" } + = t "bom_variant" %th.quantity{ 'ng-show' => 'columns.quantity.visible' } = t "products_quantity" %th.max{ 'ng-show' => 'columns.max.visible' } @@ -155,7 +162,7 @@ = t "products_price" %th.actions %th.actions - = t("ask")  + = t "ask" %input{ :type => 'checkbox', 'ng-model' => "confirmDelete" } %tr.line_item{ 'ng-repeat' => "line_item in filteredLineItems = ( lineItems | filter:quickSearch | selectFilter:supplierFilter:distributorFilter:orderCycleFilter | variantFilter:selectedUnitsProduct:selectedUnitsVariant:sharedResource | orderBy:predicate:reverse )", 'ng-class-even' => "'even'", 'ng-class-odd' => "'odd'", :id => "li_{{line_item.id}}" } diff --git a/config/locales/en.yml b/config/locales/en.yml index c867a29e67..25c3621fe2 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -245,12 +245,12 @@ en: bom_quantity: "Quantity" bom_max: "Max" bom_hub: "Hub" - bom_variant: "Variant" + bom_variant: "Product: Unit" bom_final_weigth_volume: "Weight/Volume" - bom_price: "Price" bom_actions_delete: "Delete Selected" bom_order_error: "Some errors must be resolved before you can update orders.\nAny fields with red borders contain errors." - + bom_loading: "Loading orders" ++ bom_no_results: "No orders found." unsaved_changes_warning: "Unsaved changes exist and will be lost if you continue." products: "Products" @@ -526,7 +526,6 @@ See the %{link} to find out more about %{sitename}'s features and to start using products_oc_is: "Your order cycle for this order is %{name}." products_oc_error: "Please complete your order from %{link} before shopping in a different order cycle." products_oc_current: "your current order cycle" - products_quantity: Quantity products_max_quantity: Max quantity products_distributor: Distributor products_distributor_info: When you select a distributor for your order, their address and pickup times will be displayed here. @@ -764,7 +763,7 @@ Please follow the instructions there to make your enterprise visible on the Open update_user_invoices: "Update User Invoices" update_user_invoice_explained: "Use this button to immediately update invoices for the month to date for each enterprise user in the system. This task can be set up to run automatically every night." auto_finalise_invoices: "Auto-finalise invoices monthly on the 2nd at 1:30am" - auto_update_invoices: "Auto-update invoices nightly at 1:00am" + auto_update_invoices: "Auto-update invoices nightly at 1:00am" in_progress: "In Progress" started_at: "Started at" queued: "Queued" @@ -841,7 +840,7 @@ Please follow the instructions there to make your enterprise visible on the Open no_orders_found: "No orders found." order_no: "Order No." weight_volume: "Weight/Volume" - remove_tax: "Remove tax" + remove_tax: "Remove tax" tax_settings: "Tax Settings" products_require_tax_category: "products require tax category" admin_shared_address_1: "Address" From cb33ede9dc18b9ef0be2927bb7ef4cd472cab218 Mon Sep 17 00:00:00 2001 From: Nicolas Blanc Date: Sun, 28 Feb 2016 19:54:44 +0000 Subject: [PATCH 24/40] Revert "elf-pavlik@ee52f1d" This reverts commit a8d7732a39661afe7170b9fa4031c719be8a4d80. --- app/views/admin/order_cycles/edit.html.haml | 2 +- app/views/admin/order_cycles/index.html.haml | 10 +++--- .../admin/orders/bulk_management.html.haml | 31 +++++++------------ config/locales/en.yml | 11 ++++--- 4 files changed, 24 insertions(+), 30 deletions(-) diff --git a/app/views/admin/order_cycles/edit.html.haml b/app/views/admin/order_cycles/edit.html.haml index a00935f07d..fe0892c300 100644 --- a/app/views/admin/order_cycles/edit.html.haml +++ b/app/views/admin/order_cycles/edit.html.haml @@ -5,7 +5,7 @@ %h1 - = t :edit_order_cycle + = t:edit_order_cycle - ng_controller = order_cycles_simple_form ? 'AdminSimpleEditOrderCycleCtrl' : 'AdminEditOrderCycleCtrl' diff --git a/app/views/admin/order_cycles/index.html.haml b/app/views/admin/order_cycles/index.html.haml index d0058618a2..d7a6745b19 100644 --- a/app/views/admin/order_cycles/index.html.haml +++ b/app/views/admin/order_cycles/index.html.haml @@ -30,11 +30,11 @@ %tr %th =t :name %th =t :open - %th =t :close + %th =t :close - unless order_cycles_simple_index - %th =t :supplier - %th =t :coordinator - %th =t :distributors + %th =t :supplier + %th =t :coordinator + %th =t :distributors %th =t :products %th.actions %th.actions @@ -44,4 +44,4 @@ = f.fields_for :collection do |order_cycle_form| = render 'admin/order_cycles/row', order_cycle_form: order_cycle_form - = f.submit t :update \ No newline at end of file + = f.submit t :update diff --git a/app/views/spree/admin/orders/bulk_management.html.haml b/app/views/spree/admin/orders/bulk_management.html.haml index 891a9decaf..a63f173662 100644 --- a/app/views/spree/admin/orders/bulk_management.html.haml +++ b/app/views/spree/admin/orders/bulk_management.html.haml @@ -4,7 +4,7 @@ - content_for :page_title do %h1.page-title = t "bulk_order_management" - %a{ 'ofn-with-tip' => "#t('bom_tip')" } + %a{ 'ofn-with-tip' => "Use this page to alter product quantities across multiple orders. Products may also be removed from orders entirely, if required." } What's this? = t "admin_entreprise_groups_what_s_this" %h1.page-title Bulk Order Management @@ -30,7 +30,7 @@ %br %select{ :class => "three columns alpha", :id => 'supplier_filter', 'select2-min-search' => 5, 'ng-model' => 'supplierFilter', 'ng-options' => 's.id as s.name for s in suppliers' } .filter_select{ :class => "three columns" } - %label{ :for => 'distributor_filter' } + %label{ :for => 'distributor_filter' }Hub %br %select{ :class => "three columns alpha", :id => 'distributor_filter', 'select2-min-search' => 5, 'ng-model' => 'distributorFilter', 'ng-options' => 'd.id as d.name for d in distributors'} .filter_select{ :class => "three columns" } @@ -49,7 +49,7 @@ %div.shared_resource{ :class => "four columns alpha" } %span{ :class => 'three columns alpha' } %input{ type: 'checkbox', :id => 'shared_resource', 'ng-model' => 'sharedResource'} - = t "bom_shared" + Shared Resource? %div{ :class => "eight columns" } %h6{ :class => "eight columns alpha", 'ng-show' => 'sharedResource', style: 'text-align: center;' } {{ selectedUnitsProduct.name + ": ALL" }} %h6{ :class => "eight columns alpha", 'ng-hide' => 'sharedResource', style: 'text-align: center;' } {{ selectedUnitsVariant.full_name }} @@ -103,7 +103,7 @@ %div{ :class => "seven columns" }   %div{ :class => "three columns omega" } %div.ofn_drop_down{ 'ng-controller' => "DropDownCtrl", :id => "columns_dropdown", 'ofn-drop-down' => true, :style => 'float:right;' } - %span{ :class => 'icon-reorder' } + %span{ :class => 'icon-reorder' }   Columns %span{ 'ng-class' => "expanded && 'icon-caret-up' || !expanded && 'icon-caret-down'" } %div.menu{ 'ng-show' => "expanded" } %div.menu_item{ :class => "three columns alpha", 'ng-repeat' => "column in columns", 'ofn-toggle-column' => true } @@ -111,12 +111,10 @@ %span{ :class => 'two columns omega' } {{column.name }} %div.sixteen.columns.alpha#loading{ 'ng-if' => 'RequestMonitor.loading' } %img.spinner{ src: "/assets/spinning-circles.svg" } - %h1 - =t "bom_loading" + %h1 LOADING ORDERS %div{ :class => "sixteen columns alpha", 'ng-show' => '!RequestMonitor.loading && filteredLineItems.length == 0'} - %h1#no_results - = t "bom_no_results" + %h1#no_results No orders found. %div{ 'ng-hide' => 'RequestMonitor.loading || filteredLineItems.length == 0' } %form{ name: 'bulk_order_form' } @@ -138,20 +136,15 @@ %a{ :href => '', 'ng-click' => "predicate = 'order.phone'; reverse = !reverse" } = t "phone" %th.date{ 'ng-show' => 'columns.order_date.visible' } - %a{ :href => '', 'ng-click' => "predicate = 'order.completed_at'; reverse = !reverse" } - =t "bom_date" + %a{ :href => '', 'ng-click' => "predicate = 'order.completed_at'; reverse = !reverse" } Order Date %th.producer{ 'ng-show' => 'columns.producer.visible' } - %a{ :href => '', 'ng-click' => "predicate = 'supplier.name'; reverse = !reverse" } - = t "producer" + %a{ :href => '', 'ng-click' => "predicate = 'supplier.name'; reverse = !reverse" } Producer %th.order_cycle{ 'ng-show' => 'columns.order_cycle.visible' } - %a{ :href => '', 'ng-click' => "predicate = 'order.order_cycle.name'; reverse = !reverse" } - = t "bom_cycle" + %a{ :href => '', 'ng-click' => "predicate = 'order.order_cycle.name'; reverse = !reverse" } Order Cycle %th.hub{ 'ng-show' => 'columns.hub.visible' } - %a{ :href => '', 'ng-click' => "predicate = 'order.distributor.name'; reverse = !reverse" } - = t "bom_hub" + %a{ :href => '', 'ng-click' => "predicate = 'order.distributor.name'; reverse = !reverse" } Hub %th.variant{ 'ng-show' => 'columns.variant.visible' } - %a{ :href => '', 'ng-click' => "predicate = 'units_variant.full_name'; reverse = !reverse" } - = t "bom_variant" + %a{ :href => '', 'ng-click' => "predicate = 'units_variant.full_name'; reverse = !reverse" } Product: Unit %th.quantity{ 'ng-show' => 'columns.quantity.visible' } = t "products_quantity" %th.max{ 'ng-show' => 'columns.max.visible' } @@ -162,7 +155,7 @@ = t "products_price" %th.actions %th.actions - = t "ask" + = t("ask")  %input{ :type => 'checkbox', 'ng-model' => "confirmDelete" } %tr.line_item{ 'ng-repeat' => "line_item in filteredLineItems = ( lineItems | filter:quickSearch | selectFilter:supplierFilter:distributorFilter:orderCycleFilter | variantFilter:selectedUnitsProduct:selectedUnitsVariant:sharedResource | orderBy:predicate:reverse )", 'ng-class-even' => "'even'", 'ng-class-odd' => "'odd'", :id => "li_{{line_item.id}}" } diff --git a/config/locales/en.yml b/config/locales/en.yml index 25c3621fe2..c867a29e67 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -245,12 +245,12 @@ en: bom_quantity: "Quantity" bom_max: "Max" bom_hub: "Hub" - bom_variant: "Product: Unit" + bom_variant: "Variant" bom_final_weigth_volume: "Weight/Volume" + bom_price: "Price" bom_actions_delete: "Delete Selected" bom_order_error: "Some errors must be resolved before you can update orders.\nAny fields with red borders contain errors." - bom_loading: "Loading orders" -+ bom_no_results: "No orders found." + unsaved_changes_warning: "Unsaved changes exist and will be lost if you continue." products: "Products" @@ -526,6 +526,7 @@ See the %{link} to find out more about %{sitename}'s features and to start using products_oc_is: "Your order cycle for this order is %{name}." products_oc_error: "Please complete your order from %{link} before shopping in a different order cycle." products_oc_current: "your current order cycle" + products_quantity: Quantity products_max_quantity: Max quantity products_distributor: Distributor products_distributor_info: When you select a distributor for your order, their address and pickup times will be displayed here. @@ -763,7 +764,7 @@ Please follow the instructions there to make your enterprise visible on the Open update_user_invoices: "Update User Invoices" update_user_invoice_explained: "Use this button to immediately update invoices for the month to date for each enterprise user in the system. This task can be set up to run automatically every night." auto_finalise_invoices: "Auto-finalise invoices monthly on the 2nd at 1:30am" - auto_update_invoices: "Auto-update invoices nightly at 1:00am" + auto_update_invoices: "Auto-update invoices nightly at 1:00am" in_progress: "In Progress" started_at: "Started at" queued: "Queued" @@ -840,7 +841,7 @@ Please follow the instructions there to make your enterprise visible on the Open no_orders_found: "No orders found." order_no: "Order No." weight_volume: "Weight/Volume" - remove_tax: "Remove tax" + remove_tax: "Remove tax" tax_settings: "Tax Settings" products_require_tax_category: "products require tax category" admin_shared_address_1: "Address" From 68db9b9926266a0e76fc0c5ad7687ef2c5bc7498 Mon Sep 17 00:00:00 2001 From: elf Pavlik Date: Thu, 25 Feb 2016 13:10:50 -0600 Subject: [PATCH 25/40] fixing faling tests --- app/views/admin/order_cycles/edit.html.haml | 2 +- app/views/admin/order_cycles/index.html.haml | 8 ++-- .../admin/orders/bulk_management.html.haml | 38 ++++++++++++------- config/locales/en.yml | 17 +++++---- 4 files changed, 39 insertions(+), 26 deletions(-) diff --git a/app/views/admin/order_cycles/edit.html.haml b/app/views/admin/order_cycles/edit.html.haml index fe0892c300..a00935f07d 100644 --- a/app/views/admin/order_cycles/edit.html.haml +++ b/app/views/admin/order_cycles/edit.html.haml @@ -5,7 +5,7 @@ %h1 - = t:edit_order_cycle + = t :edit_order_cycle - ng_controller = order_cycles_simple_form ? 'AdminSimpleEditOrderCycleCtrl' : 'AdminEditOrderCycleCtrl' diff --git a/app/views/admin/order_cycles/index.html.haml b/app/views/admin/order_cycles/index.html.haml index d7a6745b19..10b9b1e345 100644 --- a/app/views/admin/order_cycles/index.html.haml +++ b/app/views/admin/order_cycles/index.html.haml @@ -30,11 +30,11 @@ %tr %th =t :name %th =t :open - %th =t :close + %th =t :close - unless order_cycles_simple_index - %th =t :supplier - %th =t :coordinator - %th =t :distributors + %th =t :supplier + %th =t :coordinator + %th =t :distributors %th =t :products %th.actions %th.actions diff --git a/app/views/spree/admin/orders/bulk_management.html.haml b/app/views/spree/admin/orders/bulk_management.html.haml index a63f173662..9e9362681d 100644 --- a/app/views/spree/admin/orders/bulk_management.html.haml +++ b/app/views/spree/admin/orders/bulk_management.html.haml @@ -4,9 +4,10 @@ - content_for :page_title do %h1.page-title = t "bulk_order_management" - %a{ 'ofn-with-tip' => "Use this page to alter product quantities across multiple orders. Products may also be removed from orders entirely, if required." } What's this? + %a{ 'ofn-with-tip' => "#t('bom_tip')" } = t "admin_entreprise_groups_what_s_this" - %h1.page-title Bulk Order Management + %h1.page-title + = t "bom_page_title" = render :partial => 'spree/admin/shared/order_sub_menu' @@ -30,7 +31,8 @@ %br %select{ :class => "three columns alpha", :id => 'supplier_filter', 'select2-min-search' => 5, 'ng-model' => 'supplierFilter', 'ng-options' => 's.id as s.name for s in suppliers' } .filter_select{ :class => "three columns" } - %label{ :for => 'distributor_filter' }Hub + %label{ :for => 'distributor_filter' } + = t "bom_hub" %br %select{ :class => "three columns alpha", :id => 'distributor_filter', 'select2-min-search' => 5, 'ng-model' => 'distributorFilter', 'ng-options' => 'd.id as d.name for d in distributors'} .filter_select{ :class => "three columns" } @@ -49,7 +51,7 @@ %div.shared_resource{ :class => "four columns alpha" } %span{ :class => 'three columns alpha' } %input{ type: 'checkbox', :id => 'shared_resource', 'ng-model' => 'sharedResource'} - Shared Resource? + = t "bom_shared" %div{ :class => "eight columns" } %h6{ :class => "eight columns alpha", 'ng-show' => 'sharedResource', style: 'text-align: center;' } {{ selectedUnitsProduct.name + ": ALL" }} %h6{ :class => "eight columns alpha", 'ng-hide' => 'sharedResource', style: 'text-align: center;' } {{ selectedUnitsVariant.full_name }} @@ -60,7 +62,7 @@ .row .one.column.alpha   .two.columns - %span.two.columns + %span.two.columns = t "group_buy_unit_size" %span.two.columns {{ formattedValueWithUnitName( selectedUnitsProduct.group_buy_unit_size, selectedUnitsProduct, selectedUnitsVariant ) }} .one.column   @@ -103,7 +105,8 @@ %div{ :class => "seven columns" }   %div{ :class => "three columns omega" } %div.ofn_drop_down{ 'ng-controller' => "DropDownCtrl", :id => "columns_dropdown", 'ofn-drop-down' => true, :style => 'float:right;' } - %span{ :class => 'icon-reorder' }   Columns + %span{ :class => 'icon-reorder' } + = t "bom_columns" %span{ 'ng-class' => "expanded && 'icon-caret-up' || !expanded && 'icon-caret-down'" } %div.menu{ 'ng-show' => "expanded" } %div.menu_item{ :class => "three columns alpha", 'ng-repeat' => "column in columns", 'ofn-toggle-column' => true } @@ -111,10 +114,12 @@ %span{ :class => 'two columns omega' } {{column.name }} %div.sixteen.columns.alpha#loading{ 'ng-if' => 'RequestMonitor.loading' } %img.spinner{ src: "/assets/spinning-circles.svg" } - %h1 LOADING ORDERS + %h1 + =t "bom_loading" %div{ :class => "sixteen columns alpha", 'ng-show' => '!RequestMonitor.loading && filteredLineItems.length == 0'} - %h1#no_results No orders found. + %h1#no_results + = t "bom_no_results" %div{ 'ng-hide' => 'RequestMonitor.loading || filteredLineItems.length == 0' } %form{ name: 'bulk_order_form' } @@ -136,15 +141,20 @@ %a{ :href => '', 'ng-click' => "predicate = 'order.phone'; reverse = !reverse" } = t "phone" %th.date{ 'ng-show' => 'columns.order_date.visible' } - %a{ :href => '', 'ng-click' => "predicate = 'order.completed_at'; reverse = !reverse" } Order Date + %a{ :href => '', 'ng-click' => "predicate = 'order.completed_at'; reverse = !reverse" } + =t "bom_date" %th.producer{ 'ng-show' => 'columns.producer.visible' } - %a{ :href => '', 'ng-click' => "predicate = 'supplier.name'; reverse = !reverse" } Producer + %a{ :href => '', 'ng-click' => "predicate = 'supplier.name'; reverse = !reverse" } + = t "producer" %th.order_cycle{ 'ng-show' => 'columns.order_cycle.visible' } - %a{ :href => '', 'ng-click' => "predicate = 'order.order_cycle.name'; reverse = !reverse" } Order Cycle + %a{ :href => '', 'ng-click' => "predicate = 'order.order_cycle.name'; reverse = !reverse" } + = t "bom_cycle" %th.hub{ 'ng-show' => 'columns.hub.visible' } - %a{ :href => '', 'ng-click' => "predicate = 'order.distributor.name'; reverse = !reverse" } Hub + %a{ :href => '', 'ng-click' => "predicate = 'order.distributor.name'; reverse = !reverse" } + = t "bom_hub" %th.variant{ 'ng-show' => 'columns.variant.visible' } - %a{ :href => '', 'ng-click' => "predicate = 'units_variant.full_name'; reverse = !reverse" } Product: Unit + %a{ :href => '', 'ng-click' => "predicate = 'units_variant.full_name'; reverse = !reverse" } + = t "bom_variant" %th.quantity{ 'ng-show' => 'columns.quantity.visible' } = t "products_quantity" %th.max{ 'ng-show' => 'columns.max.visible' } @@ -155,7 +165,7 @@ = t "products_price" %th.actions %th.actions - = t("ask")  + = t "ask" %input{ :type => 'checkbox', 'ng-model' => "confirmDelete" } %tr.line_item{ 'ng-repeat' => "line_item in filteredLineItems = ( lineItems | filter:quickSearch | selectFilter:supplierFilter:distributorFilter:orderCycleFilter | variantFilter:selectedUnitsProduct:selectedUnitsVariant:sharedResource | orderBy:predicate:reverse )", 'ng-class-even' => "'even'", 'ng-class-odd' => "'odd'", :id => "li_{{line_item.id}}" } diff --git a/config/locales/en.yml b/config/locales/en.yml index c867a29e67..15a978493b 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -239,16 +239,20 @@ en: order_payment_paypal_successful: Your payment via PayPal has been processed successfully. order_hub_info: Hub Info + bom_tip: "Use this page to alter product quantities across multiple orders. Products may also be removed from orders entirely, if required." + bom_shared: "Shared Resource?" + bom_columns: "Columns" + bom_page_title: "Bulk Order Management" bom_no: "Order no." bom_date: "Order date" bom_cycle: "Order cycle" - bom_quantity: "Quantity" bom_max: "Max" bom_hub: "Hub" - bom_variant: "Variant" + bom_variant: "Product: Unit" bom_final_weigth_volume: "Weight/Volume" - bom_price: "Price" bom_actions_delete: "Delete Selected" + bom_loading: "Loading orders" + bom_no_results: "No orders found." bom_order_error: "Some errors must be resolved before you can update orders.\nAny fields with red borders contain errors." unsaved_changes_warning: "Unsaved changes exist and will be lost if you continue." @@ -526,7 +530,6 @@ See the %{link} to find out more about %{sitename}'s features and to start using products_oc_is: "Your order cycle for this order is %{name}." products_oc_error: "Please complete your order from %{link} before shopping in a different order cycle." products_oc_current: "your current order cycle" - products_quantity: Quantity products_max_quantity: Max quantity products_distributor: Distributor products_distributor_info: When you select a distributor for your order, their address and pickup times will be displayed here. @@ -764,7 +767,7 @@ Please follow the instructions there to make your enterprise visible on the Open update_user_invoices: "Update User Invoices" update_user_invoice_explained: "Use this button to immediately update invoices for the month to date for each enterprise user in the system. This task can be set up to run automatically every night." auto_finalise_invoices: "Auto-finalise invoices monthly on the 2nd at 1:30am" - auto_update_invoices: "Auto-update invoices nightly at 1:00am" + auto_update_invoices: "Auto-update invoices nightly at 1:00am" in_progress: "In Progress" started_at: "Started at" queued: "Queued" @@ -841,7 +844,7 @@ Please follow the instructions there to make your enterprise visible on the Open no_orders_found: "No orders found." order_no: "Order No." weight_volume: "Weight/Volume" - remove_tax: "Remove tax" + remove_tax: "Remove tax" tax_settings: "Tax Settings" products_require_tax_category: "products require tax category" admin_shared_address_1: "Address" @@ -864,7 +867,7 @@ Please follow the instructions there to make your enterprise visible on the Open report_customers_type: "Report Type" report_customers_csv: "Download as csv" report_customers_header: "orders header" - report_producers: "Producers: " + report_producers: "Producers: " report_type: "Report Type: " report_hubs: "Hubs: " report_payment: "Payment Methods: " From 54ecdb670d87da842e69a8f058ccc42d2eb6dc85 Mon Sep 17 00:00:00 2001 From: elf Pavlik Date: Fri, 26 Feb 2016 17:17:06 -0600 Subject: [PATCH 26/40] fixed failing i18n test in variant overrides --- .../variant_overrides/_products.html.haml | 24 ++++++++++++------- config/locales/en.yml | 4 +++- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/app/views/admin/variant_overrides/_products.html.haml b/app/views/admin/variant_overrides/_products.html.haml index 7b94c05f33..14b0298875 100644 --- a/app/views/admin/variant_overrides/_products.html.haml +++ b/app/views/admin/variant_overrides/_products.html.haml @@ -10,14 +10,22 @@ %col.inheritance{ width: "5%", ng: { show: 'columns.inheritance.visible' } } %thead %tr{ ng: { controller: "ColumnsCtrl" } } - %th.producer{ ng: { show: 'columns.producer.visible' } } = t(:producer) - %th.product{ ng: { show: 'columns.product.visible' } } = t(:product) - %th.sku{ ng: { show: 'columns.sku.visible' } } SKU - %th.price{ ng: { show: 'columns.price.visible' } } = t(:price) - %th.on_hand{ ng: { show: 'columns.on_hand.visible' } } = t(:on_hand) - %th.on_demand{ ng: { show: 'columns.on_demand.visible' } } On Demand? - %th.reset{ colspan: 2, ng: { show: 'columns.reset.visible' } } Enable Stock Level Reset? - %th.inheritance{ ng: { show: 'columns.inheritance.visible' } } Inherit? + %th.producer{ ng: { show: 'columns.producer.visible' } } + = t(:producer) + %th.product{ ng: { show: 'columns.product.visible' } } + = t(:product) + %th.sku{ ng: { show: 'columns.sku.visible' } } + = t(:products_sku) + %th.price{ ng: { show: 'columns.price.visible' } } + = t(:price) + %th.on_hand{ ng: { show: 'columns.on_hand.visible' } } + = t(:on_hand) + %th.on_demand{ ng: { show: 'columns.on_demand.visible' } } + = t(:products_on_demand) + %th.reset{ colspan: 2, ng: { show: 'columns.reset.visible' } } + = t(:products_stock_level_reset) + %th.inheritance{ ng: { show: 'columns.inheritance.visible' } } + = t(:products_inherit) %tbody{bindonce: true, ng: {repeat: 'product in products | hubPermissions:hubPermissions:hub.id | attrFilter:{producer_id:producerFilter} | filter:query' } } = render 'admin/variant_overrides/products_product' = render 'admin/variant_overrides/products_variants' diff --git a/config/locales/en.yml b/config/locales/en.yml index 15a978493b..e26c543935 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -480,11 +480,13 @@ See the %{link} to find out more about %{sitename}'s features and to start using products_name: "name" products_unit: "unit" products_on_hand: "on hand" - products_on_demand: "on demand" + products_on_demand: "On demand?" products_category: "Category" products_tax_category: "tax category" products_available_on: "Available On" + products_inherit: "Inherit?" products_inherits_properties: "Inherits Properties?" + products_stock_level_reset: "Enable Stock Level Reset?" register_title: Register From 071ee9ab546c17e4fd844e8a3dd0e4386b028926 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Wed, 9 Mar 2016 18:39:23 +1100 Subject: [PATCH 27/40] Add brackets to `t` call in js line items controller The missing brackets made all columns of the bulk order management invisible. Also removed trailing whitespaces. --- .../javascripts/admin/enterprise_fees.js | 4 +-- .../enterprise_controller.js.coffee | 2 -- .../enterprises_controller.js.coffee | 1 - .../line_items_controller.js.coffee | 32 +++++++++---------- 4 files changed, 17 insertions(+), 22 deletions(-) diff --git a/app/assets/javascripts/admin/enterprise_fees.js b/app/assets/javascripts/admin/enterprise_fees.js index ae21d04009..7eb249f4ec 100644 --- a/app/assets/javascripts/admin/enterprise_fees.js +++ b/app/assets/javascripts/admin/enterprise_fees.js @@ -34,9 +34,7 @@ angular.module('enterprise_fees', []) return function(scope, element, attrs) { if(scope.enterprise_fee.id) { var url = "/admin/enterprise_fees/" + scope.enterprise_fee.id - var html = ''; - var html = ''; - //var html = 'Delete Delete'; + var html = ''; element.append(html); } } diff --git a/app/assets/javascripts/admin/enterprises/controllers/enterprise_controller.js.coffee b/app/assets/javascripts/admin/enterprises/controllers/enterprise_controller.js.coffee index 34b4f99ca2..a806691465 100644 --- a/app/assets/javascripts/admin/enterprises/controllers/enterprise_controller.js.coffee +++ b/app/assets/javascripts/admin/enterprises/controllers/enterprise_controller.js.coffee @@ -32,5 +32,3 @@ angular.module("admin.enterprises") $scope.Enterprise.users.push manager else alert ("#{manager.email}" + " " + t("is_already_manager")) - - diff --git a/app/assets/javascripts/admin/enterprises/controllers/enterprises_controller.js.coffee b/app/assets/javascripts/admin/enterprises/controllers/enterprises_controller.js.coffee index 30710d1538..3d8bfa6446 100644 --- a/app/assets/javascripts/admin/enterprises/controllers/enterprises_controller.js.coffee +++ b/app/assets/javascripts/admin/enterprises/controllers/enterprises_controller.js.coffee @@ -11,4 +11,3 @@ angular.module("admin.enterprises").controller 'enterprisesCtrl', ($scope, $q, E package: { name: "Package", visible: true } status: { name: "Status", visible: true } manage: { name: "Manage", visible: true } - diff --git a/app/assets/javascripts/admin/line_items/controllers/line_items_controller.js.coffee b/app/assets/javascripts/admin/line_items/controllers/line_items_controller.js.coffee index d5b71f8c57..d758706d65 100644 --- a/app/assets/javascripts/admin/line_items/controllers/line_items_controller.js.coffee +++ b/app/assets/javascripts/admin/line_items/controllers/line_items_controller.js.coffee @@ -5,24 +5,24 @@ angular.module("admin.lineItems").controller 'LineItemsCtrl', ($scope, $timeout, $scope.confirmDelete = true $scope.startDate = formatDate daysFromToday -7 $scope.endDate = formatDate daysFromToday 1 - $scope.bulkActions = [ { name: t "bom_actions_delete", callback: 'deleteLineItems' } ] - $scope.selectedUnitsProduct = {}; - $scope.selectedUnitsVariant = {}; + $scope.bulkActions = [ { name: t("bom_actions_delete"), callback: 'deleteLineItems' } ] + $scope.selectedUnitsProduct = {} + $scope.selectedUnitsVariant = {} $scope.sharedResource = false $scope.columns = Columns.setColumns - order_no: { name: t "bom_no", visible: false } - full_name: { name: t "name", visible: true } - email: { name: t "email", visible: false } - phone: { name: t "phone", visible: false } - order_date: { name: t "bom_date", visible: true } - producer: { name: t "producer", visible: true } - order_cycle: { name: t "bom_cycle", visible: false } - hub: { name: t "bom_hub", visible: false } - variant: { name: t "bom_variant", visible: true } - quantity: { name: t "bom_quantity", visible: true } - max: { name: t "bom_max", visible: true } - final_weight_volume: { name: t "bom_final_weigth_volume", visible: false } - price: { name: t "bom_price", visible: false } + order_no: { name: t("bom_no"), visible: false } + full_name: { name: t("name"), visible: true } + email: { name: t("email"), visible: false } + phone: { name: t("phone"), visible: false } + order_date: { name: t("bom_date"), visible: true } + producer: { name: t("producer"), visible: true } + order_cycle: { name: t("bom_cycle"), visible: false } + hub: { name: t("bom_hub"), visible: false } + variant: { name: t("bom_variant"), visible: true } + quantity: { name: t("bom_quantity"), visible: true } + max: { name: t("bom_max"), visible: true } + final_weight_volume: { name: t("bom_final_weigth_volume"), visible: false } + price: { name: t("bom_price"), visible: false } $scope.confirmRefresh = -> LineItems.allSaved() || confirm(t "unsaved_changes_warning") From 02cbad26976de16c9f5e081c604252c859bba9bc Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Wed, 9 Mar 2016 18:49:35 +1100 Subject: [PATCH 28/40] Remove duplicate lines from merging --- app/models/customer.rb | 1 - .../accounts_and_billing_settings/edit.html.haml | 15 +++++++-------- app/views/admin/customers/index.html.haml | 6 +++--- app/views/admin/enterprise_fees/index.html.haml | 12 ++++++------ .../admin/enterprise_groups/_form_about.html.haml | 2 +- .../enterprise_groups/_form_address.html.haml | 2 +- .../enterprise_groups/_form_images.html.haml | 4 ++-- .../_form_primary_details.html.haml | 2 +- .../admin/enterprise_groups/_form_users.html.haml | 2 +- .../admin/enterprise_groups/_form_web.html.haml | 2 +- app/views/admin/enterprise_groups/index.html.haml | 6 +++--- .../_enterprise_relationship.html.haml | 2 +- .../admin/order_cycles/set_coordinator.html.haml | 2 +- .../admin/overview/_enterprises_header.html.haml | 5 ++--- 14 files changed, 30 insertions(+), 33 deletions(-) diff --git a/app/models/customer.rb b/app/models/customer.rb index 1ab2f3ae5c..c4c93cb8aa 100644 --- a/app/models/customer.rb +++ b/app/models/customer.rb @@ -18,4 +18,3 @@ class Customer < ActiveRecord::Base self.user = user || Spree::User.find_by_email(email) end end - diff --git a/app/views/admin/accounts_and_billing_settings/edit.html.haml b/app/views/admin/accounts_and_billing_settings/edit.html.haml index 7a74a59120..cd614b14f8 100644 --- a/app/views/admin/accounts_and_billing_settings/edit.html.haml +++ b/app/views/admin/accounts_and_billing_settings/edit.html.haml @@ -8,7 +8,7 @@ -# - month_options = (0...12).map { |i| Time.zone.now.beginning_of_month - i.months }.map{ |t| [t.strftime("%b %Y"), t.strftime("%b %Y %z")]} %fieldset.no-border-bottom - %legend + %legend =t :admin_settings = form_for @settings, as: :settings, url: main_app.admin_accounts_and_billing_settings_path, :method => :put do |f| .row{ ng: { app: t(:admin_accounts_and_billing) } } @@ -24,7 +24,7 @@ .row .six.columns.alpha %fieldset.no-border-bottom - %legend + %legend =t :update_invoice = f.check_box :auto_update_invoices = f.label :auto_update_invoices, @@ -32,7 +32,7 @@ .six.columns.omega %fieldset.no-border-bottom - %legend + %legend =t :finalise_invoice = f.check_box :auto_finalize_invoices = f.label :auto_finalize_invoices, @@ -48,7 +48,7 @@ .row .six.columns.alpha.step.text-center .form-buttons{"data-hook" => "buttons"} - =link_to_with_icon "icon-undo", + =link_to_with_icon "icon-undo", t(:update_user_invoices) , main_app.start_job_admin_accounts_and_billing_settings_path(job: { name: "update_account_invoices" }), class: "button fullwidth" @@ -62,7 +62,7 @@ %br =t :started_at - else - %strong + %strong =t :queued %br =t :Scheduled_for @@ -82,12 +82,12 @@ - if @finalize_account_invoices_job %p.text-center - if @finalize_account_invoices_job.run_at < Time.zone.now - %strong + %strong =t :in_progress %br =t :started_at - else - %strong + %strong =t :queued %br =t :scheduled_for @@ -95,4 +95,3 @@ - else %p.explanation =t :finalise_user_invoice_explained - diff --git a/app/views/admin/customers/index.html.haml b/app/views/admin/customers/index.html.haml index ddeddd9025..cf3ef25bb3 100644 --- a/app/views/admin/customers/index.html.haml +++ b/app/views/admin/customers/index.html.haml @@ -1,5 +1,5 @@ - content_for :page_title do - %h1.page-title + %h1.page-title =t :customers = admin_inject_shops @@ -7,7 +7,7 @@ %div{ ng: { app: 'admin.customers', controller: 'customersCtrl' } } .row{ ng: { hide: "loaded() && filteredCustomers.length > 0" } } .five.columns.alpha - %h3 + %h3 =t :please_select_hub .four.columns %select.select2.fullwidth#shop_id{ 'ng-model' => 'shop.id', name: 'shop_id', 'ng-options' => 'shop.id as shop.name for shop in shops' } @@ -27,7 +27,7 @@ %h1 =t :loading_customers .row{ :class => "sixteen columns alpha", 'ng-show' => 'loaded() && filteredCustomers.length == 0'} - %h1#no_results + %h1#no_results =t :no_customers_found diff --git a/app/views/admin/enterprise_fees/index.html.haml b/app/views/admin/enterprise_fees/index.html.haml index 42966bd6be..c9d1311d7a 100644 --- a/app/views/admin/enterprise_fees/index.html.haml +++ b/app/views/admin/enterprise_fees/index.html.haml @@ -10,17 +10,17 @@ %table.index#listing_enterprise_fees %thead %tr - %th + %th =t'Enterprise' - %th + %th =t'fee_type' - %th + %th =t'name' - %th + %th =t'tax_category' - %th + %th =t'calculator' - %th + %th =t'calculator_values' %th.actions %tbody diff --git a/app/views/admin/enterprise_groups/_form_about.html.haml b/app/views/admin/enterprise_groups/_form_about.html.haml index 2c2ba59464..1e97697a4e 100644 --- a/app/views/admin/enterprise_groups/_form_about.html.haml +++ b/app/views/admin/enterprise_groups/_form_about.html.haml @@ -1,5 +1,5 @@ %fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='About'" } } - %legend + %legend = t 'admin_entreprise_groups_about' = f.field_container :long_description do %text-angular{'id' => 'enterprise_group_long_description', 'name' => 'enterprise_group[long_description]', 'class' => 'text-angular', diff --git a/app/views/admin/enterprise_groups/_form_address.html.haml b/app/views/admin/enterprise_groups/_form_address.html.haml index a161c1d619..fa7b1e7e75 100644 --- a/app/views/admin/enterprise_groups/_form_address.html.haml +++ b/app/views/admin/enterprise_groups/_form_address.html.haml @@ -1,6 +1,6 @@ = f.fields_for :address do |af| %fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='Contact'" } } - %legend + %legend = t 'admin_entreprise_groups_contact' .row .alpha.three.columns diff --git a/app/views/admin/enterprise_groups/_form_images.html.haml b/app/views/admin/enterprise_groups/_form_images.html.haml index ee01267208..b24feb60a0 100644 --- a/app/views/admin/enterprise_groups/_form_images.html.haml +++ b/app/views/admin/enterprise_groups/_form_images.html.haml @@ -1,5 +1,5 @@ %fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='Images'" } } - %legend + %legend = t 'admin_entreprise_groups_images' .row .alpha.three.columns @@ -13,7 +13,7 @@ .alpha.three.columns = f.label :promo_image, class: 'with-tip', 'data-powertip' => t(:admin_entreprise_groups_data_powertip_promo_image) .with-tip{'data-powertip' => t(:admin_entreprise_groups_data_powertip_promo_image_tip)} - %a + %a = t 'admin_entreprise_groups_what_s_this' = f.label :promo_image, 'ofn-with-tip' => 'This image is displayed at the top of the Group profile' %div{'ofn-with-tip' => 'This image is displayed at the top of the Group profile'} diff --git a/app/views/admin/enterprise_groups/_form_primary_details.html.haml b/app/views/admin/enterprise_groups/_form_primary_details.html.haml index 6785d88ada..56771c458c 100644 --- a/app/views/admin/enterprise_groups/_form_primary_details.html.haml +++ b/app/views/admin/enterprise_groups/_form_primary_details.html.haml @@ -1,5 +1,5 @@ %fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='Primary Details'" } } - %legend + %legend = t "admin_entreprise_groups_primary_details" = f.field_container :name do = f.label :name diff --git a/app/views/admin/enterprise_groups/_form_users.html.haml b/app/views/admin/enterprise_groups/_form_users.html.haml index 3d146ed6f9..4c111c1772 100644 --- a/app/views/admin/enterprise_groups/_form_users.html.haml +++ b/app/views/admin/enterprise_groups/_form_users.html.haml @@ -4,7 +4,7 @@ .three.columns.alpha =f.label :owner_id, t(:admin_entreprise_groups_owner) .with-tip{'data-powertip' => t(:admin_entreprise_groups_data_powertip)} - %a + %a = t 'admin_entreprise_groups_what_s_this' =f.label :owner_id, 'Owner' %div{'ofn-with-tip' => "The primary user responsible for this group."} diff --git a/app/views/admin/enterprise_groups/_form_web.html.haml b/app/views/admin/enterprise_groups/_form_web.html.haml index 4d20f9d2fd..5d982f1bbb 100644 --- a/app/views/admin/enterprise_groups/_form_web.html.haml +++ b/app/views/admin/enterprise_groups/_form_web.html.haml @@ -1,5 +1,5 @@ %fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='Web'" } } - %legend + %legend = t 'admin_entreprise_groups_web' .row .alpha.three.columns diff --git a/app/views/admin/enterprise_groups/index.html.haml b/app/views/admin/enterprise_groups/index.html.haml index 932695201f..a4eddfd5ca 100644 --- a/app/views/admin/enterprise_groups/index.html.haml +++ b/app/views/admin/enterprise_groups/index.html.haml @@ -8,14 +8,14 @@ %table.index#listing_enterprise_groups %thead %tr - %th + %th = t 'admin_entreprise_groups_name' - if spree_current_user.admin? %th = t 'admin_entreprise_groups_owner' - %th + %th = t 'admin_entreprise_groups_on_front_page' - %th + %th = t 'admin_entreprise_groups_entreprise' %th.actions diff --git a/app/views/admin/enterprise_relationships/_enterprise_relationship.html.haml b/app/views/admin/enterprise_relationships/_enterprise_relationship.html.haml index b4e865f083..05e6505868 100644 --- a/app/views/admin/enterprise_relationships/_enterprise_relationship.html.haml +++ b/app/views/admin/enterprise_relationships/_enterprise_relationship.html.haml @@ -1,6 +1,6 @@ %tr{"ng-repeat" => "enterprise_relationship in EnterpriseRelationships.enterprise_relationships | keywords:query"} %td {{ enterprise_relationship.parent_name }} - %td + %td = t 'admin_entreprise_relationships_permits' %td {{ enterprise_relationship.child_name }} %td diff --git a/app/views/admin/order_cycles/set_coordinator.html.haml b/app/views/admin/order_cycles/set_coordinator.html.haml index 0216edee54..db9bbb926c 100644 --- a/app/views/admin/order_cycles/set_coordinator.html.haml +++ b/app/views/admin/order_cycles/set_coordinator.html.haml @@ -1,4 +1,4 @@ -%h4.text-center +%h4.text-center =t'select_a_coordinator_for_your_order_cycle' %br diff --git a/app/views/spree/admin/overview/_enterprises_header.html.haml b/app/views/spree/admin/overview/_enterprises_header.html.haml index 78959383c5..5b1979c4ce 100644 --- a/app/views/spree/admin/overview/_enterprises_header.html.haml +++ b/app/views/spree/admin/overview/_enterprises_header.html.haml @@ -1,11 +1,10 @@ %div.header.sixteen.columns.alpha{ :class => "#{@enterprises.count > 0 ? "" : "red"}"} - %h3.thirteen.columns.alpha + %h3.thirteen.columns.alpha = t "spree_admin_overview_enterprises_header" - if @enterprises.any? - if spree_current_user.can_own_more_enterprises? %a.three.columns.omega.icon-plus.button.blue.white-bottom{ href: "#{main_app.new_admin_enterprise_path}" } = t "spree_admin_enterprises_create_new" - else - %a.with-tip{ title: "Enterprises are Producers and/or Hubs and are the basic unit of organisation within the Open Food Network." } + %a{ "ofn-with-tip" => "Enterprises are Producers and/or Hubs and are the basic unit of organisation within the Open Food Network." } = t "admin_enterprise_groups_what_s_this" - %a{ "ofn-with-tip" => "Enterprises are Producers and/or Hubs and are the basic unit of organisation within the Open Food Network." } What's this? From 02cc5adf78787092bd6f34127718b1b262cd2147 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Wed, 9 Mar 2016 18:57:54 +1100 Subject: [PATCH 29/40] Revert false HAML indent --- .../admin/overview/_enterprises_hubs_tab.html.haml | 4 ++-- .../overview/_enterprises_producers_tab.html.haml | 4 ++-- .../spree/admin/overview/_enterprises_tabs.html.haml | 2 +- app/views/spree/admin/overview/_order_cycles.html.haml | 4 ++-- app/views/spree/admin/overview/_products.html.haml | 7 ++----- .../overview/multi_enterprise_dashboard.html.haml | 5 ++--- .../overview/single_enterprise_dashboard.html.haml | 10 +++++----- app/views/spree/admin/reports/packing.html.haml | 2 +- app/views/spree/admin/reports/payments.html.haml | 2 +- .../admin/reports/products_and_inventory.html.haml | 2 +- app/views/spree/admin/reports/sales_tax.html.haml | 2 +- app/views/spree/admin/shared/_hubs_sidebar.html.haml | 2 +- 12 files changed, 21 insertions(+), 25 deletions(-) diff --git a/app/views/spree/admin/overview/_enterprises_hubs_tab.html.haml b/app/views/spree/admin/overview/_enterprises_hubs_tab.html.haml index b8ad4b0c72..3073ec78a3 100644 --- a/app/views/spree/admin/overview/_enterprises_hubs_tab.html.haml +++ b/app/views/spree/admin/overview/_enterprises_hubs_tab.html.haml @@ -1,11 +1,11 @@ %div.hubs_tab{ ng: { show: "activeTab == 'hubs'"} } %div.sixteen.columns.alpha.list-title - %span.five.columns.alpha + %span.five.columns.alpha = t "spree_admin_enterprises_hubs_name" - if can? :admin, Spree::PaymentMethod %span.centered.three.columns Payment Methods - if can? :admin, Spree::ShippingMethod - %span.centered.three.columns + %span.centered.three.columns = t "spree_admin_enterprises_shipping_methods" - if can? :admin, EnterpriseFee %span.centered.three.columns diff --git a/app/views/spree/admin/overview/_enterprises_producers_tab.html.haml b/app/views/spree/admin/overview/_enterprises_producers_tab.html.haml index 7ff6c8b911..19cae1e6f8 100644 --- a/app/views/spree/admin/overview/_enterprises_producers_tab.html.haml +++ b/app/views/spree/admin/overview/_enterprises_producers_tab.html.haml @@ -1,11 +1,11 @@ %div.producers_tab{ ng: { show: "activeTab == 'producers'"} } %div.list-title.sixteen.columns.alpha - %span.five.columns.alpha + %span.five.columns.alpha = t "spree_admin_enterprises_producers_name" - if can? :admin, Spree::Product %span.centered.three.columns = t "spree_admin_enterprises_producers_total_products" - %span.centered.three.columns + %span.centered.three.columns = t "spree_admin_enterprises_producers_active_products" - if can? :admin, OrderCycle %span.centered.three.columns diff --git a/app/views/spree/admin/overview/_enterprises_tabs.html.haml b/app/views/spree/admin/overview/_enterprises_tabs.html.haml index 1124c90f30..5f8eb9e3c2 100644 --- a/app/views/spree/admin/overview/_enterprises_tabs.html.haml +++ b/app/views/spree/admin/overview/_enterprises_tabs.html.haml @@ -1,5 +1,5 @@ %div.sixteen.columns.alpha.tabs - %div.dashboard_tab.eight.columns.alpha.blue{ ng: { class: "{selected: activeTab == 'hubs'}", click: "activeTab = 'hubs'" } } + %div.dashboard_tab.eight.columns.alpha.blue{ ng: { class: "{selected: activeTab == 'hubs'}", click: "activeTab = 'hubs'" } } = t "spree_admin_enterprises_tabs_hubs" %div.dashboard_tab.eight.columns.omega.blue{ ng: { class: "{selected: activeTab == 'producers'}", click: "activeTab = 'producers'" } } = t "spree_admin_enterprises_tabs_producers" diff --git a/app/views/spree/admin/overview/_order_cycles.html.haml b/app/views/spree/admin/overview/_order_cycles.html.haml index 63694e5625..ae4c9c2c0b 100644 --- a/app/views/spree/admin/overview/_order_cycles.html.haml +++ b/app/views/spree/admin/overview/_order_cycles.html.haml @@ -6,7 +6,7 @@ %a.three.columns.omega.icon-plus.button.blue{ href: "#{main_app.new_admin_order_cycle_path}" } = t "spree_admin_enterprises_create_new" - else - %a.with-tip{ title: t(:spree_admin_order_cycles_tip) } + %a.with-tip{ title: t(:spree_admin_order_cycles_tip) } = t "admin_entreprise_groups_what_s_this" %a{ "ofn-with-tip" => "Order cycles determine when and where your products are available to customers." } What's this? %div.seven.columns.alpha.list @@ -21,7 +21,7 @@ %span.icon-arrow-right - else %div.seven.columns.alpha.list-item.orange - %span.six.columns.alpha + %span.six.columns.alpha = t "spree_admin_enterprises_producers_orders_cycle_text" %span.one.column.omega %span.icon-warning-sign diff --git a/app/views/spree/admin/overview/_products.html.haml b/app/views/spree/admin/overview/_products.html.haml index 2e4a159373..a85132bdf3 100644 --- a/app/views/spree/admin/overview/_products.html.haml +++ b/app/views/spree/admin/overview/_products.html.haml @@ -6,9 +6,8 @@ %a.three.columns.omega.icon-plus.button.blue{ href: "#{new_admin_product_path}" } = t "spree_admin_enterprises_create_new" - else - %a.with-tip{ title: "The products that you sell through the Open Food Network." } + %a{ "ofn-with-tip" => "The products that you sell through the Open Food Network." } = t "admin_entreprise_groups_what_s_this" - %a{ "ofn-with-tip" => "The products that you sell through the Open Food Network." } What's this? %div.seven.columns.alpha.list - if @product_count > 0 %div.seven.columns.alpha.list-item @@ -21,12 +20,10 @@ %span.icon-arrow-right - else %div.seven.columns.alpha.list-item.red - %span.six.columns.alpha + %span.six.columns.alpha = t "spree_admin_enterprises_any_active_products_text" %span.one.column.omega %span.icon-remove-sign %a.seven.columns.alpha.button.bottom.red{ href: "#{new_admin_product_path}" } = t "spree_admin_enterprises_create_new_product" %span.icon-arrow-right - CREATE A NEW PRODUCT - %span.icon-arrow-right diff --git a/app/views/spree/admin/overview/multi_enterprise_dashboard.html.haml b/app/views/spree/admin/overview/multi_enterprise_dashboard.html.haml index 202443343d..0647304e05 100644 --- a/app/views/spree/admin/overview/multi_enterprise_dashboard.html.haml +++ b/app/views/spree/admin/overview/multi_enterprise_dashboard.html.haml @@ -2,10 +2,9 @@ = render 'admin/shared/user_guide_link' -%h1{ :style => 'margin-bottom: 30px'} - = t "dashbord" %div{ 'ng-app' => 'ofn.admin' } - %h1{ :style => 'margin-bottom: 30px' } Dashboard + %h1{ :style => 'margin-bottom: 30px' } + = t "dashbord" - if @enterprises.unconfirmed.any? diff --git a/app/views/spree/admin/overview/single_enterprise_dashboard.html.haml b/app/views/spree/admin/overview/single_enterprise_dashboard.html.haml index d2b0635409..91c0934e21 100644 --- a/app/views/spree/admin/overview/single_enterprise_dashboard.html.haml +++ b/app/views/spree/admin/overview/single_enterprise_dashboard.html.haml @@ -37,7 +37,7 @@ %a.close{ href: "#" } × - if !@enterprise.visible .alert-box - %strong + %strong = t "spree_admin_single_enterprise_hint" %strong= "#{t 'manage'} #{@enterprise.name}." %a.close{ href: "#" } × @@ -47,7 +47,7 @@ .header %h3 %span.icon-map-marker - = t "your_profil_live" + = t "your_profil_live" %p = t "on_ofn_map" .list @@ -64,7 +64,7 @@ .header %h3 %span.icon-edit - = t "edit_profile_details" + = t "edit_profile_details" %p = t "edit_profile_details_etc" .list @@ -79,7 +79,7 @@ .header %h3 %span.icon-th-large - = t "add_and_manage_products" + = t "add_and_manage_products" .list %a.button.bottom{href: bulk_edit_admin_products_path} = t "manage_products" @@ -93,7 +93,7 @@ .header %h3 %span.icon-shopping-cart - = t "add_and_manage_order_cycles" + = t "add_and_manage_order_cycles" .list %a.button.bottom{href: main_app.admin_order_cycles_path} = t "manage_order_cycles" diff --git a/app/views/spree/admin/reports/packing.html.haml b/app/views/spree/admin/reports/packing.html.haml index d419f9a7cb..fa9d22eb70 100644 --- a/app/views/spree/admin/reports/packing.html.haml +++ b/app/views/spree/admin/reports/packing.html.haml @@ -29,7 +29,7 @@ %br %table#listing_orders.index %thead - %tr{'data-hook' => "orders_header" } + %tr{'data-hook' => "orders_header"} - @report.header.each do |heading| %th=heading %tbody diff --git a/app/views/spree/admin/reports/payments.html.haml b/app/views/spree/admin/reports/payments.html.haml index a0e8f1d1d8..b69708fbd1 100644 --- a/app/views/spree/admin/reports/payments.html.haml +++ b/app/views/spree/admin/reports/payments.html.haml @@ -19,7 +19,7 @@ %br %table#listing_orders.index %thead - %tr{'data-hook' => "orders_header" } + %tr{'data-hook' => "orders_header"} - @report.header.each do |heading| %th=heading %tbody diff --git a/app/views/spree/admin/reports/products_and_inventory.html.haml b/app/views/spree/admin/reports/products_and_inventory.html.haml index 53ad6649ee..b1c11918ce 100644 --- a/app/views/spree/admin/reports/products_and_inventory.html.haml +++ b/app/views/spree/admin/reports/products_and_inventory.html.haml @@ -35,7 +35,7 @@ %br %table#listing_products.index %thead - %tr{'data-hook' => "products_header" } + %tr{'data-hook' => "products_header"} - @report.header.each do |heading| %th=heading %tbody diff --git a/app/views/spree/admin/reports/sales_tax.html.haml b/app/views/spree/admin/reports/sales_tax.html.haml index c91617cc6a..9a5cb9e533 100644 --- a/app/views/spree/admin/reports/sales_tax.html.haml +++ b/app/views/spree/admin/reports/sales_tax.html.haml @@ -14,7 +14,7 @@ %br %table#listing_orders.index %thead - %tr{'data-hook' => "orders_header" } + %tr{'data-hook' => "orders_header"} - @report.header.each do |heading| %th= heading %tbody diff --git a/app/views/spree/admin/shared/_hubs_sidebar.html.haml b/app/views/spree/admin/shared/_hubs_sidebar.html.haml index 25cdd89685..9bc54be829 100644 --- a/app/views/spree/admin/shared/_hubs_sidebar.html.haml +++ b/app/views/spree/admin/shared/_hubs_sidebar.html.haml @@ -17,7 +17,7 @@ %span.icon-arrow-right - else .four.columns.alpha.list-item - %span.three.columns.alpha + %span.three.columns.alpha t(:hub_sidebar_none_available) %span.one.column.omega %span.icon-remove-sign From 3595685f9a6ad3293fb34b674787f8e20f4d1b45 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Fri, 11 Mar 2016 11:46:06 +1100 Subject: [PATCH 30/40] Merge text change in LineItemsCtrl into en.yml --- config/locales/en.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index e26c543935..608bbd86ea 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -255,7 +255,7 @@ en: bom_no_results: "No orders found." bom_order_error: "Some errors must be resolved before you can update orders.\nAny fields with red borders contain errors." - unsaved_changes_warning: "Unsaved changes exist and will be lost if you continue." + unsaved_changes_warning: "Fields with red borders contain errors." products: "Products" products_in: "in %{oc}" From 3e5f53b0827272da9afe05ed9161e4e97a1fec1a Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Fri, 11 Mar 2016 12:13:17 +1100 Subject: [PATCH 31/40] Rename i18n key what_is_this --- app/views/admin/enterprise_groups/_form_images.html.haml | 2 +- app/views/admin/enterprise_groups/_form_users.html.haml | 2 +- app/views/spree/admin/orders/bulk_management.html.haml | 6 ++---- app/views/spree/admin/overview/_order_cycles.html.haml | 2 +- app/views/spree/admin/overview/_products.html.haml | 2 +- config/locales/en.yml | 3 +-- 6 files changed, 7 insertions(+), 10 deletions(-) diff --git a/app/views/admin/enterprise_groups/_form_images.html.haml b/app/views/admin/enterprise_groups/_form_images.html.haml index b24feb60a0..67378f331b 100644 --- a/app/views/admin/enterprise_groups/_form_images.html.haml +++ b/app/views/admin/enterprise_groups/_form_images.html.haml @@ -14,7 +14,7 @@ = f.label :promo_image, class: 'with-tip', 'data-powertip' => t(:admin_entreprise_groups_data_powertip_promo_image) .with-tip{'data-powertip' => t(:admin_entreprise_groups_data_powertip_promo_image_tip)} %a - = t 'admin_entreprise_groups_what_s_this' + = t 'what_is_this' = f.label :promo_image, 'ofn-with-tip' => 'This image is displayed at the top of the Group profile' %div{'ofn-with-tip' => 'This image is displayed at the top of the Group profile'} %a What's this? diff --git a/app/views/admin/enterprise_groups/_form_users.html.haml b/app/views/admin/enterprise_groups/_form_users.html.haml index 4c111c1772..082fa2d3bf 100644 --- a/app/views/admin/enterprise_groups/_form_users.html.haml +++ b/app/views/admin/enterprise_groups/_form_users.html.haml @@ -5,7 +5,7 @@ =f.label :owner_id, t(:admin_entreprise_groups_owner) .with-tip{'data-powertip' => t(:admin_entreprise_groups_data_powertip)} %a - = t 'admin_entreprise_groups_what_s_this' + = t 'what_is_this' =f.label :owner_id, 'Owner' %div{'ofn-with-tip' => "The primary user responsible for this group."} %a What's this? diff --git a/app/views/spree/admin/orders/bulk_management.html.haml b/app/views/spree/admin/orders/bulk_management.html.haml index 9e9362681d..b0908e0b6e 100644 --- a/app/views/spree/admin/orders/bulk_management.html.haml +++ b/app/views/spree/admin/orders/bulk_management.html.haml @@ -2,12 +2,10 @@ = "ng-app='admin.lineItems'" - content_for :page_title do - %h1.page-title - = t "bulk_order_management" - %a{ 'ofn-with-tip' => "#t('bom_tip')" } - = t "admin_entreprise_groups_what_s_this" %h1.page-title = t "bom_page_title" + %a{ 'ofn-with-tip' => "#t('bom_tip')" } + = t "what_is_this" = render :partial => 'spree/admin/shared/order_sub_menu' diff --git a/app/views/spree/admin/overview/_order_cycles.html.haml b/app/views/spree/admin/overview/_order_cycles.html.haml index ae4c9c2c0b..9be7fffed2 100644 --- a/app/views/spree/admin/overview/_order_cycles.html.haml +++ b/app/views/spree/admin/overview/_order_cycles.html.haml @@ -7,7 +7,7 @@ = t "spree_admin_enterprises_create_new" - else %a.with-tip{ title: t(:spree_admin_order_cycles_tip) } - = t "admin_entreprise_groups_what_s_this" + = t "what_is_this" %a{ "ofn-with-tip" => "Order cycles determine when and where your products are available to customers." } What's this? %div.seven.columns.alpha.list - if @order_cycle_count > 0 diff --git a/app/views/spree/admin/overview/_products.html.haml b/app/views/spree/admin/overview/_products.html.haml index a85132bdf3..79da1a0f1b 100644 --- a/app/views/spree/admin/overview/_products.html.haml +++ b/app/views/spree/admin/overview/_products.html.haml @@ -7,7 +7,7 @@ = t "spree_admin_enterprises_create_new" - else %a{ "ofn-with-tip" => "The products that you sell through the Open Food Network." } - = t "admin_entreprise_groups_what_s_this" + = t "what_is_this" %div.seven.columns.alpha.list - if @product_count > 0 %div.seven.columns.alpha.list-item diff --git a/config/locales/en.yml b/config/locales/en.yml index 608bbd86ea..0a2904626d 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -789,7 +789,7 @@ Please follow the instructions there to make your enterprise visible on the Open on_hand: "On hand" save_changes: "Save Changes" update_action: "update()" #FIXME - admin_entreprise_groups_what_s_this: "What's this ?" + what_is_this: "What's this?" spree_admin_overview_enterprises_header: "My Enterprises" spree_admin_overview_enterprises_footer: "MANAGE MY ENTERPRISES" spree_admin_enterprises_hubs_name: "Name" @@ -831,7 +831,6 @@ Please follow the instructions there to make your enterprise visible on the Open manage_products: "Manage products" edit_profile_details: "Edit profile details" edit_profile_details_etc: "Change your profile description, images, etc." - bulk_order_management: "Bulk Order Management" start_date: "Start Date" end_date: "End Date" order_cycle: "Order Cycle" From 5225686d8f4c4d40b61845a4950875b97569674a Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Fri, 11 Mar 2016 12:23:12 +1100 Subject: [PATCH 32/40] Re-merge bulk order view --- .../admin/shared/_columns_dropdown.html.haml | 4 ++- .../admin/orders/bulk_management.html.haml | 35 ++++++------------- 2 files changed, 14 insertions(+), 25 deletions(-) diff --git a/app/views/admin/shared/_columns_dropdown.html.haml b/app/views/admin/shared/_columns_dropdown.html.haml index b16d388c1d..caab910ceb 100644 --- a/app/views/admin/shared/_columns_dropdown.html.haml +++ b/app/views/admin/shared/_columns_dropdown.html.haml @@ -1,6 +1,8 @@ %div.three.columns.omega %div.ofn-drop-down.right#columns-dropdown{ 'ng-controller' => "DropDownCtrl" } - %span{ :class => 'icon-reorder' }   Columns + %span{ :class => 'icon-reorder' } +   + = t "bom_columns" %span{ 'ng-class' => "expanded && 'icon-caret-up' || !expanded && 'icon-caret-down'" } %div.menu{ 'ng-show' => "expanded" } %div.menu_item.three.columns.alpha.omega{ 'ng-repeat' => "column in columns", 'ofn-toggle-column' => true } diff --git a/app/views/spree/admin/orders/bulk_management.html.haml b/app/views/spree/admin/orders/bulk_management.html.haml index b0908e0b6e..9d6ca99586 100644 --- a/app/views/spree/admin/orders/bulk_management.html.haml +++ b/app/views/spree/admin/orders/bulk_management.html.haml @@ -87,29 +87,16 @@ %div{ :class => "eight columns alpha", 'ng-hide' => 'allFinalWeightVolumesPresent()' } %span{ :class => "eight columns alpha", style: 'color:red' } = t "bulk_management_warning" - %hr{ :class => "sixteen columns alpha", :style => "margin-bottom: 15px" } - %div{ 'ng-hide' => 'RequestMonitor.loading || lineItems.length == 0' } - .controls{ :class => "sixteen columns alpha", :style => "margin-bottom: 15px;" } - %div{ :class => "three columns alpha" } - %input{ :class => "fullwidth", :type => "text", :id => 'quick_search', 'ng-model' => 'quickSearch', :placeholder => 'Quick Search' } - %div{ :class => "three columns" } - %div.ofn_drop_down{ 'ng-controller' => "DropDownCtrl", :id => "bulk_actions_dropdown", 'ofn-drop-down' => true } - %span{ :class => 'icon-check' } - = t "action" - %span{ 'ng-class' => "expanded && 'icon-caret-up' || !expanded && 'icon-caret-down'" } - %div.menu{ 'ng-show' => "expanded" } - %div.menu_item{ :class => "three columns alpha", 'ng-repeat' => "action in bulkActions", 'ng-click' => "$eval(action.callback)(filteredLineItems)", 'ofn-close-on-click' => true } - %span{ :class => 'three columns omega' } {{action.name }} - %div{ :class => "seven columns" }   - %div{ :class => "three columns omega" } - %div.ofn_drop_down{ 'ng-controller' => "DropDownCtrl", :id => "columns_dropdown", 'ofn-drop-down' => true, :style => 'float:right;' } - %span{ :class => 'icon-reorder' } - = t "bom_columns" - %span{ 'ng-class' => "expanded && 'icon-caret-up' || !expanded && 'icon-caret-down'" } - %div.menu{ 'ng-show' => "expanded" } - %div.menu_item{ :class => "three columns alpha", 'ng-repeat' => "column in columns", 'ofn-toggle-column' => true } - %span{ :class => 'one column alpha', :style => 'text-align: center'} {{ column.visible && "✓" || !column.visible && " " }} - %span{ :class => 'two columns omega' } {{column.name }} + + %hr.divider.sixteen.columns.alpha.omega + + .controls.sixteen.columns.alpha.omega{ ng: { hide: 'RequestMonitor.loading || lineItems.length == 0' } } + %div.three.columns.alpha + %input.fullwidth{ :type => "text", :id => 'quick_search', 'ng-model' => 'quickSearch', :placeholder => 'Quick Search' } + = render 'admin/shared/bulk_actions_dropdown' + %div.seven.columns   + = render 'admin/shared/columns_dropdown' + %div.sixteen.columns.alpha#loading{ 'ng-if' => 'RequestMonitor.loading' } %img.spinner{ src: "/assets/spinning-circles.svg" } %h1 @@ -119,7 +106,7 @@ %h1#no_results = t "bom_no_results" - %div{ 'ng-hide' => 'RequestMonitor.loading || filteredLineItems.length == 0' } + .margin-bottom-50{ 'ng-hide' => 'RequestMonitor.loading || filteredLineItems.length == 0' } %form{ name: 'bulk_order_form' } %table.index#listing_orders.bulk{ :class => "sixteen columns alpha" } %thead From b7320a0bd7bd3351db55b42fd95deea280d5780c Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Fri, 11 Mar 2016 12:48:35 +1100 Subject: [PATCH 33/40] Translate "Price" in Bulk Order Management --- app/assets/javascripts/admin/bulk_order_management.js.coffee | 2 +- .../line_items/controllers/line_items_controller.js.coffee | 2 +- config/locales/en.yml | 1 + spec/features/admin/bulk_order_management_spec.rb | 2 ++ 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/admin/bulk_order_management.js.coffee b/app/assets/javascripts/admin/bulk_order_management.js.coffee index c2250954b7..b747d3699e 100644 --- a/app/assets/javascripts/admin/bulk_order_management.js.coffee +++ b/app/assets/javascripts/admin/bulk_order_management.js.coffee @@ -30,7 +30,7 @@ angular.module("ofn.admin").controller "AdminOrderMgmtCtrl", [ quantity: { name: t("bom_quantity"), visible: true } max: { name: t("bom_max"), visible: true } final_weight_volume: { name: t("bom_final_weigth_volume"), visible: false } - price: { name: t("bom_price"), visible: false } + price: { name: t("price"), visible: false } $scope.initialise = -> $scope.initialiseVariables() authorise_api_reponse = "" diff --git a/app/assets/javascripts/admin/line_items/controllers/line_items_controller.js.coffee b/app/assets/javascripts/admin/line_items/controllers/line_items_controller.js.coffee index d758706d65..61526dbea5 100644 --- a/app/assets/javascripts/admin/line_items/controllers/line_items_controller.js.coffee +++ b/app/assets/javascripts/admin/line_items/controllers/line_items_controller.js.coffee @@ -22,7 +22,7 @@ angular.module("admin.lineItems").controller 'LineItemsCtrl', ($scope, $timeout, quantity: { name: t("bom_quantity"), visible: true } max: { name: t("bom_max"), visible: true } final_weight_volume: { name: t("bom_final_weigth_volume"), visible: false } - price: { name: t("bom_price"), visible: false } + price: { name: t("price"), visible: false } $scope.confirmRefresh = -> LineItems.allSaved() || confirm(t "unsaved_changes_warning") diff --git a/config/locales/en.yml b/config/locales/en.yml index 0a2904626d..87dff559bc 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -250,6 +250,7 @@ en: bom_hub: "Hub" bom_variant: "Product: Unit" bom_final_weigth_volume: "Weight/Volume" + bom_quantity: "Quantity" bom_actions_delete: "Delete Selected" bom_loading: "Loading orders" bom_no_results: "No orders found." diff --git a/spec/features/admin/bulk_order_management_spec.rb b/spec/features/admin/bulk_order_management_spec.rb index d28a20d6f9..8d1a8242e3 100644 --- a/spec/features/admin/bulk_order_management_spec.rb +++ b/spec/features/admin/bulk_order_management_spec.rb @@ -159,6 +159,8 @@ feature %q{ first("div#columns-dropdown", :text => "COLUMNS").click first("div#columns-dropdown div.menu div.menu_item", text: "Weight/Volume").click first("div#columns-dropdown div.menu div.menu_item", text: "Price").click + # hide dropdown + first("div#columns-dropdown", :text => "COLUMNS").click within "tr#li_#{li1.id}" do expect(page).to have_field "price", with: "$50.00" fill_in "final_weight_volume", :with => 2000 From 711f525d98856fbaa51657121e2a6cf9c6bd6b4e Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Fri, 11 Mar 2016 14:45:43 +1100 Subject: [PATCH 34/40] Remove   from locale en.yml --- .../admin/dropdown/directives/links_dropdown.js.coffee | 5 ----- .../templates/admin/links_dropdown.html.haml | 10 ---------- app/assets/stylesheets/admin/orders.css.scss | 4 ++++ config/locales/en.yml | 3 +-- 4 files changed, 5 insertions(+), 17 deletions(-) delete mode 100644 app/assets/javascripts/admin/dropdown/directives/links_dropdown.js.coffee delete mode 100644 app/assets/javascripts/templates/admin/links_dropdown.html.haml diff --git a/app/assets/javascripts/admin/dropdown/directives/links_dropdown.js.coffee b/app/assets/javascripts/admin/dropdown/directives/links_dropdown.js.coffee deleted file mode 100644 index a58688a542..0000000000 --- a/app/assets/javascripts/admin/dropdown/directives/links_dropdown.js.coffee +++ /dev/null @@ -1,5 +0,0 @@ - angular.module("admin.dropdown").directive "linksDropdown", ($window)-> - restrict: "C" - scope: - links: "=" - templateUrl: "admin/links_dropdown.html" diff --git a/app/assets/javascripts/templates/admin/links_dropdown.html.haml b/app/assets/javascripts/templates/admin/links_dropdown.html.haml deleted file mode 100644 index 1f44f2418c..0000000000 --- a/app/assets/javascripts/templates/admin/links_dropdown.html.haml +++ /dev/null @@ -1,10 +0,0 @@ -.ofn-drop-down - %span - %i.icon-check - Actions - %i{ 'ng-class' => "expanded && 'icon-caret-up' || !expanded && 'icon-caret-down'" } - %div.menu{ 'ng-show' => "expanded", style: 'width: 200px' } - %a.menu_item{ 'ng-repeat' => "link in links", href: '{{link.url}}', target: "{{link.target || '_self'}}", data: { method: "{{ link.method || 'get' }}", confirm: "{{link.confirm}}" }, style: 'display: inline-block; width: 100%' } - %span{ :style => 'text-align: center; display: inline-block; width: 20%'} - %i{ ng: { class: "link.icon" } } - %span{ style: "display: inline-block; width: auto"} {{ link.name }} diff --git a/app/assets/stylesheets/admin/orders.css.scss b/app/assets/stylesheets/admin/orders.css.scss index 544abfa899..9a2dd4385c 100644 --- a/app/assets/stylesheets/admin/orders.css.scss +++ b/app/assets/stylesheets/admin/orders.css.scss @@ -70,3 +70,7 @@ div#group_buy_calculation { } } } + +th.actions { + white-space: nowrap; +} diff --git a/config/locales/en.yml b/config/locales/en.yml index 87dff559bc..9e056e2c25 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -841,8 +841,7 @@ Please follow the instructions there to make your enterprise visible on the Open current_fulfilled_units: "Current Fulfilled Units" max_fulfilled_units: "Max Fulfilled Units" bulk_management_warning: "WARNING: Some variants do not have a unit value" - action: "   Actions" - ask: "Ask? " + ask: "Ask?" no_orders_found: "No orders found." order_no: "Order No." weight_volume: "Weight/Volume" From ac88817a3409c7ad4de0c984cb056e1d13873229 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Fri, 11 Mar 2016 15:46:29 +1100 Subject: [PATCH 35/40] Add translation for unsaved_changes_warning --- .../line_items/controllers/line_items_controller.js.coffee | 4 ++-- config/locales/en.yml | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/admin/line_items/controllers/line_items_controller.js.coffee b/app/assets/javascripts/admin/line_items/controllers/line_items_controller.js.coffee index 61526dbea5..f905d33bfe 100644 --- a/app/assets/javascripts/admin/line_items/controllers/line_items_controller.js.coffee +++ b/app/assets/javascripts/admin/line_items/controllers/line_items_controller.js.coffee @@ -73,9 +73,9 @@ angular.module("admin.lineItems").controller 'LineItemsCtrl', ($scope, $timeout, StatusMessage.display 'success', "All changes saved" $scope.bulk_order_form.$setPristine() ).catch -> - StatusMessage.display 'failure', t "unsaved_changes_warning" + StatusMessage.display 'failure', t "unsaved_changes_error" else - StatusMessage.display 'failure', t "unsaved_changes_warning" + StatusMessage.display 'failure', t "unsaved_changes_error" $scope.deleteLineItem = (lineItem) -> if ($scope.confirmDelete && confirm(t "are_you_sure")) || !$scope.confirmDelete diff --git a/config/locales/en.yml b/config/locales/en.yml index 9a93d754ae..0bd24a9b54 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -302,7 +302,8 @@ en: bom_no_results: "No orders found." bom_order_error: "Some errors must be resolved before you can update orders.\nAny fields with red borders contain errors." - unsaved_changes_warning: "Fields with red borders contain errors." + unsaved_changes_warning: "Unsaved changes exist and will be lost if you continue." + unsaved_changes_error: "Fields with red borders contain errors." products: "Products" products_in: "in %{oc}" From 51f94119ff3350abebaa4a7af08afc44685ce977 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Fri, 11 Mar 2016 16:39:07 +1100 Subject: [PATCH 36/40] Restore links_dropdown --- .../admin/dropdown/directives/links_dropdown.js.coffee | 5 +++++ .../templates/admin/links_dropdown.html.haml | 10 ++++++++++ 2 files changed, 15 insertions(+) create mode 100644 app/assets/javascripts/admin/dropdown/directives/links_dropdown.js.coffee create mode 100644 app/assets/javascripts/templates/admin/links_dropdown.html.haml diff --git a/app/assets/javascripts/admin/dropdown/directives/links_dropdown.js.coffee b/app/assets/javascripts/admin/dropdown/directives/links_dropdown.js.coffee new file mode 100644 index 0000000000..a58688a542 --- /dev/null +++ b/app/assets/javascripts/admin/dropdown/directives/links_dropdown.js.coffee @@ -0,0 +1,5 @@ + angular.module("admin.dropdown").directive "linksDropdown", ($window)-> + restrict: "C" + scope: + links: "=" + templateUrl: "admin/links_dropdown.html" diff --git a/app/assets/javascripts/templates/admin/links_dropdown.html.haml b/app/assets/javascripts/templates/admin/links_dropdown.html.haml new file mode 100644 index 0000000000..1f44f2418c --- /dev/null +++ b/app/assets/javascripts/templates/admin/links_dropdown.html.haml @@ -0,0 +1,10 @@ +.ofn-drop-down + %span + %i.icon-check + Actions + %i{ 'ng-class' => "expanded && 'icon-caret-up' || !expanded && 'icon-caret-down'" } + %div.menu{ 'ng-show' => "expanded", style: 'width: 200px' } + %a.menu_item{ 'ng-repeat' => "link in links", href: '{{link.url}}', target: "{{link.target || '_self'}}", data: { method: "{{ link.method || 'get' }}", confirm: "{{link.confirm}}" }, style: 'display: inline-block; width: 100%' } + %span{ :style => 'text-align: center; display: inline-block; width: 20%'} + %i{ ng: { class: "link.icon" } } + %span{ style: "display: inline-block; width: auto"} {{ link.name }} From 2546603a671ea19138147fe5138987f6b3fcd611 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Fri, 11 Mar 2016 17:08:13 +1100 Subject: [PATCH 37/40] Remove what_is_this from locale It got replaced by admin.whats_this. Changed views to use the new key. --- app/views/admin/enterprise_groups/_form_images.html.haml | 2 +- app/views/admin/enterprise_groups/_form_users.html.haml | 2 +- app/views/spree/admin/orders/bulk_management.html.haml | 2 +- app/views/spree/admin/overview/_order_cycles.html.haml | 2 +- app/views/spree/admin/overview/_products.html.haml | 2 +- config/locales/en.yml | 1 - 6 files changed, 5 insertions(+), 6 deletions(-) diff --git a/app/views/admin/enterprise_groups/_form_images.html.haml b/app/views/admin/enterprise_groups/_form_images.html.haml index 67378f331b..2269367e96 100644 --- a/app/views/admin/enterprise_groups/_form_images.html.haml +++ b/app/views/admin/enterprise_groups/_form_images.html.haml @@ -14,7 +14,7 @@ = f.label :promo_image, class: 'with-tip', 'data-powertip' => t(:admin_entreprise_groups_data_powertip_promo_image) .with-tip{'data-powertip' => t(:admin_entreprise_groups_data_powertip_promo_image_tip)} %a - = t 'what_is_this' + = t 'admin.whats_this' = f.label :promo_image, 'ofn-with-tip' => 'This image is displayed at the top of the Group profile' %div{'ofn-with-tip' => 'This image is displayed at the top of the Group profile'} %a What's this? diff --git a/app/views/admin/enterprise_groups/_form_users.html.haml b/app/views/admin/enterprise_groups/_form_users.html.haml index 082fa2d3bf..b09bde6852 100644 --- a/app/views/admin/enterprise_groups/_form_users.html.haml +++ b/app/views/admin/enterprise_groups/_form_users.html.haml @@ -5,7 +5,7 @@ =f.label :owner_id, t(:admin_entreprise_groups_owner) .with-tip{'data-powertip' => t(:admin_entreprise_groups_data_powertip)} %a - = t 'what_is_this' + = t 'admin.whats_this' =f.label :owner_id, 'Owner' %div{'ofn-with-tip' => "The primary user responsible for this group."} %a What's this? diff --git a/app/views/spree/admin/orders/bulk_management.html.haml b/app/views/spree/admin/orders/bulk_management.html.haml index 9d6ca99586..3a962defac 100644 --- a/app/views/spree/admin/orders/bulk_management.html.haml +++ b/app/views/spree/admin/orders/bulk_management.html.haml @@ -5,7 +5,7 @@ %h1.page-title = t "bom_page_title" %a{ 'ofn-with-tip' => "#t('bom_tip')" } - = t "what_is_this" + = t "admin.whats_this" = render :partial => 'spree/admin/shared/order_sub_menu' diff --git a/app/views/spree/admin/overview/_order_cycles.html.haml b/app/views/spree/admin/overview/_order_cycles.html.haml index 9be7fffed2..8628837a47 100644 --- a/app/views/spree/admin/overview/_order_cycles.html.haml +++ b/app/views/spree/admin/overview/_order_cycles.html.haml @@ -7,7 +7,7 @@ = t "spree_admin_enterprises_create_new" - else %a.with-tip{ title: t(:spree_admin_order_cycles_tip) } - = t "what_is_this" + = t "admin.whats_this" %a{ "ofn-with-tip" => "Order cycles determine when and where your products are available to customers." } What's this? %div.seven.columns.alpha.list - if @order_cycle_count > 0 diff --git a/app/views/spree/admin/overview/_products.html.haml b/app/views/spree/admin/overview/_products.html.haml index 79da1a0f1b..c017cd11f9 100644 --- a/app/views/spree/admin/overview/_products.html.haml +++ b/app/views/spree/admin/overview/_products.html.haml @@ -7,7 +7,7 @@ = t "spree_admin_enterprises_create_new" - else %a{ "ofn-with-tip" => "The products that you sell through the Open Food Network." } - = t "what_is_this" + = t "admin.whats_this" %div.seven.columns.alpha.list - if @product_count > 0 %div.seven.columns.alpha.list-item diff --git a/config/locales/en.yml b/config/locales/en.yml index 0bd24a9b54..c4ea55c3c4 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -835,7 +835,6 @@ Please follow the instructions there to make your enterprise visible on the Open on_hand: "On hand" save_changes: "Save Changes" update_action: "update()" #FIXME - what_is_this: "What's this?" spree_admin_overview_enterprises_header: "My Enterprises" spree_admin_overview_enterprises_footer: "MANAGE MY ENTERPRISES" spree_admin_enterprises_hubs_name: "Name" From 6d0dc438a7898153bb630c5f0c03b5b4173350b2 Mon Sep 17 00:00:00 2001 From: elf Pavlik Date: Mon, 21 Mar 2016 16:55:57 -0600 Subject: [PATCH 38/40] i18n fixes after @sstead feedback in #799 --- .../edit.html.haml | 4 ++-- app/views/admin/customers/index.html.haml | 2 +- .../enterprise_groups/_form_images.html.haml | 3 --- .../enterprise_groups/_form_users.html.haml | 6 ++---- app/views/admin/order_cycles/index.html.haml | 21 ++++++++++++------- .../admin/orders/bulk_management.html.haml | 2 +- .../spree/admin/reports/customers.html.haml | 9 ++++---- .../reports/order_cycle_management.html.haml | 2 +- .../reports/orders_and_fulfillment.html.haml | 2 +- .../reports/products_and_inventory.html.haml | 6 +++--- .../admin/shared/_hubs_sidebar.html.haml | 7 ++++--- config/locales/en.yml | 6 +++--- 12 files changed, 36 insertions(+), 34 deletions(-) diff --git a/app/views/admin/accounts_and_billing_settings/edit.html.haml b/app/views/admin/accounts_and_billing_settings/edit.html.haml index cd614b14f8..2121719e75 100644 --- a/app/views/admin/accounts_and_billing_settings/edit.html.haml +++ b/app/views/admin/accounts_and_billing_settings/edit.html.haml @@ -28,7 +28,7 @@ =t :update_invoice = f.check_box :auto_update_invoices = f.label :auto_update_invoices, - t(:auto_finalise_invoices) + t(:auto_update_invoices) .six.columns.omega %fieldset.no-border-bottom @@ -36,7 +36,7 @@ =t :finalise_invoice = f.check_box :auto_finalize_invoices = f.label :auto_finalize_invoices, - t(:auto_update_invoices) + t(:auto_finalise_invoices) .row .twelve.columns.alpha.omega.form-buttons{"data-hook" => "buttons"} diff --git a/app/views/admin/customers/index.html.haml b/app/views/admin/customers/index.html.haml index cf3ef25bb3..f68ad37da1 100644 --- a/app/views/admin/customers/index.html.haml +++ b/app/views/admin/customers/index.html.haml @@ -1,6 +1,6 @@ - content_for :page_title do %h1.page-title - =t :customers + =t :customers = admin_inject_shops diff --git a/app/views/admin/enterprise_groups/_form_images.html.haml b/app/views/admin/enterprise_groups/_form_images.html.haml index 2269367e96..ba40a4c849 100644 --- a/app/views/admin/enterprise_groups/_form_images.html.haml +++ b/app/views/admin/enterprise_groups/_form_images.html.haml @@ -15,9 +15,6 @@ .with-tip{'data-powertip' => t(:admin_entreprise_groups_data_powertip_promo_image_tip)} %a = t 'admin.whats_this' - = f.label :promo_image, 'ofn-with-tip' => 'This image is displayed at the top of the Group profile' - %div{'ofn-with-tip' => 'This image is displayed at the top of the Group profile'} - %a What's this? .omega.eight.columns = image_tag @object.promo_image.url if @object.promo_image.present? = f.file_field :promo_image diff --git a/app/views/admin/enterprise_groups/_form_users.html.haml b/app/views/admin/enterprise_groups/_form_users.html.haml index b09bde6852..6bd6eaa4a3 100644 --- a/app/views/admin/enterprise_groups/_form_users.html.haml +++ b/app/views/admin/enterprise_groups/_form_users.html.haml @@ -1,14 +1,12 @@ %fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='Users'" } } - %legend Users + %legend + = t(:users) .row .three.columns.alpha =f.label :owner_id, t(:admin_entreprise_groups_owner) .with-tip{'data-powertip' => t(:admin_entreprise_groups_data_powertip)} %a = t 'admin.whats_this' - =f.label :owner_id, 'Owner' - %div{'ofn-with-tip' => "The primary user responsible for this group."} - %a What's this? .eight.columns.omega - if spree_current_user.admin? = f.hidden_field :owner_id, diff --git a/app/views/admin/order_cycles/index.html.haml b/app/views/admin/order_cycles/index.html.haml index 10b9b1e345..824aa66ee8 100644 --- a/app/views/admin/order_cycles/index.html.haml +++ b/app/views/admin/order_cycles/index.html.haml @@ -28,14 +28,21 @@ %thead %tr - %th =t :name - %th =t :open - %th =t :close + %th + =t :name + %th + =t :open + %th + =t :close - unless order_cycles_simple_index - %th =t :supplier - %th =t :coordinator - %th =t :distributors - %th =t :products + %th + =t :supplier + %th + =t :coordinator + %th + =t :distributors + %th + =t :products %th.actions %th.actions %th.actions diff --git a/app/views/spree/admin/orders/bulk_management.html.haml b/app/views/spree/admin/orders/bulk_management.html.haml index 3a962defac..43983e87ea 100644 --- a/app/views/spree/admin/orders/bulk_management.html.haml +++ b/app/views/spree/admin/orders/bulk_management.html.haml @@ -4,7 +4,7 @@ - content_for :page_title do %h1.page-title = t "bom_page_title" - %a{ 'ofn-with-tip' => "#t('bom_tip')" } + %a{ 'ofn-with-tip' => t("bom_tip") } = t "admin.whats_this" = render :partial => 'spree/admin/shared/order_sub_menu' diff --git a/app/views/spree/admin/reports/customers.html.haml b/app/views/spree/admin/reports/customers.html.haml index 4b7004536c..70045662f9 100644 --- a/app/views/spree/admin/reports/customers.html.haml +++ b/app/views/spree/admin/reports/customers.html.haml @@ -2,24 +2,24 @@ %br .row .four.columns.alpha - = label_tag nil, t(:reports_customers_distributor) + = label_tag nil, t(:report_customers_distributor) = select_tag(:distributor_id, options_from_collection_for_select(@distributors, :id, :name, params[:distributor_id]), {:include_blank => true, :class => "select2 fullwidth"}) .four.columns - = label_tag nil, t(:reports_customers_supplier) + = label_tag nil, t(:report_customers_supplier) = select_tag(:supplier_id, options_from_collection_for_select(@suppliers, :id, :name, params[:supplier_id]), {:include_blank => true, :class => "select2 fullwidth"}) .six.columns - = label_tag nil, t(:reports_customers_cycle) + = label_tag nil, t(:report_customers_cycle) = select_tag(:order_cycle_id, options_for_select(report_order_cycle_options(@order_cycles), params[:order_cycle_id]), {:include_blank => true, :class => "select2 fullwidth"}) - = label_tag nil, t(:reports_customers_type) + = label_tag nil, t(:report_customers_type) = select_tag(:report_type, options_for_select(@report_types, @report_type)) %br @@ -44,4 +44,3 @@ - if @report.table.empty? %tr %td{:colspan => "2"}= t(:none) - diff --git a/app/views/spree/admin/reports/order_cycle_management.html.haml b/app/views/spree/admin/reports/order_cycle_management.html.haml index 09ac6f76bb..0b32eabe78 100644 --- a/app/views/spree/admin/reports/order_cycle_management.html.haml +++ b/app/views/spree/admin/reports/order_cycle_management.html.haml @@ -6,7 +6,7 @@ .omega.fourteen.columns= f.collection_select(:distributor_id_in, @distributors, :id, :name, {}, {class: "select2 fullwidth", multiple: true}) .row - .alpha.two.columns= label_tag nil, t(:reports_customers_cycle) + .alpha.two.columns= label_tag nil, t(:report_customers_cycle) .omega.fourteen.columns = f.select(:order_cycle_id_in, report_order_cycle_options(@order_cycles), {selected: params[:q][:order_cycle_id_in]}, {class: "select2 fullwidth", multiple: true}) diff --git a/app/views/spree/admin/reports/orders_and_fulfillment.html.haml b/app/views/spree/admin/reports/orders_and_fulfillment.html.haml index 15ad6458cd..5bda882108 100644 --- a/app/views/spree/admin/reports/orders_and_fulfillment.html.haml +++ b/app/views/spree/admin/reports/orders_and_fulfillment.html.haml @@ -10,7 +10,7 @@ .omega.fourteen.columns= select_tag(:supplier_id_in, options_from_collection_for_select(@suppliers, :id, :name, params[:supplier_id_in]), {class: "select2 fullwidth", multiple: true}) .row - .alpha.two.columns= label_tag nil, t(:reports_customers_cycle) + .alpha.two.columns= label_tag nil, t(:report_customers_cycle) .omega.fourteen.columns = f.select(:order_cycle_id_in, report_order_cycle_options(@order_cycles), {selected: params[:q][:order_cycle_id_in]}, {class: "select2 fullwidth", multiple: true}) diff --git a/app/views/spree/admin/reports/products_and_inventory.html.haml b/app/views/spree/admin/reports/products_and_inventory.html.haml index b1c11918ce..40c4fbfccf 100644 --- a/app/views/spree/admin/reports/products_and_inventory.html.haml +++ b/app/views/spree/admin/reports/products_and_inventory.html.haml @@ -7,14 +7,14 @@ options_from_collection_for_select(@distributors, :id, :name, params[:distributor_id]), {:include_blank => true, :class => "select2 fullwidth"}) - + .four.columns - = label_tag nil, t(:reports_customers_supplier) + = label_tag nil, t(:report_customers_supplier) = select_tag(:supplier_id, options_from_collection_for_select(@suppliers, :id, :name, params[:supplier_id]), {:include_blank => true, :class => "select2 fullwidth"}) - + .six.columns = label_tag nil, t(:report_order_cycle) = select_tag(:order_cycle_id, diff --git a/app/views/spree/admin/shared/_hubs_sidebar.html.haml b/app/views/spree/admin/shared/_hubs_sidebar.html.haml index 9bc54be829..75ef9bb32f 100644 --- a/app/views/spree/admin/shared/_hubs_sidebar.html.haml +++ b/app/views/spree/admin/shared/_hubs_sidebar.html.haml @@ -2,7 +2,8 @@ - hubs_color = 'red' if (controller.action_name == 'create' || controller.action_name == 'update') && @object.errors.full_messages.include?(t(:hub_sidebar_at_least)) .sidebar_item.omega.four.columns#hubs .four.columns.alpha.header{ class: "#{hubs_color}" } - %span.four.columns.alpha.centered t(:hub_sidebar_hubs) + %span.four.columns.alpha.centered + = t(:hub_sidebar_hubs) .four.columns.alpha.list{ class: "#{hubs_color}" } - if @hubs.count > 0 = hidden_field klass, :distributor_ids, :multiple => true, value: nil @@ -18,9 +19,9 @@ - else .four.columns.alpha.list-item %span.three.columns.alpha - t(:hub_sidebar_none_available) + = t(:hub_sidebar_none_available) %span.one.column.omega %span.icon-remove-sign %a.four.columns.alpha.button{ href: "#{main_app.admin_enterprises_path}", class: "#{hubs_color}" } - t(:hub_sidebar_manage) + = t(:hub_sidebar_manage) %span.icon-arrow-right diff --git a/config/locales/en.yml b/config/locales/en.yml index c4ea55c3c4..477c83cc5d 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -906,9 +906,9 @@ Please follow the instructions there to make your enterprise visible on the Open hub_sidebar_red: "red" shop_trial_in_progress: "Your shopfront trial expires in #{remaining_trial_days(enterprise)}." #FIXME shop_trial_expired: "Good news! We have decided to extend shopfront trials until further notice (probably around March 2015)." #FIXME - reports_customers_distributor: "Distributor" - reports_customers_supplier: "Supplier" - reports_customers_cycle: "Order Cycle" + report_customers_distributor: "Distributor" + report_customers_supplier: "Supplier" + report_customers_cycle: "Order Cycle" report_customers_type: "Report Type" report_customers_csv: "Download as csv" report_customers_header: "orders header" From 79ad05d405bdd559c09145c0e3e191aa36a506e3 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Wed, 23 Mar 2016 10:01:04 +1100 Subject: [PATCH 39/40] i18n group image help text --- .../admin/enterprise_groups/_form_images.html.haml | 13 ++++++------- config/locales/en.yml | 3 +-- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/app/views/admin/enterprise_groups/_form_images.html.haml b/app/views/admin/enterprise_groups/_form_images.html.haml index ba40a4c849..24bfad3bf0 100644 --- a/app/views/admin/enterprise_groups/_form_images.html.haml +++ b/app/views/admin/enterprise_groups/_form_images.html.haml @@ -3,18 +3,17 @@ = t 'admin_entreprise_groups_images' .row .alpha.three.columns - = f.label :logo, 'ofn-with-tip' => 'This is the logo for the group' - %div{'ofn-with-tip' => 'This is the logo for the group'} - %a What's this? + = f.label :logo, 'ofn-with-tip' => t('admin_entreprise_groups_data_powertip_logo') + %div{'ofn-with-tip' => t('admin_entreprise_groups_data_powertip_logo')} + %a= t 'admin.whats_this' .omega.eight.columns = image_tag @object.logo.url if @object.logo.present? = f.file_field :logo .row .alpha.three.columns - = f.label :promo_image, class: 'with-tip', 'data-powertip' => t(:admin_entreprise_groups_data_powertip_promo_image) - .with-tip{'data-powertip' => t(:admin_entreprise_groups_data_powertip_promo_image_tip)} - %a - = t 'admin.whats_this' + = f.label :promo_image, 'ofn-with-tip' => t(:admin_entreprise_groups_data_powertip_promo_image) + %div{'ofn-with-tip' => t('admin_entreprise_groups_data_powertip_promo_image')} + %a= t 'admin.whats_this' .omega.eight.columns = image_tag @object.promo_image.url if @object.promo_image.present? = f.file_field :promo_image diff --git a/config/locales/en.yml b/config/locales/en.yml index 477c83cc5d..da0948dece 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -772,9 +772,8 @@ Please follow the instructions there to make your enterprise visible on the Open admin_entreprise_groups_entreprise: "Enterprises" admin_entreprise_groups_primary_details: "Primary Details" admin_entreprise_groups_data_powertip: "The primary user responsible for this group." - admin_entreprise_groups_data_powertip_logo: "This is the logo" + admin_entreprise_groups_data_powertip_logo: "This is the logo for the group" admin_entreprise_groups_data_powertip_promo_image: "This image is displayed at the top of the Group profile" - admin_entreprise_groups_data_powertip_promo_image_tip: "This image is displayed at the top of the Group profile" admin_entreprise_groups_about: "About" admin_entreprise_groups_images: "Images" admin_entreprise_groups_contact: "Contact" From 31302fb93013894d07eb6d45f17741db9f45803c Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Wed, 23 Mar 2016 17:57:22 +1100 Subject: [PATCH 40/40] Translate unsaved products message correctly --- .../javascripts/admin/bulk_product_update.js.coffee | 10 +++++----- config/locales/en.yml | 5 ++--- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/app/assets/javascripts/admin/bulk_product_update.js.coffee b/app/assets/javascripts/admin/bulk_product_update.js.coffee index cb337c4c47..3d565f703a 100644 --- a/app/assets/javascripts/admin/bulk_product_update.js.coffee +++ b/app/assets/javascripts/admin/bulk_product_update.js.coffee @@ -265,11 +265,11 @@ angular.module("ofn.admin").controller "AdminProductEditCtrl", ($scope, $timeout $scope.displayDirtyProducts = -> - if DirtyProducts.count() > 0 - message = if DirtyProducts.count() == 1 then t("one_product") else DirtyProducts.count() + t("products") - StatusMessage.display 'notice', t("changes_to") + "#{message}" + t("remain_unsaved.") - else - StatusMessage.clear() + count = DirtyProducts.count() + switch count + when 0 then StatusMessage.clear() + when 1 then StatusMessage.display 'notice', t("one_product_unsaved") + else StatusMessage.display 'notice', t("products_unsaved", n: count) filterSubmitProducts = (productsToFilter) -> diff --git a/config/locales/en.yml b/config/locales/en.yml index da0948dece..2656fe91c9 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -938,9 +938,8 @@ Please follow the instructions there to make your enterprise visible on the Open success: "success" failure: "failure" unsaved_changes_confirmation: "Unsaved changes will be lost. Continue anyway?" - one_product: "one product" - changes_to: "Changes to" - remain_unsaved: "remain unsaced" + one_product_unsaved: "Changes to one product remain unsaved." + products_unsaved: "Changes to %{n} products remain unsaved." add_manager: "Add a manager" is_already_manager: "is already a manager!" no_change_to_save: " No change to save"