From 18758ce7805c41abe859c3cdf135105952584640 Mon Sep 17 00:00:00 2001 From: "vit.jonas@gmail.com" Date: Tue, 10 May 2011 08:26:51 +0000 Subject: [PATCH] * implemented Issue 6: Improve content of notification emails git-svn-id: http://redmine-dmsf.googlecode.com/svn/trunk/redmine_dmsf@33 5e329b0b-a2ee-ea63-e329-299493fc886d --- app/models/dmsf_file_revision.rb | 8 ++++++++ app/views/dmsf_mailer/files_deleted.text.html.rhtml | 7 ++++--- app/views/dmsf_mailer/files_deleted.text.plain.rhtml | 4 ++-- app/views/dmsf_mailer/files_updated.text.html.rhtml | 11 ++++++++--- app/views/dmsf_mailer/files_updated.text.plain.rhtml | 6 +++--- assets/stylesheets/plupload/jquery.ui.plupload.css | 3 ++- config/locales/cs.yml | 2 -- 7 files changed, 27 insertions(+), 14 deletions(-) diff --git a/app/models/dmsf_file_revision.rb b/app/models/dmsf_file_revision.rb index 02ed9b75..19766209 100644 --- a/app/models/dmsf_file_revision.rb +++ b/app/models/dmsf_file_revision.rb @@ -142,6 +142,14 @@ class DmsfFileRevision < ActiveRecord::Base return new_revision end + def workflow_str + case workflow + when 1 then l(:title_waiting_for_approval) + when 2 then l(:title_approved) + else nil + end + end + def set_workflow(workflow) if User.current.allowed_to?(:file_approval, self.file.project) self.workflow = workflow diff --git a/app/views/dmsf_mailer/files_deleted.text.html.rhtml b/app/views/dmsf_mailer/files_deleted.text.html.rhtml index db55afd1..4439430f 100644 --- a/app/views/dmsf_mailer/files_deleted.text.html.rhtml +++ b/app/views/dmsf_mailer/files_deleted.text.html.rhtml @@ -4,11 +4,12 @@ - User <%= @user %> deleted following files in project <%= @project.name %>: + User <%= link_to(h(@user), {:only_path => false, :controller => "users", :action => "show", :id => @user }) %> + deleted DMSF files in project <%= @project.name %>: <% @files.each do |file| %>

- <%= h(file.dmsf_path_str) %> - (<%= number_to_human_size(file.last_revision.size) %>), + <%= h(file.dmsf_path_str) %>, + <%= number_to_human_size(file.last_revision.size) %>, version: <%= file.last_revision.major_version %>.<%= file.last_revision.minor_version %>

<% end %> diff --git a/app/views/dmsf_mailer/files_deleted.text.plain.rhtml b/app/views/dmsf_mailer/files_deleted.text.plain.rhtml index 764b3a3e..a06527cd 100644 --- a/app/views/dmsf_mailer/files_deleted.text.plain.rhtml +++ b/app/views/dmsf_mailer/files_deleted.text.plain.rhtml @@ -1,5 +1,5 @@ -User <%= @user %> deleted following files in project <%= @project.name %>: +User <%= @user %> deleted DMSF files in project <%= @project.name %>: <% @files.each do |file| %> - <%= file.dmsf_path_str %> (<%= number_to_human_size(file.last_revision.size) %>), version: <%= file.last_revision.major_version %>.<%= file.last_revision.minor_version %> + <%= file.dmsf_path_str %>, <%= number_to_human_size(file.last_revision.size) %>, version: <%= file.last_revision.major_version %>.<%= file.last_revision.minor_version %> <% end %> \ No newline at end of file diff --git a/app/views/dmsf_mailer/files_updated.text.html.rhtml b/app/views/dmsf_mailer/files_updated.text.html.rhtml index fc651d36..cc505212 100644 --- a/app/views/dmsf_mailer/files_updated.text.html.rhtml +++ b/app/views/dmsf_mailer/files_updated.text.html.rhtml @@ -4,17 +4,22 @@ - User <%= @user %> actualized following files in project <%= @project.name %>: + User <%= link_to(h(@user), {:only_path => false, :controller => "users", :action => "show", :id => @user }) %> + actualized DMSF files in project <%= @project.name %>: <% @files.each do |file| %>

<%= link_to(h(file.dmsf_path_str), {:only_path => false, :controller => "dmsf", :action => "download_file", :id => file.project, - :file_id => file}) %> - (<%= number_to_human_size(file.last_revision.size) %>), + :file_id => file}) %>, + <%= number_to_human_size(file.last_revision.size) %>, version: <%= file.last_revision.major_version %>.<%= file.last_revision.minor_version %>, + <%= "#{file.last_revision.workflow_str}," unless file.last_revision.workflow_str.blank? %> <%= link_to("Details", {:only_path => false, :controller => "dmsf_detail", :action => "file_detail", :id => file.project, :file_id => file }) %> + <% unless file.last_revision.comment.blank? %> +
    <%= h(file.last_revision.comment) %> + <% end %>

<% end %> diff --git a/app/views/dmsf_mailer/files_updated.text.plain.rhtml b/app/views/dmsf_mailer/files_updated.text.plain.rhtml index a1f3ed64..766afdb7 100644 --- a/app/views/dmsf_mailer/files_updated.text.plain.rhtml +++ b/app/views/dmsf_mailer/files_updated.text.plain.rhtml @@ -1,7 +1,7 @@ -User <%= @user %> actualized following files in project <%= @project.name %>: +User <%= @user %> actualized DMSF files in project <%= @project.name %>: <% @files.each do |file| %> - <%= file.dmsf_path_str %> (<%= number_to_human_size(file.last_revision.size) %>), version: <%= file.last_revision.major_version %>.<%= file.last_revision.minor_version %> + <%= file.dmsf_path_str %>, <%= number_to_human_size(file.last_revision.size) %>, version: <%= file.last_revision.major_version %>.<%= file.last_revision.minor_version %><%= ", #{file.last_revision.workflow_str}" unless file.last_revision.workflow_str.blank? %> <%= url_for({:only_path => false, :controller => "dmsf_detail", :action => "file_detail", :id => file.project, :file_id => file }) %> - + <% unless file.last_revision.comment.blank? %> comment: <%= file.last_revision.comment %><% end %> <% end %> \ No newline at end of file diff --git a/assets/stylesheets/plupload/jquery.ui.plupload.css b/assets/stylesheets/plupload/jquery.ui.plupload.css index b3faf5d0..369bf7da 100644 --- a/assets/stylesheets/plupload/jquery.ui.plupload.css +++ b/assets/stylesheets/plupload/jquery.ui.plupload.css @@ -28,9 +28,10 @@ div.plupload .plupload_file {border-width: 0 0 1px 0} padding-left: 60px; position:relative; } -*/ .plupload_header_content_bw {background-image: url('../img/plupload-bw.png');} +*/ + .plupload_header_title { font: normal 18px sans-serif; padding: 6px 0 3px; diff --git a/config/locales/cs.yml b/config/locales/cs.yml index 7517cd94..ab21073b 100644 --- a/config/locales/cs.yml +++ b/config/locales/cs.yml @@ -60,5 +60,3 @@ cs: :title_download_checked: "Download checked in Zip archive" :submit_email: "Email" :title_send_checked_by_email: "Send checked by email" - - \ No newline at end of file