summaryrefslogtreecommitdiff
path: root/app/views/users/show.html.haml
blob: 814800549b399c90e02b9ae8427904a9f3768b1c (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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
- 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}
                  =image_tag(@user.image_url(:profile), :alt => "Avatar #{@user}", :class => 'img-rounded')

      %table.table.table-striped
        %tbody
          %tr
            %td
              %strong= truncate(t('users.show.user_name'), :length => 7) + ":"
            %td
              = truncate(@user.user_name, :length => 14)
          %tr
            %td
              %strong= truncate(t('users.show.email'), :length => 7) + ":"
            %td
              = mail_to @user.email, (Haml::Engine.new("%i.icon-envelope").render + ' ' + truncate(@user.email, :length => 16))

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

      - @user.sip_accounts.each do |sip_account|
        - phone_numbers = sip_account.phone_numbers.order(:position)
        %p
          - if phone_numbers[0]
            %strong= phone_numbers[0].number
          - else
            %strong= sip_account.to_s
          - if phone_numbers[1]
            %strong= phone_numbers[1].number
          - if phone_numbers[2]
            %strong= phone_numbers[2].number
          - if phone_numbers[3]
            %strong ...
          %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"), sip_account_call_forwards_path(sip_account)
            %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"), sip_account_ringtones_path(sip_account)

      - 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}

    - if GsParameter.get('SIM_CARDS') == true
      - cache(['user_show_sim_cards_overview', I18n.locale, @user, @user.sim_cards]) do
        %h2=t('sim_cards.index.page_title')
        = render :partial => 'sim_cards/index_core', :locals => {:parent => SimCardProvider.first, :sim_cards => @user.sim_cards}
        = render :partial => 'shared/create_link', :locals => {:parent => SimCardProvider.first, :child_class => SimCard}

    - 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}