- if defined?(users.total_pages)
= will_paginate users, :renderer => BootstrapPagination::Rails, :previous_label => raw(''), :next_label => raw('')
%table.table.table-striped
%thead
%tr
- if defined?(show_sip_accountable) && show_sip_accountable
%th= sortable :sip_accountable_id, t('sip_accounts.index.sip_accountable')
%th
%span.hidden-phone
= t('sip_accounts.index.online')
%th= sortable :caller_name, t('sip_accounts.index.caller_name')
%th
%span.hidden-phone
= t('sip_accounts.index.phone_numbers')
- if sip_accounts.map{ |sip_account| sip_account.phone_sip_accounts.any? }.include?(true)
%th
%span.hidden-phone
= t('phones.name')
%tbody
- for sip_account in sip_accounts
%tr{:class => (sip_account.registration ? '' : 'warning')}
- if defined?(show_sip_accountable) && show_sip_accountable
%td
= sip_account.sip_accountable
%td
- if sip_account.registration
%i.icon-ok
- else
%i.icon-ban-circle
%td
= sip_account.caller_name
- phone_numbers = sip_account.phone_numbers
%td
- if sip_account.phone_numbers.count > 0
= render 'phone_numbers/listing', :phone_numbers => sip_account.phone_numbers.order(:position)
- if sip_accounts.map{ |sip_account| sip_account.phone_sip_accounts.any? }.include?(true)
%td
%span.hidden-phone
- sip_account.phones.each do |phone|
= link_to phone.to_s, method( :"#{phone.phoneable_type.underscore}_phone_path" ).( phone.phoneable_id, phone )
=render :partial => 'shared/index_view_edit_destroy_part', :locals => {:parent => sip_account.sip_accountable, :child => sip_account}