Merge branch 'szzh' of http://repository.trustie.net/xianbo/trustie2 into szzh
This commit is contained in:
commit
06b97e281a
|
@ -175,19 +175,19 @@ class NewsController < ApplicationController
|
||||||
update_kindeditor_assets_owner ids,@news.id,OwnerTypeHelper::NEWS
|
update_kindeditor_assets_owner ids,@news.id,OwnerTypeHelper::NEWS
|
||||||
end
|
end
|
||||||
# <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ض<EFBFBD>̬<EFBFBD>ļ<EFBFBD>¼add start
|
# <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ض<EFBFBD>̬<EFBFBD>ļ<EFBFBD>¼add start
|
||||||
teachers = searchTeacherAndAssistant(@course)
|
# teachers = searchTeacherAndAssistant(@course)
|
||||||
for teacher in teachers
|
# for teacher in teachers
|
||||||
if(teacher.user_id != User.current.id)
|
# if(teacher.user_id != User.current.id)
|
||||||
notify = ActivityNotify.new()
|
# notify = ActivityNotify.new()
|
||||||
notify.activity_container_id = @course.id
|
# notify.activity_container_id = @course.id
|
||||||
notify.activity_container_type = 'Course'
|
# notify.activity_container_type = 'Course'
|
||||||
notify.activity_id = @news.id
|
# notify.activity_id = @news.id
|
||||||
notify.activity_type = 'News'
|
# notify.activity_type = 'News'
|
||||||
notify.notify_to = teacher.user_id
|
# notify.notify_to = teacher.user_id
|
||||||
notify.is_read = 0
|
# notify.is_read = 0
|
||||||
notify.save()
|
# notify.save()
|
||||||
end
|
# end
|
||||||
end
|
# end
|
||||||
# <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ض<EFBFBD>̬<EFBFBD>ļ<EFBFBD>¼add end
|
# <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ض<EFBFBD>̬<EFBFBD>ļ<EFBFBD>¼add end
|
||||||
render_attachment_warning_if_needed(@news)
|
render_attachment_warning_if_needed(@news)
|
||||||
flash[:notice] = l(:notice_successful_create)
|
flash[:notice] = l(:notice_successful_create)
|
||||||
|
|
|
@ -40,9 +40,9 @@ class HomeworkCommon < ActiveRecord::Base
|
||||||
def act_as_course_message
|
def act_as_course_message
|
||||||
if self.course
|
if self.course
|
||||||
self.course.members.each do |m|
|
self.course.members.each do |m|
|
||||||
if m.user_id != self.user_id
|
# if m.user_id != self.user_id
|
||||||
self.course_messages << CourseMessage.new(:user_id => m.user_id, :course_id => self.course_id, :viewed => false)
|
self.course_messages << CourseMessage.new(:user_id => m.user_id, :course_id => self.course_id, :viewed => false)
|
||||||
end
|
# end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -53,16 +53,17 @@ class Mailer < ActionMailer::Base
|
||||||
recipients ||= []
|
recipients ||= []
|
||||||
course.members.each do |member|
|
course.members.each do |member|
|
||||||
user = User.find(member.user_id)
|
user = User.find(member.user_id)
|
||||||
# @subject = "#{l(:mail_homework)}#{homework_common.name} #{l(:mail_anonymous_comment_open)}"
|
@subject = "#{l(:mail_homework)}#{homework_common.name} #{l(:mail_anonymous_comment_open)}"
|
||||||
@token = Token.get_token_from_user(user, 'autologin')
|
@token = Token.get_token_from_user(user, 'autologin')
|
||||||
@anonymous_comment_close_url = url_for(student_work_index_url(:homework => homework_common.id, :token => @token.value))
|
@anonymous_comment_close_url = url_for(student_work_index_url(:homework => homework_common.id, :token => @token.value))
|
||||||
@anonymous_comment_close_name = homework_common.name
|
@anonymous_comment_close_name = homework_common.name
|
||||||
@author = homework_common.user
|
@author = homework_common.user
|
||||||
#收件人邮箱
|
#收件人邮箱
|
||||||
|
|
||||||
recipients << user.mail
|
recipients << user.mail
|
||||||
end
|
end
|
||||||
mail :to => recipients,
|
mail :to => recipients,
|
||||||
:subject => "[#{l(:mail_homework)}#{homework_common.name}] #{l(:mail_anonymous_comment_open)}"
|
:subject => @subject
|
||||||
end
|
end
|
||||||
|
|
||||||
# 作业匿评关闭
|
# 作业匿评关闭
|
||||||
|
@ -71,7 +72,7 @@ class Mailer < ActionMailer::Base
|
||||||
recipients ||= []
|
recipients ||= []
|
||||||
course.members.each do |member|
|
course.members.each do |member|
|
||||||
user = User.find(member.user_id)
|
user = User.find(member.user_id)
|
||||||
#@subject = "#{l(:mail_homework)}#{homework_common.name} #{l(:mail_anonymous_comment_open)}"
|
@subject = "#{l(:mail_homework)}#{homework_common.name} #{l(:mail_anonymous_comment_close)}"
|
||||||
@token = Token.get_token_from_user(user, 'autologin')
|
@token = Token.get_token_from_user(user, 'autologin')
|
||||||
@anonymous_comment_close_url = url_for(student_work_index_url(:homework => homework_common.id, :token => @token.value))
|
@anonymous_comment_close_url = url_for(student_work_index_url(:homework => homework_common.id, :token => @token.value))
|
||||||
@anonymous_comment_close_name = homework_common.name
|
@anonymous_comment_close_name = homework_common.name
|
||||||
|
@ -80,7 +81,7 @@ class Mailer < ActionMailer::Base
|
||||||
recipients << user.mail
|
recipients << user.mail
|
||||||
end
|
end
|
||||||
mail :to => recipients,
|
mail :to => recipients,
|
||||||
:subject => "[#{l(:mail_homework)}#{homework_common.name}] #{l(:mail_anonymous_comment_open)}"
|
:subject => @subject
|
||||||
end
|
end
|
||||||
|
|
||||||
# 匿评失败给老师发送邮件通知
|
# 匿评失败给老师发送邮件通知
|
||||||
|
@ -91,17 +92,21 @@ class Mailer < ActionMailer::Base
|
||||||
course.members.each do |member|
|
course.members.each do |member|
|
||||||
if member.user.allowed_to?(:as_teacher,course)
|
if member.user.allowed_to?(:as_teacher,course)
|
||||||
user = User.find(member.user_id)
|
user = User.find(member.user_id)
|
||||||
#@subject = "[#{l(:mail_homework)} #{homework_common.name}] #{l(:mail_anonymous_comment_failed)}"
|
@subject = "[#{l(:mail_homework)} #{homework_common.name}] #{l(:mail_anonymous_comment_failed)}"
|
||||||
@token = Token.get_token_from_user(user, 'autologin')
|
@token = Token.get_token_from_user(user, 'autologin')
|
||||||
@anonymous_comment_fail_url = url_for(student_work_index_url(:homework => homework_common.id, :token => @token.value))
|
@anonymous_comment_fail_url = url_for(student_work_index_url(:homework => homework_common.id, :token => @token.value))
|
||||||
@anonymous_comment_fail_name = homework_common.name
|
@anonymous_comment_fail_name = homework_common.name
|
||||||
@author = homework_common.user
|
@author = homework_common.user
|
||||||
#收件人邮箱
|
#收件人邮箱
|
||||||
|
puts "######################"
|
||||||
|
puts homework_common.id
|
||||||
|
puts recipients
|
||||||
|
puts "######################"
|
||||||
recipients << user.mail
|
recipients << user.mail
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
mail :to => recipients,
|
mail :to => recipients,
|
||||||
:subject => "[#{l(:mail_homework)} #{homework_common.name}] #{l(:mail_anonymous_comment_failed)}"
|
:subject => @subject
|
||||||
end
|
end
|
||||||
|
|
||||||
# author: alan
|
# author: alan
|
||||||
|
|
|
@ -7,13 +7,13 @@
|
||||||
<% if @is_valuate.size > 0 %> <!-- 评价过 1代表赞 0代表踩 -->
|
<% if @is_valuate.size > 0 %> <!-- 评价过 1代表赞 0代表踩 -->
|
||||||
<% @flag = @is_valuate.first.praise_or_tread %>
|
<% @flag = @is_valuate.first.praise_or_tread %>
|
||||||
<% if @flag == 1 %> <!-- 顶过 --><!-- modified by bai -->
|
<% if @flag == 1 %> <!-- 顶过 --><!-- modified by bai -->
|
||||||
<a href="javascript:void(0);" class="linkGrey2 postLikeIcon" title="<%= l(:label_issue_praise_over)%>" > <%= get_praise_num(obj)%></a>
|
<a href="javascript:void(0);" class="<%= @obj.author.id == User.current.id ? 'linkGrey2 postLikeIcon mr30':'linkGrey2 postLikeIcon' %>" title="<%= l(:label_issue_praise_over)%>" > <%= get_praise_num(obj)%></a>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<% if user_id == obj.author_id %>
|
<% if user_id == obj.author_id %>
|
||||||
|
|
||||||
<!--<%#= image_tag "/images/praise_tread/praise_true.png" , weight:"22px", height:"22px",:title => l(:label_issue_not_praise_over) %>-->
|
<!--<%#= image_tag "/images/praise_tread/praise_true.png" , weight:"22px", height:"22px",:title => l(:label_issue_not_praise_over) %>-->
|
||||||
<a href="javascript:void(0);" class="linkGrey2 postLikeIcon" title="<%= l(:label_issue_not_praise_over)%>" > <%= get_praise_num(obj)%></a>
|
<a href="javascript:void(0);" class="linkGrey2 postLikeIcon mr30" title="<%= l(:label_issue_not_praise_over)%>" > <%= get_praise_num(obj)%></a>
|
||||||
|
|
||||||
<% else %>
|
<% else %>
|
||||||
<!-- 积分少于2分不能踩帖 -->
|
<!-- 积分少于2分不能踩帖 -->
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
|
|
||||||
function del_confirm(){
|
function del_confirm(){
|
||||||
if(confirm('确认删除么?')){
|
if(confirm('确认删除么?')){
|
||||||
$("#del_link").click();
|
$("#del_memo_link").click();
|
||||||
}else{
|
}else{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -52,7 +52,7 @@
|
||||||
<ul class="homepagePostSettiongText">
|
<ul class="homepagePostSettiongText">
|
||||||
<li><a href="<%= edit_forum_memo_path(@memo.forum,@memo)%>" class="postOptionLink">编辑</a></li>
|
<li><a href="<%= edit_forum_memo_path(@memo.forum,@memo)%>" class="postOptionLink">编辑</a></li>
|
||||||
<li><a href="javascript:void(0);" class="postOptionLink" onclick="del_confirm();">删除</a></li>
|
<li><a href="javascript:void(0);" class="postOptionLink" onclick="del_confirm();">删除</a></li>
|
||||||
<li style="display: none"><a href="<%= forum_memo_path(@memo.forum,@memo) %>" data-method="delete" id="del_link" ></a></li>
|
<li style="display: none"><a href="<%= forum_memo_path(@memo.forum,@memo) %>" data-method="delete" id="del_memo_link" ></a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
@ -197,7 +197,7 @@
|
||||||
<li class="homepageNewsPubType fl"><%=link_to ma.forge_message.author, user_path(ma.forge_message.author), :class => "newsBlue homepageNewsPublisher" %>
|
<li class="homepageNewsPubType fl"><%=link_to ma.forge_message.author, user_path(ma.forge_message.author), :class => "newsBlue homepageNewsPublisher" %>
|
||||||
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">评论了新闻:</span></li>
|
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">评论了新闻:</span></li>
|
||||||
<li class="homepageNewsContent fl">
|
<li class="homepageNewsContent fl">
|
||||||
<%= link_to "#{ma.forge_message.comments.html_safe}",
|
<%= link_to "#{ma.forge_message.commented.title}",
|
||||||
{:controller => 'news', :action => 'show', :id => ma.forge_message.commented.id },:class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
|
{:controller => 'news', :action => 'show', :id => ma.forge_message.commented.id },:class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
|
||||||
:onmouseover => "message_titile_show($(this),event)",
|
:onmouseover => "message_titile_show($(this),event)",
|
||||||
:onmouseout => "message_titile_hide($(this))" %>
|
:onmouseout => "message_titile_hide($(this))" %>
|
||||||
|
|
|
@ -32,7 +32,7 @@ namespace :homework_evaluation do
|
||||||
homework_common.course_messages << CourseMessage.new(:user_id => m.user_id, :course_id => course.id, :viewed => false, :status => 2)
|
homework_common.course_messages << CourseMessage.new(:user_id => m.user_id, :course_id => course.id, :viewed => false, :status => 2)
|
||||||
end
|
end
|
||||||
# 邮件通知
|
# 邮件通知
|
||||||
Mailer.send_mail_anonymous_comment_close(homework_common).deliver
|
Mailer.send_mail_anonymous_comment_open(homework_common).deliver
|
||||||
else
|
else
|
||||||
#作业数小于2,启动失败, 只给老师发
|
#作业数小于2,启动失败, 只给老师发
|
||||||
# status==4 发送失败
|
# status==4 发送失败
|
||||||
|
@ -65,7 +65,10 @@ namespace :homework_evaluation do
|
||||||
end
|
end
|
||||||
homework_detail_manual.update_column('comment_status', 3)
|
homework_detail_manual.update_column('comment_status', 3)
|
||||||
# 匿评关闭消息通知 给所有人发
|
# 匿评关闭消息通知 给所有人发
|
||||||
send_message_anonymous_comment(homework_common, 3)
|
course = homework_common.course
|
||||||
|
course.members.each do |m|
|
||||||
|
homework_common.course_messages << CourseMessage.new(:user_id => m.user_id, :course_id => course.id, :viewed => false, :status => 3)
|
||||||
|
end
|
||||||
# 邮件通知
|
# 邮件通知
|
||||||
Mailer.send_mail_anonymous_comment_close(homework_common).deliver
|
Mailer.send_mail_anonymous_comment_close(homework_common).deliver
|
||||||
end
|
end
|
||||||
|
|
|
@ -808,7 +808,7 @@ a.postReplyIcon:hover {background:url(images/post_image_list.png) -40px -29px no
|
||||||
.postAttIcon:hover {background:url(images/post_image_list.png) 0px -113px no-repeat;}
|
.postAttIcon:hover {background:url(images/post_image_list.png) 0px -113px no-repeat;}
|
||||||
.postThemeContainer {width:720px;}
|
.postThemeContainer {width:720px;}
|
||||||
.postThemeWrap {width:655px; float:left;position: relative}
|
.postThemeWrap {width:655px; float:left;position: relative}
|
||||||
.postLikeIcon {background:url(images/post_image_list.png) 0px -42px no-repeat ;float:right; padding-left:18px; margin-right:30px; margin-top:3px;}
|
.postLikeIcon {background:url(images/post_image_list.png) 0px -42px no-repeat ;float:right; padding-left:18px; margin-top:3px;}
|
||||||
.postLikeIcon:hover {background:url(images/post_image_list.png) 0px -64px no-repeat ;}
|
.postLikeIcon:hover {background:url(images/post_image_list.png) 0px -64px no-repeat ;}
|
||||||
a.AnnexBtn{ background: url(images/homepage_icon2.png) 0px -343px no-repeat !important; width:70px; height:20px; display:block; padding-left:20px; color:#888888;}
|
a.AnnexBtn{ background: url(images/homepage_icon2.png) 0px -343px no-repeat !important; width:70px; height:20px; display:block; padding-left:20px; color:#888888;}
|
||||||
a:hover.AnnexBtn{background: url(images/homepage_icon2.png) -90px -343px no-repeat !important; color:#3598db;}
|
a:hover.AnnexBtn{background: url(images/homepage_icon2.png) -90px -343px no-repeat !important; color:#3598db;}
|
||||||
|
|
|
@ -75,3 +75,7 @@ li.L9 { background: #eee }
|
||||||
/*.prettyprint .dec,*/
|
/*.prettyprint .dec,*/
|
||||||
/*.prettyprint .var { color: #A6E22E; }*/
|
/*.prettyprint .var { color: #A6E22E; }*/
|
||||||
/*.prettyprint .pln { color: #66D9EF; }*/
|
/*.prettyprint .pln { color: #66D9EF; }*/
|
||||||
|
.memo-content pre {
|
||||||
|
white-space:pre !important;
|
||||||
|
word-wrap: break-word;
|
||||||
|
}
|
Loading…
Reference in New Issue