diff --git a/.gitignore b/.gitignore index 0cd336786..944ad4ef2 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ /.bundle *.swp /config/database.yml +/config/configuration.yml /files/* /log/* /tmp/* @@ -14,5 +15,4 @@ /db/schema.rb /Gemfile.lock /lib/plugins/acts_as_versioned/test/debug.log -/config/configuration.yml .rbenv-gemsets diff --git a/Gemfile b/Gemfile index 5045cb822..dc834e68d 100644 --- a/Gemfile +++ b/Gemfile @@ -18,7 +18,7 @@ gem "builder", "3.0.0" gem 'acts-as-taggable-on', '2.4.1' gem 'spreadsheet' gem 'ruby-ole' -gem 'email_verifier' +#gem 'email_verifier' group :development do gem 'better_errors', path: 'lib/better_errors' diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index dcd09959d..b5e0362b3 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -273,7 +273,7 @@ class CoursesController < ApplicationController if valid_attr.eql?('name') faker.name = valid_value - # faker.course_id = @course.id + faker.course_id = params[:course_id] faker.valid? req[:valid] = faker.errors[:name].blank? req[:message] = faker.errors[:name] diff --git a/app/models/course_group.rb b/app/models/course_group.rb index c1236da93..c7fc81df4 100644 --- a/app/models/course_group.rb +++ b/app/models/course_group.rb @@ -13,7 +13,7 @@ class CourseGroup < ActiveRecord::Base attr_accessible :name validates :name, :presence => true, :length => {:maximum => 20} - validate_on_create :unique_name_and_course + validate :unique_name_and_course @@ -24,8 +24,8 @@ class CourseGroup < ActiveRecord::Base end private def unique_name_and_course - if CourseGroup.find(:conditions => ["name=? and course_id=?", name, course_id]).first - errors.add_to_base("该班名已被使用!") + if CourseGroup.where("name=? and course_id=?", name, course_id).first + errors.add(:name, :groupname_repeat) end end end diff --git a/app/models/user.rb b/app/models/user.rb index bef65fe54..06f59c764 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -188,7 +188,7 @@ class User < Principal validates_confirmation_of :password, :allow_nil => true validates_inclusion_of :mail_notification, :in => MAIL_NOTIFICATION_OPTIONS.collect(&:first), :allow_blank => true validate :validate_password_length - validates_email_realness_of :mail + #validates_email_realness_of :mail before_create :set_mail_notification before_save :update_hashed_password before_destroy :remove_references_before_destroy diff --git a/app/views/courses/member.html.erb b/app/views/courses/member.html.erb index 803be3731..e2c1fb418 100644 --- a/app/views/courses/member.html.erb +++ b/app/views/courses/member.html.erb @@ -6,7 +6,8 @@ $.get( '<%=valid_ajax_course_path%>', { valid: "name", - value: document.getElementById('group_name').value }, + value: document.getElementById('group_name').value, + course_id: <%= @course.id %> }, function (data) { if (!data.valid) { alert(data.message); diff --git a/app/views/mailer/_issue.html.erb b/app/views/mailer/_issue.html.erb index cd5fbc091..0ec585868 100644 --- a/app/views/mailer/_issue.html.erb +++ b/app/views/mailer/_issue.html.erb @@ -1,7 +1,7 @@

- <%= link_to(h("#{@issue.author}(#{@issue.author.show_name})"), @issue_author_url , :style=>'color:#1b55a7; font-weight:bold;') %> + <%= link_to(h("#{@author.login}(#{@author.show_name})"), @issue_author_url , :style=>'color:#1b55a7; font-weight:bold;') %> <%= l(:mail_issue_title_userin)%> <%= link_to(h("#{@issue.project.name}"), @project_url, :style=>'color:#1b55a7; font-weight:bold;') %><%= l(:mail_issue_title_active)%>

diff --git a/app/views/mailer/_issue.text.erb b/app/views/mailer/_issue.text.erb index 8848e494a..e0579824f 100644 --- a/app/views/mailer/_issue.text.erb +++ b/app/views/mailer/_issue.text.erb @@ -1,5 +1,5 @@ - <%= link_to(h("#{@issue.author}(#{@issue.author.show_name})"), @issue_author_url) %> + <%= link_to(h("#{@author.login}(#{@author.show_name})"), @issue_author_url) %> <%= l(:mail_issue_title_userin)%> <%= link_to(h("#{@issue.project.name}"),@project_url) %><%= l(:mail_issue_title_active)%> <%= l(:mail_issue_subject)%><%= link_to(issue.subject, issue_url) %> diff --git a/app/views/mailer/journals_for_message_add.html.erb b/app/views/mailer/journals_for_message_add.html.erb index 1aa8e45f8..f39b49026 100644 --- a/app/views/mailer/journals_for_message_add.html.erb +++ b/app/views/mailer/journals_for_message_add.html.erb @@ -1,5 +1,5 @@ 尊敬的用户,<%= @user %>给你留言了:
<%= @message %>
-

点击链接查看最新回复<%= link_to(@url, @url) %>

-         

<%= link_to(l(:lable_not_receive_mail),"http://" + Setting.host_name + "/my/account")%>

+

点击链接查看最新回复<%= link_to(@url, @url) %> +         <%= link_to(l(:lable_not_receive_mail),"http://" + Setting.host_name + "/my/account")%>

diff --git a/app/views/mailer/message_posted.html.erb b/app/views/mailer/message_posted.html.erb index 4bb487405..e031c2e98 100644 --- a/app/views/mailer/message_posted.html.erb +++ b/app/views/mailer/message_posted.html.erb @@ -1,10 +1,41 @@ -

- <% if @message.project %> - <%=h @message.board.project.name %> - <%=h @message.board.name %>: <%= link_to(h(@message.subject), @message_url) %> + + + + + +

+ + <%= h @message.author %>(<%= @message.author.show_name %>) + <%= l(:mail_issue_title_userin)%> + + <% if @message.project %> + <%=h @message.board.project.name %> - <%=h @message.board.name %>: <%= link_to(h(@message.subject), @message_url,:style=>'color:#1b55a7; font-weight:bold;') %> <% elsif @message.course %> - <%=h @message.board.course.name %> - <%=h @message.board.name %>: <%= link_to(h(@message.subject), @message_url) %> - <% end %> -

-<%=h @message.author %> + <%=h @message.board.course.name %> - <%=h @message.board.name %>: <%= link_to(h(@message.subject), @message_url,:style=>'color:#1b55a7; font-weight:bold;') %> + <% end %> + <%= l(:mail_issue_title_active)%>

+
+ +
+ +
+
+ -<%= textilizable(@message, :content, :only_path => false) %> diff --git a/config/configuration.yml b/config/configuration.yml index 9a9373e45..f17881485 100644 --- a/config/configuration.yml +++ b/config/configuration.yml @@ -87,12 +87,12 @@ default: - address: smtp.163.com + address: smtp.126.com port: 25 - domain: smtp.163.com + domain: smtp.126.com authentication: :plain - user_name: mcb592@163.com - password: 'mcb1989822' + user_name: "alanlong9278@126.com" + password: 'alanlong8788786' # Absolute path to the directory where attachments are stored. # The default is the 'files' directory in your Redmine instance. diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 77a5b4a1b..0f7d67cb8 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -152,7 +152,7 @@ zh: not_same_project: "不属于同一个项目" circular_dependency: "此关联将导致循环依赖" cant_link_an_issue_with_a_descendant: "问题不能关联到它的子任务" - + groupname_repeat: "该班名已存在" actionview_instancetag_blank_option: 请选择 @@ -598,6 +598,7 @@ zh: label_document_added: 文档已添加 label_forum_message_added: 发帖成功 label_forum_add: 贴吧创建成功 + label_message_reply: 回帖人 label_document_public_info: (打钩为公开,不打钩则不公开,若不公开,仅项目成员可见该文档。) label_role: 角色 label_role_plural: 角色