Merge branch 'develop' of https://git.trustie.net/jacknudt/trustieforge into develop

This commit is contained in:
daiao 2016-12-27 16:56:54 +08:00
commit 7c44a14fb5
9 changed files with 63 additions and 48 deletions

View File

@ -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)

View File

@ -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)

View File

@ -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

View File

@ -25,8 +25,8 @@
</div>
</div>
<% 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 %>

View File

@ -4,6 +4,8 @@
<div class="box tabular settings">
<p><%= setting_text_field :mail_from, :size => 50 %></p>
<p><%= setting_text_field :mail_subject, :size => 50 %></p>
<p><%= setting_check_box :bcc_recipients %></p>
<p><%= setting_check_box :plain_text_mail %></p>

View File

@ -1,5 +1,6 @@
<ul>
<% comments.each do |comment| %>
<% unless comment.nil? %>
<script type="text/javascript">
$(function(){
showNormalImage('reply_content_<%= comment.id %>');
@ -104,4 +105,5 @@
<div class="cl"></div>
</li>
<% end %>
<% end %>
</ul>

View File

@ -218,6 +218,7 @@ zh:
setting_pack_attachment_max_size: 附件打包最大限制
setting_issues_export_limit: 问题导出条目的限制
setting_mail_from: 邮件发件人地址
setting_mail_subject: 注册邮件标题
setting_bcc_recipients: 使用密件抄送 (bcc)
setting_plain_text_mail: 纯文本无HTML
setting_host_name: 主机名称

View File

@ -563,6 +563,8 @@ RedmineApp::Application.routes.draw do
get '/boards/:id/boards_topic', :to =>'boards#show', :as => 'boards_topic'
match 'courses/:course_id/news/index', :to => 'news#index', :via => [:get, :post], :as => 'new_course_news'
match 'courses/:course_id/news/new', :to => 'news#new', :via => [:get, :post]
match 'contests/:contest_id/news/index', :to => 'news#index', :via => [:get, :post], :as => 'new_contest_news'
match 'contests/:contest_id/news/new', :to => 'news#new', :via => [:get, :post]
match 'users/:user_id/homepage/articles/:id', :to => 'article_homepages#show', :as => "user_homepage_show"
match 'users/:id/courses', :to => 'users#course_community', :as => "user_course_community"

View File

@ -1,3 +1,4 @@
#encoding=utf-8
# Redmine - project management software
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
@ -60,6 +61,8 @@ per_page_options:
default: '25,50,100'
mail_from:
default: trustieforge@gmail.com
mail_subject:
default: 'Trustie - 用户注册帐号激活通知'
upload_avatar_max_size:
format: int
default: 5242880