From b80bd744ad873f6fc43018bc4bfb90677de167bd Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Mon, 17 Dec 2012 12:01:45 +0100 Subject: Start of GS5. --- app/views/tenants/_admin_area.html.haml | 116 ++++++++++++++++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 app/views/tenants/_admin_area.html.haml (limited to 'app/views/tenants/_admin_area.html.haml') diff --git a/app/views/tenants/_admin_area.html.haml b/app/views/tenants/_admin_area.html.haml new file mode 100644 index 0000000..d648143 --- /dev/null +++ b/app/views/tenants/_admin_area.html.haml @@ -0,0 +1,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} -- cgit v1.2.3