修改bug<注册时用户可以不填真实姓名,将其设置为可选>和《测试版:项目--点击作品下载报500错误》

Signed-off-by: alan <547533434@qq.com>
This commit is contained in:
alan 2014-10-29 16:13:49 +08:00
parent a6698bf2f1
commit 7d3a18197b
5 changed files with 40 additions and 25 deletions

View File

@ -16,11 +16,9 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class FilesController < ApplicationController
if @project
layout 'base_projects' #by young
else
layout 'base_courses'
end
menu_item :files
before_filter :find_project_by_project_id#, :except => [:getattachtype]
@ -303,26 +301,39 @@ class FilesController < ApplicationController
@isproject = true
@containers = [ Project.includes(:attachments).reorder("#{Attachment.table_name}.created_on DESC").find(@project.id)]
@containers += @project.versions.includes(:attachments).reorder(sort).all
show_attachments @containers
@attachtype = params[:type].to_i
@contenttype = params[:contentType].to_s
respond_to do |format|
format.js
format.html {
render :layout => 'base_projects'
}
end
#render :layout => 'base_projects'
elsif @course
@isproject = false
@containers = [ Course.includes(:attachments).reorder(sort).find(@course.id)]
# show_attachments @containers
# @attachtype = params[:type].to_i
# @contenttype = params[:contentType].to_s
show_attachments @containers
@attachtype = params[:type].to_i
@contenttype = params[:contentType].to_s
# render layout: 'base_courses'
respond_to do |format|
format.js
format.html {
render :layout => 'base_courses'
}
end
end
end
show_attachments @containers
@attachtype = params[:type].to_i
@contenttype = params[:contentType].to_s
respond_to do |format|
format.js
format.html
end
# show_attachments @containers
# @attachtype = params[:type].to_i
# @contenttype = params[:contentType].to_s
#
# respond_to do |format|
# format.js
# format.html
# end
end
end

View File

@ -167,7 +167,7 @@ class User < Principal
LOGIN_LENGTH_LIMIT = 25
MAIL_LENGTH_LIMIT = 60
validates_presence_of :login, :firstname, :mail, :if => Proc.new { |user| !user.is_a?(AnonymousUser) }
validates_presence_of :login, :mail, :if => Proc.new { |user| !user.is_a?(AnonymousUser) }
validates_uniqueness_of :login, :if => Proc.new { |user| user.login_changed? && user.login.present? }, :case_sensitive => false
validates_uniqueness_of :mail, :if => Proc.new { |user| user.mail_changed? && user.mail.present? }, :case_sensitive => false
# Login must contain letters, numbers, underscores only

View File

@ -335,8 +335,9 @@
<p><%= f.password_field :password_confirmation, :size => 25, :required => true %></p>
<% end %>
<span id='name' style='display:none'>
<p><%= f.text_field :firstname, :required => true %></p>
<p><%= f.text_field :lastname, :required => true %></p>
<p style="color: #ff0000"><%= l(:name_can_be_empty) %></p>
<p><%= f.text_field :firstname, :required => false %></p>
<p><%= f.text_field :lastname, :required => false %></p>
</span>
<span id='enterprise' style='display:none'>
<p>

View File

@ -7,8 +7,10 @@
<legend><%= l(:text_select_project_modules) %></legend>
<% Redmine::AccessControl.available_project_modules.each do |m| %>
<p><label><%= check_box_tag 'enabled_module_names[]', m, @project.module_enabled?(m) -%>
<%= l_or_humanize(m, :prefix => "project_module_") %></label></p>
<p><label><%= check_box_tag 'enabled_module_names[]', m, @project.module_enabled?(m) -%>
<%= l_or_humanize(m, :prefix => "project_module_") %></label></p>
<% end %>
</fieldset>
<p><%= check_all_links 'modules-form' %></p>

View File

@ -163,6 +163,7 @@ zh:
notice_account_invalid_creditentials_new: 您还未到邮箱激活
notice_account_password_updated: 密码更新成功
notice_account_wrong_password: 密码错误
name_can_be_empty: 可以不填写真实姓名[保密所需]
notice_account_register_done: 帐号创建成功,请使用注册确认邮件中的链接来激活您的帐号, 如果您的邮件没有在收件箱中可能在垃圾箱中,请您注意查收。
notice_account_unknown_email: 未知用户
notice_can_t_change_password: 该帐号使用了外部认证,因此无法更改密码。
@ -512,7 +513,7 @@ zh:
project_module_course: 课程
project_module_dts: DTS测试工具
label_module_share: DTS测试工具
project_module_code_review: 代码审查
label_user: 用户
label_user_plural: 用户列表
label_user_new: 新建用户