Conflicts:
	config/locales/zh.yml
This commit is contained in:
sw 2015-01-22 17:51:11 +08:00
commit a0e6b9c2fe
29 changed files with 428 additions and 214 deletions

View File

@ -160,12 +160,15 @@ class ForumsController < ApplicationController
def create
@forum = Forum.new(params[:forum])
@forum.creator_id = User.current.id
if @forum.save
respond_to do |format|
respond_to do |format|
if @forum.save
format.html { redirect_to @forum, notice: l(:label_forum_create_succ) }
format.json { render json: @forum, status: :created, location: @forum }
else
format.html { redirect_to @forum, notice: l(:label_forum_create_succ) }
format.json { render json: @forum, status: :created, location: @forum }
end
else
respond_to do |format|
flash.now[:error] = "#{l :label_forum_create_fail}: #{@forum.errors.full_messages[0]}"
format.html { render action: "new" }
format.json { render json: @forum.errors, status: :unprocessable_entity }

View File

@ -112,7 +112,7 @@ module CoursesHelper
# end
#获取课程所有成员
def course_member course
def course_all_member course
course.members
end
# 学生人数计算

View File

@ -18,7 +18,7 @@ class Forum < ActiveRecord::Base
acts_as_taggable
scope :by_join_date, order("created_at DESC")
after_create :send_email
def reset_counters!
self.class.reset_counters!(id)
end
@ -33,6 +33,11 @@ class Forum < ActiveRecord::Base
self.creator == user || user.admin?
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+
def self.reset_counters!(forum_id)
forum_id = forum_id.to_i

View File

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

View File

@ -26,7 +26,37 @@ class Mailer < ActionMailer::Base
def self.default_url_options
{ :host => Setting.host_name, :protocol => Setting.protocol }
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.
# 留言分为直接留言,和对留言人留言的回复
@ -62,7 +92,7 @@ class Mailer < ActionMailer::Base
course = journals_for_message.jour
@author = journals_for_message.user
#课程的教师
@members = course_member journals_for_message.jour
@members = course_all_member journals_for_message.jour
#收件人邮箱
@recipients ||= []
@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)
@user_url = url_for(my_account_url(user,:token => @token.value))
cc = issue.watcher_recipients - issue.recipients
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,
@ -167,8 +199,11 @@ class Mailer < ActionMailer::Base
# Watchers in cc
cc = nil
if recipients == journal.recipients[0]
cc = journal.watcher_recipients - journal.recipients
end
cc = journal.watcher_recipients - journal.recipients
s = "[#{issue.project.name} - #{issue.tracker.name} ##{issue_id}] "
s << "(#{issue.status.name}) " if journal.new_value_for('status_id')
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 }
when 'Course'
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 }
when 'Version'
added_to_url = url_for(:controller => 'files', :action => 'index', :project_id => container.project)
@ -323,13 +358,25 @@ class Mailer < ActionMailer::Base
# news_added(news) => Mail::Message object
# Mailer.news_added(news).deliver => sends an email to the news' project recipients
def news_added(news)
redmine_headers 'Project' => news.project.identifier
@author = news.author
message_id news
@news = news
@news_url = url_for(:controller => 'news', :action => 'show', :id => news)
mail :to => news.recipients,
:subject => "[#{news.project.name}] #{l(:label_news)}: #{news.title}"
if news.project
redmine_headers 'Project' => news.project.identifier
@author = news.author
message_id news
@news = news
@news_url = url_for(:controller => 'news', :action => 'show', :id => news)
mail :to => news.recipients,
: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
# Builds a Mail::Message object used to email recipients of a news' project when a news comment is added.
@ -339,15 +386,28 @@ class Mailer < ActionMailer::Base
# Mailer.news_comment_added(comment) => sends an email to the news' project recipients
def news_comment_added(comment)
news = comment.commented
redmine_headers 'Project' => news.project.identifier
@author = comment.author
message_id comment
@news = news
@comment = comment
@news_url = url_for(:controller => 'news', :action => 'show', :id => news)
mail :to => news.recipients,
:cc => news.watcher_recipients,
:subject => "Re: [#{news.project.name}] #{l(:label_news)}: #{news.title}"
if news.project
redmine_headers 'Project' => news.project.identifier
@author = comment.author
message_id comment
@news = news
@comment = comment
@news_url = url_for(:controller => 'news', :action => 'show', :id => news)
mail :to => news.recipients,
:cc => news.watcher_recipients,
: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
# Builds a Mail::Message object used to email the recipients of the specified message that was posted.
@ -356,18 +416,33 @@ class Mailer < ActionMailer::Base
# message_posted(message) => Mail::Message object
# Mailer.message_posted(message).deliver => sends an email to the recipients
def message_posted(message)
redmine_headers 'Project' => message.project.identifier,
'Topic-Id' => (message.parent_id || message.id)
@author = message.author
message_id message
references message.parent unless message.parent.nil?
recipients = message.recipients
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.project.name} - #{message.board.name} - msg#{message.root.id}] #{message.subject}"
if message.project
redmine_headers 'Project' => message.project.identifier,
'Topic-Id' => (message.parent_id || message.id)
@author = message.author
message_id message
references message.parent unless message.parent.nil?
recipients = message.recipients
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.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
# Builds a Mail::Message object used to email the recipients of a project of the specified wiki content was added.

View File

@ -43,7 +43,7 @@ class Memo < ActiveRecord::Base
"parent_id",
"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_destroy :reset_counters!#,:down_user_score -- 公共区发帖暂不计入得分
# after_create :send_notification
@ -54,6 +54,12 @@ class Memo < ActiveRecord::Base
# 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
errors.add :base, l(:label_memo_locked) if root.locked? && self != root
end

View File

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

View File

@ -1,49 +1,122 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>意见反馈浮窗</title>
<style type="text/css">
body{ 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,ol{ }
div,img,tr,td,table{ border:0;}
ol,ul,li{ list-style-type:none}
.cl{ clear:both; overflow:hidden; }
a{ text-decoration:none;}
html{ overflow-x:hidden;}
.custom_service p img {display: inline; margin-top:-5px; vertical-align:middle;}
.scrollsidebar{position:absolute; z-index:999; top:150px;}
.side_content{width:154px; height:auto; overflow:hidden; float:left; }
.side_content .side_list {width:154px;overflow:hidden;}
.show_btn{ width:0; height:112px; overflow:hidden; margin-top:50px; float:left; cursor:pointer;}
.show_btn span { display:none;}
.close_btn{width:24px;height:24px;cursor:pointer;}
.side_title,.side_bottom,.close_btn,.show_btn {background:url(/images/sidebar_bg.png) no-repeat;}
.side_title {height:46px;}
.side_bottom { height:8px;}
.side_center {font-family:Verdana, Geneva, sans-serif; padding:5px 12px; font-size:12px;}
.close_btn { float:right; display:block; width:21px; height:16px; margin:16px 10px 0 0; _margin:16px 5px 0 0;}
.close_btn span { display:none;}
.side_center .custom_service p { text-align:center; padding:6px 0; margin:0; vertical-align:middle;}
.msgserver { margin:10px 0 4px 4px;}
.msgserver a { background:url(/images/sidebar_bg.png) no-repeat -119px -115px; padding-left:22px;}
.opnionText{ width:120px; height:180px; border-color:#cecece; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; color:#999; padding:3px;}
a.opnionButton{ display:block; color:#fd6e2a; font-weight: bold; margin:-25px auto 0; text-align:center;}
a:hover.opnionButton{ text-decoration:underline;}
/* blue skin as the default skin */
.side_title {background-position:-195px 0;}
.side_center {background:url(/images/blue_line.png) repeat-y center;}
.side_bottom {background-position:-195px -50px;}
.close_btn {background-position:-44px 0;}
.close_btn:hover {background-position:-66px 0;}
.show_btn {background-position:-119px 0;}
.msgserver a {color:#15bccf; }
.msgserver a:hover { text-decoration:underline; }
</style>
<script>
function mypostion(o){
var width=$(window).width();
var height=$(window).height();
var divW=$(o).outerWidth();
var divH=$(o).outerHeight();
var left=(width-divW)/2+$(window).scrollLeft();
var top=(height-divH)/2+$(window).scrollTop();
return {"left":left,"top":top};
};
/* =================================================
//
// jQuery Fixed Plugins 1.3.1
// author :
// Url:
// Data : 2012-03-30
//
// <20><><EFBFBD><EFBFBD> : float --> <20><><EFBFBD><EFBFBD>[left or right]
// minStatue --> <20><>С״̬<D7B4><CCAC>ֻ<EFBFBD><D6BB>show_btn
// skin --> Ƥ<><C6A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
// durationTime --> <20><><EFBFBD>ʱ<EFBFBD><CAB1>
//<2F><><EFBFBD><EFBFBD> :
$("#scrollsidebar2").fix({
float : 'right', //default.left or right
minStatue : true, //default.false or true
skin : 'green', //default.gray or yellow <20><>blue <20><>green <20><>orange <20><>white
durationTime : 1000 //
});
//
// =================================================*/
function myTips(msg,status){
if(status!="success" && status!="error"){status="error";};
if (status=="success") {
$("body").append('<div class="ui-mask" id="ui-mask"></div><div class="change_success" id="change_success"><!--span class="send_close" onclick="$(this).parent().remove();$("#ui-mask").remove();"></span--><i></i>'+msg+'</div>');
var my=mypostion("#change_success");
$("#change_success").css({"position":"absolute","z-index":"9999999","top":my.top+"px","left":my.left+"px"});
$("#ui-mask").show();
$("#change_success").show();
setTimeout(function(){
$("#change_success,#ui-mask").fadeOut("slow",function(){
$("#ui-mask").remove();
$("#change_success").remove();
(function($){
$.fn.fix = function(options){
var defaults = {
float : 'left',
minStatue : false,
skin : 'blue',
durationTime : 1000
}
var options = $.extend(defaults, options);
this.each(function(){
//<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD>
var thisBox = $(this),
closeBtn = thisBox.find('.close_btn' ),
show_btn = thisBox.find('.show_btn' ),
sideContent = thisBox.find('.side_content'),
sideList = thisBox.find('.side_list')
;
var defaultTop = thisBox.offset().top; //<2F><><EFBFBD><EFBFBD><EFBFBD>Ĭ<EFBFBD><C4AC>top
thisBox.css(options.float, 0);
if(options.minStatue){
$(".show_btn").css("float", options.float);
sideContent.css('width', 0);
show_btn.css('width', 25);
}
//Ƥ<><C6A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
if(options.skin) thisBox.addClass('side_'+options.skin);
//<2F><><EFBFBD><EFBFBD>scroll<6C>¼<EFBFBD>
$(window).bind("scroll",function(){
var offsetTop = defaultTop + $(window).scrollTop() + "px";
thisBox.animate({
top: offsetTop
},
{
duration: options.durationTime,
queue: false //<2F>˶<EFBFBD><CBB6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EBB6AF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
});
});
//close<73>¼<EFBFBD>
closeBtn.bind("click",function(){
sideContent.animate({width: '0px'},"fast");
show_btn.stop(true, true).delay(300).animate({ width: '25px'},"fast");
});
},2500);
}
else{
$("body").append('<div class="ui-mask" id="ui-mask"></div><div class="change_error" id="change_error"><!--span class="send_close" onclick="$(this).parent().remove();$("#ui-mask").remove();"></span--><i></i>'+msg+'</div>');
var my=mypostion("#change_error");
$("#change_error").css({"position":"absolute","z-index":"9999999","top":my.top+"px","left":my.left+"px"});
$("#ui-mask").show();
$("#change_error").show();
setTimeout(function(){
$("#change_error,#ui-mask").fadeOut("slow",function(){
$("#ui-mask").remove();
$("#change_error").remove();
});
},1000);
};
};
//show<6F>¼<EFBFBD>
show_btn.click(function() {
$(this).animate({width: '0px'},"fast");
sideContent.stop(true, true).delay(200).animate({ width: '154px'},"fast");
});
}); //end this.each
};
})(jQuery);
$(function(){
@ -59,92 +132,54 @@ function f_submit()
}
</script>
<style type="text/css">
/*浮窗*/
/*body{ height:3000px; font-family:'微软雅黑';}*/
/*div,ul,li,body,h3,p{margin:0; padding:0;}*/
#roll a{ text-decoration:none;}
#roll{ background:url(/images/f_opnion.jpg) 0 0 no-repeat;width:157px; height:332px; position:absolute;}
.opnionBox{ width: 130px; height:146px; margin:76px auto 20px; }
.opnionText{ width: 120px !important; height:130px; outline:none; border:none !important;padding: 0 5px !important; color: #03a8bb;line-height:1.5; font-size:12px; }
a.opnionButton{ width:40px; height:20px; display:block; margin:0 auto;font-size:14px; color:#fd6e2a; font-weight: bold; }
a:hover.opnionButton{ text-decoration:underline;}
.opnionCall{ color:#03a8bb; font-size:12px; width:105px; margin:0 auto;}
.opnionCall .tectitle{ font-size:14px; alignment-adjust: central; color:#03a8bb; margin-bottom:8px,}
/*提示框*/
.ui-mask{background-color:#000;opacity:0.5;filter:alpha(opacity=50);width:100%;height:100%;position:fixed;_position:absolute;left:0;top:0;z-index:9999998;display:none;}
.change_success{
display:block;
height:60px;
width:300px;
line-height:1.9;
font-size:14px;
font-weight:500;
background:#fff;
color:#1395a4;
border:5px solid #1395a4;
font-size:14px;
padding:30px 20px;
position: absolute;
_position: absolute;
left:0;
top:0;
z-index:9999999;
}
</style>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>意见反馈</title>
<link href="css/sidebar.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="js/sidebar.js"></script>
</head>
<body>
<div id="roll">
<div class="opnionBox">
<% get_memo %>
<%= form_for(@new_memo, :url => create_feedback_forum_path(@public_forum)) do |f| %>
<div class="actions" style="max-width:680px;">
<p style="margin:0; padding:0;">
<%= f.text_area :subject, :class => "opnionText",:placeholder => "有什么想说的,尽管来咆哮吧~~"%>
</p>
<p style="margin:0; padding:0;">
<%= f.hidden_field :content, :required => true ,:value=>'该贴来自用户反馈!'%>
</p>
<%#= f.submit :value => l(:label_memo_create), :class => "opnionButton", :id => "button1" %>
<a href="javascript:void(0);" class="opnionButton" id="" onclick="f_submit();">提&nbsp;&nbsp;交</a>
<% end %>
</div>
</form>
<div class="clear"></div>
<body style="height:auto">
<!-- ´úÂë ¿ªÊ¼ -->
<div class="scrollsidebar" id="scrollsidebar">
<div class="side_content">
<div class="side_list">
<div class="side_title"><a title="意见反馈" class="close_btn"><span><%= l(:label_feedback) %></span></a></div>
<div class="side_center">
<div class="custom_service">
<% get_memo %>
<%= form_for(@new_memo, :url => create_feedback_forum_path(@public_forum)) do |f| %>
<%= f.text_area :subject, :class => "opnionText",:placeholder => "有什么想说的,尽管来咆哮吧~~"%>
<%= f.hidden_field :content, :required => true ,:value=>'该贴来自用户反馈!'%>
<%#= f.submit :value => l(:label_memo_create), :class => "opnionButton", :id => "button1" %>
<a href="javascript:void(0);" class="opnionButton" id="" onclick="f_submit();">提&nbsp;&nbsp;交</a>
<% end %>
</div>
<div class="msgserver">
<p>
<a href="http://user.trustie.net/users/12/user_newfeedback"><%= l(:label_technical_support) %>黄井泉</a></br>
<a href="http://user.trustie.net/users/34/user_newfeedback"><%= l(:label_technical_support) %>白&nbsp;&nbsp;&nbsp;羽</a>
</p>
</div>
</div>
<div class="side_bottom"></div>
</div>
</div>
<div class="show_btn"><span>提交</span></div>
</div>
<div class="opnionCall">
<div class="tectitle">技术支持:</div>
<p style="margin:0; padding:0;" ><%= l(:label_course_adcolick) %><a href="http://user.trustie.net/users/12/user_newfeedback">黄井泉</a><br>
<%= l(:label_course_adcolick) %><a href="http://user.trustie.net/users/34/user_newfeedback">白羽</a></p>
</div>
</div>
<!-- ´úÂë ½áÊø -->
<script type="text/javascript">
$(function() {
$("#scrollsidebar").fix({
float : 'right', //default.left or right
//minStatue : true,
skin : 'green', //default.gray or blue
durationTime : 600
});
});
</script>
</body>
</html>
<script>
var roll=document.getElementById('roll'),
initX=0,
initY,
compY,
sp=15,
//可调整时间间隔步进值不宜过大不然IE下有点闪屏
timeGap=5,
doc=document.documentElement,
docBody=document.body;
compY=initY=100;
roll.style.right=initX+"px";
;(function(){
var curScrollTop=(doc.scrollTop||docBody.scrollTop||0)-(doc.clientTop||docBody.clientTop||0);
//每次comP的值都不一样直到roll.style.top===doc.scrollTop+initY
compY+=(curScrollTop+initY-compY)/sp;
roll.style.top=Math.ceil(compY)+"px";
setTimeout(arguments.callee,timeGap);
})();
</script>
</html>

View File

@ -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;}
table,tr,td{border:0;cellspacing:0; cellpadding:0;}
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:hover{ text-decoration:underline; }
.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="mail">
<div class="mail_head">
<p>亲爱的Trustie用户您好</p>
<p><%= l(:mail_issue_greetings)%></p>
</div><!--mail_head end-->
<%= yield %>
<hr />

View File

@ -2,19 +2,19 @@
<p>
<span class="c_blue">
<%= link_to(h("#{@issue.author}(#{@issue.author.show_name})"), @issue_author_url) %>
</span>
<span class="c_blue"><%= link_to(h("#{@issue.project.name}"),@project_url) %></span>中有了一个与您相关的最新活动,请您关注!</p>
</span><%= l(:mail_issue_title_userin)%>
<span class="c_blue"><%= link_to(h("#{@issue.project.name}"),@project_url) %></span></span><%= l(:mail_issue_title_active)%></p>
<div class="mail_box">
<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>来源:</strong></span><span style="float: left; width: 500px"><%= issue.project.name %><b>|&nbsp;</b>项目<%= issue.tracker.name%></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_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><%= l(:mail_issue_sent_from)%></strong></span><span style="float: left; width: 500px"><%= issue.project.name %><b>|&nbsp;</b><%= l(:mail_issue_from_project)%></span></li>
<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>
</li>
<li style="list-style-type:none">
<% 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">
<% @issue.attachments.each do |attach| %>
<p><%= link_to_attachment(attach, :download => true, :token => @token.value, :only_path => false) %></p>
@ -25,7 +25,7 @@
</li>
</ul>
<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>
<!-- <li><%#=l(:field_author)%>: <%#=h issue.author %></li>

View File

@ -1,13 +1,13 @@
<%= link_to(h("#{@issue.author}(#{@issue.author.show_name})"), @issue_author_url) %>
<%= link_to(h("#{@issue.project.name}"),@project_url) %>中有了一个与您相关的最新活动,请您关注!
标题:<%= link_to(issue.subject, issue_url) %>
来源:<%= issue.project.name %>|&nbsp;项目缺陷<
内容:
<%= 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) %>
<%= l(:mail_issue_sent_from)%>|&nbsp;<%= l(:mail_issue_from_project)%>
<%= l(:mail_issue_content)%>
<%= issue.description %>
<% unless @issue.attachments.nil? %>
附件:
<%= l(:mail_issue_attachments)%>
<% @issue.attachments.each do |attach| %>
@ -16,4 +16,4 @@
<% end %>
<%= link_to( "我要回复", issue_url) %>
<%= link_to( l(:mail_issue_reply), issue_url) %>

View File

@ -0,0 +1,4 @@
<h1><%= link_to(h(@forum.name), @forum_url) %></h1>
<em><%=h @forum.creator.name %></em>
<%= @forum.description.html_safe %>

View File

@ -0,0 +1,4 @@
<%= @forum_url %>
<%= @author.name %>
<%= @forum.description %>

View File

@ -0,0 +1,4 @@
<h1><%= link_to(h(@memo.subject), @memo_url) %></h1>
<em><%=h @memo.author.name %></em>
<%= @memo.content.html_safe %>

View File

@ -0,0 +1,5 @@
<%= @memo_url %>
<%= @author.name %>
<%= @memo.subject %>
<%= @memo.content %>

View File

@ -5,5 +5,5 @@
</div>
<div class="mail_foot"><%= link_to("退订该邮件?", @user_url) %> </div>
<div class="mail_foot"><%= link_to( l(:mail_issue_footer), @user_url) %> </div>

View File

@ -1,3 +1,3 @@
<%= render :partial => 'issue', :formats => [:text], :locals => { :issue => @issue, :issue_url => @issue_url } %>
<%= link_to("退订该邮件?", @user_url) %>
<%= link_to( l(:mail_issue_footer), @user_url) %>

View File

@ -1,15 +1,19 @@
<%= l(:text_issue_updated, :id => "##{@issue.project_index}", :author => h(@journal.user)) %>
<div>
<%= l(:text_issue_updated, :id => "##{@issue.project_index}", :author => h(@journal.user)) %>
<ul>
<% details_to_strings(@journal.details, false, :only_path => false, :token => @token.value).each do |string| %>
<ul>
<% details_to_strings(@journal.details, false, :only_path => false, :token => @token.value).each do |string| %>
<% if (!string.include? l(:label_attachment)) && (!string.include? "attachments") %>
<li><%= string %></li>
<% end %>
<% end %>
</ul>
<% end %>
<% end %>
</ul>
<span style="float: left"><strong><%= l(:field_content)%></strong></span><span style="float: left; width: 540px"><%= @journal.notes %></span>
</div>
<div class="cl"></div>
<span style="float: left"><strong><%= l(:field_content)%></strong></span><span style="float: left; width: 540px"><%= @journal.notes %></span>
<hr />
<%= render :partial => 'issue', :formats => [:html], :locals => { :issue => @issue, :issue_url => @issue_url } %>
<div class="mail_foot"><%= link_to("退订该邮件?", @user_url) %> </div>
<div class="mail_foot"><%= link_to( l(:mail_issue_footer), @user_url) %> </div>

View File

@ -10,7 +10,7 @@
<%= l(:field_content)%><%= @journal.notes %>
<% end -%>
----------------------------------------
--------------------------------------------------------------------------------
<%= render :partial => 'issue', :formats => [:text], :locals => { :issue => @issue, :issue_url => @issue_url } %>
<%= link_to("退订该邮件?", @user_url) %>
<%= link_to( l(:mail_issue_footer), @user_url) %>

View File

@ -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>
<%= textilizable(@message, :content, :only_path => false) %>

View File

@ -123,10 +123,10 @@
<br/>
</p>
<p style="width:400px;padding-left: 50px;">
<label style="margin-right: 1px;">
<%= l(:label_identity) %><span style="color: #bb0000;"> *</span></label>
<select onchange="showtechnical_title(this.value, $('#userTechnical_title'));" name="identity" id="userIdentity" class="location" style="margin: 0px;">
<p style="width:400px;padding-left: 53px;">
<label for="userIdentity">
<%= l(:label_identity) %><span class="required"> *</span></label>
<select onchange="showtechnical_title(this.value, $('#userTechnical_title'));" name="identity" id="userIdentity" class="location" style="margin: -4px;">
<option value="">
<%= l(:label_account_identity_choose) %>
</option>
@ -187,19 +187,19 @@
<!-- added by bai 增加账户里的性别-->
<span id='gender' style='display:none'>
<% if @user.user_extensions.nil? %>
<p style="width:400px;padding-left: 52px;">
<%= l(:label_gender) %>&nbsp;&nbsp;
<p style="width:400px;padding-left: 53px;">
<label for="gender"><%= l(:label_gender) %>&nbsp;&nbsp;</label>
<%= select_tag 'gender', "<option value = '0'>#{l(:label_gender_male)}</option><option value = '1'>#{l(:label_gender_female)}</option>".html_safe, :class => 'gender' %>
</p>
<% else %>
<% if @user.user_extensions.gender == 0 %><!-- label_gender_male -->
<p style="width:400px;padding-left: 52px;">
<%= l(:label_gender) %>&nbsp;&nbsp;
<p style="width:400px;padding-left: 53px;">
<label for="gender"><%= l(:label_gender) %>&nbsp;&nbsp;</label>
<%= select_tag 'gender', "<option value = '0'>#{l(:label_gender_male)}</option><option value = '1'>#{l(:label_gender_female)}</option>".html_safe, :class => 'gender' %>
</p>
<% else %>
<p style="width:400px;padding-left: 54px;">
<%= l(:label_gender) %>&nbsp;&nbsp;
<label for="gender"><%= l(:label_gender) %>&nbsp;&nbsp;</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' %>
</p>
<% end %>
@ -212,9 +212,9 @@
<!-- 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">&nbsp;</span>
<% if User.current.user_extensions.nil? %>
<input id="province" name="province" style="display: none" type="text" value="请单击选择省份及学校" readonly>
@ -318,7 +318,7 @@
});
</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">
<option value="">--请选择省份--</option>
<option value="北京">北京</option>
@ -382,7 +382,7 @@
<legend onclick="toggleFieldset(this);">
<%= l(:field_mail_notification) %>
</legend>
<div style="padding-left: 8px;"> <!-- modified by ming -->
<div style="padding-left: 3px;"> <!-- modified by ming -->
<p style="width:380px;">
<%= render :partial => 'users/mail_notifications' %>
</p></div>

View File

@ -1,5 +1,5 @@
<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(
'user[mail_notification]',
options_for_select(

View File

@ -235,7 +235,21 @@ en:
mail_body_wiki_content_added: "The '%{id}' wiki page has been added by %{author}."
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}."
# 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_description: Description
field_summary: Summary
@ -568,6 +582,8 @@ en:
label_document_new: New document
label_document_plural: Documents
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_role: Role
label_role_plural: Roles

View File

@ -250,6 +250,21 @@ zh:
mail_body_wiki_content_added: "'%{id}' wiki页面已由 %{author} 添加。"
mail_subject_wiki_content_updated: "'%{id}' wiki页面已更新。"
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: 名称
#added by huang
field_tea_name: 教师
@ -581,6 +596,8 @@ zh:
label_document_new: 新建文档
label_document_plural: 文档
label_document_added: 文档已添加
label_forum_message_added: 发帖成功
label_forum_add: 贴吧创建成功
label_document_public_info: (打钩为公开,不打钩则不公开,若不公开,仅项目成员可见该文档。)
label_role: 角色
label_role_plural: 角色
@ -2284,3 +2301,5 @@ zh:
label_answer_total: 总计:
label_join_project: 加入项目
label_technical_support: 技术支持:
label_feedback: 意见反馈

View File

@ -20,6 +20,8 @@ module Redmine
notifications << Notifiable.new('message_posted')
notifications << Notifiable.new('wiki_content_added')
notifications << Notifiable.new('wiki_content_updated')
notifications << Notifiable.new('forum_add')
notifications << Notifiable.new('forum_message_added', 'forum_add')
notifications
end
end

BIN
public/images/blue_line.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

View File

@ -0,0 +1,5 @@
require 'spec_helper'
describe ForumObserver do
pending "add some examples to (or delete) #{__FILE__}"
end

View File

@ -0,0 +1,5 @@
require 'spec_helper'
describe MemoObserver do
pending "add some examples to (or delete) #{__FILE__}"
end