From d2ea3fc944a84a6fe3e639a507dabdc6cce06ace Mon Sep 17 00:00:00 2001 From: Artur Beljajev Date: Fri, 26 Jan 2018 01:32:38 +0200 Subject: [PATCH] Remove inline JS, extract translation --- app/views/registrar/account_activities/index.haml | 8 +------- app/views/registrar/contacts/index.haml | 8 +------- app/views/registrar/invoices/index.haml | 9 +-------- config/locales/en.yml | 1 - config/locales/registrar/account_activities.en.yml | 5 +++++ config/locales/registrar/contacts.en.yml | 3 +++ config/locales/registrar/invoices.en.yml | 5 +++++ 7 files changed, 16 insertions(+), 23 deletions(-) create mode 100644 config/locales/registrar/account_activities.en.yml create mode 100644 config/locales/registrar/invoices.en.yml diff --git a/app/views/registrar/account_activities/index.haml b/app/views/registrar/account_activities/index.haml index 4d8f2ff19..857f117d0 100644 --- a/app/views/registrar/account_activities/index.haml +++ b/app/views/registrar/account_activities/index.haml @@ -30,8 +30,7 @@   %span.glyphicon.glyphicon-search   - %button.btn.btn-default.js-reset-form - = t(:clear_fields) + = link_to(t('.reset_btn'), registrar_account_activities_path, class: 'btn btn-default') %hr .row @@ -60,8 +59,3 @@ .row .col-md-12 = paginate @account_activities - -:coffee - $(".js-reset-form").on "click", (e) -> - e.preventDefault(); - window.location = "#{registrar_account_activities_path}" diff --git a/app/views/registrar/contacts/index.haml b/app/views/registrar/contacts/index.haml index 5f5a667c0..518e6eccf 100644 --- a/app/views/registrar/contacts/index.haml +++ b/app/views/registrar/contacts/index.haml @@ -66,8 +66,7 @@   %span.glyphicon.glyphicon-search   - %button.btn.btn-default.js-reset-form - = t(:clear_fields) + = link_to(t('.reset_btn'), registrar_contacts_path, class: 'btn btn-default') .row .col-md-3 .btn-group{:role => "group"} @@ -119,8 +118,3 @@ .col-md-6.text-right .pagination = t(:result_count, count: @contacts.total_count) - -:coffee - $(".js-reset-form").on "click", (e) -> - e.preventDefault(); - window.location = "#{registrar_contacts_path}" diff --git a/app/views/registrar/invoices/index.haml b/app/views/registrar/invoices/index.haml index 64236d49d..b8c825c36 100644 --- a/app/views/registrar/invoices/index.haml +++ b/app/views/registrar/invoices/index.haml @@ -43,8 +43,7 @@   %span.glyphicon.glyphicon-search   - %button.btn.btn-default.js-reset-form - = t(:clear_fields) + = link_to(t('.reset_btn'), registrar_invoices_path, class: 'btn btn-default') %hr .row .col-md-12 @@ -72,9 +71,3 @@ .row .col-md-12 = paginate @invoices - -:coffee - $(".js-reset-form").on "click", (e) -> - e.preventDefault(); - window.location = "#{registrar_invoices_path}" - diff --git a/config/locales/en.yml b/config/locales/en.yml index dbf1ff54a..68eeb2010 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -417,7 +417,6 @@ en: attribute_is_invalid: 'Attribute is invalid: %{attribute}' request_successful: 'Request successful' choose: 'Choose...' - clear_fields: 'Clear fields' created_before: 'Created before' created_after: 'Created after' billing_address: 'Billing address' diff --git a/config/locales/registrar/account_activities.en.yml b/config/locales/registrar/account_activities.en.yml new file mode 100644 index 000000000..27d0150d6 --- /dev/null +++ b/config/locales/registrar/account_activities.en.yml @@ -0,0 +1,5 @@ +en: + registrar: + account_activities: + index: + reset_btn: Reset diff --git a/config/locales/registrar/contacts.en.yml b/config/locales/registrar/contacts.en.yml index 2a3f5ba3e..84afd481d 100644 --- a/config/locales/registrar/contacts.en.yml +++ b/config/locales/registrar/contacts.en.yml @@ -1,6 +1,9 @@ en: registrar: contacts: + index: + reset_btn: Reset + partials: domains: roles: Roles diff --git a/config/locales/registrar/invoices.en.yml b/config/locales/registrar/invoices.en.yml new file mode 100644 index 000000000..1e8ecaafc --- /dev/null +++ b/config/locales/registrar/invoices.en.yml @@ -0,0 +1,5 @@ +en: + registrar: + invoices: + index: + reset_btn: Reset