summaryrefslogtreecommitdiff
path: root/app/views/fax_accounts/_index_core.html.haml
blob: d694f8fbdfa89ec267bf7125f9f3d9e20302529a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
%table.table.table-striped
  %thead
    %tr
      %th
        %span.hidden-phone
          = t('fax_accounts.index.name')
      %th
        = t('fax_accounts.index.phone_numbers')
        %br
        = t('fax_accounts.index.station_id')
      %th
        %span.hidden-phone
          = t('fax_accounts.index.received') 
          = '/'
          = t('fax_accounts.index.sent')
          %br
          %small
            = t('fax_accounts.index.last_update')

  %tbody
    - for fax_account in fax_accounts
      %tr
        %td
          %span.hidden-phone
            =fax_account.name
        %td
          =render 'phone_numbers/listing', :phone_numbers => fax_account.phone_numbers.order(:number)
          %br
          = truncate(fax_account.station_id, :length => 20)
        %td
          - inbound_documents = fax_account.fax_documents.where(:inbound => true)
          - outbound_documents = fax_account.fax_documents.where(:inbound => [false, nil])
          = link_to inbound_documents.count, fax_account_fax_documents_path(fax_account, :anchor => "fax_document_#{inbound_documents.first.try(:id)}")
          = '/'
          = link_to outbound_documents.count, fax_account_fax_documents_path(fax_account, :anchor => "fax_document_#{outbound_documents.first.try(:id)}")
          - if fax_account.fax_documents.any?
            %br
            %small
              = time_ago_in_words(fax_account.fax_documents.order(:updated_at).last.updated_at)
        %td
          - if can?(:new, FaxDocument, :fax_account_id => fax_account.id)
            %a.btn.btn-mini.btn-primary{:href => new_fax_account_fax_document_path(fax_account) }
              %i.icon-print.icon-white
              %span.hidden-phone
                =t('fax_accounts.index.send_a_fax')


        =render :partial => 'shared/index_view_edit_destroy_part', :locals => {:parent => fax_account.fax_accountable, :child => fax_account}