From af4003816004aba3f74683a063757b1c76a03605 Mon Sep 17 00:00:00 2001 From: Martin Lensment Date: Tue, 7 Jul 2015 11:38:03 +0300 Subject: [PATCH] Add sorting feature to activities #2691 --- app/views/registrar/account_activities/index.haml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/app/views/registrar/account_activities/index.haml b/app/views/registrar/account_activities/index.haml index dd4cd254e..92f2d8e98 100644 --- a/app/views/registrar/account_activities/index.haml +++ b/app/views/registrar/account_activities/index.haml @@ -40,21 +40,18 @@ %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', t(:receipt_date)) - %th{class: 'col-xs-2'} - = sort_link(@q, 'invoice_id', t(:invoice)) %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) - - if x.invoice - %td= link_to(x.invoice, [:registrar, x.invoice]) - - else - %td - - 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