diff --git a/app/views/admin/account_activities/_search_form.html.erb b/app/views/admin/account_activities/_search_form.html.erb new file mode 100644 index 000000000..bf353a936 --- /dev/null +++ b/app/views/admin/account_activities/_search_form.html.erb @@ -0,0 +1,65 @@ +
+
+ <%= search_form_for @q, url: [:admin, :account_activities], html: { style: 'margin-bottom: 0;' } do |f| %> +
+
+
+ <%= f.label t(:registrar_name) %> + <%= f.select :account_registrar_id_in, Registrar.all.map { |x| [x, x.id] }, {}, class: 'form-control js-combobox', placeholder: t(:choose), multiple: true %> +
+
+
+ +
+
+
+ <%= f.label t(:activity_type) %> + <%= f.select :activity_type_in, AccountActivity.types_for_select, {}, class: 'form-control js-combobox', placeholder: t(:choose), multiple: true %> +
+
+ +
+
+ <%= f.label t(:description) %> + <%= f.search_field :description_cont, class: 'form-control', placeholder: t(:description), autocomplete: 'off' %> +
+
+
+ +
+
+
+ <%= f.label t(:receipt_date_from) %> + <%= f.search_field :created_at_gteq, value: params[:q][:created_at_gteq], class: 'form-control js-datepicker', placeholder: t(:receipt_date_from) %> +
+
+ +
+
+ <%= f.label t(:receipt_date_until) %> + <%= f.search_field :created_at_lteq, value: params[:q][:created_at_lteq], class: 'form-control js-datepicker', placeholder: t(:receipt_date_until) %> +
+
+ +
+
+ <%= label_tag t(:results_per_page) %> + <%= text_field_tag :results_per_page, params[:results_per_page], class: 'form-control', placeholder: t(:results_per_page) %> +
+
+ +
+ + <%= button_tag t('.download_btn'), + formaction: admin_account_activities_path(format: 'csv'), + class: 'btn btn-default' %> + <%= link_to(t('.reset_btn'), admin_account_activities_path, class: 'btn btn-default') %> +
+
+ <% end %> +
+
diff --git a/app/views/admin/account_activities/index.haml b/app/views/admin/account_activities/index.haml index 1f201f255..2e1d57dc6 100644 --- a/app/views/admin/account_activities/index.haml +++ b/app/views/admin/account_activities/index.haml @@ -1,44 +1,6 @@ -- content_for :actions do - = link_to(t(:export_csv), url_for(params.merge(format: 'csv')), class: 'btn btn-default') - = render 'shared/title', name: t(:account_activities) += render 'search_form' -.row - .col-md-12 - = search_form_for @q, url: [:admin, :account_activities], html: { style: 'margin-bottom: 0;' } do |f| - .row - .col-md-12 - .form-group - = f.label t(:registrar_name) - = f.select :account_registrar_id_in, Registrar.all.map { |x| [x, x.id] }, {}, class: 'form-control js-combobox', placeholder: t(:choose), multiple: true - .row - .col-md-6 - .form-group - = f.label t(:activity_type) - = f.select :activity_type_in, AccountActivity.types_for_select, {}, class: 'form-control js-combobox', placeholder: t(:choose), multiple: true - .col-md-6 - .form-group - = f.label t(:description) - = f.search_field :description_cont, class: 'form-control', placeholder: t(:description), autocomplete: 'off' - .row - .col-md-3 - .form-group - = f.label t(:receipt_date_from) - = f.search_field :created_at_gteq, value: params[:q][:created_at_gteq], class: 'form-control js-datepicker', placeholder: t(:receipt_date_from) - .col-md-3 - .form-group - = f.label t(:receipt_date_until) - = f.search_field :created_at_lteq, value: params[:q][:created_at_lteq], class: 'form-control js-datepicker', placeholder: t(:receipt_date_until) - .col-md-3 - .form-group - = label_tag t(:results_per_page) - = text_field_tag :results_per_page, params[:results_per_page], class: 'form-control', placeholder: t(:results_per_page) - .col-md-3{style: 'padding-top: 25px;'} - %button.btn.btn-default.search -   - %span.glyphicon.glyphicon-search -   - = link_to(t('.reset_btn'), admin_account_activities_path, class: 'btn btn-default') .row .col-md-3 .col-md-3 diff --git a/app/views/registrar/account_activities/_search_form.html.erb b/app/views/registrar/account_activities/_search_form.html.erb new file mode 100644 index 000000000..92a715096 --- /dev/null +++ b/app/views/registrar/account_activities/_search_form.html.erb @@ -0,0 +1,49 @@ +
+
+ <%= search_form_for @q, url: [:registrar, :account_activities], html: { style: 'margin-bottom: 0;' } do |f| %> +
+
+
+ <%= f.label t(:activity_type) %> + <%= f.select :activity_type_in, AccountActivity.types_for_select, {}, class: 'form-control js-combobox', placeholder: t(:choose), multiple: true %> +
+
+ +
+
+ <%= f.label t(:description) %> + <%= f.search_field :description_cont, class: 'form-control', placeholder: t(:description), autocomplete: 'off' %> +
+
+
+ +
+
+
+ <%= f.label t(:receipt_date_from) %> + <%= f.search_field :created_at_gteq, value: params[:q][:created_at_gteq], class: 'form-control js-datepicker', placeholder: t(:receipt_date_from) %> +
+
+ +
+
+ <%= f.label t(:receipt_date_until) %> + <%= f.search_field :created_at_lteq, value: params[:q][:created_at_lteq], class: 'form-control js-datepicker', placeholder: t(:receipt_date_until) %> +
+
+ +
+ + <%= button_tag t('.download_btn'), + formaction: registrar_account_activities_path(format: 'csv'), + class: 'btn btn-default' %> + <%= link_to(t('.reset_btn'), registrar_account_activities_path, class: 'btn btn-default') %> +
+
+ <% end %> +
+
diff --git a/app/views/registrar/account_activities/index.haml b/app/views/registrar/account_activities/index.haml deleted file mode 100644 index 3cc6b34e4..000000000 --- a/app/views/registrar/account_activities/index.haml +++ /dev/null @@ -1,61 +0,0 @@ -- content_for :actions do - = link_to(t(:back_to_billing), registrar_invoices_path, class: 'btn btn-default') - = link_to(t(:export_csv), url_for(params.merge(format: 'csv')), class: 'btn btn-default') - -= render 'shared/title', name: t(:account_activity) - -.row - .col-md-12 - = search_form_for @q, url: [:registrar, :account_activities], html: { style: 'margin-bottom: 0;' } do |f| - .row - .col-md-6 - .form-group - = f.label t(:activity_type) - = f.select :activity_type_in, AccountActivity.types_for_select, {}, class: 'form-control js-combobox', placeholder: t(:choose), multiple: true - .col-md-6 - .form-group - = f.label t(:description) - = f.search_field :description_cont, class: 'form-control', placeholder: t(:description), autocomplete: 'off' - .row - .col-md-3 - .form-group - = f.label t(:receipt_date_from) - = f.search_field :created_at_gteq, value: params[:q][:created_at_gteq], class: 'form-control js-datepicker', placeholder: t(:receipt_date_from) - .col-md-3 - .form-group - = f.label t(:receipt_date_until) - = f.search_field :created_at_lteq, value: params[:q][:created_at_lteq], class: 'form-control js-datepicker', placeholder: t(:receipt_date_until) - .col-md-6{style: 'padding-top: 25px;'} - %button.btn.btn-default -   - %span.glyphicon.glyphicon-search -   - = link_to(t('.reset_btn'), registrar_account_activities_path, class: 'btn btn-default') -%hr - -.row - .col-md-12 - .table-responsive - %table.table.table-hover.table-condensed - %thead - %tr - %th{class: 'col-xs-5'} - = sort_link(@q, 'description') - %th{class: 'col-xs-2'} - = sort_link(@q, 'activity_type') - %th{class: 'col-xs-3'} - = sort_link(@q, 'created_at', AccountActivity.human_attribute_name(:created_at)) - %th{class: 'col-xs-2'} - = sort_link(@q, 'sum') - %tbody - - @account_activities.each do |x| - %tr - %td= x.description.present? ? x.description : '-' - %td= x.activity_type ? t(x.activity_type) : '' - %td= l(x.created_at) - - c = x.sum > 0.0 ? 'text-success' : 'text-danger' - - s = x.sum > 0.0 ? "+#{x.sum} #{x.currency}" : "#{x.sum} #{x.currency}" - %td{class: c}= s -.row - .col-md-12 - = paginate @account_activities diff --git a/app/views/registrar/account_activities/index.html.erb b/app/views/registrar/account_activities/index.html.erb new file mode 100644 index 000000000..c5eaf2063 --- /dev/null +++ b/app/views/registrar/account_activities/index.html.erb @@ -0,0 +1,60 @@ +<% content_for :actions do %> + <%= link_to(t(:back_to_billing), registrar_invoices_path, class: 'btn btn-default') %> +<% end %> + +<%= render 'shared/title', name: t(:account_activity) %> + +<%= render 'search_form' %> + +
+ +
+
+
+ + + + + + + + + + + <% @account_activities.each do |x| %> + + + + + <% c = x.sum > 0.0 ? 'text-success' : 'text-danger' %> + <% s = x.sum > 0.0 ? "+#{x.sum} #{x.currency}" : "#{x.sum} #{x.currency}" %> + + + <% end %> + +
+ <%= sort_link(@q, 'description') %> + + <%= sort_link(@q, 'activity_type') %> + + <%= sort_link(@q, 'created_at', AccountActivity.human_attribute_name(:created_at)) %> + + <%= sort_link(@q, 'sum') %> +
+ <%= x.description.present? ? x.description : '-' %> + + <%= x.activity_type ? t(x.activity_type) : '' %> + + <%= l(x.created_at) %> + + <%= s %> +
+
+
+
+ +
+
+ <%= paginate @account_activities %> +
+
diff --git a/config/locales/admin/account_activities.en.yml b/config/locales/admin/account_activities.en.yml index 2e91e7a8f..e7cc80d65 100644 --- a/config/locales/admin/account_activities.en.yml +++ b/config/locales/admin/account_activities.en.yml @@ -1,5 +1,6 @@ en: admin: account_activities: - index: + search_form: + download_btn: Download CSV reset_btn: Reset diff --git a/config/locales/en.yml b/config/locales/en.yml index e57723cd1..5742398f7 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -592,7 +592,6 @@ en: receipt_date_from: 'Receipt date from' receipt_date_until: 'Receipt date until' add_credit: 'Add credit' - export_csv: 'Export CSV' invalid_yaml: 'Invalid YAML' reserved_pw: 'Reserved pw' no_transfers_found: 'No transfers found' diff --git a/config/locales/registrar/account_activities.en.yml b/config/locales/registrar/account_activities.en.yml index 27d0150d6..374760065 100644 --- a/config/locales/registrar/account_activities.en.yml +++ b/config/locales/registrar/account_activities.en.yml @@ -1,5 +1,6 @@ en: registrar: account_activities: - index: + search_form: + download_btn: Download CSV reset_btn: Reset