internetee/registry

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

Summary

Maintainability
Test Coverage
- content_for :actions do
  = link_to(t(:edit), edit_admin_bank_transaction_path(@bank_transaction), class: 'btn btn-primary')
  = link_to(t('back_to_bank_statement'), admin_bank_statement_path(@bank_transaction.bank_statement), class: 'btn btn-default')
= render 'shared/title', name: t(:bank_transaction)
= render 'shared/full_errors', object: @bank_transaction
%row
  .col-md-12
.panel.panel-default
  .panel-heading
    %h3.panel-title= t(:details)
  .panel-body
    %dl.dl-horizontal
      %dt= t(:document_no)
      %dd= @bank_transaction.document_no

      %dt= t(:status)
      - c = @bank_transaction.binded? ? 'text-success' : 'text-danger'
      %dd{class: c}= @bank_transaction.binded? ? t(:binded) : t(:not_binded)

      %dt= t(:bank_reference)
      %dd= @bank_transaction.bank_reference

      %dt= t('iban').upcase
      %dd= @bank_transaction.iban

      %dt= t(:buyer_bank_code)
      %dd= @bank_transaction.buyer_bank_code

      %dt= t(:buyer_iban)
      %dd= @bank_transaction.buyer_iban

      %dt= t(:buyer_name)
      %dd= @bank_transaction.buyer_name

      %dt= t(:description)
      %dd= @bank_transaction.description

      %dt= t(:sum)
      %dd= currency(@bank_transaction.sum)

      %dt= t(:currency)
      %dd= @bank_transaction.currency

      %dt= BankTransaction.human_attribute_name :reference_no
      %dd= @bank_transaction.reference_no

      %dt= t(:paid_at)
      %dd= l(@bank_transaction.paid_at, format: :date_long)

      - if @bank_transaction.binded?
        %dt= t(:binded_invoice)
        %dd= link_to(@bank_transaction.binded_invoice, admin_invoice_path(@bank_transaction.binded_invoice))

    - unless @bank_transaction.binded?
      = form_for([:admin, @bank_transaction], url: {action: :bind}, html: { class: 'form-inline' }) do |f|
        .form-group
          %dl.dl-horizontal
            %dt{style: 'padding-top: 5px'}= t(:binded_invoice)
            %dd
              = text_field_tag(:invoice_no, params[:invoice_no], class: 'form-control')
              = button_tag(t(:bind_manually), class: 'btn btn-primary')