diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 5933f2e9c..5b94dd75c 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -4067,8 +4067,10 @@ class UsersController < ApplicationController @contest = Contest.find params[:contest] member = ContestMember.where("user_id = #{@user.id} and contest_id = #{@contest.id}") end - unless member.empty? + if !member.empty? && params[:contest] member.first.update_attribute(:is_collect, member.first.is_collect == false ? 1 : 0) + elsif !member.empty? + member.first.update_attribute(:is_collect, member.first.is_collect == 0 ? 1 : 0) end if @project @projects = @user.favorite_projects.visible.select("projects.*, (SELECT MAX(updated_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS a").order("a desc").limit(10) diff --git a/app/models/mailer.rb b/app/models/mailer.rb index a348d15a7..905cac944 100644 --- a/app/models/mailer.rb +++ b/app/models/mailer.rb @@ -850,7 +850,7 @@ class Mailer < ActionMailer::Base @token = token @url = url_for(:controller => 'account', :action => 'activate', :token => token.value) mail :to => token.user.mail, - :subject => l(:mail_subject_register, Setting.app_title) + :subject => "#{Setting.mail_subject}" end def test_email(user) diff --git a/app/models/user.rb b/app/models/user.rb index a564916e9..d6722274c 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -917,6 +917,9 @@ class User < Principal # 判断是否是竞赛的主办人 def admin_of_contest?(contest) + if contest.nil? + return false + end if ContestMember.where("user_id =? and contest_id =?", self.id, contest.id).count == 0 return false end diff --git a/app/views/news/_contest_news.html.erb b/app/views/news/_contest_news.html.erb index 2af1457ce..df71b70a7 100644 --- a/app/views/news/_contest_news.html.erb +++ b/app/views/news/_contest_news.html.erb @@ -25,8 +25,8 @@ <% if contest && User.current.admin_of_contest?(@contest) %> - <%= labelled_form_for @news, :url => new_contest_news_path(:contest_id => @contest), - :html => {:id => 'news-form', :nhname => 'form', :multipart => true, :method => "get"} do |f| %> + <%= labelled_form_for @news, :url => {:controller => 'news', :action => 'new', :contest_id => @contest.id}, + :html => {:id => 'news-form', :nhname => 'form', :multipart => true} do |f| %> <%= render :partial => 'contest_news_new', :locals => {:f => f, :news => @news, :edit_mode => false, :contest => @contest} %> <% end %> <% end %> diff --git a/app/views/settings/_notifications.html.erb b/app/views/settings/_notifications.html.erb index 588880fe2..6d444fe96 100644 --- a/app/views/settings/_notifications.html.erb +++ b/app/views/settings/_notifications.html.erb @@ -4,6 +4,8 @@
<%= setting_text_field :mail_from, :size => 50 %>
+<%= setting_text_field :mail_subject, :size => 50 %>
+<%= setting_check_box :bcc_recipients %>
<%= setting_check_box :plain_text_mail %>
diff --git a/app/views/users/_news_replies.html.erb b/app/views/users/_news_replies.html.erb index 2491e6498..5b5aac94d 100644 --- a/app/views/users/_news_replies.html.erb +++ b/app/views/users/_news_replies.html.erb @@ -1,33 +1,34 @@<%= string %>
+ <% if !comment.content_detail.blank? || comment.class == Journal %> +<%= string %>
+ <% end %> <% end %> +<%= comment.notes.html_safe %>
+ <% else %> + <%= comment.content_detail.html_safe %> <% end %> -<%= comment.notes.html_safe %>
- <% else %> - <%= comment.content_detail.html_safe %> - <% end %> -