summaryrefslogtreecommitdiff
path: root/app/views/switchboard_entries/_switchboard_entry.html.haml
blob: b2b6bff6859a5b62b47e56915aef2537700fadd1 (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
%li.span1{:id => "switchboard_entry_id_#{switchboard_entry.id}"}
  %div.thumbnail
    %a.thumbnail{:href => tenant_user_path(switchboard_entry.sip_account.sip_accountable.current_tenant, switchboard_entry.sip_account.sip_accountable)}
      - if switchboard_entry.sip_account.sip_accountable.image?
        = image_tag(switchboard_entry.sip_account.sip_accountable.image_url(:small).to_s, :class => 'img-rounded')
      - else
        - if switchboard_entry.sip_account.sip_accountable.male?
          = image_tag 'icons/user-male-16x.png', :class => 'img-rounded'
        - else
          = image_tag 'icons/user-female-16x.png', :class => 'img-rounded'
    %p
      %small
        = truncate(switchboard_entry.to_s, :length => 10)
        %br
        - if !switchboard_entry.sip_account.registration
          %span.label.label-inverse
            %i.icon-ban-circle.icon-white
        - else
          - if switchboard_entry.sip_account.call_legs(:where => ["HELD", "ACTIVE"]).size != 0
            %span.label.label-success
              %i.icon-user.icon-white    
          - if switchboard_entry.sip_account.call_legs(:where => ["RINGING"]).size != 0
            %span.label.label-info
              %i.icon-bell.icon-white
        - if switchboard_entry.sip_account.phone_numbers.any?
          %span.label
            = switchboard_entry.sip_account.phone_numbers.first.number