summaryrefslogtreecommitdiff
path: root/app/views/tenants/_admin_area.html.haml
blob: d648143952de10d2ff665fc30897569109bfba30 (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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
%p
  You belong to the 
  = link_to 'admin group', tenant_user_group_path(@tenant, @tenant.user_groups.find_by_name('Admins'))
  and therefore have super powers. But always remember Peter Parker's: "With great power comes great responsibility."

%p
  = succeed '.' do
    This tenant has 
    = link_to pluralize(@tenant.user_groups.count, 'user group'), tenant_user_groups_path(@tenant)
    - if @tenant.user_groups.count < 5
      = "(#{@tenant.user_groups.order(:name).map{|group| group.to_s }.join(', ')})"
    which handle a total of 
    = link_to pluralize(@tenant.users.count, 'user'), tenant_users_path(@tenant)
  This system can setup 
  = PhoneModel.count
  different phone models from the manufacturers 
  - Manufacturer.all.each do |manufacturer|
    - if manufacturer != Manufacturer.last && manufacturer != Manufacturer.limit(Manufacturer.count - 1).last
      = succeed ', ' do
        =link_to manufacturer, manufacturer_path(manufacturer)
    - elsif manufacturer == Manufacturer.limit(Manufacturer.count - 1).last
      = succeed ' and ' do
        =link_to manufacturer, manufacturer_path(manufacturer)
    - else
      = succeed '.' do
        =link_to manufacturer, manufacturer_path(manufacturer)

%h3 SIP-Accounts and Phones

%table
  %tr{:class => 'even'}
    %th
    %th
      = @tenant
    %th
      All users of 
      = "\"#{@tenant}\""
  %tr{:class => 'odd'}
    %td
      SIP accounts
    %td
      = link_to @tenant.sip_accounts.count.to_s, tenant_sip_accounts_path(@tenant)
      = render :partial => 'shared/create_link', :locals => {:parent => @tenant, :child_class => SipAccount}
    %td= @tenant.users_sip_accounts.count.to_s
  %tr{:class => 'even'}
    %td
      Phones
    %td
      = link_to @tenant.phones.count.to_s, tenant_phones_path(@tenant)
      = render :partial => 'shared/create_link', :locals => {:parent => @tenant, :child_class => Phone}
    %td= @tenant.users_phones.count.to_s

%h3 Misc

%table
  %tr{:class => 'even'}
    %th
      Feature
    %th
      Counter
    %th
  %tr{:class => 'odd'}
    %td
      Callthroughs
    %td
      = link_to @tenant.callthroughs.count.to_s, tenant_callthroughs_path(@tenant)
    %td
      = render :partial => 'shared/create_link', :locals => {:parent => @tenant, :child_class => Callthrough}
  %tr{:class => 'even'}
    %td
      Conferences
    %td
      = link_to @tenant.conferences.count.to_s, tenant_conferences_path(@tenant)
    %td
      = render :partial => 'shared/create_link', :locals => {:parent => @tenant, :child_class => Conference}
  %tr{:class => 'odd'}
    %td
      Hunt groups
    %td
      = link_to @tenant.hunt_groups.count.to_s, tenant_hunt_groups_path(@tenant)
    %td
      = render :partial => 'shared/create_link', :locals => {:parent => @tenant, :child_class => HuntGroup}
  %tr{:class => 'even'}
    %td
      ACDs
    %td
      = link_to @tenant.automatic_call_distributors.count.to_s, tenant_automatic_call_distributors_path(@tenant)
    %td
      = render :partial => 'shared/create_link', :locals => {:parent => @tenant, :child_class => AutomaticCallDistributor}
  %tr{:class => 'odd'}
    %td
      GUI functions
    %td
      = link_to GuiFunction.count.to_s, gui_functions_path
    %td

-# Phone books
-#
- if GuiFunction.display?('show_phone_books_in_user_show_view', current_user)
  - if can?( :index, PhoneBook )
    %h2=t("phone_books.index.page_title")
    = render "phone_books/index_core", :phone_books => @tenant.phone_books
    = render :partial => 'shared/create_link', :locals => {:parent => @tenant, :child_class => PhoneBook} 

- if STRICT_INTERNAL_EXTENSION_HANDLING == true
  %h3= t('phone_number_ranges.index.page_title')

  - if @tenant.created_at > (Time.now - 15.minutes) && Delayed::Job.count > 0 && @tenant.phone_number_ranges.find_by_name(INTERNAL_EXTENSIONS).try(:phone_numbers).try(:count).to_i == 0
    This tenant was created 
    = distance_of_time_in_words_to_now(@tenant.created_at)
    ago. There are still 
    = pluralize(Delayed::Job.count, 'background job')
    not finished. This can take a couple of minutes. Please reload this page later.
  - else
    =render 'phone_number_ranges/index_core', :phone_number_ranges => (@tenant.phone_number_ranges + @tenant.country.phone_number_ranges.where(:name => SERVICE_NUMBERS))
    =render :partial => 'shared/create_link', :locals => {:parent => @tenant, :child_class => PhoneNumberRange}