From 2b5928602ed38a163c6d91e669cd083e52972124 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Fri, 23 Jan 2015 09:17:27 +0800
Subject: [PATCH 01/12] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9=E7=94=B1=E4=BA=8E?=
=?UTF-8?q?=E6=84=8F=E8=A7=81=E6=82=AC=E6=B5=AE=E6=A1=86=E5=BC=95=E8=B5=B7?=
=?UTF-8?q?=E7=9A=84=E7=95=8C=E9=9D=A2=E7=9A=84padding=E4=B8=8D=E6=AD=A3?=
=?UTF-8?q?=E7=A1=AE=E7=9A=84=E9=97=AE=E9=A2=98=202.=E4=BF=AE=E6=94=B9?=
=?UTF-8?q?=E9=97=AE=E5=8D=B7=E8=B0=83=E6=9F=A5=E5=B7=A6=E4=BE=A7=E4=BC=9A?=
=?UTF-8?q?=E5=87=BA=E7=8E=B0=E6=BB=9A=E5=8A=A8=E6=9D=A1=E7=9A=84=E9=97=AE?=
=?UTF-8?q?=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/bids/_bid_homework_show.html.erb | 11 ++-
app/views/layouts/_base_feedback.html.erb | 102 ++++++++++-----------
app/views/poll/_poll_form.html.erb | 2 +-
public/stylesheets/polls.css | 6 +-
4 files changed, 61 insertions(+), 60 deletions(-)
diff --git a/app/views/bids/_bid_homework_show.html.erb b/app/views/bids/_bid_homework_show.html.erb
index 2d6c35555..49325c0d4 100644
--- a/app/views/bids/_bid_homework_show.html.erb
+++ b/app/views/bids/_bid_homework_show.html.erb
@@ -56,18 +56,21 @@
<%= link_to(bid.name, course_for_bid_path(bid), :class => 'bid_path') %>
-
+ |
<% if User.current.logged? && is_cur_course_student(@course) %>
<% cur_user_homework = cur_user_homework_for_bid(bid) %>
+
+ 匿评中..
+
<% if cur_user_homework && cur_user_homework.empty? %>
<%= link_to l(:label_commit_homework),new_exercise_book_path(bid) %>
<% else %>
-
- <%= l(:lable_has_commit_homework)%>
-
+
+ 已 提 交
+
<% end %>
<% end %>
<% if (User.current.admin?||User.current.allowed_to?(:as_teacher,@course)) %>
diff --git a/app/views/layouts/_base_feedback.html.erb b/app/views/layouts/_base_feedback.html.erb
index ae85d9479..23a610c14 100644
--- a/app/views/layouts/_base_feedback.html.erb
+++ b/app/views/layouts/_base_feedback.html.erb
@@ -1,10 +1,10 @@
@@ -313,7 +313,7 @@
<%= link_to l(:label_poll), poll_index_path(:polls_type => "Course", :polls_group_id => @course.id)%>
From fdba8ca9868d25674bcd109d4b66b0784ba05539 Mon Sep 17 00:00:00 2001
From: alan <547533434@qq.com>
Date: Fri, 23 Jan 2015 11:46:55 +0800
Subject: [PATCH 10/12] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E3=80=8A=E9=82=AE?=
=?UTF-8?q?=E7=AE=B1=E5=9C=B0=E5=9D=80=E7=9C=9F=E5=AE=9E=E6=80=A7=E9=AA=8C?=
=?UTF-8?q?=E8=AF=81=E3=80=8B=E3=80=8A=E8=AF=BE=E7=A8=8B=E5=88=86=E7=8F=AD?=
=?UTF-8?q?=E6=8F=90=E7=A4=BA=E9=87=8D=E5=90=8D=E5=87=BA=E9=94=99=E3=80=8B?=
=?UTF-8?q?=E3=80=8A=E7=95=99=E8=A8=80=E6=A8=A1=E5=9D=97=E5=8F=91=E9=80=81?=
=?UTF-8?q?=E9=82=AE=E4=BB=B6=E6=A8=A1=E6=9D=BF=E5=8A=9F=E8=83=BD=E3=80=8B?=
=?UTF-8?q?=20Signed-off-by:=20alan=20<547533434@qq.com>?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.gitignore | 2 +-
Gemfile | 2 +-
app/controllers/courses_controller.rb | 2 +-
app/models/course_group.rb | 6 +--
app/models/user.rb | 2 +-
app/views/courses/member.html.erb | 3 +-
app/views/mailer/_issue.html.erb | 2 +-
app/views/mailer/_issue.text.erb | 2 +-
.../mailer/journals_for_message_add.html.erb | 4 +-
app/views/mailer/message_posted.html.erb | 47 +++++++++++++++----
config/configuration.yml | 8 ++--
config/locales/zh.yml | 3 +-
12 files changed, 58 insertions(+), 25 deletions(-)
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)%>
+
+
+ - <%= l(:mail_issue_subject)%> <%= link_to(h(@message.subject), @message_url, :style=>'color:#1b55a7; font-weight:bold;') %>
+ - <%= l(:mail_issue_sent_from)%>
+ <% if @message.project %>
+ <%=h @message.board.project.name %> - <%=h @message.board.name %>
+ <% elsif @message.course %>
+ <%=h @message.board.course.name %> - <%=h @message.board.name %>
+ <% end %>
+
+ - <%= l(:mail_issue_content)%>
+
+ <%= @message.content %>
+
+
+
+
+
+
+
+
+
-<%= 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: 角色
From b20204fedd1846b1609b185fb96e1f3dd85abbb0 Mon Sep 17 00:00:00 2001
From: alan <547533434@qq.com>
Date: Fri, 23 Jan 2015 13:42:25 +0800
Subject: [PATCH 11/12] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E3=80=8A=E9=82=AE?=
=?UTF-8?q?=E4=BB=B6=E9=87=8D=E5=8F=91=E4=B8=80=E6=A0=B7=E5=BC=95=E5=8F=91?=
=?UTF-8?q?=E7=9A=84bug=E3=80=8B=20Signed-off-by:=20alan=20<547533434@qq.c?=
=?UTF-8?q?om>?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/models/issue_observer.rb | 3 ++-
app/models/journal_observer.rb | 3 ++-
app/models/mailer.rb | 16 +++++-----------
app/views/mailer/message_posted.html.erb | 4 ----
4 files changed, 9 insertions(+), 17 deletions(-)
diff --git a/app/models/issue_observer.rb b/app/models/issue_observer.rb
index 50cbf2a42..e404a4a1c 100644
--- a/app/models/issue_observer.rb
+++ b/app/models/issue_observer.rb
@@ -19,7 +19,8 @@ class IssueObserver < ActiveRecord::Observer
def after_create(issue)
Thread.start do
- recipients = issue.recipients
+ # 将跟踪者与本项目的其他成员都设为收件方,并去重,不在进行抄送,
+ recipients = issue.recipients - issue.watcher_recipients + issue.watcher_recipients
recipients.each do |rec|
Mailer.issue_add(issue,rec).deliver if Setting.notified_events.include?('issue_added')
end
diff --git a/app/models/journal_observer.rb b/app/models/journal_observer.rb
index 10d3f7b4b..b58464a9b 100644
--- a/app/models/journal_observer.rb
+++ b/app/models/journal_observer.rb
@@ -24,7 +24,8 @@ class JournalObserver < ActiveRecord::Observer
(Setting.notified_events.include?('issue_priority_updated') && journal.new_value_for('priority_id').present?)
)
Thread.start do
- recipients = journal.recipients
+ # 将跟踪者与本项目的其他成员都设为收件方,并去重,不在进行抄送,
+ recipients = journal.recipients - journal.watcher_recipients + journal.watcher_recipients
recipients.each do |rec|
Mailer.issue_edit(journal,rec).deliver
diff --git a/app/models/mailer.rb b/app/models/mailer.rb
index 23ac36054..1760d9004 100644
--- a/app/models/mailer.rb
+++ b/app/models/mailer.rb
@@ -147,13 +147,11 @@ class Mailer < ActionMailer::Base
@project_url = url_for(:controller => 'projects', :action => 'show', :id => issue.project_id, :token => @token.value)
@user_url = url_for(my_account_url(user,:token => @token.value))
- cc = nil
- if recipients == issue.recipients[0]
- cc = issue.watcher_recipients - issue.recipients
- end
+
+
subject = "[#{issue.project.name} - #{issue.tracker.name} ##{issue_id}] (#{issue.status.name}) #{issue.subject}"
mail(:to => recipients,
- :cc => cc,
+
:subject => subject)
end
# issue.attachments.each do |attach|
@@ -198,11 +196,7 @@ class Mailer < ActionMailer::Base
- # Watchers in cc
- cc = nil
- if recipients == journal.recipients[0]
- cc = journal.watcher_recipients - journal.recipients
- end
+
s = "[#{issue.project.name} - #{issue.tracker.name} ##{issue_id}] "
s << "(#{issue.status.name}) " if journal.new_value_for('status_id')
@@ -211,7 +205,7 @@ class Mailer < ActionMailer::Base
@journal = journal
# @issue_url = url_for(:controller => 'issues', :action => 'show', :id => issue, :anchor => "change-#{journal.id}")
mail(:to => recipients,
- :cc => cc,
+
:subject => s)
end
diff --git a/app/views/mailer/message_posted.html.erb b/app/views/mailer/message_posted.html.erb
index e031c2e98..1fe28e04f 100644
--- a/app/views/mailer/message_posted.html.erb
+++ b/app/views/mailer/message_posted.html.erb
@@ -1,8 +1,4 @@
-
-
-
-
<%= h @message.author %>(<%= @message.author.show_name %>)
From 6645648027be82145ed7a0db50cdd1121f6e0d93 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Fri, 23 Jan 2015 14:10:38 +0800
Subject: [PATCH 12/12] =?UTF-8?q?=E5=AD=A6=E7=94=9F=E6=98=AF=E5=90=A6?=
=?UTF-8?q?=E7=9C=8B=E5=88=B0=E9=97=AE=E5=8D=B7=E7=BB=93=E6=9E=9C=E8=80=81?=
=?UTF-8?q?=E5=B8=88=E5=8F=AF=E9=85=8D=E7=BD=AE=E5=A2=9E=E5=8A=A0=E6=95=B0?=
=?UTF-8?q?=E6=8D=AE=E5=BA=93?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/poll_controller.rb | 1 +
db/migrate/20150123020615_add_show_result.rb | 9 +++++++++
2 files changed, 10 insertions(+)
create mode 100644 db/migrate/20150123020615_add_show_result.rb
diff --git a/app/controllers/poll_controller.rb b/app/controllers/poll_controller.rb
index 4abddaa5e..0ee17222e 100644
--- a/app/controllers/poll_controller.rb
+++ b/app/controllers/poll_controller.rb
@@ -47,6 +47,7 @@ class PollController < ApplicationController
:user_id => User.current.id,
:published_at => Time.now,
:closed_at => Time.now,
+ :show_result => 1,
:polls_description => ""
}
@poll = Poll.create option
diff --git a/db/migrate/20150123020615_add_show_result.rb b/db/migrate/20150123020615_add_show_result.rb
new file mode 100644
index 000000000..0407abceb
--- /dev/null
+++ b/db/migrate/20150123020615_add_show_result.rb
@@ -0,0 +1,9 @@
+class AddShowResult < ActiveRecord::Migration
+ def up
+ add_column :polls, :show_result, :integer, default: 1
+ end
+
+ def down
+ remove_column :polls, :show_result
+ end
+end
|