From 6efe9ff5c6116c3a9a46de9847971179b740fc20 Mon Sep 17 00:00:00 2001 From: z9hang Date: Mon, 12 Jan 2015 17:34:26 +0800 Subject: [PATCH 01/12] =?UTF-8?q?=E6=B3=A8=E9=87=8A=E6=8E=89=E6=97=A0?= =?UTF-8?q?=E7=94=A8=E7=9A=84=E6=96=B9=E6=B3=95=E8=B0=83=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 0fcf35aff..7b4d488a9 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -41,7 +41,7 @@ class UsersController < ApplicationController :activity_score_index, :influence_score_index, :score_index,:show_new_score, :topic_new_score_index, :project_new_score_index, :activity_new_score_index, :influence_new_score_index, :score_new_index,:user_projects_index] before_filter :auth_user_extension, only: :show - before_filter :rest_user_score, only: :show + #before_filter :rest_user_score, only: :show #before_filter :select_entry, only: :user_projects accept_api_auth :index, :show, :create, :update, :destroy,:tag_save , :tag_saveEx From 90925edce29199019eb1176bac9fc3297230d785 Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Mon, 12 Jan 2015 17:56:09 +0800 Subject: [PATCH 02/12] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E3=80=8A=E6=84=8F?= =?UTF-8?q?=E8=A7=81=E5=8F=8D=E9=A6=88=E9=A1=B5=E9=9D=A2css=E5=BC=95?= =?UTF-8?q?=E8=B5=B7=E7=9A=84css=E9=94=99=E4=B9=B1=E3=80=8B=E5=92=8C?= =?UTF-8?q?=E3=80=8A=E8=AF=BE=E7=A8=8B=E9=A6=96=E9=A1=B5=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E5=A4=AA=E5=B0=91=E3=80=8Bbug=20Signed-off-by:=20alan=20<54753?= =?UTF-8?q?3434@qq.com>?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/_base_feedback.html.erb | 6 +++--- .../lib/acts_as_activity_provider.rb | 17 ++++++++++++----- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/app/views/layouts/_base_feedback.html.erb b/app/views/layouts/_base_feedback.html.erb index 859ed0361..62b3a01e3 100644 --- a/app/views/layouts/_base_feedback.html.erb +++ b/app/views/layouts/_base_feedback.html.erb @@ -62,7 +62,7 @@ function f_submit() -<%= Redmine::WikiFormatting.to_html(Setting.text_formatting, Setting.emails_header).html_safe %> -<%= yield %> -
-<%= Redmine::WikiFormatting.to_html(Setting.text_formatting, Setting.emails_footer).html_safe %> +
+
+
+

亲爱的Trustie用户,您好!

+
+ <%= yield %> +
+
<%= link_to("退订该邮件?", @user_url) %>
+
+
diff --git a/app/views/mailer/_issue.html.erb b/app/views/mailer/_issue.html.erb index f0dc88d8b..326a21aaa 100644 --- a/app/views/mailer/_issue.html.erb +++ b/app/views/mailer/_issue.html.erb @@ -1,15 +1,39 @@ -

<%= link_to(h("#{issue.tracker.name} ##{issue.project_index}: #{issue.subject}"), issue_url) %>

- + +

+ + <%= link_to(h("#{@issue.author}(#{@issue.author.show_name})"), @issue_author_url) %> + 在 + <%= link_to(h("#{@issue.project.name}"),@project_url) %>中有了一个与您相关的最新活动,请您关注!

+
+
  • 标题:<%= link_to(issue.subject, issue_url) %>
  • +
  • 来源:<%= link_to(h("#{issue.project.name}"),@project_url) %>项目缺陷
  • +
  • 内容: +

    <%= textilizable(issue, :description, :only_path => false) %>

    +
  • +
  • 附件: +

    + <% unless @issue.attachments.nil? %> + <% @issue.attachments.each do |attach| %> + <%= link_to_attachment(attach, :download => true, :token => @token.value, :only_path => false) %><%= l(:label_added) %>
    + <% end %> + <% end %> -<%= textilizable(issue, :description, :only_path => false) %> +

    +
  • + + +
    +
    + +<%# issue.custom_field_values.each do |c| %> + diff --git a/app/views/mailer/issue_add.html.erb b/app/views/mailer/issue_add.html.erb index 3f0fce917..f51dad121 100644 --- a/app/views/mailer/issue_add.html.erb +++ b/app/views/mailer/issue_add.html.erb @@ -1,15 +1,8 @@ +
    -<%= l(:text_issue_added, :id => "##{@issue.project_index}", :author => h(@issue.author)) %> - -
    +
    -<%= render :partial => 'issue', :formats => [:html], :locals => { :issue => @issue, :issue_url => @issue_url } %> \ No newline at end of file diff --git a/app/views/mailer/issue_add.text.erb b/app/views/mailer/issue_add.text.erb index 4fb52b94c..07411a134 100644 --- a/app/views/mailer/issue_add.text.erb +++ b/app/views/mailer/issue_add.text.erb @@ -1,11 +1,11 @@ -<%= l(:text_issue_added, :id => "##{@issue.project_index}", :author => @issue.author) %> - +<%= link_to(h("#{@issue.author}"+"(#{@issue.author_id.firstname+@issue.author_id.lastname})"), @issue_author_url) %>在<%= link_to(h("#{@issue.project.name}"),@project_url) %> +<%#= l(:text_issue_added, :id => "##{@issue.project_index}", :author => @issue.author) %> !--> +<%= render :partial => 'issue', :formats => [:text], :locals => { :issue => @issue, :issue_url => @issue_url } %> <% @issue.attachments.each do |attach| %> - <%= l(:label_attachment) %> <%= link_to_attachment(attach, :download => true, :token => @token.value, :only_path => false) %> <%= l(:label_added) %> <% end %> ---------------------------------------- - -<%= render :partial => 'issue', :formats => [:text], :locals => { :issue => @issue, :issue_url => @issue_url } %> +<%= link_to( "我要回复", @issue_url) %> + <%#= render :partial => 'issue', :formats => [:text], :locals => { :issue => @issue, :issue_url => @issue_url } %> From 1602d2e439793613044db53eff0a7d480a5215a8 Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Sat, 17 Jan 2015 11:46:45 +0800 Subject: [PATCH 10/12] Signed-off-by: alan <547533434@qq.com> --- app/views/mailer/_issue.text.erb | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/app/views/mailer/_issue.text.erb b/app/views/mailer/_issue.text.erb index 7ab8acfeb..6be5544b8 100644 --- a/app/views/mailer/_issue.text.erb +++ b/app/views/mailer/_issue.text.erb @@ -1,13 +1,18 @@ -<%= "#{issue.tracker.name} ##{issue.project_index}: #{issue.subject}" %> -<%= issue_url %> -* <%=l(:field_author)%>: <%= issue.author %> -* <%=l(:field_status)%>: <%= issue.status %> -* <%=l(:field_priority)%>: <%= issue.priority %> -* <%=l(:field_assigned_to)%>: <%= issue.assigned_to %> -* <%=l(:field_category)%>: <%= issue.category %> -* <%=l(:field_fixed_version)%>: <%= issue.fixed_version %> -<% issue.custom_field_values.each do |c| %>* <%= c.custom_field.name %>: <%= show_value(c) %> -<% end -%> ----------------------------------------- -<%= issue.description %> + <%= link_to(h("#{@issue.author}(#{@issue.author.show_name})"), @issue_author_url) %> + 在 + <%= link_to(h("#{@issue.project.name}"),@project_url) %>中有了一个与您相关的最新活动,请您关注! +标题:<%= link_to(issue.subject, issue_url) %> + 来源:<%= link_to(h("#{issue.project.name}"),@project_url) %>| 项目缺陷< + 内容: + <%= textilizable(issue, :description, :only_path => false) %> + 附件: + + <% unless @issue.attachments.nil? %> + <% @issue.attachments.each do |attach| %> + <%= link_to_attachment(attach, :download => true, :token => @token.value, :only_path => false) %><%= l(:label_added) %> + <% end %> + <% end %> + + + <%= link_to( "我要回复", issue_url) %> From ade07203312286e6f207bb6b76ad2060fbb6a1f9 Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Sat, 17 Jan 2015 14:19:54 +0800 Subject: [PATCH 11/12] =?UTF-8?q?=E9=82=AE=E4=BB=B6=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E7=95=8C=E9=9D=A2=E9=87=8D=E7=BD=AE=20Signed-off-by:=20alan=20?= =?UTF-8?q?<547533434@qq.com>?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 4 +++- app/models/mailer.rb | 24 ++++++++++++++++-------- app/views/layouts/mailer.html.erb | 2 +- app/views/mailer/_issue.html.erb | 25 ++++++++++++++----------- app/views/mailer/_issue.text.erb | 7 ++++--- app/views/mailer/issue_add.text.erb | 11 +---------- app/views/mailer/issue_edit.html.erb | 6 ++++-- app/views/mailer/issue_edit.text.erb | 6 ++++-- 8 files changed, 47 insertions(+), 38 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index ee8711e7e..58af43da3 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -15,8 +15,10 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. class UsersController < ApplicationController + layout :setting_layout #Added by young + before_filter :auth_login1, :only => [:show, :user_activities] menu_item :activity menu_item :user_information, :only => :info menu_item :user_course, :only => :user_courses @@ -30,7 +32,7 @@ class UsersController < ApplicationController #Ended by young # edit - before_filter :auth_login1, :only => [:show] + # before_filter :can_show_course, :only => [:user_courses,:user_homeworks] before_filter :require_admin, :except => [:show, :index, :search, :tag_save, :tag_saveEx,:user_projects, :user_newfeedback, :user_comments, :watch_bids, :watch_contests, :info, diff --git a/app/models/mailer.rb b/app/models/mailer.rb index bee0640da..72e60a0bf 100644 --- a/app/models/mailer.rb +++ b/app/models/mailer.rb @@ -105,18 +105,18 @@ class Mailer < ActionMailer::Base @author = issue.author @issue = issue + user = User.find_by_mail(recipients) - - token = Token.new(:user => User.find_by_mail(recipients), :action => 'autologin') + token = Token.new(:user =>user , :action => 'autologin') token.save @token = token @issue_url = url_for(:controller => 'issues', :action => 'show', :id => issue.id, :token => @token.value) # edit - @issue_author_url = url_for(:controller => 'users', :action => 'show', :id => issue.author_id, :token => @token.value) + @issue_author_url = url_for(user_activities_url(@author,:token => @token.value)) @project_url = url_for(:controller => 'projects', :action => 'show', :id => issue.project_id, :token => @token.value) - @user_url = url_for(:controller => 'my', :action => 'account', :user => User.find_by_mail(recipients) , :token => @token.value) - # + + @user_url = url_for(my_account_url(user,:token => @token.value)) cc = issue.watcher_recipients - issue.recipients subject = "[#{issue.project.name} - #{issue.tracker.name} ##{issue_id}] (#{issue.status.name}) #{issue.subject}" @@ -149,10 +149,18 @@ class Mailer < ActionMailer::Base references issue @author = journal.user + user = User.find_by_mail(recipients) + + token = Token.new(:user =>user , :action => 'autologin') + token.save + @token = token + + + # edit + @issue_author_url = url_for(:controller => 'users', :action => 'show', :id => issue.author_id, :token => @token.value) + @project_url = url_for(:controller => 'projects', :action => 'show', :id => issue.project_id, :token => @token.value) + @user_url = url_for(my_account_url(user,:token => @token.value)) - token = Token.new(:user => User.find_by_mail(recipients), :action => 'autologin') - token.save - @token = token @issue_url = url_for(:controller => 'issues', :action => 'show', :id => issue.id, :anchor => "change-#{journal.id}", :token => @token.value) diff --git a/app/views/layouts/mailer.html.erb b/app/views/layouts/mailer.html.erb index de7f4a837..aa43b9194 100644 --- a/app/views/layouts/mailer.html.erb +++ b/app/views/layouts/mailer.html.erb @@ -14,7 +14,7 @@ ol,ul,li{ list-style-type:none} .cl{ clear:both; overflow:hidden; } a{ text-decoration:none; } a:hover{ text-decoration:underline; } - +.mail_box,ul,li{ list-style-type:none} .mail{ width:600px; margin:20px; height:auto; color:#4b4b4b; font-size:14px; } .mail a{color:#1b55a7; font-weight: bold; } .mail_content{ margin-top:30px;} diff --git a/app/views/mailer/_issue.html.erb b/app/views/mailer/_issue.html.erb index 326a21aaa..c5e136dfc 100644 --- a/app/views/mailer/_issue.html.erb +++ b/app/views/mailer/_issue.html.erb @@ -6,23 +6,26 @@ <%= link_to(h("#{@issue.project.name}"),@project_url) %>中有了一个与您相关的最新活动,请您关注!

    - +
    +
    + <%= render :partial => 'issue', :formats => [:text], :locals => { :issue => @issue, :issue_url => @issue_url } %> -<% @issue.attachments.each do |attach| %> - <%= link_to_attachment(attach, :download => true, :token => @token.value, :only_path => false) %> <%= l(:label_added) %> -<% end %> - ----------------------------------------- -<%= link_to( "我要回复", @issue_url) %> - <%#= render :partial => 'issue', :formats => [:text], :locals => { :issue => @issue, :issue_url => @issue_url } %> - diff --git a/app/views/mailer/issue_edit.html.erb b/app/views/mailer/issue_edit.html.erb index 8af66d891..3cbd1b02a 100644 --- a/app/views/mailer/issue_edit.html.erb +++ b/app/views/mailer/issue_edit.html.erb @@ -2,10 +2,12 @@ -<%= textilizable(@journal, :notes, :only_path => false) %> +<%= l(:field_content)%>:<%= @journal.notes %>
    <%= render :partial => 'issue', :formats => [:html], :locals => { :issue => @issue, :issue_url => @issue_url } %> diff --git a/app/views/mailer/issue_edit.text.erb b/app/views/mailer/issue_edit.text.erb index a5614595c..5b93b6fe0 100644 --- a/app/views/mailer/issue_edit.text.erb +++ b/app/views/mailer/issue_edit.text.erb @@ -1,11 +1,13 @@ <%= l(:text_issue_updated, :id => "##{@issue.project_index}", :author => @journal.user) %> <% details_to_strings(@journal.details, true, :token => @token.value).each do |string| -%> -<%= string %> + <% if (!string.include? l(:label_attachment)) && (!string.include? "attachments") %> +
  • <%= string %>
  • + <% end %> <% end -%> <% if @journal.notes? -%> -<%= @journal.notes %> + <%= l(:field_content)%>:<%= @journal.notes %> <% end -%> ---------------------------------------- From ebf63b9ba2e2f355fa85c7eea71da174fc8e124e Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Sat, 17 Jan 2015 14:31:56 +0800 Subject: [PATCH 12/12] Signed-off-by: alan <547533434@qq.com> --- app/views/mailer/_issue.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/mailer/_issue.html.erb b/app/views/mailer/_issue.html.erb index c5e136dfc..5979877a3 100644 --- a/app/views/mailer/_issue.html.erb +++ b/app/views/mailer/_issue.html.erb @@ -7,7 +7,7 @@