From 6374c0b3e38dfc74eb1b4a5a1fcc5229eacdcaf2 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Fri, 8 Mar 2013 12:09:17 +0100 Subject: Added SwitchboardEntry scaffold. switchboard has_many switchboard_entries --- app/views/switchboard_entries/_form.html.haml | 7 +++++++ app/views/switchboard_entries/_form_core.html.haml | 3 +++ .../switchboard_entries/_index_core.html.haml | 16 ++++++++++++++++ app/views/switchboard_entries/edit.html.haml | 3 +++ app/views/switchboard_entries/index.html.haml | 6 ++++++ app/views/switchboard_entries/new.html.haml | 3 +++ app/views/switchboard_entries/show.html.haml | 22 ++++++++++++++++++++++ 7 files changed, 60 insertions(+) create mode 100644 app/views/switchboard_entries/_form.html.haml create mode 100644 app/views/switchboard_entries/_form_core.html.haml create mode 100644 app/views/switchboard_entries/_index_core.html.haml create mode 100644 app/views/switchboard_entries/edit.html.haml create mode 100644 app/views/switchboard_entries/index.html.haml create mode 100644 app/views/switchboard_entries/new.html.haml create mode 100644 app/views/switchboard_entries/show.html.haml (limited to 'app/views/switchboard_entries') diff --git a/app/views/switchboard_entries/_form.html.haml b/app/views/switchboard_entries/_form.html.haml new file mode 100644 index 0000000..b3d56ec --- /dev/null +++ b/app/views/switchboard_entries/_form.html.haml @@ -0,0 +1,7 @@ += simple_form_for([@switchboard, @switchboard_entry]) do |f| + = f.error_notification + + = render "form_core", :f => f + + .form-actions + = f.button :submit, conditional_t('switchboard_entries.form.submit') diff --git a/app/views/switchboard_entries/_form_core.html.haml b/app/views/switchboard_entries/_form_core.html.haml new file mode 100644 index 0000000..6f340c2 --- /dev/null +++ b/app/views/switchboard_entries/_form_core.html.haml @@ -0,0 +1,3 @@ +.inputs + = f.association :sip_account, :collection => @sip_accounts, :label => t('switchboard_entries.form.sip_account_id.label'), :hint => conditional_hint('switchboard_entries.form.sip_account_id.hint'), :autofocus => true, :include_blank => false + = f.input :name, :label => t('switchboard_entries.form.name.label'), :hint => conditional_hint('switchboard_entries.form.name.hint') diff --git a/app/views/switchboard_entries/_index_core.html.haml b/app/views/switchboard_entries/_index_core.html.haml new file mode 100644 index 0000000..406db71 --- /dev/null +++ b/app/views/switchboard_entries/_index_core.html.haml @@ -0,0 +1,16 @@ +%table.table.table-striped + %tr + %th + %th= t('switchboard_entries.index.sip_account_id') + %th= t('switchboard_entries.index.name') + %th + + %tbody{ :id => "switchboard_entries", :'data-update-url' => sort_switchboard_switchboard_entries_path(switchboard_entries.first.switchboard) } + - for switchboard_entry in switchboard_entries + = content_tag_for :tr, switchboard_entry do + %td + %span.handle + %i.icon-resize-vertical + %td= switchboard_entry.sip_account + %td= switchboard_entry.name + =render :partial => 'shared/index_view_edit_destroy_part', :locals => {:parent => switchboard_entry.switchboard, :child => switchboard_entry} \ No newline at end of file diff --git a/app/views/switchboard_entries/edit.html.haml b/app/views/switchboard_entries/edit.html.haml new file mode 100644 index 0000000..8885e25 --- /dev/null +++ b/app/views/switchboard_entries/edit.html.haml @@ -0,0 +1,3 @@ +- content_for :title, t("switchboard_entries.edit.page_title") + += render "form" \ No newline at end of file diff --git a/app/views/switchboard_entries/index.html.haml b/app/views/switchboard_entries/index.html.haml new file mode 100644 index 0000000..302b778 --- /dev/null +++ b/app/views/switchboard_entries/index.html.haml @@ -0,0 +1,6 @@ +- content_for :title, t("switchboard_entries.index.page_title") + +- if @switchboard_entries && @switchboard_entries.count > 0 + = render "index_core", :switchboard_entries => @switchboard_entries + += render :partial => 'shared/create_link', :locals => {:parent => @switchboard, :child_class => SwitchboardEntry} \ No newline at end of file diff --git a/app/views/switchboard_entries/new.html.haml b/app/views/switchboard_entries/new.html.haml new file mode 100644 index 0000000..0801a65 --- /dev/null +++ b/app/views/switchboard_entries/new.html.haml @@ -0,0 +1,3 @@ +- content_for :title, t("switchboard_entries.new.page_title") + += render "form" \ No newline at end of file diff --git a/app/views/switchboard_entries/show.html.haml b/app/views/switchboard_entries/show.html.haml new file mode 100644 index 0000000..b519781 --- /dev/null +++ b/app/views/switchboard_entries/show.html.haml @@ -0,0 +1,22 @@ +- content_for :title, t("switchboard_entries.show.page_title") + +.row + .span6 + %table.table.table-striped + %tr + %td + %strong= t('switchboard_entries.show.sip_account_id') + ":" + %td + = @switchboard_entry.sip_account + %tr + %td + %strong= t('switchboard_entries.show.name') + ":" + %td + = @switchboard_entry.name + %tr + %td + %strong= t('switchboard_entries.show.position') + ":" + %td + = @switchboard_entry.position + + = render :partial => 'shared/show_edit_destroy_part', :locals => {:parent => @switchboard, :child => @switchboard_entry } \ No newline at end of file -- cgit v1.2.3