summaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-03-10 08:43:23 +0100
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-03-10 08:43:23 +0100
commit21d0843117c0962bd962fc50fccaf276a5b3067f (patch)
tree22745bde7f8b140e0a8fb15a09db0670afe2e0b7 /app/views
parent6374c0b3e38dfc74eb1b4a5a1fcc5229eacdcaf2 (diff)
Misc
Diffstat (limited to 'app/views')
-rw-r--r--app/views/switchboards/show.html.haml53
1 files changed, 43 insertions, 10 deletions
diff --git a/app/views/switchboards/show.html.haml b/app/views/switchboards/show.html.haml
index 746e180..b81980c 100644
--- a/app/views/switchboards/show.html.haml
+++ b/app/views/switchboards/show.html.haml
@@ -1,12 +1,45 @@
-- content_for :title, t("switchboards.show.page_title")
+- content_for :title, @switchboard.name
+
.row
- .span6
- %table.table.table-striped
- %tr
- %td
- %strong= t('switchboards.show.name') + ":"
- %td
- = @switchboard.name
-
-= render :partial => 'shared/show_edit_destroy_part', :locals => { :parent => @user, :child => @switchboard } \ No newline at end of file
+ .span12
+ .well.pull-right
+ %p
+ =current_user
+
+ %ul.thumbnails
+ - @switchboard.switchboard_entries.each do |switchboard_entry|
+ %li.span1
+ %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
+
+- if can? :edit, @switchboard
+ .row
+ .span12
+ %a.btn.btn-small.btn-warning{:href => switchboard_switchboard_entries_path(@switchboard) }
+ %i.icon-edit.icon-white
+ %span.hidden-phone
+ =t("switchboard_entries.index.page_title")