summaryrefslogtreecommitdiff
path: root/app/views/phone_number_ranges
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/phone_number_ranges')
-rw-r--r--app/views/phone_number_ranges/_form.html.haml7
-rw-r--r--app/views/phone_number_ranges/_form_core.html.haml3
-rw-r--r--app/views/phone_number_ranges/_index_core.html.haml21
-rw-r--r--app/views/phone_number_ranges/edit.html.haml3
-rw-r--r--app/views/phone_number_ranges/index.html.haml6
-rw-r--r--app/views/phone_number_ranges/new.html.haml3
-rw-r--r--app/views/phone_number_ranges/show.html.haml18
7 files changed, 61 insertions, 0 deletions
diff --git a/app/views/phone_number_ranges/_form.html.haml b/app/views/phone_number_ranges/_form.html.haml
new file mode 100644
index 0000000..a86d45b
--- /dev/null
+++ b/app/views/phone_number_ranges/_form.html.haml
@@ -0,0 +1,7 @@
+= simple_form_for([ @phone_number_range.phone_number_rangeable, @phone_number_range ]) do |f|
+ = f.error_notification
+
+ = render "form_core", :f => f
+
+ .actions
+ = f.button :submit, conditional_t('phone_number_ranges.form.submit') \ No newline at end of file
diff --git a/app/views/phone_number_ranges/_form_core.html.haml b/app/views/phone_number_ranges/_form_core.html.haml
new file mode 100644
index 0000000..f553f08
--- /dev/null
+++ b/app/views/phone_number_ranges/_form_core.html.haml
@@ -0,0 +1,3 @@
+.inputs
+ = f.input :name, :label => t('phone_number_ranges.form.name.label'), :hint => conditional_hint('phone_number_ranges.form.name.hint')
+ = f.input :description, :label => t('phone_number_ranges.form.description.label'), :hint => conditional_hint('phone_number_ranges.form.description.hint')
diff --git a/app/views/phone_number_ranges/_index_core.html.haml b/app/views/phone_number_ranges/_index_core.html.haml
new file mode 100644
index 0000000..24ea96d
--- /dev/null
+++ b/app/views/phone_number_ranges/_index_core.html.haml
@@ -0,0 +1,21 @@
+%table
+ %tr
+ %th= t('phone_number_ranges.index.name')
+ %th= t('phone_number_ranges.index.description')
+ %th= t('phone_number_ranges.index.numbers')
+ %th= t('phone_number_ranges.index.amount')
+
+ - reset_cycle
+ - for phone_number_range in phone_number_ranges
+ %tr{:class => cycle('odd', 'even')}
+ %td= t("phone_number_ranges.ranges.#{phone_number_range}.label")
+ %td= t("phone_number_ranges.ranges.#{phone_number_range}.description")
+ %td
+ - if phone_number_range.phone_numbers.count > 0
+ = render 'phone_numbers/listing', :phone_numbers => phone_number_range.phone_numbers.order(:number)
+ %br
+ = render :partial => 'shared/create_link', :locals => {:parent => phone_number_range, :child_class => PhoneNumber, :short_link => true}
+
+ %td= phone_number_range.phone_numbers.count
+ - if phone_number_range.phone_number_rangeable.class != Country
+ =render :partial => 'shared/index_view_edit_destroy_part', :locals => {:parent => phone_number_range.phone_number_rangeable, :child => phone_number_range} \ No newline at end of file
diff --git a/app/views/phone_number_ranges/edit.html.haml b/app/views/phone_number_ranges/edit.html.haml
new file mode 100644
index 0000000..fbf6d12
--- /dev/null
+++ b/app/views/phone_number_ranges/edit.html.haml
@@ -0,0 +1,3 @@
+- title t("phone_number_ranges.edit.page_title", :resource => @phone_number_range)
+
+= render "form"
diff --git a/app/views/phone_number_ranges/index.html.haml b/app/views/phone_number_ranges/index.html.haml
new file mode 100644
index 0000000..56cf137
--- /dev/null
+++ b/app/views/phone_number_ranges/index.html.haml
@@ -0,0 +1,6 @@
+- title t("phone_number_ranges.index.page_title")
+
+- if @phone_number_ranges.count > 0
+ = render "index_core", :phone_number_ranges => @phone_number_ranges
+
+= render :partial => 'shared/create_link', :locals => {:child_class => PhoneNumberRange} \ No newline at end of file
diff --git a/app/views/phone_number_ranges/new.html.haml b/app/views/phone_number_ranges/new.html.haml
new file mode 100644
index 0000000..d26b34d
--- /dev/null
+++ b/app/views/phone_number_ranges/new.html.haml
@@ -0,0 +1,3 @@
+- title t("phone_number_ranges.new.page_title")
+
+= render "form"
diff --git a/app/views/phone_number_ranges/show.html.haml b/app/views/phone_number_ranges/show.html.haml
new file mode 100644
index 0000000..64df556
--- /dev/null
+++ b/app/views/phone_number_ranges/show.html.haml
@@ -0,0 +1,18 @@
+- title t("phone_number_ranges.show.page_title")
+
+%p
+ %strong= t('phone_number_ranges.show.name') + ":"
+ = t("phone_number_ranges.ranges.#{@phone_number_range}.label")
+%p
+ %strong= t('phone_number_ranges.show.description') + ":"
+ = @phone_number_range.description
+
+= render :partial => 'shared/show_edit_destroy_part', :locals => { :parent => @phone_number_range.phone_number_rangeable, :child => @phone_number_range }
+
+%h2= t("phone_number_ranges.show.phone_numbers")
+
+- if @phone_number_range.try(:phone_numbers).try(:count).to_i > 0
+ = render "phone_numbers/index_core", :phone_numbers => @phone_number_range.phone_numbers.order(:number)
+
+%p
+ = render :partial => 'shared/create_link', :locals => {:parent => @phone_number_range, :child_class => PhoneNumber} \ No newline at end of file