Merge branch 'sw_new_course' of http://repository.trustie.net/xianbo/trustie2 into sw_new_course

Conflicts:
	app/controllers/users_controller.rb
	public/stylesheets/new_user.css
This commit is contained in:
sw 2015-08-26 17:31:37 +08:00
commit b7cbb9b0c2
40 changed files with 701 additions and 372 deletions

View File

@ -36,6 +36,11 @@ class AccountController < ApplicationController
end end
end end
# 服务协议
def agreement
render :layout => 'static_base'
end
# Log out current user and redirect to welcome page # Log out current user and redirect to welcome page
def logout def logout
if User.current.anonymous? if User.current.anonymous?

View File

@ -68,6 +68,28 @@ class BoardsController < ApplicationController
end end
def show def show
#¸üжÔÓ¦µÄforge_messages±íµÄviewed×Ö¶Î
if @project
query_forge_messages = @board.messages
query_forge_messages.each do |query_forge_message|
query = query_forge_message.forge_messages
query.each do |forge_message|
if User.current.id == forge_message.user_id
forge_message.update_attributes(:viewed => true)
end
end
end
elsif @course
query_course_messages = @board.messages
query_course_messages.each do |query_course_message|
query = query_course_message.course_messages
query.each do |course_message|
if User.current.id == course_message.user_id
course_message.update_attributes(:viewed => true)
end
end
end
end
respond_to do |format| respond_to do |format|
format.js format.js
format.html { format.html {

View File

@ -115,6 +115,8 @@ class MemosController < ApplicationController
REPLIES_PER_PAGE = 20 unless const_defined?(:REPLIES_PER_PAGE) REPLIES_PER_PAGE = 20 unless const_defined?(:REPLIES_PER_PAGE)
def show def show
#更新贴吧帖子留言对应的memo_messages的viewed字段
query_memo_messages = @memo.memo_messages
pre_count = REPLIES_PER_PAGE pre_count = REPLIES_PER_PAGE
@memo = @memo.root # 取出楼主防止输入帖子id让回复作为主贴显示 @memo = @memo.root # 取出楼主防止输入帖子id让回复作为主贴显示

View File

@ -99,6 +99,31 @@ class NewsController < ApplicationController
end end
def show def show
#更新news对应的forge_messages的viewed字段
query_forge_news = @news.forge_messages
query_forge_news.each do |query|
if User.current.id == query.user_id
query.update_attributes(:viewed => true)
end
end
#更新news对应的course_messages的viewed字段
query_course_news = @news.course_messages
query_course_news.each do |query|
if User.current.id == query.user_id
query.update_attributes(:viewed => true)
end
end
#更新项目新闻的评阅的viewed字段
current_forge_comments = @news.comments
current_forge_comments.each do |current_forge_comment|
query_forge_comment = current_forge_comment.forge_messages
query_forge_comment.each do |query|
if User.current.id == query.user_id
query.update_attributes(:viewed => true)
end
end
end
cs = CoursesService.new cs = CoursesService.new
result = cs.show_course_news params,User.current result = cs.show_course_news params,User.current
@news = result[:news] @news = result[:news]

View File

@ -28,6 +28,12 @@ class PollController < ApplicationController
render_403 render_403
return return
end end
query_course_poll = @poll.course_messages
query_course_poll.each do |query|
if User.current.id == query.user_id
query.update_attributes(:viewed => true)
end
end
#已提交问卷的用户不能再访问该界面 #已提交问卷的用户不能再访问该界面
if has_commit_poll?(@poll.id,User.current.id) && (!User.current.admin?) if has_commit_poll?(@poll.id,User.current.id) && (!User.current.admin?)
redirect_to poll_index_url(:polls_type => "Course", :polls_group_id => @course.id) redirect_to poll_index_url(:polls_type => "Course", :polls_group_id => @course.id)

View File

@ -11,6 +11,13 @@ class StudentWorkController < ApplicationController
protect_from_forgery :except => :set_program_score protect_from_forgery :except => :set_program_score
def index def index
#设置作业对应的forge_messages表的viewed字段
query_student_work = @homework.course_messages
query_student_work.each do |query|
if User.current.id == query.user_id
query.update_attributes(:viewed => true)
end
end
@order,@b_sort,@name,@group = params[:order] || "score",params[:sort] || "desc",params[:name] || "",params[:group] @order,@b_sort,@name,@group = params[:order] || "score",params[:sort] || "desc",params[:name] || "",params[:group]
@is_teacher = User.current.allowed_to?(:as_teacher,@course) @is_teacher = User.current.allowed_to?(:as_teacher,@course)
course_group = CourseGroup.find_by_id(@group) if @group course_group = CourseGroup.find_by_id(@group) if @group

View File

@ -123,56 +123,75 @@ class UsersController < ApplicationController
@new_message_count = @user.forge_messages.count + @user.memo_messages.count + @user.course_messages.count + @user.user_feedback_messages.count @new_message_count = @user.forge_messages.count + @user.memo_messages.count + @user.course_messages.count + @user.user_feedback_messages.count
case params[:type] case params[:type]
when nil when nil
@user_course_messages = CourseMessage.where("user_id =?",@user).order("created_at desc") @message_alls = []
@user_forge_messages = ForgeMessage.where("user_id =?",@user).order("created_at desc") messages = MessageAll.where("user_id =?",@user).order("created_at desc")
@user_memo_messages = MemoMessage.where("user_id =?",@user).order("created_at desc") messages.each do |message_all|
@user_feedback_messages = UserFeedbackMessage.where("user_id =?",@user).order("created_at desc") @message_alls << message_all.message
@user_course_messages_count = @user_course_messages.count end
@user_forge_messages_count = @user_forge_messages.count
@user_memo_messages_count = @user_memo_messages.count # @user_course_messages = MessageAll.where("user_id =? and message_type=?",@user,"CourseMessage").order("created_at desc")
@user_feedback_messages_count = @user_feedback_messages.count # @user_forge_messages = MessageAll.where("user_id =? and message_type=?",@user,"ForgeMessage").order("created_at desc")
# @user_memo_messages = MessageAll.where("user_id =? and message_type=?",@user,"MemoMessage").order("created_at desc")
# @user_feedback_messages = MessageAll.where("user_id =? and message_type=?",@user,"UserFeedbackMessage").order("created_at desc")
# @user_course_messages_count = @user_course_messages.count
# @user_forge_messages_count = @user_forge_messages.count
# @user_memo_messages_count = @user_memo_messages.count
# @user_feedback_messages_count = @user_feedback_messages.count
when 'homework' when 'homework'
@user_course_messages = CourseMessage.where("course_message_type =? and user_id =?", "HomeworkCommon", @user).order("created_at desc") @message_alls = CourseMessage.where("course_message_type =? and user_id =?", "HomeworkCommon", @user).order("created_at desc")
@user_course_messages_count = @user_course_messages.count @message_alls_count = @message_alls.count
#@user_course_messages_count = @user_course_messages.count
when 'course_message' when 'course_message'
@user_course_messages = CourseMessage.where("course_message_type =? and user_id =?", "Message", @user).order("created_at desc") @message_alls = CourseMessage.where("course_message_type =? and user_id =?", "Message", @user).order("created_at desc")
@user_course_messages_count = @user_course_messages.count @message_alls_count = @message_alls.count
#@user_course_messages_count = @user_course_messages.count
when 'forge_message' when 'forge_message'
@user_forge_messages = ForgeMessage.where("forge_message_type =? and user_id =?", "Message", @user).order("created_at desc") @message_alls = ForgeMessage.where("forge_message_type =? and user_id =?", "Message", @user).order("created_at desc")
@user_forge_messages_count = @user_forge_messages.count @message_alls_count = @message_alls.count
#@user_forge_messages_count = @user_forge_messages.count
when 'course_news' when 'course_news'
@user_course_messages = CourseMessage.where("course_message_type =? and user_id =?", "News", @user).order("created_at desc") @message_alls = CourseMessage.where("course_message_type =? and user_id =?", "News", @user).order("created_at desc")
@user_course_messages_count = @user_course_messages.count @message_alls_count = @message_alls.count
#@user_course_messages_count = @user_course_messages.count
when 'forge_news' when 'forge_news'
@user_forge_messages = ForgeMessage.where("forge_message_type =? and user_id =?", "News", @user).order("created_at desc") @message_alls = ForgeMessage.where("forge_message_type =? and user_id =?", "News", @user).order("created_at desc")
@user_forge_messages_count = @user_forge_messages.count @message_alls_count = @message_alls.count
#@user_forge_messages_count = @user_forge_messages.count
when 'course_news_reply' when 'course_news_reply'
@user_course_messages = CourseMessage.where("course_message_type =? and user_id =?", "Comment", @user).order("created_at desc") @message_alls = CourseMessage.where("course_message_type =? and user_id =?", "Comment", @user).order("created_at desc")
@user_course_messages_count = @user_course_messages.count #@user_course_messages_count = @user_course_messages.count
when 'forge_news_reply' when 'forge_news_reply'
@user_forge_messages = ForgeMessage.where("course_message_type =? and user_id =?", "Comment", @user).order("created_at desc") @message_alls = ForgeMessage.where("forge_message_type =? and user_id =?", "Comment", @user).order("created_at desc")
@user_forge_messagess_count = @user_forge_messages.count @message_alls_count = @message_alls.count
#@user_forge_messagess_count = @user_forge_messages.count
when 'poll' when 'poll'
@user_course_messages = CourseMessage.where("course_message_type =? and user_id =?", "Poll", @user).order("created_at desc") @message_alls = CourseMessage.where("course_message_type =? and user_id =?", "Poll", @user).order("created_at desc")
@user_course_messages_count = @user_course_messages.count @message_alls_count = @message_alls.count
#@user_course_messages_count = @user_course_messages.count
when 'works_reviewers' when 'works_reviewers'
@user_course_messages = CourseMessage.where("course_message_type =? and user_id =?", "StudentWorksScore", @user).order("created_at desc") @message_alls = CourseMessage.where("course_message_type =? and user_id =?", "StudentWorksScore", @user).order("created_at desc")
@user_course_messages_count = @user_course_messages.count @message_alls_count = @message_alls.count
#@user_course_messages_count = @user_course_messages.count
when 'works_reply' when 'works_reply'
@user_course_messages = CourseMessage.where("course_message_type =? and user_id =?", "JournalsForMessage", @user).order("created_at desc") @message_alls = CourseMessage.where("course_message_type =? and user_id =?", "JournalsForMessage", @user).order("created_at desc")
@user_course_messages_count = @user_course_messages.count @message_alls_count = @message_alls.count
#@user_course_messages_count = @user_course_messages.count
when 'issue' when 'issue'
@user_forge_messages = ForgeMessage.where("forge_message_type =? and user_id =?", "Issue", @user).order("created_at desc") @message_alls = ForgeMessage.where("forge_message_type =? and user_id =?", "Issue", @user).order("created_at desc")
@user_forge_messages_count = @user_forge_messages.count @message_alls_count = @message_alls.count
#@user_forge_messages_count = @user_forge_messages.count
when 'issue_update' # 缺陷状态更新、留言 when 'issue_update' # 缺陷状态更新、留言
@user_forge_messages = ForgeMessage.where("forge_message_type =? and user_id =?", "Journal", @user).order("created_at desc") @message_alls = ForgeMessage.where("forge_message_type =? and user_id =?", "Journal", @user).order("created_at desc")
@user_forge_messages_count = @user_forge_messages.count @message_alls_count = @message_alls.count
#@user_forge_messages_count = @user_forge_messages.count
when 'forum' when 'forum'
@user_memo_messages = MemoMessage.where("memo_type =? and user_id =?", "Memo", @user).order("created_at desc") @message_alls = MemoMessage.where("memo_type =? and user_id =?", "Memo", @user).order("created_at desc")
@user_memo_messages_count = @user_memo_messages.count @message_alls_count = @message_alls.count
#@user_memo_messages_count = @user_memo_messages.count
when 'user_feedback' when 'user_feedback'
@user_feedback_messages = UserFeedbackMessage.where("journals_for_message_type =? and user_id =?", "Principal", @user).order("created_at desc") @message_alls = UserFeedbackMessage.where("journals_for_message_type =? and user_id =?", "JournalsForMessage", @user).order("created_at desc")
@user_feedback_messages_count = @user_feedback_messages.count @message_alls_count = @message_alls.count
#@user_feedback_messages_count = @user_feedback_messages.count
else else
render_404 render_404
return return

View File

@ -1,12 +1,19 @@
class CourseMessage < ActiveRecord::Base class CourseMessage < ActiveRecord::Base
attr_accessible :course_id, :course_message_id, :course_message_type, :user_id, :viewed attr_accessible :course_id, :course_message_id, :course_message_type, :user_id, :viewed, :content, :status
# 多态 虚拟关联 # 多态 虚拟关联
belongs_to :course_message ,:polymorphic => true belongs_to :course_message ,:polymorphic => true
belongs_to :course belongs_to :course
belongs_to :user belongs_to :user
has_many :message_alls, :class_name => 'MessageAll',:as =>:message, :dependent => :destroy
validates :user_id,presence: true validates :user_id,presence: true
validates :course_id,presence: true validates :course_id,presence: true
validates :course_message_id,presence: true validates :course_message_id,presence: true
validates :course_message_type, presence: true validates :course_message_type, presence: true
after_create :add_user_message
def add_user_message
self.message_alls << MessageAll.new(:user_id => self.user_id)
end
end end

View File

@ -13,8 +13,15 @@ class ForgeMessage < ActiveRecord::Base
belongs_to :forge_message ,:polymorphic => true belongs_to :forge_message ,:polymorphic => true
belongs_to :project belongs_to :project
belongs_to :user belongs_to :user
has_many :message_alls, :class_name => 'MessageAll',:as =>:message, :dependent => :destroy
validates :user_id,presence: true validates :user_id,presence: true
validates :project_id,presence: true validates :project_id,presence: true
validates :forge_message_id,presence: true validates :forge_message_id,presence: true
validates :forge_message_type, presence: true validates :forge_message_type, presence: true
after_create :add_user_message
def add_user_message
self.message_alls << MessageAll.new(:user_id => self.user_id)
end
end end

View File

@ -83,7 +83,7 @@ class Issue < ActiveRecord::Base
# fq # fq
after_create :act_as_activity,:be_user_score_new_issue,:act_as_forge_activity, :act_as_forge_message after_create :act_as_activity,:be_user_score_new_issue,:act_as_forge_activity, :act_as_forge_message
after_update :be_user_score, :act_as_forge_message_update after_update :be_user_score
after_destroy :down_user_score after_destroy :down_user_score
# after_create :be_user_score # after_create :be_user_score
# end # end
@ -145,20 +145,16 @@ class Issue < ActiveRecord::Base
def act_as_forge_message def act_as_forge_message
# 指派给自己的缺陷不提示消息 # 指派给自己的缺陷不提示消息
unless self.author_id == self.assigned_to_id unless self.author_id == self.assigned_to_id
self.forge_messages << ForgeMessage.new(:user_id => self.assigned_to_id, self.forge_messages << ForgeMessage.new(:user_id => self.assigned_to_id, :project_id => self.project_id, :viewed => false)
:project_id => self.project_id,
:viewed => false)
end end
end end
# 更新缺陷 # 更新缺陷
def act_as_forge_message_update #def act_as_forge_message_update
unless self.author_id == self.assigned_to_id # unless self.author_id == self.assigned_to_id
self.forge_messages << ForgeMessage.new(:user_id => self.assigned_to_id, # self.forge_messages << ForgeMessage.new(:user_id => self.assigned_to_id, :project_id => self.project_id, :viewed => false)
:project_id => self.project_id, # end
:viewed => false) #end
end
end
# Returns a SQL conditions string used to find all issues visible by the specified user # Returns a SQL conditions string used to find all issues visible by the specified user

View File

@ -172,9 +172,10 @@ class Journal < ActiveRecord::Base
# 缺陷状态更改,消息提醒 # 缺陷状态更改,消息提醒
def act_as_forge_message def act_as_forge_message
if self.user_id != self.issue.author_id if self.user_id != self.issue.author_id
self.forge_messages << ForgeMessage.new(:user_id => self.issue.author_id, self.forge_messages << ForgeMessage.new(:user_id => self.issue.author_id, :project_id => self.issue.project_id, :viewed => false)
:project_id => self.issue.project_id, end
:viewed => false) if self.user_id != self.issue.assigned_to_id # 指派人不是自己的话,则给指派人发送
self.forge_messages << ForgeMessage.new(:user_id => self.issue.assigned_to_id, :project_id => self.issue.project_id, :viewed => false)
end end
end end

View File

@ -209,14 +209,20 @@ class JournalsForMessage < ActiveRecord::Base
end end
else # 留言回复 else # 留言回复
reply_to = User.find(self.reply_id) reply_to = User.find(self.reply_id)
if self.user_id != self.parent.user_id if self.user_id != self.reply_id # 添加我回复的那个人
receivers << reply_to
if self.reply_id != self.parent.user_id
receivers << self.parent.user
end
else
receivers << reply_to receivers << reply_to
end end
if self.user_id != self.parent.jour_id # 给东家发信息
receivers << self.parent.jour
end
# if self.user_id != self.parent.user_id
# receivers << reply_to
# if self.reply_id != self.parent.user_id
# receivers << self.parent.user
# end
# else
# receivers << reply_to
# end
# 添加留言回复人 # 添加留言回复人
#reply_to = User.find(self.reply_id) #reply_to = User.find(self.reply_id)

View File

@ -79,7 +79,7 @@ class Memo < ActiveRecord::Base
receivers << self.forum.creator receivers << self.forum.creator
end end
# 添加发帖人 # 添加发帖人
if self.forum.creator_id != self.parent.author_id if self.author_id != self.parent.author_id
receivers << self.parent.author receivers << self.parent.author
end end
end end

View File

@ -3,9 +3,15 @@ class MemoMessage < ActiveRecord::Base
belongs_to :memo belongs_to :memo
belongs_to :user belongs_to :user
has_many :message_alls, :class_name => 'MessageAll',:as =>:message, :dependent => :destroy
validates :user_id,presence: true validates :user_id,presence: true
validates :forum_id,presence: true validates :forum_id,presence: true
validates :memo_id,presence: true validates :memo_id,presence: true
validates :memo_type, presence: true validates :memo_type, presence: true
after_create :add_user_message
def add_user_message
self.message_alls << MessageAll.new(:user_id => self.user_id)
end
end end

View File

@ -0,0 +1,5 @@
class MessageAll < ActiveRecord::Base
attr_accessible :message_id, :message_type, :user_id
# 虚拟关联---项目消息表/课程消息表/用户留言消息表/贴吧消息表
belongs_to :message ,:polymorphic => true
end

View File

@ -1,3 +1,4 @@
#encoding=UTF-8
class StudentWorksScore < ActiveRecord::Base class StudentWorksScore < ActiveRecord::Base
#reviewer_role: 1:教师评分;2:教辅评分;3:学生匿评 #reviewer_role: 1:教师评分;2:教辅评分;3:学生匿评
attr_accessible :student_work_id, :user_id, :score, :comment, :reviewer_role attr_accessible :student_work_id, :user_id, :score, :comment, :reviewer_role
@ -9,13 +10,31 @@ class StudentWorksScore < ActiveRecord::Base
acts_as_attachable acts_as_attachable
after_create :act_as_course_message after_save :act_as_course_message
# 评阅作品消息提示 # 评阅作品消息提示
def act_as_course_message def act_as_course_message
if self.student_work if self.student_work && self.student_work.user && self.student_work.homework_common.course
receiver = self.student_work.user receiver = self.student_work.user
self.course_messages << CourseMessage.new(:user_id => receiver.id, :course_id => self.student_work.homework_common.course.id, :viewed => false) # 判断是第一次评阅还是更新 status:0 新建1 更新
if self.created_at == self.updated_at
if self.comment.nil?
self.course_messages << CourseMessage.new(:user_id => receiver.id, :course_id => self.student_work.homework_common.course.id,
:viewed => false, :content => "作业评分:#{self.score}", :status=> false)
else
self.course_messages << CourseMessage.new(:user_id => receiver.id, :course_id => self.student_work.homework_common.course.id,
:viewed => false, :content => "作业评分:#{self.score}&nbsp;&nbsp;&nbsp; 评语:#{self.comment}", :status=> false)
end
else # 更新
if self.comment.nil?
self.course_messages << CourseMessage.new(:user_id => receiver.id, :course_id => self.student_work.homework_common.course.id,
:viewed => false, :content => "作业评分:#{self.score}", :status=> true)
else
self.course_messages << CourseMessage.new(:user_id => receiver.id, :course_id => self.student_work.homework_common.course.id,
:viewed => false, :content => "作业评分:#{self.score}&nbsp;&nbsp;&nbsp; 评语:#{self.comment}", :status=> true)
end end
end end
end end
end
end

View File

@ -3,8 +3,14 @@ class UserFeedbackMessage < ActiveRecord::Base
belongs_to :journals_for_message belongs_to :journals_for_message
belongs_to :user belongs_to :user
has_many :message_alls, :class_name => 'MessageAll',:as =>:message, :dependent => :destroy
validates :user_id,presence: true validates :user_id,presence: true
validates :journals_for_message_id,presence: true validates :journals_for_message_id,presence: true
validates :journals_for_message_type, presence: true validates :journals_for_message_type, presence: true
after_create :add_user_message
def add_user_message
self.message_alls << MessageAll.new(:user_id => self.user_id)
end
end end

View File

@ -0,0 +1,51 @@
<%= stylesheet_link_tag 'new_user'%>
<div class="homepageContentContainer " style="margin-top:20px;">
<div class="homepageContent BgBox">
<h2 class="BgBox_h2">Trustie服务协议</h2>
<div class="AgreementBox">
<p>尊敬的用户,您好!<br />
欢迎使用Trustie平台在您使用Trustie平台前请您认真阅读并遵守《Trustie服务协议》以下简称"本协议"),请您务必审慎阅读、充分理解协议的各条款内容。<br />
当您在注册过程中点击查看"看过并同意本服务协议"按照注册流程成功注册为Trustie平台的用户即表示您已充分阅读、理解并完全接受本协议中的全部条款。您承诺接受并遵守本协议的约定届时您不应以未阅读本协议的内容等理由主张本协议无效或本协议中的某些条款无效或要求撤销本协议。</p>
<h4 class="Agreementh4">一、Trustie平台权利和义务</h4>
<p>1、尊重用户隐私尊重用户隐私保障用户隐私安全是Trustie平台的一项基本政策<br />
2、管理平台用户Trustie平台依据国家法律、地方法律和国际法律等的标准以及本行业的规则来管理平台注册用户<br />
3、处理用户反馈Trustie平台的相关人员会及时处理用户反馈的问题并给予及时回复。</p>
<h4 class="Agreementh4">二、用户权利和义务</h4>
<p>用户在使用Trustie平台的过程中必须遵守如下原则<br />
1、遵守中国的有关法律和法规<br />
2、使用网络服务不作非法用途<br />
3、不干扰和混乱网络服务<br />
4、遵守所有使用网络服务的网络协议、规定、程序和惯例<br />
5、不传输任何非法的、骚扰性的、中伤他人的、辱骂性的、恐吓性的、伤害性的、庸俗的淫秽等信息资料<br />
6、不传输任何教唆他人构成犯罪行为的资料<br />
7、用户不得故意或者过失损害Trustie平台合法权利和利益。及时回复。</p>
<h4 class="Agreementh4">三、关于责任</h4>
<p>鉴于网络服务的特殊性用户同意Trustie团队有权在事先通知的情况下变更、中断、升级部分网络服务。Trustie团队不担保网络服务不会中断但承诺在用户可承受的时间内快速恢复服务同时确保用户数据的安全性和可靠性。</p>
<h4 class="Agreementh4">四、服务条款的修改</h4>
<p>Trustie团队保留在必要时对本协议修改的权利一旦发生变动这些条款可由Trustie团队及时更新且毋须另行通知修改后的条款一旦在网页上公布即有效代替原来的服务条款。您可随时查阅最新版服务条款。</p>
<p class=" mt15 fb">本协议最终解释权归Trustie团队所有。</p>
</div>
</div><!---BgBox end--->
</div><!---homepageContentContainer end--->
<script>
$(".resourcesList").mousedown(function(e) {
if (3 == e.which) {
document.oncontextmenu = function() {return false;}
$("#contextMenu").hide();
$("#contextMenu").attr("style","display: block; position: fixed; top:"
+ e.pageY
+ "px; left:"
+ e.pageX
+ "px; width: 80px;");
$("#contextMenu").show();
}
});
$(".resourcesList").click(function(e) {
$("#contextMenu").hide();
document.oncontextmenu = function() {return true;}
});
</script>

View File

@ -246,7 +246,7 @@
<div class="fl mt3 mr5"> <div class="fl mt3 mr5">
<input type="checkbox" id="read_and_confirm"/> <input type="checkbox" id="read_and_confirm"/>
</div> </div>
我已阅读并接受<a href="javascript:void(0);" class="newsBlue"><u>Trustie服务协议</u></a>条款</div> 我已阅读并接受<a href="<%= agreement_path %>" class="newsBlue"><u>Trustie服务协议</u></a>条款</div>
<div class="loginUpButton"> <div class="loginUpButton">
<a href="javascript:void(0);" class="c_white db" onclick="register();">注册</a> <a href="javascript:void(0);" class="c_white db" onclick="register();">注册</a>

View File

@ -1,16 +1,36 @@
<% @nav_dispaly_home_path_label = 1 <%= stylesheet_link_tag 'new_user'%>
@nav_dispaly_main_course_label = 1
@nav_dispaly_main_project_label = 1 <div class="homepageContentContainer " style="margin-top:20px;">
@nav_dispaly_main_contest_label = 1 %> <div class="homepageContent BgBox">
<% @nav_dispaly_forum_label = 1%> <h2 class="BgBox_h2">忘记密码</h2>
<h3><%=l(:label_password_forget)%></h3> <div class="BgBoxCon">
<p class="BgBoxConP mb5">通过注册邮箱链接重设密码</p>
<input type="text" class="NomalInput mb20 " value="请输入登录邮箱地址" />
<div class="LoginButton"><a href="javascript:void(0);" class="c_white db">提交</a></div>
<%= form_tag(lost_password_path) do %>
<div class="box tabular">
<p>
<label for="mail"><%=l(:field_mail)%> <span class="required">*</span></label>
<%= text_field_tag 'mail', nil, :size => 40, :placeholder => '请输入注册邮箱'%>
<%= submit_tag l(:button_submit) %>
</p>
</div> </div>
<% end %>
</div><!---BgBox end--->
</div><!---homepageContentContainer end--->
<script>
$(".resourcesList").mousedown(function(e) {
if (3 == e.which) {
document.oncontextmenu = function() {return false;}
$("#contextMenu").hide();
$("#contextMenu").attr("style","display: block; position: fixed; top:"
+ e.pageY
+ "px; left:"
+ e.pageX
+ "px; width: 80px;");
$("#contextMenu").show();
}
});
$(".resourcesList").click(function(e) {
$("#contextMenu").hide();
document.oncontextmenu = function() {return true;}
});
</script>
</body>
</html>

View File

@ -56,9 +56,9 @@
</li><!---level1 end---> </li><!---level1 end--->
<!--消息提醒--> <!--消息提醒-->
<div class="navHomepageNews"> <div class="navHomepageNews">
<%= link_to image_tag("/images/news_icon_small.png" , :width => "21", :height => "24"), {:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user} %> <%= link_to image_tag("/images/news_icon_small.png" , :width => "21", :height => "24"), user_message_path(User.current) %>
<% if User.current.count_new_message >0 %> <% if User.current.count_new_message >0 %>
<div class="newsActive"></div> <div class="newsActive"><%= link_to "" , user_message_path(User.current) %></div>
<% end %> <% end %>
</div> </div>
<!--消息提醒end--> <!--消息提醒end-->

View File

@ -76,11 +76,10 @@
</ul> </ul>
</div> </div>
<div class="navHomepageNews"> <div class="navHomepageNews">
<%= link_to image_tag("/images/news_icon_small.png" , :width => "21", :height => "24"), {:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user} %> <%= link_to "", user_message_path(User.current), :class => "homepageNewsIcon" %>
<% if User.current.count_new_message >0 %> <% if User.current.count_new_message >0 %>
<div class="newsActive"></div> <div ><%= link_to "" , user_message_path(User.current), :class => "newsActive" %></div>
<% end %> <% end %>
<div class="newsActive"></div>
</div> </div>
</div> </div>

View File

@ -0,0 +1,41 @@
<!DOCTYPE html>
<html lang="<%= current_language %>">
<head>
<meta charset="utf-8" />
<title><%=h html_title %></title>
<meta name="description" content="<%= Redmine::Info.app_name %>" />
<meta name="keywords" content="issue,bug,tracker" />
<%= csrf_meta_tag %>
<%= favicon %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'application', 'nyan', :media => 'all' %>
<%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
<%= javascript_heads %>
<%= javascript_include_tag "jquery.leanModal.min" %>
<%= javascript_include_tag 'seems_rateable/jRating', 'seems_rateable/rateable'%>
<%= heads_for_theme %>
<%= call_hook :view_layouts_base_html_head %>
<!-- page specific tags -->
<%= yield :header_tags -%>
<%= stylesheet_link_tag 'base','header', :media => 'all'%>
</head>
<body>
<div class="cl"></div>
<div class="navContainer mb10">
<% if User.current.logged? %>
<%= render :partial => 'layouts/logined_header',:locals=>{:name=>@name,:type=>@type} %>
<% else%>
<%= render :partial => 'layouts/unlogin_header',:locals=>{:name=>@name,:type=>@type} %>
<% end%>
</div>
<div class="cl"></div>
<div>
<%= yield %>
<div style="clear:both;"></div>
</div>
<div class="cl"></div>
<%= render :partial => 'layouts/footer' %>
<div class="cl"></div>
<%= call_hook :view_layouts_base_body_bottom %>
</body>
</html>

View File

@ -4,7 +4,7 @@
<%= link_to image_tag(url_to_avatar(activity.user), :width => "90", :height => "90"), user_path(activity.user_id), :alt => "用户头像" %> <%= link_to image_tag(url_to_avatar(activity.user), :width => "90", :height => "90"), user_path(activity.user_id), :alt => "用户头像" %>
</div> </div>
<div class="homepagePostDes"> <div class="homepagePostDes">
<div class="homepagePostTo"> <div class="homepagePostTo" style="word-break:break-all;">
<% if activity.try(:user).try(:realname) == ' ' %> <% if activity.try(:user).try(:realname) == ' ' %>
<%= link_to activity.try(:user), user_path(activity.user_id), :class => "newsBlue mr15" %> <%= link_to activity.try(:user), user_path(activity.user_id), :class => "newsBlue mr15" %>
<% else %> <% else %>
@ -12,12 +12,12 @@
<% end %> TO <% end %> TO
<%= link_to activity.course.name.to_s+"(课程名称)", course_path(activity.course_id), :class => "newsBlue ml15", :style=>"word-break:break-all" %> <%= link_to activity.course.name.to_s+"(课程名称)", course_path(activity.course_id), :class => "newsBlue ml15", :style=>"word-break:break-all" %>
</div> </div>
<div class="homepagePostTitle"> <div class="homepagePostTitle" style="word-break:break-all;">
<%= link_to activity.name.to_s+"(作业名称)", student_work_index_path(:homework => activity.id), :class => "postGrey", :style=>"word-break:break-all" %> <%= link_to activity.name.to_s+"(作业名称)", student_work_index_path(:homework => activity.id), :class => "postGrey", :style=>"word-break:break-all" %>
</div> </div>
<div class="homepagePostSubmitContainer"> <div class="homepagePostSubmitContainer">
<div class="homepagePostSubmit"> <div class="homepagePostSubmit">
<%= link_to "提交("+activity.student_works.count.to_s+")", student_work_index_path(activity.id), :class=> "c_blue" %> <%= link_to "提交("+activity.student_works.count.to_s+")", student_work_index_path(:homework => activity.id), :class=> "c_blue" %>
</div> </div>
<div class="homepagePostDeadline">截止时间:<%= format_date(activity.end_time) %></div> <div class="homepagePostDeadline">截止时间:<%= format_date(activity.end_time) %></div>
</div> </div>

View File

@ -4,7 +4,7 @@
<%= link_to image_tag(url_to_avatar(activity.author), :width => "90", :height => "90"), user_path(activity.author_id), :alt => "用户头像" %> <%= link_to image_tag(url_to_avatar(activity.author), :width => "90", :height => "90"), user_path(activity.author_id), :alt => "用户头像" %>
</div> </div>
<div class="homepagePostDes"> <div class="homepagePostDes">
<div class="homepagePostTo"> <div class="homepagePostTo" style="word-break:break-all;">
<% if activity.try(:author).try(:realname) == ' ' %> <% if activity.try(:author).try(:realname) == ' ' %>
<%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %> <%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %>
<% else %> <% else %>
@ -13,16 +13,17 @@
TO TO
<%= link_to activity.course.name.to_s+"(课程讨论区)", course_path(activity.course), :class => "newsBlue ml15 mr5", :style=>"word-break:break-all"%> <%= link_to activity.course.name.to_s+"(课程讨论区)", course_path(activity.course), :class => "newsBlue ml15 mr5", :style=>"word-break:break-all"%>
</div> </div>
<div class="homepagePostTitle"> <div class="homepagePostTitle" style="word-break:break-all;">
<% if activity.parent_id.nil? %> <% if activity.parent_id.nil? %>
<%= link_to activity.subject.to_s.html_safe+"(讨论区内容)", course_boards_path(Board.where('id=?',activity.board_id).first.course_id), :class=> "postGrey", :style=>"word-break:break-all" %> <%= link_to activity.subject.to_s.html_safe+"(帖子标题)", course_boards_path(activity.course,:parent_id =>activity.id, :topic_id => activity.id), :class=> "postGrey", :style=>"word-break:break-all" %>
<% else %> <% else %>
<%= link_to activity.parent.subject.to_s.html_safe+"(讨论区内容)", course_boards_path(Board.where('id=?',activity.board_id).first.course_id), :class=> "postGrey", :style=>"word-break:break-all"%> <%= link_to activity.parent.subject.to_s.html_safe+"(帖子标题)", course_boards_path(activity.course,:parent_id =>activity.parent_id, :topic_id => activity.id), :class=> "postGrey", :style=>"word-break:break-all"%>
<% end %> <% end %>
</div> </div>
<div class="homepagePostSubmitContainer"> <div class="homepagePostSubmitContainer">
<div class="homepagePostDeadline">时间:<%= format_date(activity.created_on) %></div> <div class="homepagePostDeadline">时间:<%= format_date(activity.created_on) %></div>
</div> </div>
<div class="homepagePostIntro" style="word-break:break-all">(描述)<%= activity.content.html_safe %></div>
<div class="homepagePostSetting" id="act-<%= user_activity.id %>" style="visibility: hidden"> <div class="homepagePostSetting" id="act-<%= user_activity.id %>" style="visibility: hidden">
<ul> <ul>
<li class="homepagePostSettingIcon"> <li class="homepagePostSettingIcon">

View File

@ -4,7 +4,7 @@
<%= link_to image_tag(url_to_avatar(activity.author), :width => "90", :height => "90"), user_path(activity.author_id), :alt => "用户头像" %> <%= link_to image_tag(url_to_avatar(activity.author), :width => "90", :height => "90"), user_path(activity.author_id), :alt => "用户头像" %>
</div> </div>
<div class="homepagePostDes"> <div class="homepagePostDes">
<div class="homepagePostTo"> <div class="homepagePostTo" style="word-break:break-all;">
<% if @ctivity.try(:author).try(:realname) == ' ' %> <% if @ctivity.try(:author).try(:realname) == ' ' %>
<%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %> <%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %>
<% else %> <% else %>
@ -12,7 +12,7 @@
<% end %> TO <% end %> TO
<%= link_to activity.course.name.to_s+"(课程名称)", course_path(activity.course), :class => "newsBlue ml15", :style=>"word-break:break-all" %> <%= link_to activity.course.name.to_s+"(课程名称)", course_path(activity.course), :class => "newsBlue ml15", :style=>"word-break:break-all" %>
</div> </div>
<div class="homepagePostTitle"> <div class="homepagePostTitle" style="word-break:break-all;">
<%=link_to activity.title.to_s+"(通知标题)", news_path(activity), :class=> "postGrey", :style=>"word-break:break-all" %> <%=link_to activity.title.to_s+"(通知标题)", news_path(activity), :class=> "postGrey", :style=>"word-break:break-all" %>
</div> </div>
<div class="homepagePostSubmitContainer"> <div class="homepagePostSubmitContainer">

View File

@ -5,7 +5,7 @@
<%= link_to image_tag(url_to_avatar(activity.user), :width => "90", :height => "90"), user_path(activity.user_id), :alt => "用户头像" %> <%= link_to image_tag(url_to_avatar(activity.user), :width => "90", :height => "90"), user_path(activity.user_id), :alt => "用户头像" %>
</div> </div>
<div class="homepagePostDes"> <div class="homepagePostDes">
<div class="homepagePostTo"> <div class="homepagePostTo" style="word-break:break-all;">
<% if activity.try(:user).try(:realname) == ' ' %> <% if activity.try(:user).try(:realname) == ' ' %>
<%= link_to activity.try(:user), user_path(activity.user_id), :class => "newsBlue mr15" %> <%= link_to activity.try(:user), user_path(activity.user_id), :class => "newsBlue mr15" %>
<% else %> <% else %>
@ -15,13 +15,13 @@
<%= link_to Course.find(activity.polls_group_id).name.to_s+"(课程名称)", course_path(activity.polls_group_id), :class => "newsBlue ml15", :style=>"word-break:break-all" %> <%= link_to Course.find(activity.polls_group_id).name.to_s+"(课程名称)", course_path(activity.polls_group_id), :class => "newsBlue ml15", :style=>"word-break:break-all" %>
<!--<a href="javascript:void(0);" class="newsBlue ml15">分布式计算环境(课程名称)</a>--> <!--<a href="javascript:void(0);" class="newsBlue ml15">分布式计算环境(课程名称)</a>-->
</div> </div>
<div class="homepagePostTitle"> <div class="homepagePostTitle" style="word-break:break-all;">
<a href="javascript:void(0);" class="postGrey"><%=activity.polls_name.to_s%>(问卷名称)</a> <a href="javascript:void(0);" class="postGrey"><%=activity.polls_name.to_s%>(问卷名称)</a>
</div> </div>
<div class="homepagePostSubmitContainer"> <div class="homepagePostSubmitContainer">
<div class="homepagePostDeadline">时间:<%= format_date(activity.created_at) %></div> <div class="homepagePostDeadline">时间:<%= format_date(activity.created_at) %></div>
</div> </div>
<div class="homepagePostIntro">(问卷描述)<%=activity.polls_description.to_s%></div> <div class="homepagePostIntro" style="word-break:break-all;">(问卷描述)<%=activity.polls_description.to_s%></div>
<div class="homepagePostSetting" id="act-<%= user_activity.id %>" style="visibility: hidden"> <div class="homepagePostSetting" id="act-<%= user_activity.id %>" style="visibility: hidden">
<ul> <ul>
<li class="homepagePostSettingIcon"> <li class="homepagePostSettingIcon">

View File

@ -4,7 +4,7 @@
<%= link_to image_tag(url_to_avatar(activity.author), :width => "90", :height => "90"), user_path(activity.author_id), :alt => "用户头像" %> <%= link_to image_tag(url_to_avatar(activity.author), :width => "90", :height => "90"), user_path(activity.author_id), :alt => "用户头像" %>
</div> </div>
<div class="homepagePostDes"> <div class="homepagePostDes">
<div class="homepagePostTo"> <div class="homepagePostTo" style="word-break:break-all;">
<% if activity.try(:author).try(:realname) == ' ' %> <% if activity.try(:author).try(:realname) == ' ' %>
<%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %> <%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %>
<% else %> <% else %>
@ -12,7 +12,7 @@
<% end %> TO <% end %> TO
<%= link_to activity.project.name.to_s+"(项目名称)", project_path(activity.project), :class => "newsBlue ml15", :style=>"word-break:break-all" %> <%= link_to activity.project.name.to_s+"(项目名称)", project_path(activity.project), :class => "newsBlue ml15", :style=>"word-break:break-all" %>
</div> </div>
<div class="homepagePostTitle"> <div class="homepagePostTitle" style="word-break:break-all;">
<%= link_to activity.subject.to_s+"(缺陷标题)", issue_path(activity), :class => "postGrey", :style=>"word-break:break-all" %> <%= link_to activity.subject.to_s+"(缺陷标题)", issue_path(activity), :class => "postGrey", :style=>"word-break:break-all" %>
<span class="homepagePostProjectState"><%=activity.status.name %></span> <span class="homepagePostProjectState"><%=activity.status.name %></span>
</div> </div>

View File

@ -4,7 +4,7 @@
<%= link_to image_tag(url_to_avatar(activity.author), :width => "90", :height => "90"), user_path(activity.author_id), :alt => "用户头像" %> <%= link_to image_tag(url_to_avatar(activity.author), :width => "90", :height => "90"), user_path(activity.author_id), :alt => "用户头像" %>
</div> </div>
<div class="homepagePostDes"> <div class="homepagePostDes">
<div class="homepagePostTo"> <div class="homepagePostTo" style="word-break:break-all;">
<% if activity.try(:author).try(:realname) == ' ' %> <% if activity.try(:author).try(:realname) == ' ' %>
<%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %> <%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %>
<% else %> <% else %>
@ -14,16 +14,17 @@
<%= link_to activity.project.name.to_s+"(项目讨论区)", project_path(activity.project), :class => "newsBlue ml15 mr5", :style=>"word-break:break-all"%> <%= link_to activity.project.name.to_s+"(项目讨论区)", project_path(activity.project), :class => "newsBlue ml15 mr5", :style=>"word-break:break-all"%>
<!--<a href="javascript:void(0);" class="newsBlue ml15 mr5"><%= activity.project.name %>(项目讨论区)</a>--> <!--<a href="javascript:void(0);" class="newsBlue ml15 mr5"><%= activity.project.name %>(项目讨论区)</a>-->
</div> </div>
<div class="homepagePostTitle"> <div class="homepagePostTitle" style="word-break:break-all;">
<% if activity.parent_id.nil? %> <% if activity.parent_id.nil? %>
<%= link_to activity.subject.to_s.html_safe+"(讨论区内容)", project_boards_path(Board.where('id=?',activity.board_id).first.project_id), :class=> "postGrey", :style=>"word-break:break-all" %> <%= link_to activity.subject.to_s.html_safe+"(帖子标题)", project_boards_path(activity.project,:parent_id =>activity.id, :topic_id => activity.id), :class=> "postGrey", :style=>"word-break:break-all" %>
<% else %> <% else %>
<%= link_to activity.parent.subject.to_s.html_safe+"(讨论区内容)", project_boards_path(Board.where('id=?',activity.board_id).first.project_id), :class=> "postGrey", :style=>"word-break:break-all"%> <%= link_to activity.parent.subject.to_s.html_safe+"(帖子标题)", project_boards_path(activity.project,:parent_id =>activity.parent_id, :topic_id => activity.id), :class=> "postGrey", :style=>"word-break:break-all"%>
<% end %> <% end %>
</div> </div>
<div class="homepagePostSubmitContainer"> <div class="homepagePostSubmitContainer">
<div class="homepagePostDeadline">时间:<%= format_date(activity.created_on) %></div> <div class="homepagePostDeadline">时间:<%= format_date(activity.created_on) %></div>
</div> </div>
<div class="homepagePostIntro" style="word-break:break-all">(描述)<%= activity.content.html_safe %></div>
<div class="homepagePostSetting" id="act-<%= user_activity.id %>" style="visibility: hidden"> <div class="homepagePostSetting" id="act-<%= user_activity.id %>" style="visibility: hidden">
<ul> <ul>
<li class="homepagePostSettingIcon"> <li class="homepagePostSettingIcon">

View File

@ -22,6 +22,7 @@
<% end %> <% end %>
<% end %> <% end %>
<% when 'Project' %> <% when 'Project' %>
<% if act %>
<% case user_activity.act_type.to_s %> <% case user_activity.act_type.to_s %>
<% when 'Issue' %> <% when 'Issue' %>
<%= render :partial => 'project_issue', :locals => {:activity => act,:user_activity =>user_activity} %> <%= render :partial => 'project_issue', :locals => {:activity => act,:user_activity =>user_activity} %>
@ -41,4 +42,5 @@
<% end %> <% end %>
<% end %> <% end %>
<% end %> <% end %>
<% end %>
<input type="hidden" value="<%= page%>" id="show_more_activities" /> <input type="hidden" value="<%= page%>" id="show_more_activities" />

View File

@ -1,254 +1,260 @@
<div id="RSide" class="fl">
<div class="homepageRight">
<div class="resourcesBanner"> <div class="resources">
<div class="bannerName">消息</div> <div class="homepageRightBanner">
<div class="NewsBannerName">消息</div>
<ul class="resourcesSelect"> <ul class="resourcesSelect">
<li class="resourcesSelected2"><a href="javascript:void(0);" class="resourcesIcon2"></a> <li class="resourcesSelected"><a href="javascript:void(0);" class="resourcesIcon"></a>
<ul class="newsType"> <ul class="newsType">
<li><a href="javascript:void(0);" class="resourcesGrey"><%= link_to "全部",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user} %></a></li> <li><%= link_to "全部",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user}, :class => "resourcesGrey" %></li>
<%# 课程相关消息 %> <%# 课程相关消息 %>
<li><a href="javascript:void(0);" class="resourcesGrey"><%= link_to "作业消息",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'homework'} %></a></li> <li><%= link_to "作业消息",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'homework'}, :class => "resourcesGrey" %></li>
<li><a href="javascript:void(0);" class="resourcesGrey"><%= link_to "课程讨论区",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'course_message'} %></a></li> <li><%= link_to "课程讨论区",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'course_message'}, :class => "resourcesGrey" %></li>
<li><a href="javascript:void(0);" class="resourcesGrey"><%= link_to "课程通知",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'course_news'} %></a></li> <li><%= link_to "课程通知",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'course_news'}, :class => "resourcesGrey" %></li>
<li><a href="javascript:void(0);" class="resourcesGrey"><%= link_to "通知回复",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'course_news_reply'} %></a></li> <li><%= link_to "通知回复",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'course_news_reply'}, :class => "resourcesGrey" %></li>
<li><a href="javascript:void(0);" class="resourcesGrey"><%= link_to "课程问卷",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'poll'} %></a></li> <li><%= link_to "课程问卷",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'poll'}, :class => "resourcesGrey" %></a></li>
<li><a href="javascript:void(0);" class="resourcesGrey"><%= link_to "作品评阅",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'works_reviewers'} %></a></li> <li><%= link_to "作品评阅",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'works_reviewers'}, :class => "resourcesGrey" %></li>
<li><a href="javascript:void(0);" class="resourcesGrey"><%= link_to "作品讨论",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'works_reply'} %></a></li> <li><%= link_to "作品讨论",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'works_reply'}, :class => "resourcesGrey" %></li>
<%# 项目相关消息 %> <%# 项目相关消息 %>
<li><a href="javascript:void(0);" class="resourcesGrey"><%= link_to "指派给我",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'issue'} %></a></li> <li><%= link_to "指派问题",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'issue'}, :class => "resourcesGrey" %></li>
<li><a href="javascript:void(0);" class="resourcesGrey"><%= link_to "更新了问题",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'issue_update'} %></a></li> <li><%= link_to "问题更新",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'issue_update'}, :class => "resourcesGrey" %></li>
<li><a href="javascript:void(0);" class="resourcesGrey"><%= link_to "项目讨论区",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'forge_message'} %></a></li> <li><%= link_to "项目讨论区",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'forge_message'}, :class => "resourcesGrey" %></li>
<li><a href="javascript:void(0);" class="resourcesGrey"><%= link_to "项目新闻",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'forge_news'} %></a></li> <li><%= link_to "项目新闻",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'forge_news'}, :class => "resourcesGrey" %></li>
<li><a href="javascript:void(0);" class="resourcesGrey"><%= link_to "新闻回复",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'forge_news_reply'} %></a></li> <li><%= link_to "新闻回复",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'forge_news_reply'}, :class => "resourcesGrey" %></li>
<%# 项目相关消息 %> <%# 项目相关消息 %>
<li><a href="javascript:void(0);" class="resourcesGrey"><%= link_to "贴吧帖子",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'forum'} %></a></li> <li><%= link_to "贴吧帖子",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'forum'}, :class => "resourcesGrey" %></li>
<%# 系统贴吧 %> <%# 系统贴吧 %>
<li><a href="javascript:void(0);" class="resourcesGrey"><%= link_to "用户留言",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'user_feedback'} %></a></li> <li><%= link_to "用户留言",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'user_feedback'}, :class => "resourcesGrey" %></li>
</ul> </ul>
</li> </li>
</ul> </ul>
</div> </div>
<div> <div>
<% if @new_message_count >0 %> <% if @new_message_count >0 %>
<%# 课程消息 %> <%# 课程消息 %>
<% unless @user_course_messages.nil? %> <% unless @message_alls.nil? %>
<% @user_course_messages.each do |ucm| %> <% @message_alls.each do |ma| %>
<% if ucm.course_message_type == "News" %> <% if ma.class == CourseMessage %>
<% if ma.course_message_type == "News" %>
<ul class="homepageNewsList fl"> <ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%= image_tag(url_to_avatar(ucm.course_message.author), :width => "30", :height => "30") %></a></li> <li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.course_message.author), :width => "30", :height => "30"),user_path(ma.course_message.author) %></a></li>
<li class="homepageNewsPublisher fl"><a href="javascript:void(0);" class="<%=ucm.viewed == 0?"newsBlack":"newsBlue"%>"><%= ucm.course_message.author %></a></li> <li class="homepageNewsPublisher fl"><%=link_to ma.course_message.author, user_path(ma.course_message.author), :class => "newsBlue" %></li>
<li class="<%= ucm.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">发布通知</li> <li class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">发布通知</li>
<li class="homepageNewsContent fl"> <li class="homepageNewsContent fl">
<%= link_to "#{ucm.course_message.title.html_safe}", {:controller => 'news', :action => 'show', :id => ucm.course_message.id }, <%= link_to ma.course_message.title, {:controller => 'news', :action => 'show', :id => ma.course_message.id },
:class =>"#{ucm.viewed == 0 ? "newsBlack" : "newsGrey"}", :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
:title => "#{ucm.course_message.title.html_safe}" %></li> :title => "#{ma.course_message.title}" %></li>
<li class="homepageNewsTime fl"><%= time_tag(ucm.course_message.created_on).html_safe %> </li> <li class="homepageNewsTime fl"><%= time_tag(ma.course_message.created_on).html_safe %> </li>
</ul> </ul>
<% end %> <% end %>
<% if ucm.course_message_type == "Comment" %> <% if ma.course_message_type == "Comment" %>
<ul class="homepageNewsList fl"> <ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%= image_tag(url_to_avatar(ucm.course_message.author), :width => "30", :height => "30") %></a></li> <li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.course_message.author), :width => "30", :height => "30"), user_path(ma.course_message.author) %></a></li>
<li class="homepageNewsPublisher fl"><a href="javascript:void(0);" class="newsBlue"><%= ucm.course_message.author %></a></li> <li class="homepageNewsPublisher fl"><%=link_to ma.course_message.author, user_path(ma.course_message.author), :class => "newsBlue" %></li>
<li class="<%= ucm.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">回复了通知</li> <li class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">评论了通知</li>
<li class="homepageNewsContent fl"> <li class="homepageNewsContent fl">
<%= link_to "#{ucm.course_message.comments.html_safe}", {:controller => 'news', :action => 'show', :id => ucm.course_message.commented.id }, <%= link_to ma.course_message.comments.html_safe, {:controller => 'news', :action => 'show', :id => ma.course_message.commented.id },
:class =>"#{ucm.viewed == 0 ? "newsBlack" : "newsGrey"}", :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
:title => "#{ucm.course_message.comments.html_safe}" %></li> :title => "#{ma.course_message.comments.html_safe}" %></li>
<li class="homepageNewsTime fl"><%= time_tag(ucm.course_message.created_on).html_safe %> </li> <li class="homepageNewsTime fl"><%= time_tag(ma.course_message.created_on).html_safe %> </li>
</ul> </ul>
<% end %> <% end %>
<% if ucm.course_message_type == "HomeworkCommon" %> <% if ma.course_message_type == "HomeworkCommon" %>
<ul class="homepageNewsList fl"> <ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%= image_tag(url_to_avatar(ucm.course_message.user), :width => "30", :height => "30") %></a></li> <li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user) %></a></li>
<li class="homepageNewsPublisher fl"><a href="javascript:void(0);" class="newsBlue"><%= ucm.course_message.user %></a></li> <li class="homepageNewsPublisher fl"><%=link_to ma.course_message.user, user_path(ma.course_message.user), :class => "newsBlue" %></a></li>
<li class="homepageNewsType fl">发布作业</li> <li class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">发布作业</li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey"> <li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to ("#{ucm.course_message.name}"), student_work_index_path(:homework => ucm.course_message.id),:class => "newsGrey", :title => "#{ucm.course_message.name}" %></a></li> <%= link_to ma.course_message.name, student_work_index_path(:homework => ma.course_message.id),:class => "newsGrey", :title => "#{ma.course_message.name}" %></a></li>
<li class="homepageNewsTime fl"><%= time_tag(ucm.course_message.created_at).html_safe %> </li> <li class="homepageNewsTime fl"><%= time_tag(ma.course_message.created_at).html_safe %> </li>
</ul> </ul>
<% end %> <% end %>
<% if ucm.course_message_type == "Poll" %> <% if ma.course_message_type == "Poll" %>
<ul class="homepageNewsList fl"> <ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%= image_tag(url_to_avatar(ucm.course_message.user), :width => "30", :height => "30") %></a></li> <li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user) %></a></li>
<li class="homepageNewsPublisher fl"><a href="javascript:void(0);" class="<%=ucm.viewed == 0?"newsBlack":"newsBlue"%>"><%= ucm.course_message.user %></a></li> <li class="homepageNewsPublisher fl"><%=link_to ma.course_message.user, user_path(ma.course_message.user), :class => "newsBlue" %></a></li>
<li class="<%= ucm.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">发布问卷</li> <li class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">发布问卷</li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey"> <li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to format_activity_title(" #{ucm.course_message.polls_name.nil? ? "未命名问卷" : ucm.course_message.polls_name}"), poll_index_path(:polls_type => "Course", :polls_group_id => ucm.course_id), <%= link_to format_activity_title(" #{ma.course_message.polls_name.nil? ? "未命名问卷" : ma.course_message.polls_name}"), poll_path(ma.course_message.id),
:class=>"#{ucm.viewed==0?"newsBlack":"newsGrey"}", :class=>"#{ma.viewed==0?"newsBlack":"newsGrey"}",
:title => "#{ucm.course_message.polls_name}" %></a></li> :title => "#{ma.course_message.polls_name}" %></a></li>
<li class="homepageNewsTime fl"><%= time_tag(ucm.course_message.created_at).html_safe %> </li> <li class="homepageNewsTime fl"><%= time_tag(ma.course_message.created_at).html_safe %> </li>
</ul> </ul>
<% end %> <% end %>
<% if ucm.course_message_type == "Message" %> <% if ma.course_message_type == "Message" %>
<ul class="homepageNewsList fl"> <ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%= image_tag(url_to_avatar(ucm.course_message.author), :width => "30", :height => "30") %></a></li> <li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.course_message.author), :width => "30", :height => "30"), user_path(ma.course_message.author) %></a></li>
<li class="homepageNewsPublisher fl"><a href="javascript:void(0);" class="<%=ucm.viewed == 0?"newsBlack":"newsBlue"%>"><%= ucm.course_message.author %></a></li> <li class="homepageNewsPublisher fl"><%=link_to ma.course_message.author, user_path(ma.course_message.author), :class => "newsBlue" %></li>
<% if ucm.course_message.parent_id.nil? %> <% if ma.course_message.parent_id.nil? %>
<li class="<%= ucm.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">发布帖子</li> <li class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">发布帖子</li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey"> <li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%=link_to ucm.course_message.subject.html_safe, course_boards_path(ucm.course_message.course,:parent_id => ucm.course_message.parent_id ? ucm.course_message.parent_id : ucm.course_message.id, <%=link_to ma.course_message.subject.html_safe, course_boards_path(ma.course_message.course,:parent_id => ma.course_message.parent_id ? ma.course_message.parent_id : ma.course_message.id,
:topic_id => ucm.course_message.id),:class=>"#{ucm.viewed==0?"newsBlack":"newsGrey"}", :topic_id => ma.course_message.id),:class=>"#{ma.viewed==0?"newsBlack":"newsGrey"}",
:title => "#{ucm.course_message.subject.html_safe}" %></a></li> :title => "#{ma.course_message.subject.html_safe}" %></a></li>
<li class="homepageNewsTime fl"><%= time_tag(ucm.course_message.created_on).html_safe %> </li> <li class="homepageNewsTime fl"><%= time_tag(ma.course_message.created_on).html_safe %> </li>
<% else %> <% else %>
<li class="<%= ucm.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">回复帖子</li> <li class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">回复帖子</li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey"> <li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%=link_to ucm.course_message.subject.html_safe, course_boards_path(ucm.course_message.course,:parent_id => ucm.course_message.parent_id ? ucm.course_message.parent_id : ucm.course_message.id, <%=link_to ma.course_message.subject.html_safe, course_boards_path(ma.course_message.course,:parent_id => ma.course_message.parent_id ? ma.course_message.parent_id : ma.course_message.id,
:topic_id => ucm.course_message.id),:class=>"#{ucm.viewed==0?"newsBlack":"newsGrey"}", :topic_id => ma.course_message.id),:class=>"#{ma.viewed==0?"newsBlack":"newsGrey"}",
:title => "#{ucm.course_message.subject.html_safe}" %> </a></li> :title => "#{ma.course_message.subject.html_safe}" %> </a></li>
<li class="homepageNewsTime fl"><%= time_tag(ucm.course_message.created_on).html_safe %> </li> <li class="homepageNewsTime fl"><%= time_tag(ma.course_message.created_on).html_safe %> </li>
<% end %> <% end %>
</ul> </ul>
<% end %> <% end %>
<% if ucm.course_message_type == "StudentWorksScore" %> <% if ma.course_message_type == "StudentWorksScore" %>
<ul class="homepageNewsList fl"> <ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%= image_tag(url_to_avatar(ucm.course_message.user), :width => "30", :height => "30") %></a></li> <li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user) %></a></li>
<li class="homepageNewsPublisher fl"><a href="javascript:void(0);" class="newsBlue"><%= ucm.course_message.user %></a></li> <li class="homepageNewsPublisher fl"><%=link_to ma.course_message.user, user_path(ma.course_message.user), :class => "newsBlue" %></li>
<li class="homepageNewsType fl">评阅了作品</li> <li class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>"><%= ma.status == 0 ? "评阅了作品" : "重新评阅了作品" %></li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey"> <li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to "#{ucm.course_message.comment.nil? ? "分数:"+ucm.course_message.score.to_s : "分数:"+ucm.course_message.score.to_s + "----" + "评语:" + ucm.course_message.comment}", student_work_index_path(:homework => ucm.course_message.student_work.homework_common_id),:class=>"newsGrey",:title => "#{ucm.course_message.comment}" %></a></li> <% unless ma.content.nil? %>
<li class="homepageNewsTime fl"><%= time_tag(ucm.course_message.created_at).html_safe %> </li> <%= link_to ma.content.html_safe, student_work_index_path(:homework => ma.course_message.student_work.homework_common_id),:class=>"newsGrey",:title => "#{ma.content.html_safe}" %></a></li>
<% end %>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
</ul> </ul>
<% end %> <% end %>
<% if ucm.course_message_type == "JournalsForMessage" %> <% if ma.course_message_type == "JournalsForMessage" %>
<ul class="homepageNewsList fl"> <ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%= image_tag(url_to_avatar(ucm.course_message.user), :width => "30", :height => "30") %></a></li> <li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user) %></a></li>
<li class="homepageNewsPublisher fl"><a href="javascript:void(0);" class="newsBlue"><%= ucm.course_message.user %></a></li> <li class="homepageNewsPublisher fl"><%=link_to ma.course_message.user, user_path(ma.course_message.user), :class => "newsBlue" %></li>
<li class="homepageNewsType fl">回复了作品</li> <li class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">回复了作品评论</li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey"> <li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to ucm.course_message.notes, student_work_index_path(:homework => ucm.course_message.jour.student_work.homework_common_id),:class=>"newsGrey",:title => "#{ucm.course_message.notes}" %></a></li> <%= link_to ma.course_message.notes, student_work_index_path(:homework => ma.course_message.jour.student_work.homework_common_id),:class=>"newsGrey",:title => "#{ma.course_message.notes}" %></a></li>
<li class="homepageNewsTime fl"><%= time_tag(ucm.course_message.created_on).html_safe %> </li> <li class="homepageNewsTime fl"><%= time_tag(ma.course_message.created_on).html_safe %> </li>
</ul> </ul>
<% end %> <% end %>
<div class="cl"></div>
<% end %>
<% end %> <% end %>
<!--项目消息--> <!--项目消息-->
<% unless @user_forge_messages.nil? %> <% if ma.class == ForgeMessage %>
<% @user_forge_messages.each do |ufm| %> <% if ma.forge_message_type == "Issue" %>
<% if ufm.forge_message_type == "Issue" %>
<ul class="homepageNewsList fl"> <ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"> <li class="homepageNewsPortrait fl">
<a href="javascript:void(0);"><%= image_tag(url_to_avatar(ufm.forge_message.author), :width => "30", :height => "30") %></a> <a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.forge_message.author), :width => "30", :height => "30"), user_path(ma.forge_message.author) %></a>
</li> </li>
<li class="homepageNewsPublisher fl"> <li class="homepageNewsPublisher fl">
<a href="javascript:void(0);" class="<%= ufm.viewed == 0 ? "newsBlack" : "newsBlue" %>"><%= ufm.forge_message.author %></a> <%=link_to ma.forge_message.author, user_path(ma.forge_message.author), :class => "newsBlue" %>
</li> </li>
<li class="<%= ufm.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">指派问题给我</li> <li class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">指派了问题给你</li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey"> <li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to ("#{ufm.forge_message.subject.html_safe}"), issue_path(:id => ufm.forge_message.id), :class => "#{ufm.viewed == 0 ? "newsBlack" : "newsGrey"}",:title => "#{ufm.forge_message.subject.html_safe}" %></a> <%= link_to ma.forge_message.subject, issue_path(:id => ma.forge_message.id), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",:title => "#{ma.forge_message.subject}" %></a>
</li> </li>
<li class="homepageNewsTime fl"><%= time_tag(ufm.forge_message.created_on).html_safe %> </li> <li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
</ul> </ul>
<% end %> <% end %>
<% if ufm.forge_message_type == "Journal" %> <% if ma.forge_message_type == "Journal" %>
<ul class="homepageNewsList fl"> <ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"> <li class="homepageNewsPortrait fl">
<a href="javascript:void(0);"><%= image_tag(url_to_avatar(ufm.forge_message.user), :width => "30", :height => "30") %></a> <a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.forge_message.user), :width => "30", :height => "30"), user_path(ma.forge_message.user) %></a>
</li> </li>
<li class="homepageNewsPublisher fl"> <li class="homepageNewsPublisher fl">
<a href="javascript:void(0);" class="<%= ufm.viewed == 0 ? "newsBlack" : "newsBlue" %>"><%= ufm.forge_message.user %></a> <%=link_to ma.forge_message.user, user_path(ma.forge_message.user), :class => "newsBlue" %>
</li> </li>
<li class="<%= ufm.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>"> <li class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">
更新了问题 更新了问题状态
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey"> <li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to get_issue_des_update(ufm.forge_message), <%= link_to get_issue_des_update(ma.forge_message),
issue_path(:id => ufm.forge_message.journalized_id), :class => "#{ufm.viewed == 0 ? "newsBlack" : "newsGrey"}", issue_path(:id => ma.forge_message.journalized_id), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
:title => "#{get_issue_des_update(ufm.forge_message)}" %></a> :title => "#{get_issue_des_update(ma.forge_message)}" %></a>
</li> </li>
<li class="homepageNewsTime fl"><%= time_tag(ufm.forge_message.created_on).html_safe %> </li> <li class="homepageNewsTime fl"><%= time_tag(ma.forge_message.created_on).html_safe %> </li>
</ul> </ul>
<% end %> <% end %>
<% if ufm.forge_message_type == "Message" %> <% if ma.forge_message_type == "Message" %>
<ul class="homepageNewsList fl"> <ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%= image_tag(url_to_avatar(ufm.forge_message.author), :width => "30", :height => "30") %></a></li> <li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.forge_message.author), :width => "30", :height => "30"), user_path(ma.forge_message.author) %></a></li>
<li class="homepageNewsPublisher fl"><a href="javascript:void(0);" class="<%=ufm.viewed == 0?"newsBlack":"newsBlue"%>"><%= ufm.forge_message.author %></a></li> <li class="homepageNewsPublisher fl"><%=link_to ma.forge_message.author, user_path(ma.forge_message.author), :class => "newsBlue" %></li>
<li class="<%= ufm.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>"><%= ufm.forge_message.parent_id.nil? ? "发布帖子" : "回复帖子" %></li> <li class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>"><%= ma.forge_message.parent_id.nil? ? "发布帖子" : "回复帖子" %></li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey"> <li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%=link_to ufm.forge_message.subject.html_safe, project_boards_path(ufm.forge_message.project, <%=link_to ma.forge_message.subject.html_safe, project_boards_path(ma.forge_message.project,
:parent_id => ufm.forge_message.parent_id ? ufm.forge_message.parent_id : ufm.forge_message.id, :parent_id => ma.forge_message.parent_id ? ma.forge_message.parent_id : ma.forge_message.id,
:topic_id => ufm.forge_message.id),:class=>"#{ufm.viewed==0?"newsBlack":"newsGrey"}", :topic_id => ma.forge_message.id),:class=>"#{ma.viewed==0?"newsBlack":"newsGrey"}",
:title => "#{ufm.forge_message.subject.html_safe}" %></a></li> :title => "#{ma.forge_message.subject.html_safe}" %></a></li>
<li class="homepageNewsTime fl"><%= time_tag(ufm.forge_message.created_on).html_safe %> </li> <li class="homepageNewsTime fl"><%= time_tag(ma.forge_message.created_on).html_safe %> </li>
</ul> </ul>
<% end %> <% end %>
<% if ufm.forge_message_type == "News" %> <% if ma.forge_message_type == "News" %>
<ul class="homepageNewsList fl"> <ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"> <li class="homepageNewsPortrait fl">
<a href="javascript:void(0);"><%= image_tag(url_to_avatar(ufm.forge_message.author), :width => "30", :height => "30") %></a> <a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.forge_message.author), :width => "30", :height => "30"), user_path(ma.forge_message.author) %></a>
</li> </li>
<li class="homepageNewsPublisher fl"> <li class="homepageNewsPublisher fl">
<a href="javascript:void(0);" class="newsBlue"><%= ufm.forge_message.author %></a> <%=link_to ma.forge_message.author, user_path(ma.forge_message.author), :class => "newsBlue" %>
</li> </li>
<li class="homepageNewsType fl">发布新闻</li> <li class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">发布新闻</li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey"> <li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to ("#{ufm.forge_message.title.html_safe}"), {:controller => 'news', :action => 'show', :id => ufm.forge_message.id}, :class => "newsGrey", :title => "#{ufm.forge_message.title.html_safe}" %></a> <%= link_to ("#{ma.forge_message.title.html_safe}"), {:controller => 'news', :action => 'show', :id => ma.forge_message.id}, :class => "newsGrey", :title => "#{ma.forge_message.title.html_safe}" %></a>
</li> </li>
<li class="homepageNewsTime fl"><%= time_tag(ufm.forge_message.created_on).html_safe %> </li> <li class="homepageNewsTime fl"><%= time_tag(ma.forge_message.created_on).html_safe %> </li>
</ul> </ul>
<% end %> <% end %>
<% if ufm.forge_message_type == "Comment" %> <% if ma.forge_message_type == "Comment" %>
<ul class="homepageNewsList fl"> <ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%= image_tag(url_to_avatar(ufm.forge_message.author), :width => "30", :height => "30") %></a></li> <li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.forge_message.author), :width => "30", :height => "30"), user_path(ma.forge_message.author) %></a></li>
<li class="homepageNewsPublisher fl"><a href="javascript:void(0);" class="newsBlue"><%= ufm.forge_message.author %></a></li> <li class="homepageNewsPublisher fl"><%=link_to ma.forge_message.author, user_path(ma.forge_message.author), :class => "newsBlue" %></li>
<li class="homepageNewsType fl">回复了新闻</li> <li class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">回复了新闻</li>
<li class="homepageNewsContent fl"> <li class="homepageNewsContent fl">
<%= link_to "#{ufm.forge_message.comments.html_safe}", <%= link_to "#{ma.forge_message.comments.html_safe}",
{:controller => 'news', :action => 'show', :id => ufm.forge_message.commented.id },:class =>"#{ufm.viewed == 0 ? "newsBlack" : "newsGrey"}", :title => "#{ufm.forge_message.comments.html_safe}"%></li> {:controller => 'news', :action => 'show', :id => ma.forge_message.commented.id },:class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", :title => "#{ma.forge_message.comments.html_safe}"%></li>
<li class="homepageNewsTime fl"><%= time_tag(ufm.forge_message.created_on).html_safe %> </li> <li class="homepageNewsTime fl"><%= time_tag(ma.forge_message.created_on).html_safe %> </li>
</ul> </ul>
<% end %> <% end %>
<% end %> <% end %>
<% end %> <!--公共贴吧-->
<%# 公共贴吧 %> <% if ma.class == MemoMessage %>
<% unless @user_memo_messages.nil? %> <% if ma.memo_type == "Memo" %>
<% @user_memo_messages.each do |urm| %>
<% if urm.memo_type == "Memo" %>
<ul class="homepageNewsList fl"> <ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"> <li class="homepageNewsPortrait fl">
<a href="javascript:void(0);"><%= image_tag(url_to_avatar(urm.memo.author), :width => "30", :height => "30") %></a> <a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.memo.author), :width => "30", :height => "30"), user_path(ma.memo.author) %></a>
</li> </li>
<li class="homepageNewsPublisher fl"> <li class="homepageNewsPublisher fl">
<a href="javascript:void(0);" class="newsBlue"><%= urm.memo.author %></a> <%=link_to ma.memo.author, user_path(ma.memo.author), :class => "newsBlue" %>
</li> </li>
<li class="homepageNewsType fl" >新建贴吧帖子</li> <li class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>" ><%= ma.memo.parent_id.nil? ? "在贴吧发布帖子" : "回复了贴吧帖子" %></li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey"> <li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to urm.memo.content.html_safe, forum_memo_path(urm.memo.forum_id, urm.memo.parent_id ? urm.memo.parent_id: urm.memo.id),:class => "newsGrey" , :title => "#{urm.memo.content.html_safe}" %></a> <%= link_to ma.memo.subject, forum_memo_path(ma.memo.forum_id, ma.memo.parent_id ? ma.memo.parent_id: ma.memo.id),:class => "newsGrey" , :title => "#{ma.memo.content.html_safe}" %></a>
</li> </li>
<li class="homepageNewsTime fl"><%= time_tag(urm.memo.created_at).html_safe %> </li> <li class="homepageNewsTime fl"><%= time_tag(ma.memo.created_at).html_safe %> </li>
</ul> </ul>
<% end %> <% end %>
<% end %> <% end %>
<% end %> <!--用户留言-->
<%# 用户留言消息 %> <% if ma.class == UserFeedbackMessage %>
<% unless @user_feedback_messages.nil? %> <% if ma.journals_for_message_type == "JournalsForMessage" %>
<% @user_feedback_messages.each do |ufm| %>
<% if ufm.journals_for_message_type == "JournalsForMessage" %>
<ul class="homepageNewsList fl"> <ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"> <li class="homepageNewsPortrait fl">
<a href="javascript:void(0);"><%= image_tag(url_to_avatar(ufm.journals_for_message.user), :width => "30", :height => "30") %></a> <a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.journals_for_message.user), :width => "30", :height => "30"), user_path(ma.journals_for_message.user) %></a>
</li> </li>
<li class="homepageNewsPublisher fl"> <li class="homepageNewsPublisher fl">
<a href="javascript:void(0);" class="newsBlue"><%= ufm.journals_for_message.user %></a> <%=link_to ma.journals_for_message.user, user_path(ma.journals_for_message.user), :class => "newsBlue" %>
</li> </li>
<li class="homepageNewsType fl"><%= ufm.journals_for_message.reply_id == 0 ? "给你留言了" : "回复了你的留言" %></li> <li class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>"><%= ma.journals_for_message.reply_id == 0 ? "给你留言了" : "回复了你的留言" %></li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey"> <li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to ufm.journals_for_message.notes.html_safe, feedback_path(ufm.journals_for_message.jour_id), :class => "newsGrey", :title => "#{ufm.journals_for_message.notes.html_safe}" %></a> <%= link_to ma.journals_for_message.notes.html_safe, feedback_path(ma.journals_for_message.jour_id), :class => "newsGrey", :title => "#{ma.journals_for_message.notes}" %></a>
</li> </li>
<li class="homepageNewsTime fl"><%= time_tag(ufm.journals_for_message.created_on).html_safe %> </li> <li class="homepageNewsTime fl"><%= time_tag(ma.journals_for_message.created_on).html_safe %> </li>
</ul> </ul>
<% end %> <% end %>
<% end %> <% end %>
<% end %> <% end %>
<% end %>
<!--项目消息-->
<% else %> <% else %>
<div class="flash notice">暂无消息!</div> <div class="flash notice">您目前还没有相关消息!</div>
<% end %> <% end %>
<div class="cl"></div>
</div> </div>
</div> </div>
</div>

View File

@ -24,6 +24,10 @@
<!--<div class="users_r_top">--> <!--<div class="users_r_top">-->
<!--<h2 class="users_r_h2">用户留言</h2>--> <!--<h2 class="users_r_h2">用户留言</h2>-->
<!--</div>--> <!--</div>-->
<div class="feedBack">
<div class="homepageRightBanner">
<div class="NewsBannerName">留言</div>
</div>
<div class="message_box mb10"> <div class="message_box mb10">
<div nhname='new_message' style="display:none;"> <div nhname='new_message' style="display:none;">
<%= form_for('new_form',:url => leave_user_message_path(@user.id),:method => "post") do |f|%> <%= form_for('new_form',:url => leave_user_message_path(@user.id),:method => "post") do |f|%>
@ -50,4 +54,4 @@
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div><!--message_box end--> </div><!--message_box end-->
<!--</div>--> </div>

View File

@ -262,6 +262,7 @@ RedmineApp::Application.routes.draw do
match 'account/heartbeat', to: 'account#heartbeat', :via => :get match 'account/heartbeat', to: 'account#heartbeat', :via => :get
match 'login', :to => 'account#login', :as => 'signin', :via => [:get, :post] match 'login', :to => 'account#login', :as => 'signin', :via => [:get, :post]
match 'logout', :to => 'account#logout', :as => 'signout', :via => [:get, :post] match 'logout', :to => 'account#logout', :as => 'signout', :via => [:get, :post]
match 'agreement',:to => 'account#agreement',:as => 'agreement',:via=>[:get]
match 'account/register', :via => [:get, :post], :as => 'register' match 'account/register', :via => [:get, :post], :as => 'register'
match 'account/lost_password', :via => [:get, :post], :as => 'lost_password' match 'account/lost_password', :via => [:get, :post], :as => 'lost_password'
match 'account/activate', :via => :get match 'account/activate', :via => :get
@ -365,7 +366,9 @@ RedmineApp::Application.routes.draw do
end end
match 'users/:id/user_newfeedback', :to => 'users#user_newfeedback', :via => :get, :as => "feedback" match 'users/:id/user_newfeedback', :to => 'users#user_newfeedback', :via => :get, :as => "feedback"
match 'users/:id/user_projects', :to => 'users#user_projects', :via => :get match 'users/:id/user_projects', :to => 'users#user_projects', :via => :get
match 'users/:id/user_messages', :to => 'users#user_messages', :via => :get #消息
match 'users/:id/user_messages', :to => 'users#user_messages', :via => :get, :as => "user_message"
#match 'users/:id/user_messages/:homework', :to => 'users#user_messages_homework', :via => :get, :as => "user_message_homewrok"

View File

@ -0,0 +1,11 @@
class CreateMessageAlls < ActiveRecord::Migration
def change
create_table :message_alls do |t|
t.integer :user_id
t.integer :message_id
t.string :message_type
t.timestamps
end
end
end

View File

@ -0,0 +1,5 @@
class AddContentToCourseMessage < ActiveRecord::Migration
def change
add_column :course_messages, :content, :string
end
end

View File

@ -0,0 +1,5 @@
class AddStatusToCourseMessage < ActiveRecord::Migration
def change
add_column :course_messages, :status, :integer
end
end

View File

@ -11,7 +11,7 @@
# #
# It's strongly recommended to check this file into your version control system. # It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20150820025358) do ActiveRecord::Schema.define(:version => 20150826061843) do
create_table "activities", :force => true do |t| create_table "activities", :force => true do |t|
t.integer "act_id", :null => false t.integer "act_id", :null => false
@ -374,6 +374,8 @@ ActiveRecord::Schema.define(:version => 20150820025358) do
t.integer "viewed" t.integer "viewed"
t.datetime "created_at", :null => false t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false t.datetime "updated_at", :null => false
t.string "content"
t.integer "status"
end end
create_table "course_statuses", :force => true do |t| create_table "course_statuses", :force => true do |t|
@ -867,6 +869,14 @@ ActiveRecord::Schema.define(:version => 20150820025358) do
t.integer "viewed_count", :default => 0 t.integer "viewed_count", :default => 0
end end
create_table "message_alls", :force => true do |t|
t.integer "user_id"
t.integer "message_id"
t.string "message_type"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "messages", :force => true do |t| create_table "messages", :force => true do |t|
t.integer "board_id", :null => false t.integer "board_id", :null => false
t.integer "parent_id" t.integer "parent_id"
@ -1301,7 +1311,6 @@ ActiveRecord::Schema.define(:version => 20150820025358) do
t.datetime "updated_at", :null => false t.datetime "updated_at", :null => false
t.integer "late_penalty", :default => 0 t.integer "late_penalty", :default => 0
t.integer "absence_penalty", :default => 0 t.integer "absence_penalty", :default => 0
t.integer "system_score"
end end
create_table "student_works_evaluation_distributions", :force => true do |t| create_table "student_works_evaluation_distributions", :force => true do |t|
@ -1519,6 +1528,7 @@ ActiveRecord::Schema.define(:version => 20150820025358) do
t.string "identity_url" t.string "identity_url"
t.string "mail_notification", :default => "", :null => false t.string "mail_notification", :default => "", :null => false
t.string "salt", :limit => 64 t.string "salt", :limit => 64
t.integer "gid"
end end
add_index "users", ["auth_source_id"], :name => "index_users_on_auth_source_id" add_index "users", ["auth_source_id"], :name => "index_users_on_auth_source_id"

View File

@ -512,7 +512,7 @@ a.homepageMenuText {color:#484848; font-size:16px; margin-left:20px;}
.homepageNewsPortrait {width:40px; display:block; margin-top:7px;} .homepageNewsPortrait {width:40px; display:block; margin-top:7px;}
.homepageNewsPublisher {width:80px; max-width:80px; margin-right:10px; font-size:12px; color:#15bccf; display:block; padding-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; } .homepageNewsPublisher {width:80px; max-width:80px; margin-right:10px; font-size:12px; color:#15bccf; display:block; padding-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; }
.homepageNewsType {width:95px; font-size:12px; color:#888888; display:block;} .homepageNewsType {width:95px; font-size:12px; color:#888888; display:block;}
.homepageNewsContent {width:395px; max-width:395px; margin-right:10px; font-size:12px; color:#4b4b4b; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; } .homepageNewsContent {width:395px; max-width:395px; margin-right:10px; font-size:12px; color:#4b4b4b; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;height:49px; max-height:49px; }
.homepageNewsTime {width:75px; font-size:12px; color:#888888; display:block; text-align:right;} .homepageNewsTime {width:75px; font-size:12px; color:#888888; display:block; text-align:right;}
a.homepageWhite {color:#ffffff;} a.homepageWhite {color:#ffffff;}
a.homepageWhite:hover {color:#a1ebff} a.homepageWhite:hover {color:#a1ebff}
@ -629,6 +629,22 @@ ul.list_watch{
border-bottom: 1px dashed rgb(204, 204, 204); border-bottom: 1px dashed rgb(204, 204, 204);
} }
/*留言*/
.feedBack {width:728px; background-color:#ffffff; padding:10px; border:1px solid #dddddd;float: right}
/*20150826忘记密码 LB*/
.BgBox{ width:968px; border:1px solid #dddddd; background:#fff; padding:15px; padding-top:10px;}
.BgBox_h2{ font-size:16px; color:#484848; width:968px;border-bottom:1px solid #e3e3e3; padding-bottom:5px;}
.NomalInput{width:308px; height:38px; border:1px solid #98a1a6; outline:none; color:#888888; font-size:14px;}
.BgBoxCon{ width:310px; margin:80px auto;}
.BgBoxConP{ font-size:14px; color:#484848;}
.LoginButton {width:315px; height:40px; background-color:#269ac9; font-size:14px; text-align:center; line-height:40px; vertical-align:middle;}
.LoginButton:hover {background-color:#297fb8;}
/*20150826协议 LB*/
.AgreementBox{ margin:20px 0; color:#666666; font-size:14px; line-height:1.9;}
.Agreementh4{ color:#2980b9; font-weight:bold; font-size:14px; margin-top:30px;}
/*底部*/ /*底部*/
#Footer{background-color:#ffffff; margin-bottom:10px; padding-bottom:15px; color:#666666;} #Footer{background-color:#ffffff; margin-bottom:10px; padding-bottom:15px; color:#666666;}
@ -854,6 +870,9 @@ img.ui-datepicker-trigger {
float:left; float:left;
margin: 7px; margin: 7px;
} }
/*消息*/
.homepageNewsType {width:95px; font-size:12px; color:#888888; display:block;}
.homepageNewsTypeNotRead {width:95px; font-size:12px; color:#888888; display:block;}
.calendar_input{border-left:none !important;border-bottom: none!important; border-top: none!important; border-right: 1px solid #d9d9d9;} .calendar_input{border-left:none !important;border-bottom: none!important; border-top: none!important; border-right: 1px solid #d9d9d9;}
.calendar_div{border: 1px solid #d9d9d9;} .calendar_div{border: 1px solid #d9d9d9;}
@ -885,4 +904,3 @@ img.ui-datepicker-trigger {

View File

@ -0,0 +1,8 @@
FactoryGirl.define do
factory :message_all do
user_id 1
message_id 1
message_type "MyString"
end
end

View File

@ -0,0 +1,5 @@
require 'rails_helper'
RSpec.describe MessageAll, :type => :model do
pending "add some examples to (or delete) #{__FILE__}"
end