summaryrefslogtreecommitdiff
path: root/app/views/fax_accounts
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2012-12-17 12:05:14 +0100
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2012-12-17 12:05:14 +0100
commiteaad37485fe59d0306c37cc038dda6d210052910 (patch)
tree072c4b0e33d442528555b82c415f5e7a1712b2b0 /app/views/fax_accounts
parent3e706c2025ecc5523e81ad649639ef2ff75e7bac (diff)
parentb80bd744ad873f6fc43018bc4bfb90677de167bd (diff)
Merge branch 'develop'
Diffstat (limited to 'app/views/fax_accounts')
-rw-r--r--app/views/fax_accounts/_form.html.haml7
-rw-r--r--app/views/fax_accounts/_form_core.html.haml11
-rw-r--r--app/views/fax_accounts/_index_core.html.haml35
-rw-r--r--app/views/fax_accounts/edit.html.haml3
-rw-r--r--app/views/fax_accounts/index.html.haml6
-rw-r--r--app/views/fax_accounts/new.html.haml3
-rw-r--r--app/views/fax_accounts/show.html.haml21
7 files changed, 86 insertions, 0 deletions
diff --git a/app/views/fax_accounts/_form.html.haml b/app/views/fax_accounts/_form.html.haml
new file mode 100644
index 0000000..0a5a4c0
--- /dev/null
+++ b/app/views/fax_accounts/_form.html.haml
@@ -0,0 +1,7 @@
+= simple_form_for([ @parent, @fax_account ]) do |f|
+ = f.error_notification
+
+ = render "form_core", :f => f
+
+ .actions
+ = f.button :submit, conditional_t('fax_accounts.form.submit') \ No newline at end of file
diff --git a/app/views/fax_accounts/_form_core.html.haml b/app/views/fax_accounts/_form_core.html.haml
new file mode 100644
index 0000000..8153e5f
--- /dev/null
+++ b/app/views/fax_accounts/_form_core.html.haml
@@ -0,0 +1,11 @@
+.inputs
+ = f.input :name, :label => t('fax_accounts.form.name.label'), :hint => conditional_hint('fax_accounts.form.name.hint')
+ = f.input :station_id, :label => t('fax_accounts.form.station_id.label'), :hint => conditional_hint('fax_accounts.form.station_id.hint')
+ = f.input :retries, :label => t('fax_accounts.form.retries.label'), :hint => conditional_hint('fax_accounts.form.retries.hint')
+ = f.input :email, :label => t('fax_accounts.form.email.label'), :hint => conditional_hint('fax_accounts.form.email.hint')
+
+ = f.input :days_till_auto_delete, :label => t('fax_accounts.form.days_till_auto_delete.label'), :hint => conditional_hint('fax_accounts.form.days_till_auto_delete.hint')
+
+ %h2= t('phone_numbers.name')
+ = f.simple_fields_for :phone_numbers, @fax_account.phone_numbers do |phone_number|
+ = render "phone_numbers/form_core", :f => phone_number
diff --git a/app/views/fax_accounts/_index_core.html.haml b/app/views/fax_accounts/_index_core.html.haml
new file mode 100644
index 0000000..50dc2eb
--- /dev/null
+++ b/app/views/fax_accounts/_index_core.html.haml
@@ -0,0 +1,35 @@
+%table
+ %tr
+ %th= t('fax_accounts.index.name')
+ %th
+ = t('fax_accounts.index.phone_numbers')
+ %br
+ = t('fax_accounts.index.station_id')
+ %th
+ = t('fax_accounts.index.received')
+ = '/'
+ = t('fax_accounts.index.sent')
+ %br
+ %small
+ = t('fax_accounts.index.last_update')
+
+ - reset_cycle
+ - for fax_account in fax_accounts
+ %tr{:class => cycle('odd', 'even')}
+ %td= truncate(fax_account.name, :length => 15)
+ %td
+ =render 'phone_numbers/listing', :phone_numbers => fax_account.phone_numbers.order(:number)
+ %br
+ = truncate(fax_account.station_id, :length => 20)
+ %td
+ = link_to fax_account.fax_documents.inbound.count, fax_account_fax_documents_path(fax_account, :anchor => "fax_document_#{fax_account.fax_documents.inbound.first.try(:id)}")
+ = '/'
+ = link_to fax_account.fax_documents.outbound.count, fax_account_fax_documents_path(fax_account, :anchor => "fax_document_#{fax_account.fax_documents.outbound.first.try(:id)}")
+ - if fax_account.fax_documents.count > 0
+ %br
+ %small
+ = time_ago_in_words(fax_account.fax_documents.order(:updated_at).last.updated_at)
+ %td
+ - if can?(:new, FaxDocument, :fax_account_id => fax_account.id)
+ = link_to t('fax_accounts.index.send_a_fax'), new_fax_account_fax_document_path(fax_account)
+ =render :partial => 'shared/index_view_edit_destroy_part', :locals => {:parent => fax_account.fax_accountable, :child => fax_account} \ No newline at end of file
diff --git a/app/views/fax_accounts/edit.html.haml b/app/views/fax_accounts/edit.html.haml
new file mode 100644
index 0000000..86f664d
--- /dev/null
+++ b/app/views/fax_accounts/edit.html.haml
@@ -0,0 +1,3 @@
+- title t("fax_accounts.edit.page_title")
+
+= render "form"
diff --git a/app/views/fax_accounts/index.html.haml b/app/views/fax_accounts/index.html.haml
new file mode 100644
index 0000000..309a10d
--- /dev/null
+++ b/app/views/fax_accounts/index.html.haml
@@ -0,0 +1,6 @@
+- title t("fax_accounts.index.page_title")
+
+- if @fax_accounts.count > 0
+ = render "index_core", {:fax_accounts => @fax_accounts, :fax_accountable => @parent}
+
+= render :partial => 'shared/create_link', :locals => {:parent => @parent, :child_class => FaxAccount} \ No newline at end of file
diff --git a/app/views/fax_accounts/new.html.haml b/app/views/fax_accounts/new.html.haml
new file mode 100644
index 0000000..9a67100
--- /dev/null
+++ b/app/views/fax_accounts/new.html.haml
@@ -0,0 +1,3 @@
+- title t("fax_accounts.new.page_title")
+
+= render "form"
diff --git a/app/views/fax_accounts/show.html.haml b/app/views/fax_accounts/show.html.haml
new file mode 100644
index 0000000..95fb7b2
--- /dev/null
+++ b/app/views/fax_accounts/show.html.haml
@@ -0,0 +1,21 @@
+- title t("fax_accounts.show.page_title")
+
+%p
+ %strong= t('fax_accounts.show.name') + ":"
+ = @fax_account.name
+%p
+ %strong= t('fax_accounts.show.email') + ":"
+ = @fax_account.email
+%p
+ %strong= t('fax_accounts.show.days_till_auto_delete') + ":"
+ = @fax_account.days_till_auto_delete
+
+= render :partial => 'shared/show_edit_destroy_part', :locals => { :parent => @parent, :child => @fax_account }
+
+= render :partial => 'shared/create_link', :locals => { :parent => @fax_account, :child_class => FaxDocument }
+
+%h2= t('phone_numbers.index.page_title')
+- if @fax_account.phone_numbers.count > 0
+ = render "phone_numbers/index_core", :phone_numbers => @fax_account.phone_numbers
+ %br
+= render :partial => 'shared/create_link', :locals => { :parent => @fax_account, :child_class => PhoneNumber } \ No newline at end of file