summaryrefslogtreecommitdiff
path: root/app/views/phone_numbers
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/phone_numbers
parent3e706c2025ecc5523e81ad649639ef2ff75e7bac (diff)
Start of GS5.
Diffstat (limited to 'app/views/phone_numbers')
-rw-r--r--app/views/phone_numbers/_form.html.haml7
-rw-r--r--app/views/phone_numbers/_form_core.html.haml10
-rw-r--r--app/views/phone_numbers/_index_core.html.haml13
-rw-r--r--app/views/phone_numbers/_listing.html.haml8
-rw-r--r--app/views/phone_numbers/edit.html.haml3
-rw-r--r--app/views/phone_numbers/index.html.haml6
-rw-r--r--app/views/phone_numbers/new.html.haml3
-rw-r--r--app/views/phone_numbers/show.html.haml27
8 files changed, 77 insertions, 0 deletions
diff --git a/app/views/phone_numbers/_form.html.haml b/app/views/phone_numbers/_form.html.haml
new file mode 100644
index 0000000..2812e21
--- /dev/null
+++ b/app/views/phone_numbers/_form.html.haml
@@ -0,0 +1,7 @@
+= simple_form_for([ @parent, @phone_number ]) do |f|
+ = f.error_notification
+
+ = render "form_core", :f => f
+
+ .actions
+ = f.button :submit, conditional_t('phone_numbers.form.submit')
diff --git a/app/views/phone_numbers/_form_core.html.haml b/app/views/phone_numbers/_form_core.html.haml
new file mode 100644
index 0000000..add3039
--- /dev/null
+++ b/app/views/phone_numbers/_form_core.html.haml
@@ -0,0 +1,10 @@
+.inputs
+
+ - if @phone_book_entry
+ = f.input :name, :collection => ['Office', 'Home', 'Mobile', 'Fax'], :include_blank => false, :label => t('phone_numbers.form.name.label'), :hint => conditional_hint('phone_numbers.form.name.hint')
+ = f.input :number, :label => t('phone_numbers.form.number.label'), :hint => conditional_hint('phone_numbers.form.number.hint')
+ - else
+ - if @callthrough || @hunt_group_member || @access_authorization || @current_user.current_tenant.array_of_available_internal_extensions_and_dids.count == 0 || @current_user.current_tenant.array_of_available_internal_extensions_and_dids.count > 250
+ = f.input :number, :label => t('phone_numbers.form.number.label'), :hint => conditional_hint('phone_numbers.form.number.hint')
+ - else
+ = f.input :number, :collection => @current_user.current_tenant.array_of_available_internal_extensions_and_dids, :label => t('phone_numbers.form.number.label'), :hint => conditional_hint('phone_numbers.form.number.hint'), :include_blank => false
diff --git a/app/views/phone_numbers/_index_core.html.haml b/app/views/phone_numbers/_index_core.html.haml
new file mode 100644
index 0000000..06b27c8
--- /dev/null
+++ b/app/views/phone_numbers/_index_core.html.haml
@@ -0,0 +1,13 @@
+%table
+ %tr
+ - if phone_numbers.count > 1 && phone_numbers.first.phone_numberable_type == 'PhoneBookEntry'
+ %th= t('phone_numbers.index.name')
+ %th= t('phone_numbers.index.number')
+
+ - reset_cycle
+ - for phone_number in phone_numbers.order(:position)
+ %tr{:class => cycle('odd', 'even')}
+ - if phone_number.phone_numberable_type == 'PhoneBookEntry'
+ %td= phone_number.name
+ %td= phone_number
+ = render :partial => 'shared/index_view_edit_destroy_part', :locals => {:parent => phone_number.phone_numberable, :child => phone_number}
diff --git a/app/views/phone_numbers/_listing.html.haml b/app/views/phone_numbers/_listing.html.haml
new file mode 100644
index 0000000..ca002c5
--- /dev/null
+++ b/app/views/phone_numbers/_listing.html.haml
@@ -0,0 +1,8 @@
+- amount_of_phone_numbers = phone_numbers.count
+- if amount_of_phone_numbers > 0
+ - if amount_of_phone_numbers < 110
+ = phone_numbers.map{|number| number}.join(', ')
+ - else
+ = phone_numbers.limit(30).map{|number| number}.join(', ') + ', '
+ = '[...]'
+ = phone_numbers.offset(amount_of_phone_numbers - 30).map{|number| number}.join(', ') \ No newline at end of file
diff --git a/app/views/phone_numbers/edit.html.haml b/app/views/phone_numbers/edit.html.haml
new file mode 100644
index 0000000..d238d3d
--- /dev/null
+++ b/app/views/phone_numbers/edit.html.haml
@@ -0,0 +1,3 @@
+- title t("phone_numbers.edit.page_title", :resource => "" )
+
+= render "form" \ No newline at end of file
diff --git a/app/views/phone_numbers/index.html.haml b/app/views/phone_numbers/index.html.haml
new file mode 100644
index 0000000..2161739
--- /dev/null
+++ b/app/views/phone_numbers/index.html.haml
@@ -0,0 +1,6 @@
+- title @parent
+
+- if @phone_numbers.count > 0
+ = render "index_core", :phone_numbers => @phone_numbers
+
+= render :partial => 'shared/create_link', :locals => {:parent => @parent, :child_class => PhoneNumber} \ No newline at end of file
diff --git a/app/views/phone_numbers/new.html.haml b/app/views/phone_numbers/new.html.haml
new file mode 100644
index 0000000..e91f4f4
--- /dev/null
+++ b/app/views/phone_numbers/new.html.haml
@@ -0,0 +1,3 @@
+- title t("phone_numbers.new.page_title")
+
+= render "form"
diff --git a/app/views/phone_numbers/show.html.haml b/app/views/phone_numbers/show.html.haml
new file mode 100644
index 0000000..30c48bc
--- /dev/null
+++ b/app/views/phone_numbers/show.html.haml
@@ -0,0 +1,27 @@
+- title t("phone_numbers.show.page_title")
+
+- if @phone_number.phone_numberable.class == PhoneBookEntry
+ %p
+ %strong= t('phone_numbers.show.name') + ":"
+ = @phone_number.name
+
+%p
+ %strong= t('phone_numbers.show.number') + ":"
+ = @phone_number.to_s
+
+- if @ringtoneable_classes.has_key?(@phone_number.phone_numberable.class.to_s)
+ %p
+ %strong= t('ringtones.name') + ':'
+ - if @phone_number.ringtones.count > 0
+ = link_to @phone_number.ringtones.first, phone_number_ringtone_path(@phone_number, @phone_number.ringtones.first)
+ - else
+ = link_to t('ringtones.set_a_ringtone'), new_phone_number_ringtone_path(@phone_number)
+
+= render :partial => 'shared/show_edit_destroy_part', :locals => { :parent => @phone_number.phone_numberable, :child => @phone_number }
+
+- if @forwardable_classes.has_key?(@phone_number.phone_numberable.class.to_s)
+ %h3= t("call_forwards.index.page_title")
+ - if @phone_number.call_forwards.length > 0
+ = render "call_forwards/index_core", :call_forwards => @phone_number.call_forwards
+
+ = render :partial => 'shared/create_link', :locals => {:parent => @phone_number, :child_class => CallForward} \ No newline at end of file