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
|
end
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@q = Registrar.ordered.search(params[:q])
|
@q = Registrar.joins(:accounts).ordered.search(params[:q])
|
||||||
@registrars = @q.result.page(params[:page])
|
@registrars = @q.result.page(params[:page])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -55,6 +55,7 @@
|
||||||
%th{class: 'col-xs-2'}
|
%th{class: 'col-xs-2'}
|
||||||
= sort_link(@q, 'sum')
|
= sort_link(@q, 'sum')
|
||||||
%tbody
|
%tbody
|
||||||
|
-total = 0
|
||||||
- @account_activities.each do |x|
|
- @account_activities.each do |x|
|
||||||
%tr
|
%tr
|
||||||
%td= link_to(x.account.registrar.try(:code), admin_registrar_path(x.account.registrar))
|
%td= link_to(x.account.registrar.try(:code), admin_registrar_path(x.account.registrar))
|
||||||
|
@ -63,7 +64,15 @@
|
||||||
%td= l(x.created_at)
|
%td= l(x.created_at)
|
||||||
- c = x.sum > 0.0 ? 'text-success' : 'text-danger'
|
- c = x.sum > 0.0 ? 'text-success' : 'text-danger'
|
||||||
- s = x.sum > 0.0 ? "+#{x.sum} #{x.currency}" : "#{x.sum} #{x.currency}"
|
- s = x.sum > 0.0 ? "+#{x.sum} #{x.currency}" : "#{x.sum} #{x.currency}"
|
||||||
|
-total += x.sum
|
||||||
%td{class: c}= s
|
%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
|
.row
|
||||||
.col-md-12
|
.col-md-12
|
||||||
= paginate @account_activities
|
= paginate @account_activities
|
||||||
|
|
|
@ -8,15 +8,18 @@
|
||||||
%table.table.table-hover.table-bordered.table-condensed
|
%table.table.table-hover.table-bordered.table-condensed
|
||||||
%thead
|
%thead
|
||||||
%tr
|
%tr
|
||||||
%th{class: 'col-xs-6'}
|
%th{class: 'col-xs-4'}
|
||||||
= sort_link(@q, 'name')
|
= sort_link(@q, 'name')
|
||||||
%th{class: 'col-xs-6'}
|
%th{class: 'col-xs-4'}
|
||||||
= sort_link(@q, 'reg_no', t(:reg_no))
|
= sort_link(@q, 'reg_no', t(:reg_no))
|
||||||
|
%th{class: 'col-xs-4'}
|
||||||
|
= t(:credit_balance)
|
||||||
%tbody
|
%tbody
|
||||||
- @registrars.each do |x|
|
- @registrars.each do |x|
|
||||||
%tr
|
%tr
|
||||||
%td= link_to(x, [:admin, x])
|
%td= link_to(x, [:admin, x])
|
||||||
%td= x.reg_no
|
%td= x.reg_no
|
||||||
|
%td= "#{x.balance}"
|
||||||
.row
|
.row
|
||||||
.col-md-12
|
.col-md-12
|
||||||
= paginate @registrars
|
= paginate @registrars
|
||||||
|
|
|
@ -32,6 +32,9 @@
|
||||||
%dt= t(:id)
|
%dt= t(:id)
|
||||||
%dd= @registrar.code
|
%dd= @registrar.code
|
||||||
|
|
||||||
|
%dt= t(:credit_balance)
|
||||||
|
%dd= @registrar.balance
|
||||||
|
|
||||||
.col-md-6
|
.col-md-6
|
||||||
.panel.panel-default
|
.panel.panel-default
|
||||||
.panel-heading
|
.panel-heading
|
||||||
|
|
|
@ -351,6 +351,7 @@ en:
|
||||||
status: 'Status'
|
status: 'Status'
|
||||||
eedirekt: 'EEDirekt'
|
eedirekt: 'EEDirekt'
|
||||||
contact: 'Contact'
|
contact: 'Contact'
|
||||||
|
credit_balance: 'Credit balance'
|
||||||
|
|
||||||
domain_transfer_requested: 'Domain transfer requested!'
|
domain_transfer_requested: 'Domain transfer requested!'
|
||||||
domain_transfer_approved: 'Domain transfer approved!'
|
domain_transfer_approved: 'Domain transfer approved!'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue