internetee/registry

View on GitHub
app/views/admin/bank_statements/show.haml

Summary

Maintainability
Test Coverage
- content_for :actions do
  = link_to(t(:bind_invoices), bind_invoices_admin_bank_statement_path,
    class: 'btn btn-primary', method: :post)
  = link_to(t(:back_to_bank_statements), admin_bank_statements_path, class: 'btn btn-default')
= render 'shared/title', name: t(:bank_statement)

%row
  .col-md-12
.panel.panel-default
  .panel-heading
    %h3.panel-title= t(:details)
  .panel-body
    %dl.dl-horizontal
      %dt= t(:bank_code)
      %dd= @bank_statement.bank_code

      %dt= t(:iban)
      %dd= @bank_statement.iban

      %dt= t(:status)
      - sc = 'text-success' if @bank_statement.fully_binded?
      - sc = 'text-warning' if @bank_statement.partially_binded?
      - sc = 'text-danger' if @bank_statement.not_binded?
      %dd{class: sc}= t(@bank_statement.status)

      - if @bank_statement.queried_at
        %dt= t(:queried_at)
        %dd= l(@bank_statement.queried_at)

      %dt= t(:created_at)
      %dd= l(@bank_statement.created_at)

.row
  .col-sm-6
    %h3.text-center-xs
      = t(:bank_transactions)
  .col-sm-6.text-right
    %h3.text-right.text-center-xs
      = link_to(t(:add), new_admin_bank_statement_bank_transaction_path(@bank_statement), class: 'btn btn-primary')
%hr
.row
  .col-md-12
    .table-responsive
      %table.table.table-hover.table-bordered.table-condensed
        %thead
          %tr
            %th{class: 'col-xs-3'}
              = sort_link(@q, 'paid_at')
            %th{class: 'col-xs-3'}
              = sort_link(@q, 'buyer_name')
            %th{class: 'col-xs-2'}
              = sort_link(@q, 'sum')
            %th{class: 'col-xs-2'}
              = sort_link(@q, 'currency')
            %th{class: 'col-xs-2'}
              = sort_link(@q, 'account_activity_id', t(:status))
        %tbody
          - @bank_transactions.each do |x|
            %tr
              %td= link_to(l(x.paid_at, format: :date_long), [:admin, x])
              %td= x.buyer_name
              %td= currency(x.sum)
              %td= x.currency
              - c = x.binded? ? 'text-success' : 'text-danger'
              %td{class: c}= x.binded? ? t(:binded) : t(:not_binded)
.row
  .col-md-12
    = paginate @bank_transactions