internetee-registry/app/views/admin/invoices/index.haml

36 lines
1.2 KiB
Text

- content_for :actions do
= link_to(t(:add), new_admin_invoice_path, class: 'btn btn-primary')
= render 'shared/title', name: t(:invoices)
.row
.col-md-12
.table-responsive
%table.table.table-hover.table-bordered.table-condensed
%thead
%tr
%th{class: 'col-xs-3'}
= sort_link(@q, 'invoice')
%th{class: 'col-xs-3'}
= sort_link(@q, 'buyer')
%th{class: 'col-xs-3'}
= sort_link(@q, 'due_date')
%th{class: 'col-xs-3'}
= sort_link(@q, 'receipt_date')
%tbody
- @invoices.each do |x|
%tr
%td= link_to(x, [:admin, x])
%td= link_to(x.buyer_name, admin_registrar_path(x.buyer_id))
- if x.cancelled?
%td.text-grey= t(:cancelled)
- else
%td= l(x.due_date, format: :date_long)
- if x.binded?
%td= l(x.receipt_date, format: :date_long)
- elsif x.cancelled?
%td.text-grey= t(:cancelled)
- else
%td.text-danger= t(:unpaid)
.row
.col-md-12
= paginate @invoices