From 3833ac1506fb336cd617ec41d25e35c34e74064e Mon Sep 17 00:00:00 2001 From: Peter Kozak Date: Tue, 26 Mar 2013 15:51:35 +0100 Subject: voicemail refactored --- app/views/voicemail_settings/_form.html.haml | 3 +- app/views/voicemail_settings/_form_core.html.haml | 17 ++++++----- app/views/voicemail_settings/_index_core.html.haml | 14 +++++++++ app/views/voicemail_settings/edit.html.haml | 2 +- app/views/voicemail_settings/index.html.haml | 6 ++++ app/views/voicemail_settings/new.html.haml | 3 ++ app/views/voicemail_settings/show.html.haml | 33 +++++++++------------- 7 files changed, 47 insertions(+), 31 deletions(-) create mode 100644 app/views/voicemail_settings/_index_core.html.haml create mode 100644 app/views/voicemail_settings/index.html.haml create mode 100644 app/views/voicemail_settings/new.html.haml (limited to 'app/views/voicemail_settings') diff --git a/app/views/voicemail_settings/_form.html.haml b/app/views/voicemail_settings/_form.html.haml index cd43b2d..08fc37b 100644 --- a/app/views/voicemail_settings/_form.html.haml +++ b/app/views/voicemail_settings/_form.html.haml @@ -1,4 +1,5 @@ -= simple_form_for([@sip_account,@voicemail_setting]) do |f| + += simple_form_for([@voicemail_account, @voicemail_setting]) do |f| = f.error_notification = render "form_core", :f => f diff --git a/app/views/voicemail_settings/_form_core.html.haml b/app/views/voicemail_settings/_form_core.html.haml index 08bdfc2..bf47e46 100644 --- a/app/views/voicemail_settings/_form_core.html.haml +++ b/app/views/voicemail_settings/_form_core.html.haml @@ -1,11 +1,10 @@ .inputs + - if !@no_edit or !@no_edit[:name] + = f.input :name, :collection => VoicemailSetting::VOICEMAIL_SETTINGS.keys.collect{|i, k| [t("voicemail_settings.settings.#{i}"), i]}, :label => t('voicemail_settings.form.name.label'), :hint => conditional_hint('voicemail_settings.form.name.hint'), :autofocus => true, :include_blank => false + = f.input :value, :label => t('voicemail_settings.form.value.label'), :hint => conditional_hint('voicemail_settings.form.value.hint') + - else + = f.input :value, :label => t("voicemail_settings.settings.#{@no_edit[:name][:name]}"), :hint => conditional_hint('voicemail_settings.form.value.hint'), :as => @no_edit[:name][:input] - = f.input :greeting_path, :as => :select, :label => t('voicemail_settings.form.greeting.label'), :hint => conditional_hint('voicemail_settings.form.greeting.hint'), :collection => @greeting_files - = f.input :name_path, :as => :select, :label => t('voicemail_settings.form.name.label'), :hint => conditional_hint('voicemail_settings.form.name.hint'), :collection => @name_files - - = f.input :password, :label => t('voicemail_settings.form.pin.label'), :hint => conditional_hint('voicemail_settings.form.pin.hint') - - = f.input :notify, :as => :boolean, :label => t('voicemail_settings.form.notify.label'), :hint => conditional_hint('voicemail_settings.form.notify.hint') - = f.input :attachment, :as => :boolean, :label => t('voicemail_settings.form.attachment.label'), :hint => conditional_hint('voicemail_settings.form.attachment.hint') - = f.input :mark_read, :as => :boolean, :label => t('voicemail_settings.form.mark_read.label'), :hint => conditional_hint('voicemail_settings.form.mark_read.hint') - = f.input :purge, :as => :boolean, :label => t('voicemail_settings.form.purge.label'), :hint => conditional_hint('voicemail_settings.form.purge.hint') + - if !@no_edit or !@no_edit[:description] + = f.input :description, :label => t('voicemail_settings.form.description.label'), :hint => conditional_hint('voicemail_settings.form.description.hint') + diff --git a/app/views/voicemail_settings/_index_core.html.haml b/app/views/voicemail_settings/_index_core.html.haml new file mode 100644 index 0000000..94ebfb1 --- /dev/null +++ b/app/views/voicemail_settings/_index_core.html.haml @@ -0,0 +1,14 @@ +%table.table.table-striped + %thead + %tr + %th= t('voicemail_settings.index.name') + %th= t('voicemail_settings.index.value') + %th= t('voicemail_settings.index.description') + + %tbody + - for voicemail_setting in voicemail_settings + %tr + %td= voicemail_setting.name + %td= voicemail_setting.value + %td= voicemail_setting.description + =render :partial => 'shared/index_view_edit_destroy_part', :locals => {:parent => voicemail_setting.voicemail_account, :child => voicemail_setting} diff --git a/app/views/voicemail_settings/edit.html.haml b/app/views/voicemail_settings/edit.html.haml index 56e5765..cb9924b 100644 --- a/app/views/voicemail_settings/edit.html.haml +++ b/app/views/voicemail_settings/edit.html.haml @@ -1,3 +1,3 @@ - content_for :title, t("voicemail_settings.edit.page_title") -= render "form" += render "form" \ No newline at end of file diff --git a/app/views/voicemail_settings/index.html.haml b/app/views/voicemail_settings/index.html.haml new file mode 100644 index 0000000..5eb9940 --- /dev/null +++ b/app/views/voicemail_settings/index.html.haml @@ -0,0 +1,6 @@ +- content_for :title, t("voicemail_settings.index.page_title") + +- if @voicemail_settings && @voicemail_settings.count > 0 + = render "index_core", :voicemail_settings => @voicemail_settings + += render :partial => 'shared/create_link', :locals => {:parent => @voicemail_account, :child_class => VoicemailSetting} diff --git a/app/views/voicemail_settings/new.html.haml b/app/views/voicemail_settings/new.html.haml new file mode 100644 index 0000000..6eddc39 --- /dev/null +++ b/app/views/voicemail_settings/new.html.haml @@ -0,0 +1,3 @@ +- content_for :title, t("voicemail_settings.new.page_title") + += render "form" \ No newline at end of file diff --git a/app/views/voicemail_settings/show.html.haml b/app/views/voicemail_settings/show.html.haml index e156d7b..f1a3e61 100644 --- a/app/views/voicemail_settings/show.html.haml +++ b/app/views/voicemail_settings/show.html.haml @@ -1,26 +1,19 @@ - content_for :title, t("voicemail_settings.show.page_title") %p - %strong= t('voicemail_settings.show.greeting_path') + ":" - = File.basename(@voicemail_setting.greeting_path.to_s) - + %strong= t('voicemail_settings.show.voicemail_id') + ":" + = @voicemail_setting.voicemail %p - %strong= t('voicemail_settings.show.name_path') + ":" - = File.basename(@voicemail_setting.name_path.to_s) - + %strong= t('voicemail_settings.show.name') + ":" + = @voicemail_setting.name +%p + %strong= t('voicemail_settings.show.value') + ":" + = @voicemail_setting.value +%p + %strong= t('voicemail_settings.show.class_type') + ":" + = @voicemail_setting.class_type %p - %strong= t('voicemail_settings.show.flags') + ":" - - if @voicemail_setting.notify - %br - = "- " + t('voicemail_settings.show.notify') - - if @voicemail_setting.attachment - %br - = "- " + t('voicemail_settings.show.attachment') - - if @voicemail_setting.mark_read - %br - = "- " + t('voicemail_settings.show.mark_read') - - if @voicemail_setting.purge - %br - = "- " + t('voicemail_settings.show.purge') + %strong= t('voicemail_settings.show.description') + ":" + = @voicemail_setting.description -= link_to t('voicemail_settings.actions.edit'), edit_sip_account_voicemail_setting_path(@sip_account, @voicemail_setting) += render :partial => 'shared/show_edit_destroy_part', :locals => {:parent => @voicemail_setting.voicemail_account, :child => @voicemail_setting} \ No newline at end of file -- cgit v1.2.3 From 41b306402d020aff3615308cdd555b0a05221343 Mon Sep 17 00:00:00 2001 From: Peter Kozak Date: Wed, 27 Mar 2013 08:13:21 +0100 Subject: voicemail settings --- app/views/voicemail_settings/_form_core.html.haml | 3 ++- app/views/voicemail_settings/_index_core.html.haml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'app/views/voicemail_settings') diff --git a/app/views/voicemail_settings/_form_core.html.haml b/app/views/voicemail_settings/_form_core.html.haml index bf47e46..31c6bbf 100644 --- a/app/views/voicemail_settings/_form_core.html.haml +++ b/app/views/voicemail_settings/_form_core.html.haml @@ -1,9 +1,10 @@ + .inputs - if !@no_edit or !@no_edit[:name] = f.input :name, :collection => VoicemailSetting::VOICEMAIL_SETTINGS.keys.collect{|i, k| [t("voicemail_settings.settings.#{i}"), i]}, :label => t('voicemail_settings.form.name.label'), :hint => conditional_hint('voicemail_settings.form.name.hint'), :autofocus => true, :include_blank => false = f.input :value, :label => t('voicemail_settings.form.value.label'), :hint => conditional_hint('voicemail_settings.form.value.hint') - else - = f.input :value, :label => t("voicemail_settings.settings.#{@no_edit[:name][:name]}"), :hint => conditional_hint('voicemail_settings.form.value.hint'), :as => @no_edit[:name][:input] + = f.input :value, :label => t("voicemail_settings.settings.#{@no_edit[:name][:name]}"), :hint => conditional_hint('voicemail_settings.form.value.hint'), :as => @no_edit[:name][:input], input_html: @no_edit[:name][:html] - if !@no_edit or !@no_edit[:description] = f.input :description, :label => t('voicemail_settings.form.description.label'), :hint => conditional_hint('voicemail_settings.form.description.hint') diff --git a/app/views/voicemail_settings/_index_core.html.haml b/app/views/voicemail_settings/_index_core.html.haml index 94ebfb1..9173fe6 100644 --- a/app/views/voicemail_settings/_index_core.html.haml +++ b/app/views/voicemail_settings/_index_core.html.haml @@ -8,7 +8,7 @@ %tbody - for voicemail_setting in voicemail_settings %tr - %td= voicemail_setting.name + %td= t("voicemail_settings.settings.#{voicemail_setting.name}") %td= voicemail_setting.value %td= voicemail_setting.description =render :partial => 'shared/index_view_edit_destroy_part', :locals => {:parent => voicemail_setting.voicemail_account, :child => voicemail_setting} -- cgit v1.2.3 From ebd0b70051c53d207ab21d9671944201894baea3 Mon Sep 17 00:00:00 2001 From: Peter Kozak Date: Thu, 25 Apr 2013 12:13:12 +0200 Subject: form_core fixed --- app/views/voicemail_settings/_form_core.html.haml | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'app/views/voicemail_settings') diff --git a/app/views/voicemail_settings/_form_core.html.haml b/app/views/voicemail_settings/_form_core.html.haml index 31c6bbf..00d2a9e 100644 --- a/app/views/voicemail_settings/_form_core.html.haml +++ b/app/views/voicemail_settings/_form_core.html.haml @@ -1,11 +1,5 @@ .inputs - - if !@no_edit or !@no_edit[:name] - = f.input :name, :collection => VoicemailSetting::VOICEMAIL_SETTINGS.keys.collect{|i, k| [t("voicemail_settings.settings.#{i}"), i]}, :label => t('voicemail_settings.form.name.label'), :hint => conditional_hint('voicemail_settings.form.name.hint'), :autofocus => true, :include_blank => false - = f.input :value, :label => t('voicemail_settings.form.value.label'), :hint => conditional_hint('voicemail_settings.form.value.hint') - - else - = f.input :value, :label => t("voicemail_settings.settings.#{@no_edit[:name][:name]}"), :hint => conditional_hint('voicemail_settings.form.value.hint'), :as => @no_edit[:name][:input], input_html: @no_edit[:name][:html] - - - if !@no_edit or !@no_edit[:description] - = f.input :description, :label => t('voicemail_settings.form.description.label'), :hint => conditional_hint('voicemail_settings.form.description.hint') - + = f.input :name, :collection => @names_possible, :label => t('voicemail_settings.form.name.label'), :hint => conditional_hint('voicemail_settings.form.name.hint'), :autofocus => true, :include_blank => false + = f.input :value, :label => t('voicemail_settings.form.value.label'), :hint => conditional_hint('voicemail_settings.form.value.hint') + = f.input :description, :label => t('voicemail_settings.form.description.label'), :hint => conditional_hint('voicemail_settings.form.description.hint') -- cgit v1.2.3 From 7e6b6a93a2d21c0e5bd8ad4c2b7be6172cb2638b Mon Sep 17 00:00:00 2001 From: Peter Kozak Date: Thu, 25 Apr 2013 12:13:49 +0200 Subject: edit form --- app/views/voicemail_settings/_edit_form.html.haml | 8 ++++++++ app/views/voicemail_settings/_edit_form_core.html.haml | 2 ++ app/views/voicemail_settings/edit.html.haml | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 app/views/voicemail_settings/_edit_form.html.haml create mode 100644 app/views/voicemail_settings/_edit_form_core.html.haml (limited to 'app/views/voicemail_settings') diff --git a/app/views/voicemail_settings/_edit_form.html.haml b/app/views/voicemail_settings/_edit_form.html.haml new file mode 100644 index 0000000..374df9f --- /dev/null +++ b/app/views/voicemail_settings/_edit_form.html.haml @@ -0,0 +1,8 @@ + += simple_form_for([@voicemail_account, @voicemail_setting]) do |f| + = f.error_notification + + = render "edit_form_core", :f => f + + .form-actions + = f.button :submit, conditional_t('voicemail_settings.form.submit') diff --git a/app/views/voicemail_settings/_edit_form_core.html.haml b/app/views/voicemail_settings/_edit_form_core.html.haml new file mode 100644 index 0000000..4352f24 --- /dev/null +++ b/app/views/voicemail_settings/_edit_form_core.html.haml @@ -0,0 +1,2 @@ +.inputs + = f.input :value, :label => t("voicemail_settings.settings.#{@voicemail_setting.name.to_s}"), :hint => @voicemail_setting.description, :as => @input_type, input_html: @input_html diff --git a/app/views/voicemail_settings/edit.html.haml b/app/views/voicemail_settings/edit.html.haml index cb9924b..cfda363 100644 --- a/app/views/voicemail_settings/edit.html.haml +++ b/app/views/voicemail_settings/edit.html.haml @@ -1,3 +1,3 @@ - content_for :title, t("voicemail_settings.edit.page_title") -= render "form" \ No newline at end of file += render "edit_form" \ No newline at end of file -- cgit v1.2.3 From f9012f9ffa7eb074cf5c7db74a372437017e2ddd Mon Sep 17 00:00:00 2001 From: Peter Kozak Date: Thu, 25 Apr 2013 12:14:26 +0200 Subject: voicemail_settings view fixed --- app/views/voicemail_settings/show.html.haml | 3 --- 1 file changed, 3 deletions(-) (limited to 'app/views/voicemail_settings') diff --git a/app/views/voicemail_settings/show.html.haml b/app/views/voicemail_settings/show.html.haml index f1a3e61..277874e 100644 --- a/app/views/voicemail_settings/show.html.haml +++ b/app/views/voicemail_settings/show.html.haml @@ -1,8 +1,5 @@ - content_for :title, t("voicemail_settings.show.page_title") -%p - %strong= t('voicemail_settings.show.voicemail_id') + ":" - = @voicemail_setting.voicemail %p %strong= t('voicemail_settings.show.name') + ":" = @voicemail_setting.name -- cgit v1.2.3