mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 17:59:47 +02:00
107279984-credit_balance_views
This commit is contained in:
parent
9fbeeb70a2
commit
0fd682c6b9
5 changed files with 19 additions and 3 deletions
|
@ -6,7 +6,7 @@ class Admin::RegistrarsController < AdminController
|
|||
end
|
||||
|
||||
def index
|
||||
@q = Registrar.ordered.search(params[:q])
|
||||
@q = Registrar.joins(:accounts).ordered.search(params[:q])
|
||||
@registrars = @q.result.page(params[:page])
|
||||
end
|
||||
|
||||
|
|
|
@ -55,6 +55,7 @@
|
|||
%th{class: 'col-xs-2'}
|
||||
= sort_link(@q, 'sum')
|
||||
%tbody
|
||||
-total = 0
|
||||
- @account_activities.each do |x|
|
||||
%tr
|
||||
%td= link_to(x.account.registrar.try(:code), admin_registrar_path(x.account.registrar))
|
||||
|
@ -63,7 +64,15 @@
|
|||
%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}"
|
||||
-total += x.sum
|
||||
%td{class: c}= s
|
||||
- if @account_activities.count > 0
|
||||
%tr
|
||||
%td
|
||||
%td
|
||||
%td
|
||||
%td{class: 'text-right'}= t(:total)
|
||||
%td{class: 'text-success'}= total > 0 ? "+#{total} EUR" : "#{total} EUR"
|
||||
.row
|
||||
.col-md-12
|
||||
= paginate @account_activities
|
||||
|
|
|
@ -8,15 +8,18 @@
|
|||
%table.table.table-hover.table-bordered.table-condensed
|
||||
%thead
|
||||
%tr
|
||||
%th{class: 'col-xs-6'}
|
||||
%th{class: 'col-xs-4'}
|
||||
= sort_link(@q, 'name')
|
||||
%th{class: 'col-xs-6'}
|
||||
%th{class: 'col-xs-4'}
|
||||
= sort_link(@q, 'reg_no', t(:reg_no))
|
||||
%th{class: 'col-xs-4'}
|
||||
= t(:credit_balance)
|
||||
%tbody
|
||||
- @registrars.each do |x|
|
||||
%tr
|
||||
%td= link_to(x, [:admin, x])
|
||||
%td= x.reg_no
|
||||
%td= "#{x.balance}"
|
||||
.row
|
||||
.col-md-12
|
||||
= paginate @registrars
|
||||
|
|
|
@ -32,6 +32,9 @@
|
|||
%dt= t(:id)
|
||||
%dd= @registrar.code
|
||||
|
||||
%dt= t(:credit_balance)
|
||||
%dd= @registrar.balance
|
||||
|
||||
.col-md-6
|
||||
.panel.panel-default
|
||||
.panel-heading
|
||||
|
|
|
@ -351,6 +351,7 @@ en:
|
|||
status: 'Status'
|
||||
eedirekt: 'EEDirekt'
|
||||
contact: 'Contact'
|
||||
credit_balance: 'Credit balance'
|
||||
|
||||
domain_transfer_requested: 'Domain transfer requested!'
|
||||
domain_transfer_approved: 'Domain transfer approved!'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue