Merge branch 'szzh' of http://repository.trustie.net/xianbo/trustie2 into szzh
This commit is contained in:
commit
388ddac96b
|
@ -160,12 +160,15 @@ class ForumsController < ApplicationController
|
||||||
def create
|
def create
|
||||||
@forum = Forum.new(params[:forum])
|
@forum = Forum.new(params[:forum])
|
||||||
@forum.creator_id = User.current.id
|
@forum.creator_id = User.current.id
|
||||||
|
|
||||||
respond_to do |format|
|
|
||||||
if @forum.save
|
if @forum.save
|
||||||
|
respond_to do |format|
|
||||||
|
|
||||||
format.html { redirect_to @forum, notice: l(:label_forum_create_succ) }
|
format.html { redirect_to @forum, notice: l(:label_forum_create_succ) }
|
||||||
format.json { render json: @forum, status: :created, location: @forum }
|
format.json { render json: @forum, status: :created, location: @forum }
|
||||||
|
end
|
||||||
|
|
||||||
else
|
else
|
||||||
|
respond_to do |format|
|
||||||
flash.now[:error] = "#{l :label_forum_create_fail}: #{@forum.errors.full_messages[0]}"
|
flash.now[:error] = "#{l :label_forum_create_fail}: #{@forum.errors.full_messages[0]}"
|
||||||
format.html { render action: "new" }
|
format.html { render action: "new" }
|
||||||
format.json { render json: @forum.errors, status: :unprocessable_entity }
|
format.json { render json: @forum.errors, status: :unprocessable_entity }
|
||||||
|
|
|
@ -112,7 +112,7 @@ module CoursesHelper
|
||||||
# end
|
# end
|
||||||
|
|
||||||
#获取课程所有成员
|
#获取课程所有成员
|
||||||
def course_member course
|
def course_all_member course
|
||||||
course.members
|
course.members
|
||||||
end
|
end
|
||||||
# 学生人数计算
|
# 学生人数计算
|
||||||
|
|
|
@ -18,7 +18,7 @@ class Forum < ActiveRecord::Base
|
||||||
|
|
||||||
acts_as_taggable
|
acts_as_taggable
|
||||||
scope :by_join_date, order("created_at DESC")
|
scope :by_join_date, order("created_at DESC")
|
||||||
|
after_create :send_email
|
||||||
def reset_counters!
|
def reset_counters!
|
||||||
self.class.reset_counters!(id)
|
self.class.reset_counters!(id)
|
||||||
end
|
end
|
||||||
|
@ -33,6 +33,11 @@ class Forum < ActiveRecord::Base
|
||||||
self.creator == user || user.admin?
|
self.creator == user || user.admin?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def send_email
|
||||||
|
Thread.start do
|
||||||
|
Mailer.forum_add(self).deliver if Setting.notified_events.include?('forum_add')
|
||||||
|
end
|
||||||
|
end
|
||||||
# Updates topic_count, memo_count and last_memo_id attributes for +board_id+
|
# Updates topic_count, memo_count and last_memo_id attributes for +board_id+
|
||||||
def self.reset_counters!(forum_id)
|
def self.reset_counters!(forum_id)
|
||||||
forum_id = forum_id.to_i
|
forum_id = forum_id.to_i
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
class ForumObserver < ActiveRecord::Observer
|
||||||
|
def after_create(forum)
|
||||||
|
Thread.start do
|
||||||
|
Mailer.forum_add(forum).deliver if Setting.notified_events.include?('forum_add')
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
|
@ -27,6 +27,36 @@ class Mailer < ActionMailer::Base
|
||||||
{ :host => Setting.host_name, :protocol => Setting.protocol }
|
{ :host => Setting.host_name, :protocol => Setting.protocol }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# 贴吧新建贴吧发送邮件
|
||||||
|
# example Mailer.forum(forum).deliver
|
||||||
|
def forum_add(forum)
|
||||||
|
|
||||||
|
redmine_headers 'Forum' => forum.id
|
||||||
|
@forum = forum
|
||||||
|
@author = forum.creator
|
||||||
|
recipients = forum.creator.mail
|
||||||
|
# cc = wiki_content.page.wiki.watcher_recipients - recipients
|
||||||
|
|
||||||
|
@forum_url = url_for(:controller => 'forums', :action => 'show', :id => forum.id)
|
||||||
|
mail :to => recipients,:subject => "[ #{l(:label_forum)} : #{forum.name} #{l(:notice_successful_create)}]"
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
def forum_message_added(memo)
|
||||||
|
@memo = memo
|
||||||
|
redmine_headers 'Memo' => memo.id
|
||||||
|
@forum = memo.forum
|
||||||
|
@author = memo.author
|
||||||
|
recipients ||= []
|
||||||
|
mems = memo.self_and_siblings
|
||||||
|
mems.each do |mem|
|
||||||
|
recipients << mem.author.mail unless recipients.include? mem.author.mail
|
||||||
|
end
|
||||||
|
# cc = wiki_content.page.wiki.watcher_recipients - recipients
|
||||||
|
|
||||||
|
@memo_url = url_for(forum_memo_url(@forum, (@memo.parent_id.nil? ? @memo : @memo.parent_id)))
|
||||||
|
mail :to => recipients,:subject => "[ #{l(:label_message_plural)} : #{memo.subject} #{l(:label_memo_create_succ)}]"
|
||||||
|
end
|
||||||
# Builds a Mail::Message object used to email recipients of the added journals for message.
|
# Builds a Mail::Message object used to email recipients of the added journals for message.
|
||||||
|
|
||||||
# 留言分为直接留言,和对留言人留言的回复
|
# 留言分为直接留言,和对留言人留言的回复
|
||||||
|
@ -62,7 +92,7 @@ class Mailer < ActionMailer::Base
|
||||||
course = journals_for_message.jour
|
course = journals_for_message.jour
|
||||||
@author = journals_for_message.user
|
@author = journals_for_message.user
|
||||||
#课程的教师
|
#课程的教师
|
||||||
@members = course_member journals_for_message.jour
|
@members = course_all_member journals_for_message.jour
|
||||||
#收件人邮箱
|
#收件人邮箱
|
||||||
@recipients ||= []
|
@recipients ||= []
|
||||||
@members.each do |teacher|
|
@members.each do |teacher|
|
||||||
|
@ -117,8 +147,10 @@ class Mailer < ActionMailer::Base
|
||||||
@project_url = url_for(:controller => 'projects', :action => 'show', :id => issue.project_id, :token => @token.value)
|
@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))
|
@user_url = url_for(my_account_url(user,:token => @token.value))
|
||||||
|
cc = nil
|
||||||
|
if recipients == issue.recipients[0]
|
||||||
cc = issue.watcher_recipients - issue.recipients
|
cc = issue.watcher_recipients - issue.recipients
|
||||||
|
end
|
||||||
subject = "[#{issue.project.name} - #{issue.tracker.name} ##{issue_id}] (#{issue.status.name}) #{issue.subject}"
|
subject = "[#{issue.project.name} - #{issue.tracker.name} ##{issue_id}] (#{issue.status.name}) #{issue.subject}"
|
||||||
mail(:to => recipients,
|
mail(:to => recipients,
|
||||||
:cc => cc,
|
:cc => cc,
|
||||||
|
@ -167,8 +199,11 @@ class Mailer < ActionMailer::Base
|
||||||
|
|
||||||
|
|
||||||
# Watchers in cc
|
# Watchers in cc
|
||||||
|
cc = nil
|
||||||
|
if recipients == journal.recipients[0]
|
||||||
cc = journal.watcher_recipients - journal.recipients
|
cc = journal.watcher_recipients - journal.recipients
|
||||||
|
end
|
||||||
|
|
||||||
s = "[#{issue.project.name} - #{issue.tracker.name} ##{issue_id}] "
|
s = "[#{issue.project.name} - #{issue.tracker.name} ##{issue_id}] "
|
||||||
s << "(#{issue.status.name}) " if journal.new_value_for('status_id')
|
s << "(#{issue.status.name}) " if journal.new_value_for('status_id')
|
||||||
s << issue.subject
|
s << issue.subject
|
||||||
|
@ -282,7 +317,7 @@ class Mailer < ActionMailer::Base
|
||||||
recipients = container.notified_users.select { |user| user.allowed_to?(:view_files, container) }.collect { |u| u.mail }
|
recipients = container.notified_users.select { |user| user.allowed_to?(:view_files, container) }.collect { |u| u.mail }
|
||||||
when 'Course'
|
when 'Course'
|
||||||
added_to_url = url_for(:controller => 'files', :action => 'index', :course_id => container)
|
added_to_url = url_for(:controller => 'files', :action => 'index', :course_id => container)
|
||||||
added_to = "#{l(:label_course)}: #{container}"
|
added_to = "#{l(:label_course)}: #{container.name}"
|
||||||
recipients = container.notified_users.select { |user| user.allowed_to?(:view_files, container) }.collect { |u| u.mail }
|
recipients = container.notified_users.select { |user| user.allowed_to?(:view_files, container) }.collect { |u| u.mail }
|
||||||
when 'Version'
|
when 'Version'
|
||||||
added_to_url = url_for(:controller => 'files', :action => 'index', :project_id => container.project)
|
added_to_url = url_for(:controller => 'files', :action => 'index', :project_id => container.project)
|
||||||
|
@ -323,6 +358,8 @@ class Mailer < ActionMailer::Base
|
||||||
# news_added(news) => Mail::Message object
|
# news_added(news) => Mail::Message object
|
||||||
# Mailer.news_added(news).deliver => sends an email to the news' project recipients
|
# Mailer.news_added(news).deliver => sends an email to the news' project recipients
|
||||||
def news_added(news)
|
def news_added(news)
|
||||||
|
|
||||||
|
if news.project
|
||||||
redmine_headers 'Project' => news.project.identifier
|
redmine_headers 'Project' => news.project.identifier
|
||||||
@author = news.author
|
@author = news.author
|
||||||
message_id news
|
message_id news
|
||||||
|
@ -330,6 +367,16 @@ class Mailer < ActionMailer::Base
|
||||||
@news_url = url_for(:controller => 'news', :action => 'show', :id => news)
|
@news_url = url_for(:controller => 'news', :action => 'show', :id => news)
|
||||||
mail :to => news.recipients,
|
mail :to => news.recipients,
|
||||||
:subject => "[#{news.project.name}] #{l(:label_news)}: #{news.title}"
|
:subject => "[#{news.project.name}] #{l(:label_news)}: #{news.title}"
|
||||||
|
elsif news.course
|
||||||
|
redmine_headers 'Course' => news.course.id
|
||||||
|
@author = news.author
|
||||||
|
message_id news
|
||||||
|
@news = news
|
||||||
|
recipients = news.course.notified_users.select { |user| user.allowed_to?(:view_files, news.course) }.collect { |u| u.mail }
|
||||||
|
@news_url = url_for(:controller => 'news', :action => 'show', :id => news)
|
||||||
|
mail :to => recipients,
|
||||||
|
:subject => "[#{news.course.name}] #{l(:label_news)}: #{news.title}"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Builds a Mail::Message object used to email recipients of a news' project when a news comment is added.
|
# Builds a Mail::Message object used to email recipients of a news' project when a news comment is added.
|
||||||
|
@ -339,6 +386,7 @@ class Mailer < ActionMailer::Base
|
||||||
# Mailer.news_comment_added(comment) => sends an email to the news' project recipients
|
# Mailer.news_comment_added(comment) => sends an email to the news' project recipients
|
||||||
def news_comment_added(comment)
|
def news_comment_added(comment)
|
||||||
news = comment.commented
|
news = comment.commented
|
||||||
|
if news.project
|
||||||
redmine_headers 'Project' => news.project.identifier
|
redmine_headers 'Project' => news.project.identifier
|
||||||
@author = comment.author
|
@author = comment.author
|
||||||
message_id comment
|
message_id comment
|
||||||
|
@ -348,6 +396,18 @@ class Mailer < ActionMailer::Base
|
||||||
mail :to => news.recipients,
|
mail :to => news.recipients,
|
||||||
:cc => news.watcher_recipients,
|
:cc => news.watcher_recipients,
|
||||||
:subject => "Re: [#{news.project.name}] #{l(:label_news)}: #{news.title}"
|
:subject => "Re: [#{news.project.name}] #{l(:label_news)}: #{news.title}"
|
||||||
|
elsif news.course
|
||||||
|
redmine_headers 'Course' => news.course.id
|
||||||
|
@author = comment.author
|
||||||
|
message_id comment
|
||||||
|
@news = news
|
||||||
|
@comment = comment
|
||||||
|
@news_url = url_for(:controller => 'news', :action => 'show', :id => news)
|
||||||
|
recipients = news.course.notified_users.select { |user| user.allowed_to?(:view_files, news.course) }.collect { |u| u.mail }
|
||||||
|
|
||||||
|
mail :to => recipients,
|
||||||
|
:subject => "[#{news.course.name}] #{l(:label_news)}: #{news.title}"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Builds a Mail::Message object used to email the recipients of the specified message that was posted.
|
# Builds a Mail::Message object used to email the recipients of the specified message that was posted.
|
||||||
|
@ -356,6 +416,7 @@ class Mailer < ActionMailer::Base
|
||||||
# message_posted(message) => Mail::Message object
|
# message_posted(message) => Mail::Message object
|
||||||
# Mailer.message_posted(message).deliver => sends an email to the recipients
|
# Mailer.message_posted(message).deliver => sends an email to the recipients
|
||||||
def message_posted(message)
|
def message_posted(message)
|
||||||
|
if message.project
|
||||||
redmine_headers 'Project' => message.project.identifier,
|
redmine_headers 'Project' => message.project.identifier,
|
||||||
'Topic-Id' => (message.parent_id || message.id)
|
'Topic-Id' => (message.parent_id || message.id)
|
||||||
@author = message.author
|
@author = message.author
|
||||||
|
@ -368,6 +429,20 @@ class Mailer < ActionMailer::Base
|
||||||
mail :to => recipients,
|
mail :to => recipients,
|
||||||
:cc => cc,
|
:cc => cc,
|
||||||
:subject => "[#{message.board.project.name} - #{message.board.name} - msg#{message.root.id}] #{message.subject}"
|
:subject => "[#{message.board.project.name} - #{message.board.name} - msg#{message.root.id}] #{message.subject}"
|
||||||
|
elsif message.course
|
||||||
|
redmine_headers 'Course' => message.course.id,
|
||||||
|
'Topic-Id' => (message.parent_id || message.id)
|
||||||
|
@author = message.author
|
||||||
|
message_id message
|
||||||
|
references message.parent unless message.parent.nil?
|
||||||
|
recipients = message.course.notified_users.select { |user| user.allowed_to?(:view_files, message.course) }.collect { |u| u.mail }
|
||||||
|
cc = ((message.root.watcher_recipients + message.board.watcher_recipients).uniq - recipients)
|
||||||
|
@message = message
|
||||||
|
@message_url = url_for(message.event_url)
|
||||||
|
mail :to => recipients,
|
||||||
|
:cc => cc,
|
||||||
|
:subject => "[#{message.board.course.name} - #{message.board.name} - msg#{message.root.id}] #{message.subject}"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Builds a Mail::Message object used to email the recipients of a project of the specified wiki content was added.
|
# Builds a Mail::Message object used to email the recipients of a project of the specified wiki content was added.
|
||||||
|
|
|
@ -43,7 +43,7 @@ class Memo < ActiveRecord::Base
|
||||||
"parent_id",
|
"parent_id",
|
||||||
"replies_count"
|
"replies_count"
|
||||||
|
|
||||||
after_create :add_author_as_watcher, :reset_counters!#,:be_user_score -- 公共区发帖暂不计入得分
|
after_create :add_author_as_watcher, :reset_counters!, :sendmail#,:be_user_score -- 公共区发帖暂不计入得分
|
||||||
# after_update :update_memos_forum
|
# after_update :update_memos_forum
|
||||||
after_destroy :reset_counters!#,:down_user_score -- 公共区发帖暂不计入得分
|
after_destroy :reset_counters!#,:down_user_score -- 公共区发帖暂不计入得分
|
||||||
# after_create :send_notification
|
# after_create :send_notification
|
||||||
|
@ -54,6 +54,12 @@ class Memo < ActiveRecord::Base
|
||||||
# includes(:forum => ).where()
|
# includes(:forum => ).where()
|
||||||
# }
|
# }
|
||||||
|
|
||||||
|
def sendmail
|
||||||
|
thread1=Thread.new do
|
||||||
|
Mailer.forum_message_added(self).deliver if Setting.notified_events.include?('forum_message_added')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def cannot_reply_to_locked_topic
|
def cannot_reply_to_locked_topic
|
||||||
errors.add :base, l(:label_memo_locked) if root.locked? && self != root
|
errors.add :base, l(:label_memo_locked) if root.locked? && self != root
|
||||||
end
|
end
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
class MemoObserver < ActiveRecord::Observer
|
||||||
|
def after_create(memo)
|
||||||
|
|
||||||
|
thread1=Thread.new do
|
||||||
|
Mailer.forum_message_added(memo).deliver if Setting.notified_events.include?('forum_message_added')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -56,7 +56,7 @@
|
||||||
</script>
|
</script>
|
||||||
<%= stylesheet_link_tag 'course_group', :media => 'all' %>
|
<%= stylesheet_link_tag 'course_group', :media => 'all' %>
|
||||||
<script type="text/javascript" src="javascripts/jquery-1.8.3-ui-1.9.2-ujs-2.0.3.js"></script>
|
<script type="text/javascript" src="javascripts/jquery-1.8.3-ui-1.9.2-ujs-2.0.3.js"></script>
|
||||||
<div class="st_list">
|
<div class="st_list" id="member_of_course">
|
||||||
<div class="st_search" style="margin-left: 14px" >
|
<div class="st_search" style="margin-left: 14px" >
|
||||||
<span class="f_l"><%= @subPage_title %></span>
|
<span class="f_l"><%= @subPage_title %></span>
|
||||||
<span id = "search_members">
|
<span id = "search_members">
|
||||||
|
|
|
@ -11,7 +11,7 @@ div,html,img,ul,li,p,body,h1,h2,h3,h4,p,a,table,tr,td,fieldset,input,span,ol{ ma
|
||||||
div,img,tr,td,table{ border:0;}
|
div,img,tr,td,table{ border:0;}
|
||||||
table,tr,td{border:0;cellspacing:0; cellpadding:0;}
|
table,tr,td{border:0;cellspacing:0; cellpadding:0;}
|
||||||
ol,ul,li{ list-style-type:none}
|
ol,ul,li{ list-style-type:none}
|
||||||
.cl{ clear:both; overflow:hidden; }
|
.cl{ clear:both; overflow:hidden; margin-top: 30px;}
|
||||||
a{ text-decoration:none; }
|
a{ text-decoration:none; }
|
||||||
a:hover{ text-decoration:underline; }
|
a:hover{ text-decoration:underline; }
|
||||||
.mail_box,ul,li{ list-style-type:none}
|
.mail_box,ul,li{ list-style-type:none}
|
||||||
|
@ -35,7 +35,7 @@ a:hover.mail_reply{ background:#06a9bc; text-decoration:none;}
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="mail">
|
<div class="mail">
|
||||||
<div class="mail_head">
|
<div class="mail_head">
|
||||||
<p>亲爱的Trustie用户,您好!</p>
|
<p><%= l(:mail_issue_greetings)%></p>
|
||||||
</div><!--mail_head end-->
|
</div><!--mail_head end-->
|
||||||
<%= yield %>
|
<%= yield %>
|
||||||
<hr />
|
<hr />
|
||||||
|
|
|
@ -2,19 +2,19 @@
|
||||||
<p>
|
<p>
|
||||||
<span class="c_blue">
|
<span class="c_blue">
|
||||||
<%= link_to(h("#{@issue.author}(#{@issue.author.show_name})"), @issue_author_url) %>
|
<%= link_to(h("#{@issue.author}(#{@issue.author.show_name})"), @issue_author_url) %>
|
||||||
</span>在
|
</span><%= l(:mail_issue_title_userin)%>
|
||||||
<span class="c_blue"><%= link_to(h("#{@issue.project.name}"),@project_url) %></span>中有了一个与您相关的最新活动,请您关注!</p>
|
<span class="c_blue"><%= link_to(h("#{@issue.project.name}"),@project_url) %></span></span><%= l(:mail_issue_title_active)%></p>
|
||||||
<div class="mail_box">
|
<div class="mail_box">
|
||||||
<ul>
|
<ul>
|
||||||
<li style="list-style-type:none"><span style="float: left"><strong>标题:</strong></span><span style="float: left; width: 500px"><%= link_to(issue.subject, issue_url) %></span></li>
|
<li style="list-style-type:none"><span style="float: left"><strong><%= l(:mail_issue_subject)%></strong></span><span style="float: left; width: 500px"><%= link_to(issue.subject, issue_url) %></span></li>
|
||||||
<li style="list-style-type:none"><span style="float: left"> <strong>来源:</strong></span><span style="float: left; width: 500px"><%= issue.project.name %><b>| </b>项目<%= issue.tracker.name%></span></li>
|
<li style="list-style-type:none"><span style="float: left"> <strong><%= l(:mail_issue_sent_from)%></strong></span><span style="float: left; width: 500px"><%= issue.project.name %><b>| </b><%= l(:mail_issue_from_project)%></span></li>
|
||||||
<li style="list-style-type:none"><span style="float: left"> <strong >内容:</strong></span><span style="float: left; width: 500px">
|
<li style="list-style-type:none"><span style="float: left"> <strong ><%= l(:mail_issue_content)%></strong></span><span style="float: left; width: 500px">
|
||||||
<%= issue.description %></span>
|
<%= issue.description %></span>
|
||||||
</li>
|
</li>
|
||||||
<li style="list-style-type:none">
|
<li style="list-style-type:none">
|
||||||
|
|
||||||
<% unless @issue.attachments.nil? %>
|
<% unless @issue.attachments.nil? %>
|
||||||
<span style="float: left"> <strong>附件:</strong>
|
<span style="float: left"> <strong><%= l(:mail_issue_attachments)%></strong>
|
||||||
</span><span style="float: left; width: 500px">
|
</span><span style="float: left; width: 500px">
|
||||||
<% @issue.attachments.each do |attach| %>
|
<% @issue.attachments.each do |attach| %>
|
||||||
<p><%= link_to_attachment(attach, :download => true, :token => @token.value, :only_path => false) %></p>
|
<p><%= link_to_attachment(attach, :download => true, :token => @token.value, :only_path => false) %></p>
|
||||||
|
@ -25,7 +25,7 @@
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<label class="mail_reply"><%= link_to( "我要回复", issue_url, :class => "mail_reply") %></label>
|
<label class="mail_reply"><%= link_to( l(:mail_issue_reply), issue_url, :class => "mail_reply") %></label>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</div>
|
</div>
|
||||||
<!-- <li><%#=l(:field_author)%>: <%#=h issue.author %></li>
|
<!-- <li><%#=l(:field_author)%>: <%#=h issue.author %></li>
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
|
|
||||||
<%= link_to(h("#{@issue.author}(#{@issue.author.show_name})"), @issue_author_url) %>
|
<%= link_to(h("#{@issue.author}(#{@issue.author.show_name})"), @issue_author_url) %>
|
||||||
在
|
<%= l(:mail_issue_title_userin)%>
|
||||||
<%= link_to(h("#{@issue.project.name}"),@project_url) %>中有了一个与您相关的最新活动,请您关注!
|
<%= link_to(h("#{@issue.project.name}"),@project_url) %><%= l(:mail_issue_title_active)%>
|
||||||
标题:<%= link_to(issue.subject, issue_url) %>
|
<%= l(:mail_issue_subject)%><%= link_to(issue.subject, issue_url) %>
|
||||||
来源:<%= issue.project.name %>| 项目缺陷<
|
<%= l(:mail_issue_sent_from)%>| <%= l(:mail_issue_from_project)%>
|
||||||
内容:
|
<%= l(:mail_issue_content)%>
|
||||||
<%= issue.description %>
|
<%= issue.description %>
|
||||||
<% unless @issue.attachments.nil? %>
|
<% unless @issue.attachments.nil? %>
|
||||||
附件:
|
<%= l(:mail_issue_attachments)%>
|
||||||
|
|
||||||
|
|
||||||
<% @issue.attachments.each do |attach| %>
|
<% @issue.attachments.each do |attach| %>
|
||||||
|
@ -16,4 +16,4 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
|
||||||
<%= link_to( "我要回复", issue_url) %>
|
<%= link_to( l(:mail_issue_reply), issue_url) %>
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
<h1><%= link_to(h(@forum.name), @forum_url) %></h1>
|
||||||
|
<em><%=h @forum.creator.name %></em>
|
||||||
|
|
||||||
|
<%= @forum.description.html_safe %>
|
|
@ -0,0 +1,4 @@
|
||||||
|
<%= @forum_url %>
|
||||||
|
<%= @author.name %>
|
||||||
|
|
||||||
|
<%= @forum.description %>
|
|
@ -0,0 +1,4 @@
|
||||||
|
<h1><%= link_to(h(@memo.subject), @memo_url) %></h1>
|
||||||
|
<em><%=h @memo.author.name %></em>
|
||||||
|
|
||||||
|
<%= @memo.content.html_safe %>
|
|
@ -0,0 +1,5 @@
|
||||||
|
<%= @memo_url %>
|
||||||
|
<%= @author.name %>
|
||||||
|
|
||||||
|
<%= @memo.subject %>
|
||||||
|
<%= @memo.content %>
|
|
@ -5,5 +5,5 @@
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="mail_foot"><%= link_to("退订该邮件?", @user_url) %> </div>
|
<div class="mail_foot"><%= link_to( l(:mail_issue_footer), @user_url) %> </div>
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
|
|
||||||
<%= render :partial => 'issue', :formats => [:text], :locals => { :issue => @issue, :issue_url => @issue_url } %>
|
<%= render :partial => 'issue', :formats => [:text], :locals => { :issue => @issue, :issue_url => @issue_url } %>
|
||||||
<%= link_to("退订该邮件?", @user_url) %>
|
<%= link_to( l(:mail_issue_footer), @user_url) %>
|
|
@ -1,3 +1,4 @@
|
||||||
|
<div>
|
||||||
<%= l(:text_issue_updated, :id => "##{@issue.project_index}", :author => h(@journal.user)) %>
|
<%= l(:text_issue_updated, :id => "##{@issue.project_index}", :author => h(@journal.user)) %>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
|
@ -9,7 +10,10 @@
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<span style="float: left"><strong><%= l(:field_content)%>:</strong></span><span style="float: left; width: 540px"><%= @journal.notes %></span>
|
<span style="float: left"><strong><%= l(:field_content)%>:</strong></span><span style="float: left; width: 540px"><%= @journal.notes %></span>
|
||||||
<hr />
|
</div>
|
||||||
<%= render :partial => 'issue', :formats => [:html], :locals => { :issue => @issue, :issue_url => @issue_url } %>
|
<div class="cl"></div>
|
||||||
<div class="mail_foot"><%= link_to("退订该邮件?", @user_url) %> </div>
|
|
||||||
|
|
||||||
|
<%= render :partial => 'issue', :formats => [:html], :locals => { :issue => @issue, :issue_url => @issue_url } %>
|
||||||
|
<div class="mail_foot"><%= link_to( l(:mail_issue_footer), @user_url) %> </div>
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
<%= l(:field_content)%>:<%= @journal.notes %>
|
<%= l(:field_content)%>:<%= @journal.notes %>
|
||||||
|
|
||||||
<% end -%>
|
<% end -%>
|
||||||
----------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
<%= render :partial => 'issue', :formats => [:text], :locals => { :issue => @issue, :issue_url => @issue_url } %>
|
<%= render :partial => 'issue', :formats => [:text], :locals => { :issue => @issue, :issue_url => @issue_url } %>
|
||||||
|
|
||||||
<%= link_to("退订该邮件?", @user_url) %>
|
<%= link_to( l(:mail_issue_footer), @user_url) %>
|
|
@ -1,4 +1,10 @@
|
||||||
<h1><%=h @message.board.project.name %> - <%=h @message.board.name %>: <%= link_to(h(@message.subject), @message_url) %></h1>
|
<h1>
|
||||||
|
<% if @message.project %>
|
||||||
|
<%=h @message.board.project.name %> - <%=h @message.board.name %>: <%= link_to(h(@message.subject), @message_url) %>
|
||||||
|
<% elsif @message.course %>
|
||||||
|
<%=h @message.board.course.name %> - <%=h @message.board.name %>: <%= link_to(h(@message.subject), @message_url) %>
|
||||||
|
<% end %>
|
||||||
|
</h1>
|
||||||
<em><%=h @message.author %></em>
|
<em><%=h @message.author %></em>
|
||||||
|
|
||||||
<%= textilizable(@message, :content, :only_path => false) %>
|
<%= textilizable(@message, :content, :only_path => false) %>
|
||||||
|
|
|
@ -123,10 +123,10 @@
|
||||||
<br/>
|
<br/>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p style="width:400px;padding-left: 50px;">
|
<p style="width:400px;padding-left: 53px;">
|
||||||
<label style="margin-right: 1px;">
|
<label for="userIdentity">
|
||||||
<%= l(:label_identity) %><span style="color: #bb0000;"> *</span></label>
|
<%= l(:label_identity) %><span class="required"> *</span></label>
|
||||||
<select onchange="showtechnical_title(this.value, $('#userTechnical_title'));" name="identity" id="userIdentity" class="location" style="margin: 0px;">
|
<select onchange="showtechnical_title(this.value, $('#userTechnical_title'));" name="identity" id="userIdentity" class="location" style="margin: -4px;">
|
||||||
<option value="">
|
<option value="">
|
||||||
<%= l(:label_account_identity_choose) %>
|
<%= l(:label_account_identity_choose) %>
|
||||||
</option>
|
</option>
|
||||||
|
@ -187,19 +187,19 @@
|
||||||
<!-- added by bai 增加账户里的性别-->
|
<!-- added by bai 增加账户里的性别-->
|
||||||
<span id='gender' style='display:none'>
|
<span id='gender' style='display:none'>
|
||||||
<% if @user.user_extensions.nil? %>
|
<% if @user.user_extensions.nil? %>
|
||||||
<p style="width:400px;padding-left: 52px;">
|
<p style="width:400px;padding-left: 53px;">
|
||||||
<%= l(:label_gender) %>
|
<label for="gender"><%= l(:label_gender) %> </label>
|
||||||
<%= select_tag 'gender', "<option value = '0'>#{l(:label_gender_male)}</option><option value = '1'>#{l(:label_gender_female)}</option>".html_safe, :class => 'gender' %>
|
<%= select_tag 'gender', "<option value = '0'>#{l(:label_gender_male)}</option><option value = '1'>#{l(:label_gender_female)}</option>".html_safe, :class => 'gender' %>
|
||||||
</p>
|
</p>
|
||||||
<% else %>
|
<% else %>
|
||||||
<% if @user.user_extensions.gender == 0 %><!-- label_gender_male -->
|
<% if @user.user_extensions.gender == 0 %><!-- label_gender_male -->
|
||||||
<p style="width:400px;padding-left: 52px;">
|
<p style="width:400px;padding-left: 53px;">
|
||||||
<%= l(:label_gender) %>
|
<label for="gender"><%= l(:label_gender) %> </label>
|
||||||
<%= select_tag 'gender', "<option value = '0'>#{l(:label_gender_male)}</option><option value = '1'>#{l(:label_gender_female)}</option>".html_safe, :class => 'gender' %>
|
<%= select_tag 'gender', "<option value = '0'>#{l(:label_gender_male)}</option><option value = '1'>#{l(:label_gender_female)}</option>".html_safe, :class => 'gender' %>
|
||||||
</p>
|
</p>
|
||||||
<% else %>
|
<% else %>
|
||||||
<p style="width:400px;padding-left: 54px;">
|
<p style="width:400px;padding-left: 54px;">
|
||||||
<%= l(:label_gender) %>
|
<label for="gender"><%= l(:label_gender) %> </label>
|
||||||
<%= select_tag 'gender', "<option value = '0'>#{l(:label_gender_male)}</option><option value = '1' selected='selected'>#{l(:label_gender_female)}</option>".html_safe, :class => 'gender' %>
|
<%= select_tag 'gender', "<option value = '0'>#{l(:label_gender_male)}</option><option value = '1' selected='selected'>#{l(:label_gender_female)}</option>".html_safe, :class => 'gender' %>
|
||||||
</p>
|
</p>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
@ -212,9 +212,9 @@
|
||||||
|
|
||||||
|
|
||||||
<!-- added by Wen -->
|
<!-- added by Wen -->
|
||||||
<p id="occupation_detail" style="padding-left: 24px; display: none">
|
<p id="occupation_detail" style="padding-left: 25px; display: none">
|
||||||
|
|
||||||
<%= l(:field_occupation) %>
|
<label for="occupation_name"><%= l(:field_occupation) %></label>
|
||||||
<span class="required"> </span>
|
<span class="required"> </span>
|
||||||
<% if User.current.user_extensions.nil? %>
|
<% if User.current.user_extensions.nil? %>
|
||||||
<input id="province" name="province" style="display: none" type="text" value="请单击选择省份及学校" readonly>
|
<input id="province" name="province" style="display: none" type="text" value="请单击选择省份及学校" readonly>
|
||||||
|
@ -318,7 +318,7 @@
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<p style="width:400px;padding-left: 55px;"><label style="margin-right: 5px;"><%= l(:label_location) %></label>
|
<p style="width:400px;padding-left: 55px;"><label style="margin-right: 5px;" for="userProvince"><%= l(:label_location) %></label>
|
||||||
<select onchange="showcity(this.value, document.getElementById('userCity'));" name="province" id="userProvince" class="location">
|
<select onchange="showcity(this.value, document.getElementById('userCity'));" name="province" id="userProvince" class="location">
|
||||||
<option value="">--请选择省份--</option>
|
<option value="">--请选择省份--</option>
|
||||||
<option value="北京">北京</option>
|
<option value="北京">北京</option>
|
||||||
|
@ -382,7 +382,7 @@
|
||||||
<legend onclick="toggleFieldset(this);">
|
<legend onclick="toggleFieldset(this);">
|
||||||
<%= l(:field_mail_notification) %>
|
<%= l(:field_mail_notification) %>
|
||||||
</legend>
|
</legend>
|
||||||
<div style="padding-left: 8px;"> <!-- modified by ming -->
|
<div style="padding-left: 3px;"> <!-- modified by ming -->
|
||||||
<p style="width:380px;">
|
<p style="width:380px;">
|
||||||
<%= render :partial => 'users/mail_notifications' %>
|
<%= render :partial => 'users/mail_notifications' %>
|
||||||
</p></div>
|
</p></div>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<p>
|
<p>
|
||||||
<%= label_tag "user_mail_notification", l(:description_user_mail_notification), :class => "hidden-for-sighted_bak" %>
|
<%= label_tag "user_mail_notification", l(:description_user_mail_notification), :class => "hidden-for-sighted_bak" , :style=> 'margin-right: 5px;'%>
|
||||||
<%= select_tag(
|
<%= select_tag(
|
||||||
'user[mail_notification]',
|
'user[mail_notification]',
|
||||||
options_for_select(
|
options_for_select(
|
||||||
|
|
|
@ -236,6 +236,20 @@ en:
|
||||||
mail_subject_wiki_content_updated: "'%{id}' wiki page has been updated"
|
mail_subject_wiki_content_updated: "'%{id}' wiki page has been updated"
|
||||||
mail_body_wiki_content_updated: "The '%{id}' wiki page has been updated by %{author}."
|
mail_body_wiki_content_updated: "The '%{id}' wiki page has been updated by %{author}."
|
||||||
|
|
||||||
|
# edit by meng
|
||||||
|
# emailer
|
||||||
|
mail_issue_greetings: "Dear user , Greetings from Trustie"
|
||||||
|
mail_issue_footer: "Unsubscribe this message?"
|
||||||
|
mail_issue_title_userin: "in"
|
||||||
|
mail_issue_title_active: "has a new activity which relevants to you , please pay more attention to this!"
|
||||||
|
mail_issue_subject: "Title:"
|
||||||
|
mail_issue_content: "Content:"
|
||||||
|
mail_issue_sent_from: "From:"
|
||||||
|
mail_issue_from_project: "project issue"
|
||||||
|
mail_issue_attachments: "Attachments:"
|
||||||
|
mail_issue_reply: "Want reply"
|
||||||
|
#end
|
||||||
|
|
||||||
field_name: Name
|
field_name: Name
|
||||||
field_description: Description
|
field_description: Description
|
||||||
field_summary: Summary
|
field_summary: Summary
|
||||||
|
@ -568,6 +582,8 @@ en:
|
||||||
label_document_new: New document
|
label_document_new: New document
|
||||||
label_document_plural: Documents
|
label_document_plural: Documents
|
||||||
label_document_added: Document added
|
label_document_added: Document added
|
||||||
|
label_forum_message_added: Message added
|
||||||
|
label_forum_add: Forum added
|
||||||
label_document_public_info: "If you don't choose public, only the project's members can see the document."
|
label_document_public_info: "If you don't choose public, only the project's members can see the document."
|
||||||
label_role: Role
|
label_role: Role
|
||||||
label_role_plural: Roles
|
label_role_plural: Roles
|
||||||
|
|
|
@ -250,6 +250,21 @@ zh:
|
||||||
mail_body_wiki_content_added: "'%{id}' wiki页面已由 %{author} 添加。"
|
mail_body_wiki_content_added: "'%{id}' wiki页面已由 %{author} 添加。"
|
||||||
mail_subject_wiki_content_updated: "'%{id}' wiki页面已更新。"
|
mail_subject_wiki_content_updated: "'%{id}' wiki页面已更新。"
|
||||||
mail_body_wiki_content_updated: "'%{id}' wiki页面已由 %{author} 更新。"
|
mail_body_wiki_content_updated: "'%{id}' wiki页面已由 %{author} 更新。"
|
||||||
|
|
||||||
|
# edit by meng
|
||||||
|
# emailer
|
||||||
|
mail_issue_greetings: "亲爱的Trustie用户,您好!"
|
||||||
|
mail_issue_footer: "退订该邮件!"
|
||||||
|
mail_issue_title_userin: "在"
|
||||||
|
mail_issue_title_active: "中有了一个与您相关的最新活动,请您关注!"
|
||||||
|
mail_issue_subject: "标题:"
|
||||||
|
mail_issue_content: "内容:"
|
||||||
|
mail_issue_sent_from: "来源:"
|
||||||
|
mail_issue_from_project: "项目问题跟踪"
|
||||||
|
mail_issue_attachments: "附件:"
|
||||||
|
mail_issue_reply: "我要回复"
|
||||||
|
#end
|
||||||
|
|
||||||
field_name: 名称
|
field_name: 名称
|
||||||
#added by huang
|
#added by huang
|
||||||
field_tea_name: 教师
|
field_tea_name: 教师
|
||||||
|
@ -581,6 +596,8 @@ zh:
|
||||||
label_document_new: 新建文档
|
label_document_new: 新建文档
|
||||||
label_document_plural: 文档
|
label_document_plural: 文档
|
||||||
label_document_added: 文档已添加
|
label_document_added: 文档已添加
|
||||||
|
label_forum_message_added: 发帖成功
|
||||||
|
label_forum_add: 贴吧创建成功
|
||||||
label_document_public_info: (打钩为公开,不打钩则不公开,若不公开,仅项目成员可见该文档。)
|
label_document_public_info: (打钩为公开,不打钩则不公开,若不公开,仅项目成员可见该文档。)
|
||||||
label_role: 角色
|
label_role: 角色
|
||||||
label_role_plural: 角色
|
label_role_plural: 角色
|
||||||
|
|
|
@ -20,6 +20,8 @@ module Redmine
|
||||||
notifications << Notifiable.new('message_posted')
|
notifications << Notifiable.new('message_posted')
|
||||||
notifications << Notifiable.new('wiki_content_added')
|
notifications << Notifiable.new('wiki_content_added')
|
||||||
notifications << Notifiable.new('wiki_content_updated')
|
notifications << Notifiable.new('wiki_content_updated')
|
||||||
|
notifications << Notifiable.new('forum_add')
|
||||||
|
notifications << Notifiable.new('forum_message_added', 'forum_add')
|
||||||
notifications
|
notifications
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
body{ font-size:12px; font-family:"微软雅黑","宋体"; line-height:1.9; background:#fff; font-style:normal;}
|
#member_of_course{ font-size:12px; font-family:"微软雅黑","宋体"; line-height:1.9; background:#fff; font-style:normal;}
|
||||||
div,html,img,ul,li,p,body,h1,h2,h3,h4,p,a,table,tr,td,fieldset,input,span,textarea,form{ margin:0; padding:0;}
|
div,html,img,ul,li,p,body,h1,h2,h3,h4,p,a,table,tr,td,fieldset,input,span,textarea,form{ margin:0; padding:0;}
|
||||||
div,img,tr,td,textarea,form{ border:0;}
|
div,img,tr,td,textarea,form{ border:0;}
|
||||||
table,tr,td{border:0; cellspacing:0; cellpadding:0;}
|
table,tr,td{border:0; cellspacing:0; cellpadding:0;}
|
||||||
|
|
|
@ -19,7 +19,7 @@ div,html,img,ul,li,p,body,h1,h2,h3,h4,p,a,table,tr,td,fieldset,input,span{ margi
|
||||||
.polls_btn span{ color:#15bed1; font-size:12px; font-weight:normal;}
|
.polls_btn span{ color:#15bed1; font-size:12px; font-weight:normal;}
|
||||||
|
|
||||||
/*问卷列表*/
|
/*问卷列表*/
|
||||||
.polls_content{ width:615px;}
|
.polls_content{ width:615px;padding-left: 6px;}
|
||||||
.polls_head{ width:677px; height:48px; background:#eaeaea;}
|
.polls_head{ width:677px; height:48px; background:#eaeaea;}
|
||||||
.polls_head h2{ float:left; font-size:14px; color:#585858; margin:11px 0 0 10px;}
|
.polls_head h2{ float:left; font-size:14px; color:#585858; margin:11px 0 0 10px;}
|
||||||
.polls_head span{ font-weight:normal; color:#15bccf;}
|
.polls_head span{ font-weight:normal; color:#15bccf;}
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
require 'spec_helper'
|
||||||
|
|
||||||
|
describe ForumObserver do
|
||||||
|
pending "add some examples to (or delete) #{__FILE__}"
|
||||||
|
end
|
|
@ -0,0 +1,5 @@
|
||||||
|
require 'spec_helper'
|
||||||
|
|
||||||
|
describe MemoObserver do
|
||||||
|
pending "add some examples to (or delete) #{__FILE__}"
|
||||||
|
end
|
Loading…
Reference in New Issue