diff --git a/app/controllers/concerns/data_table.rb b/app/controllers/concerns/data_table.rb index 4c80095..0b67007 100644 --- a/app/controllers/concerns/data_table.rb +++ b/app/controllers/concerns/data_table.rb @@ -31,11 +31,11 @@ module DataTable def selection_to_json(user, selection) { data: selection.map { |transaction| { + time: transaction.created_at, amount: transaction.signed_amount_for(user), + peer: transaction.peer_of(user).try(:name), issuer: transaction.issuer.name, message: transaction.message, - peer: transaction.peer_of(user).try(:name), - time: transaction.created_at } } } end diff --git a/app/views/users/show.html.haml b/app/views/users/show.html.haml index 90d0e74..0a16fc1 100644 --- a/app/views/users/show.html.haml +++ b/app/views/users/show.html.haml @@ -2,26 +2,26 @@ %table#transactions.display.responsive.no-wrap{data: { source: user_path(@user) }} %thead %tr + %th Time %th Amount + %th Peer %th Issuer %th Message - %th Peer - %th Time %tr + %td.bound.input-listen + %input.lower-bound{type: 'date', placeholder: 'after'} + = "<= Time <=" + %input.upper-bound{type: 'date', placeholder: 'before'} %td.bound.input-listen %input.lower-bound{type: 'number', placeholder: 'lower', class: 'pure-u-1-5'} = "<= Amount <=" %input.upper-bound{type: 'number', placeholder: 'upper', class: 'pure-u-1-5'} + %td.input-listen + %input{type: 'text', placeholder: 'Filter on Peer'} %td.input-listen %input{type: 'text', placeholder: 'Filter on Issuer'} %td.input-listen %input{type: 'text', placeholder: 'Filter on Message'} - %td.input-listen - %input{type: 'text', placeholder: 'Filter on Peer'} - %td.bound.input-listen - %input.lower-bound{type: 'date', placeholder: 'after'} - = "<= Time <=" - %input.upper-bound{type: 'date', placeholder: 'before'} %tbody :javascript @@ -33,14 +33,14 @@ ordering: false, ajax: $('#transactions').data('source'), pagingType: 'full_numbers', + autoWidth: false, columns: [ + { data: 'time', name: 'Time' }, { data: 'amount', name: 'Amount' }, + { data: 'peer', name: 'Peer' }, { data: 'issuer', name: 'Issuer' }, { data: 'message', name: 'Message' }, - { data: 'peer', name: 'Peer' }, - { data: 'time', name: 'Time' } - ], - autoWidth: false + ] }); var tds = $('.input-listen');