diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index ad25b22a9..5b94dd75c 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -1888,7 +1888,7 @@ class UsersController < ApplicationController @applied_message_alls << mess end elsif (message_all.message_type == "AppliedMessage" ) - if (mess.applied_type == "AppliedContest" && mess.status == 0) || (mess.applied_type == "StudentWorksScoresAppeal" && mess.status == 0) || (mess.applied_type == "AppliedProject" && mess.status == 1) || ( mess.applied_type == "ApplyAddSchools" && ApplyAddSchools.where(:school_id => mess.applied_id, :status => 0).count != 0 ) + if (mess.applied_type == "AppliedContest" && mess.status == 0) || (mess.applied_type == "StudentWorksScoresAppeal" && mess.status == 0) || (mess.applied_type == "AppliedProject" && mess.status == 1 && AppliedMessage.where("applied_id = #{mess.applied_id} and status != 1").count == 0) || ( mess.applied_type == "ApplyAddSchools" && ApplyAddSchools.where(:school_id => mess.applied_id, :status => 0).count != 0 ) @applied_message_alls << mess end elsif message_all.message_type == "CourseMessage" @@ -2099,7 +2099,7 @@ class UsersController < ApplicationController @message_alls << mess end elsif (message_all.message_type == "AppliedMessage" ) - if (mess.applied_type == "AppliedContest" && mess.status == 0) || (mess.applied_type == "StudentWorksScoresAppeal" && mess.status == 0) || (mess.applied_type == "AppliedProject" && mess.status == 1) || ( mess.applied_type == "ApplyAddSchools" && ApplyAddSchools.where(:school_id => mess.applied_id, :status => 0).count != 0 ) + if (mess.applied_type == "AppliedContest" && mess.status == 0) || (mess.applied_type == "StudentWorksScoresAppeal" && mess.status == 0) || (mess.applied_type == "AppliedProject" && mess.status == 1 && AppliedMessage.where("applied_id = #{mess.applied_id} and status != 1").count == 0) || ( mess.applied_type == "ApplyAddSchools" && ApplyAddSchools.where(:school_id => mess.applied_id, :status => 0).count != 0 ) @message_alls << mess end elsif message_all.message_type == "CourseMessage" @@ -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/controllers/versions_controller.rb b/app/controllers/versions_controller.rb index 7b4695d3c..ad5f5b9d4 100644 --- a/app/controllers/versions_controller.rb +++ b/app/controllers/versions_controller.rb @@ -19,11 +19,11 @@ class VersionsController < ApplicationController layout "base_projects" menu_item :roadmap model_object Version - before_filter :find_model_object, :except => [:index, :new, :create, :close_completed] + before_filter :find_model_object, :except => [:index, :new, :create, :close_completed,:judge_version_title] #before_filter :find_model_object_contest, :except => [:index, :new, :create] - before_filter :find_project_from_association, :except => [:index, :new, :create, :close_completed] - before_filter :find_project_by_project_id, :only => [:index, :new, :create, :close_completed] - before_filter :authorize + before_filter :find_project_from_association, :except => [:index, :new, :create, :close_completed, :judge_version_title] + before_filter :find_project_by_project_id, :only => [:index, :new, :create, :close_completed,:judge_version_title] + before_filter :authorize, :except => [:judge_version_title] accept_api_auth :index, :show, :create, :update, :destroy @@ -189,9 +189,9 @@ class VersionsController < ApplicationController end else respond_to do |format| - format.html { flash[:error] = @version.errors.full_messages.flatten.to_s - redirect_to settings_project_url(@project, :tab => 'versions') } - format.js { render :action => 'new' } + # format.html { flash[:error] = @version.errors.full_messages.flatten.to_s + # redirect_to settings_project_url(@project, :tab => 'versions') } + format.js { @error = @version.errors.full_messages.flatten.to_s } format.api { render_validation_errors(@version) } end end @@ -275,6 +275,21 @@ class VersionsController < ApplicationController redirect_to settings_contest_url(@contest, :tab => 'versions') end + # 判断里程碑是否重名 + def judge_version_title + begin + version = Version.where(:name => params[:version_name], :project_id => @project.id).first + if version.blank? + result = {:result => true} + else + result = {:result => false} + end + rescue Exception => e + puts e + end + render :json => result + end + def destroy begin project = @version.project diff --git a/app/models/mailer.rb b/app/models/mailer.rb index 036ee3673..a03c35381 100644 --- a/app/models/mailer.rb +++ b/app/models/mailer.rb @@ -848,9 +848,10 @@ class Mailer < ActionMailer::Base def register(token) set_language_if_valid(token.user.language) @token = token + @login = token.user.try(:login) @url = url_for(:controller => 'account', :action => 'activate', :token => token.value) mail :to => token.user.mail, - :subject => l(:mail_subject) + :subject => "#{Setting.mail_subject}" end def test_email(user) diff --git a/app/views/account/email_valid.html.erb b/app/views/account/email_valid.html.erb index fcda47f72..611902047 100644 --- a/app/views/account/email_valid.html.erb +++ b/app/views/account/email_valid.html.erb @@ -42,8 +42,7 @@

<%= l(:notice_email_register_time) %>

- <%= l(:notice_email_arrival)%> - <%= @user.mail %> + <%= l(:notice_email_arrival)%> : <%= @user.mail %>

<%= l(:label_check_email)%> diff --git a/app/views/contests/_contest_base_info.html.erb b/app/views/contests/_contest_base_info.html.erb index 795553b44..5dc5665f1 100644 --- a/app/views/contests/_contest_base_info.html.erb +++ b/app/views/contests/_contest_base_info.html.erb @@ -8,7 +8,13 @@ <% end %>

- +

<%= @contest.name %>

@@ -50,4 +56,4 @@

<%= @contest.invite_code_halt == 0 ? "请将邀请码告诉成员" : "邀请码已停用" %>

<%= @contest.invite_code_halt == 0 ? "他们可以主动加入" : "暂时停止成员主动加入" %>

-<% end %> \ No newline at end of file +<% end %> diff --git a/app/views/mailer/register.html.erb b/app/views/mailer/register.html.erb index 5b4e8262b..146456358 100644 --- a/app/views/mailer/register.html.erb +++ b/app/views/mailer/register.html.erb @@ -1,6 +1,56 @@ -

<%= l(:mail_body_register) %>
-<%= link_to h(@url), @url %>

-

如果点击链接无效请复制该链接到浏览器中打开

-
-

感谢您的使用!

-

Trustie团队

+ + + + + + +
+
+
+ +

确实让创新更美好

+
+
+
+

+ <%= @login %>,您好!
+ 您已经成功注册为Trustie用户!
+ 请点击以下链接激活您的帐号:
+ <%= link_to h(@url), @url, :style => "font-weight: normal; color:#3b94d6;" %>
+ + (如果链接点击无效,请手动复制链接并粘贴到浏览器地址栏中,然后按“回车”打开页面即可) + +

+
+ +

+ 扫一扫,关注 Trustie 微信公众号,更方便获任务通知,作业等提醒
+ 想了解更多信息,请访问 www.trustie.net +

+
+
+

如果您在使用中有任何的疑问和建议,欢迎您给我们反馈意见
+ 联系电话:13467631747 QQ群:373967360

+

Trustie团队

+
+
+
+
+ + \ No newline at end of file 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/projects/settings/_new_versions.html.erb b/app/views/projects/settings/_new_versions.html.erb index 6f35a73cf..aeb6dbb22 100644 --- a/app/views/projects/settings/_new_versions.html.erb +++ b/app/views/projects/settings/_new_versions.html.erb @@ -1,5 +1,5 @@ <% if @project.shared_versions.empty? %> -

<%= l(:milestone_no_data) %>

+

<%= l(:milestone_no_data) %>

<% end %>
新建里程碑 @@ -8,73 +8,45 @@
<% if @project.shared_versions.any? %> -
- - - - - - - - - - - - <% @project.shared_versions.reverse.each do |version| %> +
+
名称结束日期描述状态操作
+ - - - - - + + + + + - <% end %> - -
<%= format_date(version.effective_date) %><%= l("version_status_#{version.status}") %> - <% if version.project == @project && User.current.allowed_to?(:manage_versions, @project) %> - <%= link_to l(:button_edit), edit_version_path(version, :is_setting => true), :class => 'sy_btn_blue mr5', :remote => true %> - <%= delete_link_version version_path(version, :is_setting => true), :class=>"sy_btn_grey mr5", :remote => true %> - <% end %> - 名称结束日期描述状态操作
-
+ + + <% @project.shared_versions.reverse.each do |version| %> + + + <%= link_to version.name, version_path(version), :class => "c_blue02" %> + + <%= format_date(version.effective_date) %> + <%=h version.description %> + <%= l("version_status_#{version.status}") %> + + <% if version.project == @project && User.current.allowed_to?(:manage_versions, @project) %> + <%= link_to l(:button_edit), edit_version_path(version, :is_setting => true), :class => 'sy_btn_blue mr5', :remote => true %> + <%= delete_link_version version_path(version, :is_setting => true), :class=>"sy_btn_grey mr5", :remote => true %> + <% end %> + + + <% end %> + + + <% end %> \ No newline at end of file diff --git a/app/views/projects/settings/_new_versions_form.html.erb b/app/views/projects/settings/_new_versions_form.html.erb index f6dc90d91..c7a8d4256 100644 --- a/app/views/projects/settings/_new_versions_form.html.erb +++ b/app/views/projects/settings/_new_versions_form.html.erb @@ -1,10 +1,10 @@ -<%= form_for :version, :url => project_versions_path(@project, :is_setting => true),:html=>{:id=>"new_project_version_form", :remote => true} do |f| %> +<%= form_for :version, :url => project_versions_path(@project, :is_setting => true),:html=>{:id => "setting_new_project_version_form", :remote => true} do |f| %> <% end %> \ No newline at end of file diff --git a/app/views/repositories/_dir_list_content.html.erb b/app/views/repositories/_dir_list_content.html.erb index 287eabfbf..d69c3af04 100644 --- a/app/views/repositories/_dir_list_content.html.erb +++ b/app/views/repositories/_dir_list_content.html.erb @@ -48,13 +48,11 @@ diff --git a/app/views/versions/_new_milestone.html.erb b/app/views/versions/_new_milestone.html.erb index b89936f3e..81f3721f6 100644 --- a/app/views/versions/_new_milestone.html.erb +++ b/app/views/versions/_new_milestone.html.erb @@ -8,13 +8,15 @@
<%#= form_tag( url_for(:controller => 'versions', :action => 'update', :is_setting => true, :is_index => @is_index), :remote => true, :id => 'project_applied_form') do %> - <%= form_for :version, :url => project_versions_path(@project, :is_setting => @is_setting, :is_issue => @is_issue, :is_create => @is_create, :issue_project_id => @issue_project_id),:html => {:id=>"popub_new_project_version_form", :remote => @is_setting ? true : false} do |f| %> + <%= form_for :version, :url => project_versions_path(@project, :is_setting => @is_setting, :is_issue => @is_issue, :is_create => @is_create, :issue_project_id => @issue_project_id), + :html => {:id => "popub_new_project_version_form", :remote => @is_setting ? true : false} do |f| %> <%#= labelled_form_for @version, :html => {:id => "popub_new_project_version_form", :remote => true, :is_setting => true, :is_index => params[:is_index] } do |f| %>