summaryrefslogtreecommitdiff
path: root/app/views/users/show.html.haml
blob: 0b9c06ea4411676498abd765d03219eeafa3c3ea (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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
- content_for :title, "User: #{@user}"

.row
  .span3
    - cache(['user_show_aside', I18n.locale, @user, @user.sip_accounts, @user.conferences]) do

      - if @user.image? && @user.image_url(:profile)
        %span.hidden-phone
          %ul.thumbnails
            %li.span3
              %div.thumbnail
                %a.thumbnail{:href => @user.image_url(:profile).to_s}
                  =image_tag(@user.image_url(:profile), :alt => "Avatar #{@user}")

      %table.table.table-striped
        %tbody
          %tr
            %td
              %strong= t('users.show.user_name') + ":"
            %td
              = truncate(@user.user_name, :length => 14)
          %tr
            %td
              %strong= t('users.show.email') + ":"
            %td
              = truncate(@user.email, :length => 14)

      %p.controls
        = render :partial => 'shared/show_edit_destroy_part', :locals => { :parent => @tenant, :child => @user }

      - @user.sip_accounts.each do |sip_account|
        - phone_number = sip_account.phone_numbers.order(:number).last
        - if phone_number && !phone_number.number.blank? && phone_number.number[0] != '+'
          %p
            %strong= sip_account.phone_numbers.order(:number).last.number
          %p
            =link_to t("call_histories.index.page_title"), sip_account_call_histories_path(sip_account)
            %br
            =link_to t("voicemail_messages.index.page_title"), sip_account_voicemail_messages_path(sip_account)
            %br
            =link_to t("call_forwards.index.page_title"), phone_number_call_forwards_path(phone_number)
            %br
            =link_to t("voicemail_settings.index.page_title"), sip_account_voicemail_settings_path(sip_account)
            %br
            =link_to t("softkeys.index.page_title"), sip_account_softkeys_path(sip_account)
            %br
            =link_to t("ringtones.show.page_title"), phone_number_ringtones_path(phone_number)

      - if @user.conferences.any?
        %p
          %strong= t("conferences.index.page_title")
        - @user.conferences.each do |conference|
          %p
            =link_to conference, edit_user_conference_path(@user, conference)


  .span9
    = render :partial => 'phone_books', :locals => {:user => @user, :phone_books => @phone_books}

    - if current_user.user_groups.where(:name => 'Admins').any?
      - cache(['user_show_user_groups_overview', I18n.locale, @user, @user.user_groups]) do
        = render :partial => 'user_groups', :locals => {:user => @user, :tenant => @tenant}

    - cache(['user_show_sip_accounts_overview', I18n.locale, @user, @user.sip_accounts]) do
      = render :partial => 'sip_accounts', :locals => {:user => @user}

    - cache(['user_show_phones_overview', I18n.locale, @user, @user.phones]) do
      = render :partial => 'phones', :locals => {:user => @user}

    - cache(['user_show_fax_accounts_overview', I18n.locale, @user, @user.fax_accounts]) do
      = render :partial => 'fax_accounts', :locals => {:user => @user}

    - cache(['user_show_conferences_overview', I18n.locale, @user, @user.conferences]) do
      = render :partial => 'conferences', :locals => {:user => @user}