From e4da52d673f12673614f7f9303ad384c77dbc37c Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Wed, 23 Jan 2013 10:40:33 +0100 Subject: Improved UI for tenant#show --- .../_index_core.html.haml | 59 ++++++++++++---------- app/views/callthroughs/_index_core.html.haml | 16 ++++-- app/views/hunt_groups/_index_core.html.haml | 29 ++++++----- app/views/tenants/_admin_area.html.haml | 9 +++- ..._table_of_automatic_call_distributors.html.haml | 8 +++ app/views/tenants/_table_of_callthroughs.html.haml | 8 +++ app/views/tenants/_table_of_conferences.html.haml | 8 +++ app/views/tenants/_table_of_functions.html.haml | 56 -------------------- app/views/tenants/_table_of_hunt_groups.html.haml | 8 +++ 9 files changed, 100 insertions(+), 101 deletions(-) create mode 100644 app/views/tenants/_table_of_automatic_call_distributors.html.haml create mode 100644 app/views/tenants/_table_of_callthroughs.html.haml create mode 100644 app/views/tenants/_table_of_conferences.html.haml delete mode 100644 app/views/tenants/_table_of_functions.html.haml create mode 100644 app/views/tenants/_table_of_hunt_groups.html.haml (limited to 'app/views') diff --git a/app/views/automatic_call_distributors/_index_core.html.haml b/app/views/automatic_call_distributors/_index_core.html.haml index 4878b56..85790aa 100644 --- a/app/views/automatic_call_distributors/_index_core.html.haml +++ b/app/views/automatic_call_distributors/_index_core.html.haml @@ -2,39 +2,46 @@ %thead %tr %th= t('automatic_call_distributors.index.name') - %th= t('automatic_call_distributors.index.strategy') - %th= t('automatic_call_distributors.index.max_callers') - %th= t('automatic_call_distributors.index.agent_timeout') - %th= t('automatic_call_distributors.index.retry_timeout') - %th= t('automatic_call_distributors.index.join') - %th= t('automatic_call_distributors.index.leave') + %th + %span.hidden-phone + = t('automatic_call_distributors.index.strategy') %th= t('automatic_call_distributors.index.phone_numbers') - %th= t('automatic_call_distributors.index.acd_agents') + %th + %span.hidden-phone + = t('automatic_call_distributors.index.max_callers') + %th + %span.hidden-phone + = t('automatic_call_distributors.index.agent_timeout') + %th + %span.hidden-phone + = t('automatic_call_distributors.index.acd_agents') %tbody - for automatic_call_distributor in automatic_call_distributors %tr - %td= automatic_call_distributor.name - %td= t("automatic_call_distributors.strategies.#{automatic_call_distributor.strategy}") - %td= automatic_call_distributor.max_callers - %td= automatic_call_distributor.agent_timeout - %td= automatic_call_distributor.retry_timeout - %td= t("automatic_call_distributors.join_on.#{automatic_call_distributor.join}") - %td= t("automatic_call_distributors.leave_on.#{automatic_call_distributor.leave}") - %td - - if automatic_call_distributor.phone_numbers.count > 0 + %span.hidden-phone + = automatic_call_distributor.name + %span.visible-phone + = truncate(automatic_call_distributor.name, :length => 8) + %td + %span.hidden-phone + = t("automatic_call_distributors.strategies.#{automatic_call_distributor.strategy}") + %td + - if automatic_call_distributor.phone_numbers.any? = render 'phone_numbers/listing', :phone_numbers => automatic_call_distributor.phone_numbers - %br - = render :partial => 'shared/create_link', :locals => {:parent => automatic_call_distributor, :child_class => PhoneNumber, :short_link => true} - %td - - if automatic_call_distributor.acd_agents.count > 3 - = link_to automatic_call_distributor.acd_agents.count, automatic_call_distributor_acd_agents_path(automatic_call_distributor) - %br - - elsif automatic_call_distributor.acd_agents.count > 0 - = render 'acd_agents/listing', :acd_agents => automatic_call_distributor.acd_agents - %br - = render :partial => 'shared/create_link', :locals => {:parent => automatic_call_distributor, :child_class => AcdAgent, :short_link => true} + %span.hidden-phone + = automatic_call_distributor.max_callers + %td + %span.hidden-phone + = automatic_call_distributor.agent_timeout + %td + %span.hidden-phone + - if automatic_call_distributor.acd_agents.count > 3 + = link_to automatic_call_distributor.acd_agents.count, automatic_call_distributor_acd_agents_path(automatic_call_distributor) + %br + - elsif automatic_call_distributor.acd_agents.any? + = render 'acd_agents/listing', :acd_agents => automatic_call_distributor.acd_agents =render :partial => 'shared/index_view_edit_destroy_part', :locals => {:parent => automatic_call_distributor.automatic_call_distributorable, :child => automatic_call_distributor} \ No newline at end of file diff --git a/app/views/callthroughs/_index_core.html.haml b/app/views/callthroughs/_index_core.html.haml index 1767f5b..acb152e 100644 --- a/app/views/callthroughs/_index_core.html.haml +++ b/app/views/callthroughs/_index_core.html.haml @@ -3,16 +3,24 @@ %tr %th= t('callthroughs.index.name') %th= t('callthroughs.index.phone_numbers') - %th= t('callthroughs.index.access_authorized_phone_numbers') + %th + %span.hidden-phone + = t('callthroughs.index.access_authorized_phone_numbers') - if GsParameter.get('CALLTHROUGH_HAS_WHITELISTS') == true - %th= t('callthroughs.index.whitelist_phone_numbers') + %th + %span.hidden-phone + = t('callthroughs.index.whitelist_phone_numbers') %tbody - for callthrough in callthroughs %tr %td= callthrough.name %td=render 'phone_numbers/listing', :phone_numbers => callthrough.phone_numbers - %td=render 'phone_numbers/listing', :phone_numbers => callthrough.access_authorization_phone_numbers + %td + %span.hidden-phone + =render 'phone_numbers/listing', :phone_numbers => callthrough.access_authorization_phone_numbers - if GsParameter.get('CALLTHROUGH_HAS_WHITELISTS') == true - %td=render 'phone_numbers/listing', :phone_numbers => callthrough.whitelisted_phone_numbers + %td + %span.hidden-phone + =render 'phone_numbers/listing', :phone_numbers => callthrough.whitelisted_phone_numbers =render :partial => 'shared/index_view_edit_destroy_part', :locals => {:parent => callthrough.tenant, :child => callthrough} \ No newline at end of file diff --git a/app/views/hunt_groups/_index_core.html.haml b/app/views/hunt_groups/_index_core.html.haml index 5f6e797..9cc237b 100644 --- a/app/views/hunt_groups/_index_core.html.haml +++ b/app/views/hunt_groups/_index_core.html.haml @@ -4,32 +4,35 @@ %thead %tr %th= t('hunt_groups.index.name') - %th= t('hunt_groups.index.strategy') + %th + %span.hidden-phone + = t('hunt_groups.index.strategy') - if show_seconds %th= t('hunt_groups.index.seconds_between_jumps') %th= t('hunt_groups.index.phone_numbers') - %th= t('hunt_groups.index.hunt_group_members') + %th + %span.hidden-phone + = t('hunt_groups.index.hunt_group_members') %tbody - for hunt_group in hunt_groups %tr %td= hunt_group.name - %td= t("hunt_groups.strategies.#{hunt_group.strategy}") + %td + %span.hidden-phone + = t("hunt_groups.strategies.#{hunt_group.strategy}") - if show_seconds %td= hunt_group.seconds_between_jumps %td - - if hunt_group.phone_numbers.count > 0 + - if hunt_group.phone_numbers.any? =render 'phone_numbers/listing', :phone_numbers => hunt_group.phone_numbers - %br - = render :partial => 'shared/create_link', :locals => {:parent => hunt_group, :child_class => PhoneNumber, :short_link => true} %td - - if hunt_group.hunt_group_members.count > 3 - = link_to hunt_group.hunt_group_members.count, hunt_group_hunt_group_members_path(hunt_group) - %br - - elsif hunt_group.hunt_group_members.count > 0 - =render 'hunt_group_members/listing', :hunt_group_members => hunt_group.hunt_group_members - %br - = render :partial => 'shared/create_link', :locals => {:parent => hunt_group, :child_class => HuntGroupMember, :short_link => true} + %span.hidden-phone + - if hunt_group.hunt_group_members.count > 3 + = link_to hunt_group.hunt_group_members.count, hunt_group_hunt_group_members_path(hunt_group) + %br + - elsif hunt_group.hunt_group_members.any? + =render 'hunt_group_members/listing', :hunt_group_members => hunt_group.hunt_group_members =render :partial => 'shared/index_view_edit_destroy_part', :locals => {:parent => hunt_group.tenant, :child => hunt_group} \ No newline at end of file diff --git a/app/views/tenants/_admin_area.html.haml b/app/views/tenants/_admin_area.html.haml index d634f73..1a05264 100644 --- a/app/views/tenants/_admin_area.html.haml +++ b/app/views/tenants/_admin_area.html.haml @@ -16,8 +16,13 @@ = render :partial => 'user_groups_table', :locals => {:tenant => tenant} -%h2 Features -= render :partial => 'tenants/table_of_functions', :locals => {:tenant => tenant} += render :partial => 'tenants/table_of_conferences', :locals => {:tenant => tenant} + += render :partial => 'tenants/table_of_callthroughs', :locals => {:tenant => tenant} + += render :partial => 'tenants/table_of_hunt_groups', :locals => {:tenant => tenant} + += render :partial => 'tenants/table_of_automatic_call_distributors', :locals => {:tenant => tenant} = render :partial => 'tenants/table_of_phone_books', :locals => {:tenant => tenant} diff --git a/app/views/tenants/_table_of_automatic_call_distributors.html.haml b/app/views/tenants/_table_of_automatic_call_distributors.html.haml new file mode 100644 index 0000000..22796af --- /dev/null +++ b/app/views/tenants/_table_of_automatic_call_distributors.html.haml @@ -0,0 +1,8 @@ +- cache(['tenant_show_table_of_automatic_call_distributors', I18n.locale, tenant, tenant.automatic_call_distributors.count, tenant.automatic_call_distributors.reorder(:updated_at).last]) do + -# AutomaticCallDistributors + -# + - if (can?( :index, AutomaticCallDistributor ) && tenant.automatic_call_distributors.count > 0 ) || can?( :create, AutomaticCallDistributor ) + %h2= t('automatic_call_distributors.index.page_title') + - if can?( :index, AutomaticCallDistributor ) && tenant.automatic_call_distributors.count > 0 + = render "automatic_call_distributors/index_core", :automatic_call_distributors => tenant.automatic_call_distributors + = render :partial => 'shared/create_link', :locals => {:parent => tenant, :child_class => AutomaticCallDistributor} \ No newline at end of file diff --git a/app/views/tenants/_table_of_callthroughs.html.haml b/app/views/tenants/_table_of_callthroughs.html.haml new file mode 100644 index 0000000..9cd6bf1 --- /dev/null +++ b/app/views/tenants/_table_of_callthroughs.html.haml @@ -0,0 +1,8 @@ +- cache(['tenant_show_table_of_callthroughs', I18n.locale, tenant, tenant.callthroughs.count, tenant.callthroughs.reorder(:updated_at).last]) do + -# Callthroughs + -# + - if (can?( :index, Callthrough ) && tenant.callthroughs.count > 0 ) || can?( :create, Callthrough ) + %h2= t('callthroughs.index.page_title') + - if can?( :index, Callthrough ) && tenant.callthroughs.count > 0 + = render "callthroughs/index_core", :callthroughs => tenant.callthroughs + = render :partial => 'shared/create_link', :locals => {:parent => tenant, :child_class => Callthrough} \ No newline at end of file diff --git a/app/views/tenants/_table_of_conferences.html.haml b/app/views/tenants/_table_of_conferences.html.haml new file mode 100644 index 0000000..9775989 --- /dev/null +++ b/app/views/tenants/_table_of_conferences.html.haml @@ -0,0 +1,8 @@ +- cache(['table_of_pbx_features_conferences_row', I18n.locale, tenant, tenant.conferences.count, tenant.conferences.reorder(:updated_at).last]) do + -# Conferences + -# + - if (can?( :index, Conference ) && tenant.conferences.count > 0 ) || can?( :create, Conference ) + %h2= t('conferences.index.page_title') + - if can?( :index, Conference ) && tenant.conferences.count > 0 + = render "conferences/index_core", :conferences => tenant.conferences + = render :partial => 'shared/create_link', :locals => {:parent => tenant, :child_class => Conference} \ No newline at end of file diff --git a/app/views/tenants/_table_of_functions.html.haml b/app/views/tenants/_table_of_functions.html.haml deleted file mode 100644 index 3587eb8..0000000 --- a/app/views/tenants/_table_of_functions.html.haml +++ /dev/null @@ -1,56 +0,0 @@ -- cache(['table_of_pbx_features', I18n.locale, tenant, tenant.callthroughs.count, tenant.callthroughs.reorder(:updated_at).last, tenant.conferences.count, tenant.conferences.reorder(:updated_at).last, tenant.hunt_groups.count, tenant.hunt_groups.reorder(:updated_at).last, tenant.automatic_call_distributors.count, tenant.automatic_call_distributors.reorder(:updated_at).last]) do - %table{:class => 'table table-striped'} - %thead - %tr - %th - Funktion - %th - Anzahl - %th - - %tbody - - cache(['table_of_pbx_features_callthroughs_row', I18n.locale, tenant, tenant.callthroughs.count, tenant.callthroughs.reorder(:updated_at).last]) do - %tr - %td - = t("callthroughs.name") - %td - - if tenant.callthroughs.any? - = link_to Haml::Engine.new("%i.icon-list").render + ' ' + tenant.callthroughs.count.to_s, tenant_callthroughs_path(tenant) - - else - = '-' - %td - = render :partial => 'shared/create_link', :locals => {:parent => tenant, :child_class => Callthrough} - - cache(['table_of_pbx_features_conferences_row', I18n.locale, tenant, tenant.conferences.count, tenant.conferences.reorder(:updated_at).last]) do - %tr - %td - = t("conferences.name") - %td - - if tenant.conferences.any? - - = link_to Haml::Engine.new("%i.icon-list").render + ' ' + tenant.conferences.count.to_s, tenant_conferences_path(tenant) - - else - = '-' - %td - = render :partial => 'shared/create_link', :locals => {:parent => tenant, :child_class => Conference} - - cache(['table_of_pbx_features_hunt_groups_row', I18n.locale, tenant, tenant.hunt_groups.count, tenant.hunt_groups.reorder(:updated_at).last]) do - %tr - %td - = t("hunt_groups.name") - %td - - if tenant.hunt_groups.any? - = link_to Haml::Engine.new("%i.icon-list").render + ' ' + tenant.hunt_groups.count.to_s, tenant_hunt_groups_path(tenant) - - else - = '-' - %td - = render :partial => 'shared/create_link', :locals => {:parent => tenant, :child_class => HuntGroup} - - cache(['table_of_pbx_features_automatic_call_distributors_row', I18n.locale, tenant, tenant.automatic_call_distributors.count, tenant.automatic_call_distributors.reorder(:updated_at).last]) do - %tr - %td - = t("automatic_call_distributors.name") - %td - - if tenant.automatic_call_distributors.any? - = link_to Haml::Engine.new("%i.icon-list").render + ' ' + tenant.automatic_call_distributors.count.to_s, tenant_automatic_call_distributors_path(tenant) - - else - = '-' - %td - = render :partial => 'shared/create_link', :locals => {:parent => tenant, :child_class => AutomaticCallDistributor} \ No newline at end of file diff --git a/app/views/tenants/_table_of_hunt_groups.html.haml b/app/views/tenants/_table_of_hunt_groups.html.haml new file mode 100644 index 0000000..aca570d --- /dev/null +++ b/app/views/tenants/_table_of_hunt_groups.html.haml @@ -0,0 +1,8 @@ +- cache(['table_of_pbx_features_hunt_groups_row', I18n.locale, tenant, tenant.hunt_groups.count, tenant.hunt_groups.reorder(:updated_at).last]) do + -# HuntGroups + -# + - if (can?( :index, HuntGroup ) && tenant.hunt_groups.count > 0 ) || can?( :create, HuntGroup ) + %h2= t('hunt_groups.index.page_title') + - if can?( :index, HuntGroup ) && tenant.hunt_groups.count > 0 + = render "hunt_groups/index_core", :hunt_groups => tenant.hunt_groups + = render :partial => 'shared/create_link', :locals => {:parent => tenant, :child_class => HuntGroup} \ No newline at end of file -- cgit v1.2.3