summaryrefslogtreecommitdiff
path: root/app/views/hunt_groups
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2012-12-17 12:01:45 +0100
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2012-12-17 12:01:45 +0100
commitb80bd744ad873f6fc43018bc4bfb90677de167bd (patch)
tree072c4b0e33d442528555b82c415f5e7a1712b2b0 /app/views/hunt_groups
parent3e706c2025ecc5523e81ad649639ef2ff75e7bac (diff)
Start of GS5.
Diffstat (limited to 'app/views/hunt_groups')
-rw-r--r--app/views/hunt_groups/_form.html.haml7
-rw-r--r--app/views/hunt_groups/_form_core.html.haml4
-rw-r--r--app/views/hunt_groups/_index_core.html.haml34
-rw-r--r--app/views/hunt_groups/edit.html.haml3
-rw-r--r--app/views/hunt_groups/index.html.haml6
-rw-r--r--app/views/hunt_groups/new.html.haml3
-rw-r--r--app/views/hunt_groups/show.html.haml26
7 files changed, 83 insertions, 0 deletions
diff --git a/app/views/hunt_groups/_form.html.haml b/app/views/hunt_groups/_form.html.haml
new file mode 100644
index 0000000..bc2663b
--- /dev/null
+++ b/app/views/hunt_groups/_form.html.haml
@@ -0,0 +1,7 @@
+= simple_form_for([@tenant, @hunt_group]) do |f|
+ = f.error_notification
+
+ = render "form_core", :f => f
+
+ .actions
+ = f.button :submit, conditional_t('hunt_groups.form.submit') \ No newline at end of file
diff --git a/app/views/hunt_groups/_form_core.html.haml b/app/views/hunt_groups/_form_core.html.haml
new file mode 100644
index 0000000..10a0111
--- /dev/null
+++ b/app/views/hunt_groups/_form_core.html.haml
@@ -0,0 +1,4 @@
+.inputs
+ = f.input :name, :label => t('hunt_groups.form.name.label'), :hint => conditional_hint('hunt_groups.form.name.hint')
+ = f.input :strategy, :as => :select, :label => t('hunt_groups.form.strategy.label'), :hint => conditional_hint('hunt_groups.form.strategy.hint'), :include_blank => false, :collection => HUNT_GROUP_STRATEGIES.map {|x| [I18n.t('hunt_groups.strategies.' + x), x] }
+ = f.input :seconds_between_jumps, :collection => VALID_SECONDS_BETWEEN_JUMPS_VALUES, :label => t('hunt_groups.form.seconds_between_jumps.label'), :hint => conditional_hint('hunt_groups.form.seconds_between_jumps.hint') \ 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
new file mode 100644
index 0000000..3000e97
--- /dev/null
+++ b/app/views/hunt_groups/_index_core.html.haml
@@ -0,0 +1,34 @@
+- show_seconds = hunt_groups.map{|x| ! x.seconds_between_jumps.nil? }.include?(true)
+
+%table
+ %tr
+ %th= t('hunt_groups.index.name')
+ %th= 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')
+
+ - reset_cycle
+ - for hunt_group in hunt_groups
+ %tr{:class => cycle('odd', 'even')}
+ %td= hunt_group.name
+ %td= t("hunt_groups.strategies.#{hunt_group.strategy}")
+ - if show_seconds
+ %td= hunt_group.seconds_between_jumps
+ %td
+ - if hunt_group.phone_numbers.count > 0
+ =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}
+
+ =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/hunt_groups/edit.html.haml b/app/views/hunt_groups/edit.html.haml
new file mode 100644
index 0000000..f2ef998
--- /dev/null
+++ b/app/views/hunt_groups/edit.html.haml
@@ -0,0 +1,3 @@
+- title t("hunt_groups.edit.page_title")
+
+= render "form"
diff --git a/app/views/hunt_groups/index.html.haml b/app/views/hunt_groups/index.html.haml
new file mode 100644
index 0000000..62bc2aa
--- /dev/null
+++ b/app/views/hunt_groups/index.html.haml
@@ -0,0 +1,6 @@
+- title t("hunt_groups.index.page_title")
+
+- if @hunt_groups.count > 0
+ = render "index_core", :hunt_groups => @hunt_groups
+
+= render :partial => 'shared/create_link', :locals => {:parent => @tenant, :child_class => HuntGroup} \ No newline at end of file
diff --git a/app/views/hunt_groups/new.html.haml b/app/views/hunt_groups/new.html.haml
new file mode 100644
index 0000000..a40e579
--- /dev/null
+++ b/app/views/hunt_groups/new.html.haml
@@ -0,0 +1,3 @@
+- title t("hunt_groups.new.page_title")
+
+= render "form"
diff --git a/app/views/hunt_groups/show.html.haml b/app/views/hunt_groups/show.html.haml
new file mode 100644
index 0000000..009af50
--- /dev/null
+++ b/app/views/hunt_groups/show.html.haml
@@ -0,0 +1,26 @@
+- title t("hunt_groups.show.page_title")
+
+%p
+ %strong= t('hunt_groups.show.name') + ":"
+ = @hunt_group.name
+%p
+ %strong= t('hunt_groups.show.strategy') + ":"
+ = t("hunt_groups.strategies.#{@hunt_group.strategy}")
+- if @hunt_group.seconds_between_jumps
+ %p
+ %strong= t('hunt_groups.show.seconds_between_jumps') + ":"
+ = @hunt_group.seconds_between_jumps
+
+= render :partial => 'shared/show_edit_destroy_part', :locals => { :parent => @tenant, :child => @hunt_group }
+
+%h2= t('hunt_groups.form.phone_numbers.label')
+- if @hunt_group.phone_numbers.count > 0
+ = render 'phone_numbers/index_core', :phone_numbers => @hunt_group.phone_numbers
+ %br
+= render :partial => 'shared/create_link', :locals => {:parent => @hunt_group, :child_class => PhoneNumber}
+
+%h2= t('hunt_groups.form.hunt_group_members.label')
+- if @hunt_group.hunt_group_members.count > 0
+ = render 'hunt_group_members/index_core', :hunt_group_members => @hunt_group.hunt_group_members
+ %br
+= render :partial => 'shared/create_link', :locals => {:parent => @hunt_group, :child_class => HuntGroupMember} \ No newline at end of file