From d216accd6f00ec90e19f3171440ae7c5d7cdb53a Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Wed, 13 Feb 2013 14:13:04 +0100 Subject: Better UI for FaxDocument#show --- app/views/fax_documents/show.html.haml | 62 +++++++++++++++++++++------------- 1 file changed, 38 insertions(+), 24 deletions(-) (limited to 'app/views/fax_documents/show.html.haml') diff --git a/app/views/fax_documents/show.html.haml b/app/views/fax_documents/show.html.haml index 41d3bff..de8c1cc 100644 --- a/app/views/fax_documents/show.html.haml +++ b/app/views/fax_documents/show.html.haml @@ -2,35 +2,49 @@ - 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 +%table.table.table-striped + %tr + %td + %strong= t('fax_documents.index.state') + ":" + %td + = t("fax_documents.states.#{@fax_document.state}") + %tr + %td + %strong= t('fax_documents.index.result_code') + ":" + %td + = @fax_document.result_code + %tr + %td + %strong= t('fax_documents.index.result_text') + ":" + %td + = t("fax_documents.result_codes.code_#{@fax_document.result_code}") + %tr + %td + %strong= t('fax_documents.show.document_transferred_pages') + ":" + %td + = @fax_document.document_transferred_pages + %tr + %td + %strong= t('fax_documents.show.remote_station_id') + ":" + %td + = @fax_document.remote_station_id + %tr + %td + %strong= t('fax_documents.show.fax_resolution') + ":" + %td + = @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}" + %p + - @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" + %p + %a{:href => "#{request.protocol}#{request.host_with_port}#{request.fullpath.split("?")[0]}.pdf"} + %i{:class => 'icon-download'} + = t("fax_documents.index.actions.download_pdf") = render :partial => 'shared/show_edit_destroy_part', :locals => { :parent => @fax_document.fax_account, :child => @fax_document } -- cgit v1.2.3 From 3db09ff394b92b5d168c32c355d4529fd3861d36 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Wed, 13 Feb 2013 15:29:43 +0100 Subject: Improvements in the fax_document model and in FaxDocument#show. --- app/views/fax_documents/show.html.haml | 97 +++++++++++++++++++--------------- 1 file changed, 53 insertions(+), 44 deletions(-) (limited to 'app/views/fax_documents/show.html.haml') diff --git a/app/views/fax_documents/show.html.haml b/app/views/fax_documents/show.html.haml index de8c1cc..3419d5c 100644 --- a/app/views/fax_documents/show.html.haml +++ b/app/views/fax_documents/show.html.haml @@ -2,49 +2,58 @@ - child = @fax_document - parent = @fax_document.fax_account -%table.table.table-striped - %tr - %td - %strong= t('fax_documents.index.state') + ":" - %td - = t("fax_documents.states.#{@fax_document.state}") - %tr - %td - %strong= t('fax_documents.index.result_code') + ":" - %td - = @fax_document.result_code - %tr - %td - %strong= t('fax_documents.index.result_text') + ":" - %td - = t("fax_documents.result_codes.code_#{@fax_document.result_code}") - %tr - %td - %strong= t('fax_documents.show.document_transferred_pages') + ":" - %td - = @fax_document.document_transferred_pages - %tr - %td - %strong= t('fax_documents.show.remote_station_id') + ":" - %td - = @fax_document.remote_station_id - %tr - %td - %strong= t('fax_documents.show.fax_resolution') + ":" - %td - = @fax_document.fax_resolution +.row + .span12 + %table.table.table-striped + %tr + %td + %strong= t('fax_documents.index.state') + ":" + %td + = t("fax_documents.states.#{@fax_document.state}") + %tr + %td + %strong= t('fax_documents.index.result_code') + ":" + %td + = @fax_document.result_code + %tr + %td + %strong= t('fax_documents.index.result_text') + ":" + %td + = t("fax_documents.result_codes.code_#{@fax_document.result_code}") + %tr + %td + %strong= t('fax_documents.show.document_transferred_pages') + ":" + %td + = @fax_document.document_transferred_pages + %tr + %td + %strong= t('fax_documents.show.remote_station_id') + ":" + %td + = @fax_document.remote_station_id + %tr + %td + %strong= t('fax_documents.show.fax_resolution') + ":" + %td + = @fax_document.fax_resolution -- if @fax_document.fax_thumbnails.count > 0 - - i = @fax_document.fax_thumbnails.count - - i = 10 if i > 10 - %p - - @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? + %p + %a{:href => @fax_document.document.url} + %i{:class => 'icon-download'} + = t("fax_documents.index.actions.download_pdf") + " (#{number_to_human_size(@fax_document.document.size, :precision => 2)})" -- if @fax_document.document.path - %p - %a{:href => "#{request.protocol}#{request.host_with_port}#{request.fullpath.split("?")[0]}.pdf"} - %i{:class => 'icon-download'} - = t("fax_documents.index.actions.download_pdf") - -= render :partial => 'shared/show_edit_destroy_part', :locals => { :parent => @fax_document.fax_account, :child => @fax_document } +.row + .span12 + - if @fax_document.fax_thumbnails.any? + %ul.thumbnails + - @fax_document.fax_thumbnails.each do |fax_thumbnail| + %li.span4 + %div.thumbnail + %a.thumbnail{:href => fax_thumbnail.thumbnail.url} + =image_tag(fax_thumbnail.thumbnail.url, :alt => "Page #{fax_thumbnail.position}") + %p + = "#{fax_thumbnail.position}/#{@fax_document.fax_thumbnails.count}" + +.row + .span12 + = render :partial => 'shared/show_edit_destroy_part', :locals => { :parent => @fax_document.fax_account, :child => @fax_document } -- cgit v1.2.3 From 12a6b6ec57d67da3d4969378a0d930042bcc97bd Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Wed, 13 Feb 2013 17:19:47 +0100 Subject: UI improvments for FaxDocument#index and FaxDocument#show --- app/views/fax_documents/show.html.haml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'app/views/fax_documents/show.html.haml') diff --git a/app/views/fax_documents/show.html.haml b/app/views/fax_documents/show.html.haml index 3419d5c..9925c2f 100644 --- a/app/views/fax_documents/show.html.haml +++ b/app/views/fax_documents/show.html.haml @@ -1,11 +1,19 @@ - content_for :title, t("fax_documents.show.page_title") -- child = @fax_document -- parent = @fax_document.fax_account .row .span12 %table.table.table-striped - %tr + - case @fax_document.state + - when 'unsuccessful' + - current_status = 'error' + - when 'sending' + - current_status = 'success' + - when 'queued_for_sending' + - current_status = 'warning' + - else + - current_status = '' + + %tr{:class => current_status} %td %strong= t('fax_documents.index.state') + ":" %td @@ -46,7 +54,7 @@ .span12 - if @fax_document.fax_thumbnails.any? %ul.thumbnails - - @fax_document.fax_thumbnails.each do |fax_thumbnail| + - @fax_document.fax_thumbnails.limit(50).each do |fax_thumbnail| %li.span4 %div.thumbnail %a.thumbnail{:href => fax_thumbnail.thumbnail.url} -- cgit v1.2.3