From b80bd744ad873f6fc43018bc4bfb90677de167bd Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Mon, 17 Dec 2012 12:01:45 +0100 Subject: Start of GS5. --- app/views/fax_documents/_form.html.haml | 7 ++++++ app/views/fax_documents/_form_core.html.haml | 7 ++++++ app/views/fax_documents/_index_core.html.haml | 33 ++++++++++++++++++++++++ app/views/fax_documents/edit.html.haml | 9 +++++++ app/views/fax_documents/index.html.haml | 5 ++++ app/views/fax_documents/new.html.haml | 3 +++ app/views/fax_documents/show.html.haml | 36 +++++++++++++++++++++++++++ 7 files changed, 100 insertions(+) create mode 100644 app/views/fax_documents/_form.html.haml create mode 100644 app/views/fax_documents/_form_core.html.haml create mode 100644 app/views/fax_documents/_index_core.html.haml create mode 100644 app/views/fax_documents/edit.html.haml create mode 100644 app/views/fax_documents/index.html.haml create mode 100644 app/views/fax_documents/new.html.haml create mode 100644 app/views/fax_documents/show.html.haml (limited to 'app/views/fax_documents') diff --git a/app/views/fax_documents/_form.html.haml b/app/views/fax_documents/_form.html.haml new file mode 100644 index 0000000..e240371 --- /dev/null +++ b/app/views/fax_documents/_form.html.haml @@ -0,0 +1,7 @@ += simple_form_for([@fax_account,@fax_document]) do |f| + = f.error_notification + + = render "form_core", :f => f + + .actions + = f.button :submit, conditional_t('fax_documents.form.submit') \ No newline at end of file diff --git a/app/views/fax_documents/_form_core.html.haml b/app/views/fax_documents/_form_core.html.haml new file mode 100644 index 0000000..2a53cd5 --- /dev/null +++ b/app/views/fax_documents/_form_core.html.haml @@ -0,0 +1,7 @@ +.inputs + = f.input :document, :label => t('fax_documents.form.document.label'), :hint => conditional_hint('fax_documents.form.document.hint') + = f.association :fax_resolution, :label => t('fax_documents.form.fax_resolution.label'), :hint => conditional_hint('fax_documents.form.fax_resolution.hint'), :include_blank => false + + = f.simple_fields_for :destination_phone_number, @phone_number do |u| + = render "phone_numbers/form_core", :f => u + diff --git a/app/views/fax_documents/_index_core.html.haml b/app/views/fax_documents/_index_core.html.haml new file mode 100644 index 0000000..4e15509 --- /dev/null +++ b/app/views/fax_documents/_index_core.html.haml @@ -0,0 +1,33 @@ +%table + %tr + %th= t('fax_documents.index.sent_at') + %th= t('fax_documents.index.state') + %th= t('fax_documents.index.result') + %th + = t('fax_documents.index.phone_number') + %br + = t('fax_documents.index.remote_station_id') + %th= t('fax_documents.index.thumbnails') + + - reset_cycle + - for fax_document in fax_documents + %tr{:class => cycle('odd', 'even'), :id => "fax_document_#{fax_document.id}"} + - if fax_document.sent_at + %td= "#{fax_document.inbound ? '⇨' : '⇦'} #{fax_document.sent_at}".html_safe + %td= t("fax_documents.states.#{fax_document.state}") + %td= t("fax_documents.result_codes.code_#{fax_document.result_code}") + " (#{fax_document.result_code})" + - else + %td{ :colspan => 3 }= t("fax_documents.states.#{fax_document.state}") + %td + - if fax_document.inbound + = "#{fax_document.caller_id_number} #{fax_document.caller_id_name}" + - else + = fax_document.destination_phone_number + %br + = fax_document.remote_station_id + %td + - fax_document.fax_thumbnails.limit(5).each do |fax_thumbnail| + =image_tag fax_thumbnail.thumbnail_url(:mini), :class => 'FaxThumbnail', :alt => "Thumbnail of page \##{fax_thumbnail.position}" + - if can?(:show, fax_document) && !fax_document.document.blank? && File.readable?(fax_document.document.path) + = link_to t('fax_documents.index.actions.download'), fax_account_fax_document_path(@fax_account, fax_document, :format => :pdf), :method => :get + =render :partial => 'shared/index_view_edit_destroy_part', :locals => {:parent => fax_document.fax_account, :child => fax_document} diff --git a/app/views/fax_documents/edit.html.haml b/app/views/fax_documents/edit.html.haml new file mode 100644 index 0000000..5da92c6 --- /dev/null +++ b/app/views/fax_documents/edit.html.haml @@ -0,0 +1,9 @@ +- title t("fax_documents.edit.page_title") + += render "form" + +%p + - if can? :edit, @fax_document + = link_to t('fax_documents.edit.actions.edit'), @fax_document + | + = link_to t('fax_documents.edit.actions.view_all'), fax_documents_path diff --git a/app/views/fax_documents/index.html.haml b/app/views/fax_documents/index.html.haml new file mode 100644 index 0000000..11199dd --- /dev/null +++ b/app/views/fax_documents/index.html.haml @@ -0,0 +1,5 @@ +- title t("fax_documents.index.page_title") + += render "index_core", :fax_documents => @fax_documents + += render :partial => 'shared/create_link', :locals => {:parent => @fax_account, :child_class => FaxDocument} \ No newline at end of file diff --git a/app/views/fax_documents/new.html.haml b/app/views/fax_documents/new.html.haml new file mode 100644 index 0000000..be02860 --- /dev/null +++ b/app/views/fax_documents/new.html.haml @@ -0,0 +1,3 @@ +- title t("fax_documents.new.page_title") + += render "form" diff --git a/app/views/fax_documents/show.html.haml b/app/views/fax_documents/show.html.haml new file mode 100644 index 0000000..4703e1d --- /dev/null +++ b/app/views/fax_documents/show.html.haml @@ -0,0 +1,36 @@ +- title t("fax_documents.show.page_title") +- child = @fax_document +- parent = @fax_document.fax_account + +%p + %strong= t('fax_documents.index.state') + ":" + = t("fax_documents.states.#{@fax_document.state}") + +%p + %strong= t('fax_documents.index.result_code') + ":" + = @fax_document.result_code + +%p + %strong= t('fax_documents.index.result_text') + ":" + = t("fax_documents.result_codes.code_#{@fax_document.result_code}") + +%p + %strong= t('fax_documents.show.document_transferred_pages') + ":" + = @fax_document.document_transferred_pages +%p + %strong= t('fax_documents.show.remote_station_id') + ":" + = @fax_document.remote_station_id +%p + %strong= t('fax_documents.show.fax_resolution') + ":" + = @fax_document.fax_resolution + +- if @fax_document.fax_thumbnails.count > 0 + - i = @fax_document.fax_thumbnails.count + - i = 10 if i > 10 + - @fax_document.fax_thumbnails.limit(i).each do |fax_thumbnail| + =image_tag fax_thumbnail.thumbnail_url(:medium), :class => 'FaxThumbnail', :alt => "Thumbnail of page \##{fax_thumbnail.position}" + +- if @fax_document.document.path + = link_to t("fax_documents.index.actions.download_pdf"), "#{request.protocol}#{request.host_with_port}#{request.fullpath.split("?")[0]}.pdf" + += render :partial => 'shared/show_edit_destroy_part', :locals => { :parent => @fax_document.fax_account, :child => @fax_document } -- cgit v1.2.3