summaryrefslogtreecommitdiff
path: root/app/views/softkeys
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/softkeys')
-rw-r--r--app/views/softkeys/_form.html.haml7
-rw-r--r--app/views/softkeys/_form_core.html.haml12
-rw-r--r--app/views/softkeys/_index_core.html.haml14
-rw-r--r--app/views/softkeys/edit.html.haml3
-rw-r--r--app/views/softkeys/index.html.haml6
-rw-r--r--app/views/softkeys/new.html.haml3
-rw-r--r--app/views/softkeys/show.html.haml7
7 files changed, 52 insertions, 0 deletions
diff --git a/app/views/softkeys/_form.html.haml b/app/views/softkeys/_form.html.haml
new file mode 100644
index 0000000..5b799b6
--- /dev/null
+++ b/app/views/softkeys/_form.html.haml
@@ -0,0 +1,7 @@
+= simple_form_for([@sip_account, @softkey]) do |f|
+ = f.error_notification
+
+ = render "form_core", :f => f
+
+ .actions
+ = f.button :submit, conditional_t('softkeys.form.submit') \ No newline at end of file
diff --git a/app/views/softkeys/_form_core.html.haml b/app/views/softkeys/_form_core.html.haml
new file mode 100644
index 0000000..b833aad
--- /dev/null
+++ b/app/views/softkeys/_form_core.html.haml
@@ -0,0 +1,12 @@
+%script{:type => "text/javascript"}
+ :plain
+ call_forwarding_function_name = "#{I18n.t('softkeys.functions.call_forwarding')}"
+ hold_function_name = "#{I18n.t('softkeys.functions.hold')}"
+ deactivated_function_name = "#{I18n.t('softkeys.functions.deactivated')}"
+
+.inputs
+ = f.input :softkey_function_id, :as => :select, :collection => @softkey_functions.map {|x| [I18n.t("softkeys.functions.#{x}"), x.id] }, :label => t('softkeys.form.function.label'), :hint => conditional_hint('softkeys.form.function.hint'), :include_blank => false
+ - if @available_call_forwards && @available_call_forwards.count > 0
+ = f.association :call_forward, :collection => @available_call_forwards, :label => t('softkeys.form.call_forward.label'), :hint => conditional_hint('softkeys.form.call_forward.hint'), :include_blank => false
+ = f.input :number, :label => t('softkeys.form.number.label'), :hint => conditional_hint('softkeys.form.number.hint')
+ = f.input :label, :label => t('softkeys.form.label.label'), :hint => conditional_hint('softkeys.form.label.hint')
diff --git a/app/views/softkeys/_index_core.html.haml b/app/views/softkeys/_index_core.html.haml
new file mode 100644
index 0000000..fd3dca8
--- /dev/null
+++ b/app/views/softkeys/_index_core.html.haml
@@ -0,0 +1,14 @@
+%table
+ %tr
+ %th= t('softkeys.index.function')
+ %th= t('softkeys.index.number')
+ %th= t('softkeys.index.label')
+
+ - reset_cycle
+ - for softkey in softkeys.order(:position)
+ %tr{:class => cycle('odd', 'even')}
+ %td
+ =softkey.to_s
+ %td= softkey.number
+ %td= softkey.label
+ =render :partial => 'shared/index_view_edit_destroy_part', :locals => {:parent => softkey.sip_account, :child => softkey} \ No newline at end of file
diff --git a/app/views/softkeys/edit.html.haml b/app/views/softkeys/edit.html.haml
new file mode 100644
index 0000000..54d53fc
--- /dev/null
+++ b/app/views/softkeys/edit.html.haml
@@ -0,0 +1,3 @@
+- title t("softkeys.edit.page_title")
+
+= render "form" \ No newline at end of file
diff --git a/app/views/softkeys/index.html.haml b/app/views/softkeys/index.html.haml
new file mode 100644
index 0000000..8bdc00e
--- /dev/null
+++ b/app/views/softkeys/index.html.haml
@@ -0,0 +1,6 @@
+- title t("softkeys.index.page_title")
+
+- if @softkeys.count > 0
+ = render "index_core", :softkeys => @softkeys
+
+= render :partial => 'shared/create_link', :locals => {:parent => @sip_account, :child_class => Softkey} \ No newline at end of file
diff --git a/app/views/softkeys/new.html.haml b/app/views/softkeys/new.html.haml
new file mode 100644
index 0000000..593add6
--- /dev/null
+++ b/app/views/softkeys/new.html.haml
@@ -0,0 +1,3 @@
+- title t("softkeys.new.page_title")
+
+= render "form"
diff --git a/app/views/softkeys/show.html.haml b/app/views/softkeys/show.html.haml
new file mode 100644
index 0000000..9ab4333
--- /dev/null
+++ b/app/views/softkeys/show.html.haml
@@ -0,0 +1,7 @@
+- title t("softkeys.show.page_title")
+
+%p
+ %strong= t('softkeys.show.function') + ":"
+ =@softkey.to_s
+
+= render :partial => 'shared/show_edit_destroy_part', :locals => { :parent => @softkey.sip_account, :child => @softkey } \ No newline at end of file