From db9dbf03d88cfbd68ce99a242730b9e870339539 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Thu, 7 Mar 2013 13:15:35 +0100 Subject: Added Switchboard scaffold. --- app/views/switchboards/_form.html.haml | 7 +++++++ app/views/switchboards/_form_core.html.haml | 2 ++ app/views/switchboards/_index_core.html.haml | 10 ++++++++++ app/views/switchboards/edit.html.haml | 3 +++ app/views/switchboards/index.html.haml | 8 ++++++++ app/views/switchboards/new.html.haml | 3 +++ app/views/switchboards/show.html.haml | 12 ++++++++++++ 7 files changed, 45 insertions(+) create mode 100644 app/views/switchboards/_form.html.haml create mode 100644 app/views/switchboards/_form_core.html.haml create mode 100644 app/views/switchboards/_index_core.html.haml create mode 100644 app/views/switchboards/edit.html.haml create mode 100644 app/views/switchboards/index.html.haml create mode 100644 app/views/switchboards/new.html.haml create mode 100644 app/views/switchboards/show.html.haml (limited to 'app/views') diff --git a/app/views/switchboards/_form.html.haml b/app/views/switchboards/_form.html.haml new file mode 100644 index 0000000..bb09713 --- /dev/null +++ b/app/views/switchboards/_form.html.haml @@ -0,0 +1,7 @@ += simple_form_for([@user, @switchboard]) do |f| + = f.error_notification + + = render "form_core", :f => f + + .form-actions + = f.button :submit, conditional_t('switchboards.form.submit') diff --git a/app/views/switchboards/_form_core.html.haml b/app/views/switchboards/_form_core.html.haml new file mode 100644 index 0000000..61b5934 --- /dev/null +++ b/app/views/switchboards/_form_core.html.haml @@ -0,0 +1,2 @@ +.inputs + = f.input :name, :label => t('switchboards.form.name.label'), :hint => conditional_hint('switchboards.form.name.hint'), :autofocus => true diff --git a/app/views/switchboards/_index_core.html.haml b/app/views/switchboards/_index_core.html.haml new file mode 100644 index 0000000..858f624 --- /dev/null +++ b/app/views/switchboards/_index_core.html.haml @@ -0,0 +1,10 @@ +%table.table.table-striped + %tr + %th= t('switchboards.index.name') + %th + + + - for switchboard in switchboards + %tr + %td= switchboard.name + =render :partial => 'shared/index_view_edit_destroy_part', :locals => {:parent => user, :child => switchboard} \ No newline at end of file diff --git a/app/views/switchboards/edit.html.haml b/app/views/switchboards/edit.html.haml new file mode 100644 index 0000000..1ab0efe --- /dev/null +++ b/app/views/switchboards/edit.html.haml @@ -0,0 +1,3 @@ +- content_for :title, t("switchboards.edit.page_title") + += render "form" \ No newline at end of file diff --git a/app/views/switchboards/index.html.haml b/app/views/switchboards/index.html.haml new file mode 100644 index 0000000..4f29d7d --- /dev/null +++ b/app/views/switchboards/index.html.haml @@ -0,0 +1,8 @@ +- content_for :title, t("switchboards.index.page_title") + +.row + .span6 + - if @switchboards && @switchboards.count > 0 + = render :partial => "index_core", :locals => {:switchboards => @switchboards, :user => @user} + + = render :partial => 'shared/create_link', :locals => {:parent => @user, :child_class => Switchboard} \ No newline at end of file diff --git a/app/views/switchboards/new.html.haml b/app/views/switchboards/new.html.haml new file mode 100644 index 0000000..9f5918f --- /dev/null +++ b/app/views/switchboards/new.html.haml @@ -0,0 +1,3 @@ +- content_for :title, t("switchboards.new.page_title") + += render "form" \ No newline at end of file diff --git a/app/views/switchboards/show.html.haml b/app/views/switchboards/show.html.haml new file mode 100644 index 0000000..746e180 --- /dev/null +++ b/app/views/switchboards/show.html.haml @@ -0,0 +1,12 @@ +- content_for :title, t("switchboards.show.page_title") + +.row + .span6 + %table.table.table-striped + %tr + %td + %strong= t('switchboards.show.name') + ":" + %td + = @switchboard.name + += render :partial => 'shared/show_edit_destroy_part', :locals => { :parent => @user, :child => @switchboard } \ No newline at end of file -- cgit v1.2.3 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') 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 From 21d0843117c0962bd962fc50fccaf276a5b3067f Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Sun, 10 Mar 2013 08:43:23 +0100 Subject: Misc --- app/views/switchboards/show.html.haml | 53 ++++++++++++++++++++++++++++------- 1 file changed, 43 insertions(+), 10 deletions(-) (limited to 'app/views') diff --git a/app/views/switchboards/show.html.haml b/app/views/switchboards/show.html.haml index 746e180..b81980c 100644 --- a/app/views/switchboards/show.html.haml +++ b/app/views/switchboards/show.html.haml @@ -1,12 +1,45 @@ -- content_for :title, t("switchboards.show.page_title") +- content_for :title, @switchboard.name + .row - .span6 - %table.table.table-striped - %tr - %td - %strong= t('switchboards.show.name') + ":" - %td - = @switchboard.name - -= render :partial => 'shared/show_edit_destroy_part', :locals => { :parent => @user, :child => @switchboard } \ No newline at end of file + .span12 + .well.pull-right + %p + =current_user + + %ul.thumbnails + - @switchboard.switchboard_entries.each do |switchboard_entry| + %li.span1 + %div.thumbnail + %a.thumbnail{:href => tenant_user_path(switchboard_entry.sip_account.sip_accountable.current_tenant, switchboard_entry.sip_account.sip_accountable)} + - if switchboard_entry.sip_account.sip_accountable.image? + = image_tag(switchboard_entry.sip_account.sip_accountable.image_url(:mini).to_s, :class => 'img-rounded') + - else + - if switchboard_entry.sip_account.sip_accountable.male? + = image_tag 'icons/user-male-16x.png', :class => 'img-rounded' + - else + = image_tag 'icons/user-female-16x.png', :class => 'img-rounded' + %p + %small + = truncate(switchboard_entry.to_s, :length => 10) + %span{:class => "label #{(switchboard_entry.sip_account.registration ? '' : 'label-inverse')}"} + - if !switchboard_entry.sip_account.registration + %i.icon-ban-circle.icon-white + - if switchboard_entry.sip_account.phone_numbers.count > 1 + - phone_numbers = [] + - switchboard_entry.sip_account.phone_numbers.order(:position).each do |phone_number| + - if phone_number.number.length < 6 + - phone_numbers << phone_number + - if phone_numbers.size == 0 + - phone_numbers = switchboard_entry.sip_account.phone_numbers.order(:position) + - else + - phone_numbers = switchboard_entry.sip_account.phone_numbers + = render 'phone_numbers/listing', :phone_numbers => phone_numbers + +- if can? :edit, @switchboard + .row + .span12 + %a.btn.btn-small.btn-warning{:href => switchboard_switchboard_entries_path(@switchboard) } + %i.icon-edit.icon-white + %span.hidden-phone + =t("switchboard_entries.index.page_title") -- cgit v1.2.3