summaryrefslogtreecommitdiff
path: root/app/views/switchboard_entries
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-03-10 10:50:49 +0100
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-03-10 12:07:40 +0100
commitf0932e38b890b08397020a5994ddde7110d7b8db (patch)
tree38b93326fc394fb62e1fcadbfb219a11fff986aa /app/views/switchboard_entries
parentc563859fa60defd2b40f17a0b7cf1c4912f72792 (diff)
refactoring
Diffstat (limited to 'app/views/switchboard_entries')
-rw-r--r--app/views/switchboard_entries/_switchboard_entry.html.haml26
1 files changed, 26 insertions, 0 deletions
diff --git a/app/views/switchboard_entries/_switchboard_entry.html.haml b/app/views/switchboard_entries/_switchboard_entry.html.haml
new file mode 100644
index 0000000..2902a83
--- /dev/null
+++ b/app/views/switchboard_entries/_switchboard_entry.html.haml
@@ -0,0 +1,26 @@
+%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(:mini).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)
+ %span{:class => "label #{(switchboard_entry.sip_account.registration ? '' : 'label-inverse')}"}
+ - if !switchboard_entry.sip_account.registration
+ %i.icon-ban-circle.icon-white
+ - if switchboard_entry.sip_account.phone_numbers.count > 1
+ - phone_numbers = []
+ - switchboard_entry.sip_account.phone_numbers.order(:position).each do |phone_number|
+ - if phone_number.number.length < 6
+ - phone_numbers << phone_number
+ - if phone_numbers.size == 0
+ - phone_numbers = switchboard_entry.sip_account.phone_numbers.order(:position)
+ - else
+ - phone_numbers = switchboard_entry.sip_account.phone_numbers
+ = render 'phone_numbers/listing', :phone_numbers => phone_numbers