Merge branch 'szzh' of http://repository.trustie.net/xianbo/trustie2 into szzh
This commit is contained in:
commit
b9bac42c1a
|
@ -631,6 +631,11 @@ class CoursesController < ApplicationController
|
|||
end
|
||||
|
||||
def feedback
|
||||
@course.journals_for_messages.each do |messages|
|
||||
query = messages.course_messages.where("user_id = ?", User.current.id)
|
||||
query.update_all(:viewed => true);
|
||||
end
|
||||
|
||||
if (User.current.admin? || @course.is_public == 1 || (@course.is_public == 0 && User.current.member_of_course?(@course)))
|
||||
page = params[:page]
|
||||
# Find the page of the requested reply
|
||||
|
|
|
@ -137,6 +137,7 @@ class HomeworkCommonController < ApplicationController
|
|||
|
||||
def edit
|
||||
@user = User.current
|
||||
@is_in_course = params[:is_in_course]
|
||||
respond_to do |format|
|
||||
format.html{render :layout => 'new_base_user'}
|
||||
end
|
||||
|
@ -173,15 +174,25 @@ class HomeworkCommonController < ApplicationController
|
|||
if @homework.save
|
||||
@homework_detail_manual.save if @homework_detail_manual
|
||||
@homework_detail_programing.save if @homework_detail_programing
|
||||
if params[:is_in_course] == "1"
|
||||
redirect_to homework_common_index_path(:course => @course.id)
|
||||
else
|
||||
redirect_to user_homeworks_user_path(User.current.id)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def destroy
|
||||
if @homework.destroy
|
||||
respond_to do |format|
|
||||
format.html {redirect_to user_homeworks_user_path(User.current.id)}
|
||||
format.html {
|
||||
if params[:is_in_course] == "1"
|
||||
redirect_to homework_common_index_path(:course => @course.id)
|
||||
else
|
||||
redirect_to user_homeworks_user_path(User.current.id)
|
||||
end
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -206,6 +217,9 @@ class HomeworkCommonController < ApplicationController
|
|||
end
|
||||
@homework_detail_manual.update_column('comment_status', 2)
|
||||
@statue = 1
|
||||
# 匿评开启消息邮件通知
|
||||
send_message_anonymous_comment(@homework, m_status = 2)
|
||||
Mailer.send_mail_anonymous_comment_open(@homework).deliver
|
||||
else
|
||||
@statue = 2
|
||||
end
|
||||
|
@ -224,12 +238,22 @@ class HomeworkCommonController < ApplicationController
|
|||
student_work.absence_penalty = absence_penalty_count > 0 ? absence_penalty_count * @homework_detail_manual.absence_penalty : 0
|
||||
student_work.save
|
||||
end
|
||||
|
||||
# 匿评关闭消息邮件通知
|
||||
send_message_anonymous_comment(@homework, m_status = 3)
|
||||
Mailer.send_mail_anonymous_comment_close(@homework).deliver
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
# 开启/关闭匿评消息通知
|
||||
def send_message_anonymous_comment(homework, m_status )
|
||||
# status 标记匿评状态 1为关闭 0为开启
|
||||
course = @homework.course
|
||||
course.student.each do |st|
|
||||
@homework.course_messages << CourseMessage.new(:user_id => st.student_id, :course_id => course.id, :viewed => false, :status => m_status)
|
||||
end
|
||||
end
|
||||
#提示
|
||||
def alert_anonymous_comment
|
||||
@cur_size = 0
|
||||
|
|
|
@ -33,7 +33,7 @@ class ProjectsController < ApplicationController
|
|||
before_filter :require_admin, :only => [ :copy, :archive, :unarchive, :destroy, :calendar]
|
||||
before_filter :file, :statistics #:watcherlist
|
||||
# 除非项目内人员,不可查看成员, TODO: 完了写报表里去
|
||||
before_filter :memberAccess, only: :member
|
||||
# before_filter :memberAccess, only: :member
|
||||
|
||||
# accept_rss_auth :index
|
||||
accept_api_auth :index, :show, :create, :update, :destroy
|
||||
|
@ -358,24 +358,57 @@ class ProjectsController < ApplicationController
|
|||
|
||||
end
|
||||
|
||||
# 项目邀请用户加入实现过程
|
||||
# 两种情况:1、系统外用户;2、系统内用户 (通过邮件判定)
|
||||
def send_mail_to_member
|
||||
# 该邮箱未注册过
|
||||
if !params[:mail].blank? && User.find_by_mail(params[:mail].to_s).nil?
|
||||
email = params[:mail]
|
||||
Mailer.run.send_invite_in_project(email, @project, User.current)
|
||||
@is_zhuce = false
|
||||
flash[:notice] = l(:notice_email_sent, :value => email)
|
||||
elsif !User.find_by_mail(params[:mail].to_s).nil?
|
||||
user = User.find_by_mail(params[:mail].to_s)
|
||||
if !User.where("login =?", params[:mail]).first.nil?
|
||||
# 用户名唯一,用户修改邮箱,未修改用户名,用户名等同邮箱的情况,默认改用户已经注册
|
||||
user = User.find_by_login(params[:mail].to_s)
|
||||
if !user.member_of?(@project)
|
||||
# 如果已经邀请过该用户,则不重复发送
|
||||
if InviteList.where("project_id =? and mail =?", @project.id, params[:mail].to_s).first.nil?
|
||||
email = params[:mail]
|
||||
Mailer.run.request_member_to_project(email, @project, User.current)
|
||||
Mailer.request_member_to_project(email, @project, User.current).deliver
|
||||
flash[:notice] = l(:notice_email_sent, :value => email)
|
||||
else
|
||||
flash[:error] = l(:notice_email_invited)
|
||||
end
|
||||
else
|
||||
flash[:error] = l(:label_member_of_project, :value => email)
|
||||
end
|
||||
else
|
||||
email = params[:mail]
|
||||
Mailer.send_invite_in_project(email, @project, User.current).deliver
|
||||
@is_zhuce = false
|
||||
flash[:notice] = l(:notice_email_sent, :value => email)
|
||||
end
|
||||
|
||||
# 邮箱地址已被注册
|
||||
elsif !User.find_by_mail(params[:mail].to_s).nil?
|
||||
user = User.find_by_mail(params[:mail].to_s)
|
||||
if !user.member_of?(@project)
|
||||
# 如果已经邀请过该用户,则不重复发送
|
||||
invite_list = InviteList.where("project_id =? and mail =?", @project.id, params[:mail].to_s).first
|
||||
if invite_list.nil?
|
||||
email = params[:mail]
|
||||
Mailer.request_member_to_project(email, @project, User.current).deliver
|
||||
flash[:notice] = l(:notice_email_sent, :value => email)
|
||||
else
|
||||
# 已经发送过了,则隔3小时才能再次发送
|
||||
if Time.now - invite_list.created_at > 10800
|
||||
email = params[:mail]
|
||||
Mailer.request_member_to_project(email, @project, User.current).deliver
|
||||
flash[:notice] = l(:notice_email_sent, :value => email)
|
||||
else
|
||||
flash[:error] = l(:notice_email_invited)
|
||||
end
|
||||
end
|
||||
else
|
||||
flash[:error] = l(:label_member_of_project, :value => email)
|
||||
end
|
||||
else
|
||||
flash[:error] = l(:notice_registed_error, :value => email)
|
||||
@is_zhuce = true
|
||||
end
|
||||
respond_to do |format|
|
||||
|
@ -383,25 +416,26 @@ class ProjectsController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
#发送邮件邀请新用户
|
||||
# 发送邮件邀请新用户页面对应方法
|
||||
def invite_members_by_mail
|
||||
if User.current.member_of?(@project) || User.current.admin?
|
||||
@inviter_lists = InviteList.where(project_id:@project.id).all
|
||||
@inviters = []
|
||||
@waiters = []
|
||||
unless @inviter_lists.blank?
|
||||
@inviter_lists.each do|inviter_list|
|
||||
unless inviter_list.user.nil?
|
||||
if inviter_list.user.member_of?(@project)
|
||||
@inviters << inviter_list.user
|
||||
@inviters_count = @inviters.size
|
||||
else
|
||||
@waiters << inviter_list.user
|
||||
@waiters_count = @waiters.size
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@inviter_lists = InviteList.where(project_id:@project.id).order("created_at desc")
|
||||
|
||||
# @inviters = []
|
||||
# @waiters = []
|
||||
# unless @inviter_lists.blank?
|
||||
# @inviter_lists.each do|inviter_list|
|
||||
# unless inviter_list.user.nil?
|
||||
# if inviter_list.user.member_of?(@project)
|
||||
# @inviters << inviter_list.user
|
||||
# @inviters_count = @inviters.size
|
||||
# else
|
||||
# @waiters << inviter_list.user
|
||||
# @waiters_count = @waiters.size
|
||||
# end
|
||||
# end
|
||||
# end
|
||||
# end
|
||||
@is_zhuce = false
|
||||
respond_to do |format|
|
||||
format.html
|
||||
|
@ -413,16 +447,16 @@ class ProjectsController < ApplicationController
|
|||
end
|
||||
|
||||
# 邀请Trustie注册用户
|
||||
def invite_members
|
||||
if User.current.member_of?(@project) || User.current.admin?
|
||||
@member ||= @project.members.new
|
||||
respond_to do |format|
|
||||
format.html
|
||||
end
|
||||
else
|
||||
render_403
|
||||
end
|
||||
end
|
||||
# def invite_members
|
||||
# if User.current.member_of?(@project) || User.current.admin?
|
||||
# @member ||= @project.members.new
|
||||
# respond_to do |format|
|
||||
# format.html
|
||||
# end
|
||||
# else
|
||||
# render_403
|
||||
# end
|
||||
# end
|
||||
|
||||
def edit
|
||||
end
|
||||
|
@ -430,6 +464,10 @@ class ProjectsController < ApplicationController
|
|||
# by young
|
||||
# include CoursesHelper
|
||||
def member
|
||||
# 消息"同意加入项目"
|
||||
if params[:message_id]
|
||||
message_invite(params[:message_id], params[:key])
|
||||
end
|
||||
# params[:login]为邮箱邀请用户加入,主要功能:
|
||||
# 1、自动注册
|
||||
# 2、加入项目、创建角色
|
||||
|
@ -451,6 +489,10 @@ class ProjectsController < ApplicationController
|
|||
flash[:notice] = l(:label_mail_invite_success)
|
||||
end
|
||||
end
|
||||
# 私有项目非项目成员无法访问成员列表
|
||||
unless @project.is_public?
|
||||
return render_403 unless User.current.member_of?(@project)
|
||||
end
|
||||
## 有角色参数的才是课程,没有的就是项目
|
||||
@render_file = 'project_member_list'
|
||||
# 判断是否课程
|
||||
|
@ -481,6 +523,14 @@ class ProjectsController < ApplicationController
|
|||
@members = paginateHelper @members
|
||||
end
|
||||
|
||||
def message_invite(message_id, key)
|
||||
forge_message = ForgeMessage.find(message_id)
|
||||
if key == forge_message.secret_key
|
||||
Member.create(:role_ids => [4], :user_id => forge_message.user_id, :project_id => forge_message.project_id)
|
||||
UserGrade.create(:user_id => forge_message.user_id, :project_id => forge_message.project_id)
|
||||
end
|
||||
end
|
||||
|
||||
#判断指定用户是否为课程教师
|
||||
def isCourseTeacher(id)
|
||||
result = false
|
||||
|
|
|
@ -38,14 +38,15 @@ class SystemMessagesController < ApplicationController
|
|||
return
|
||||
end
|
||||
@system_messages = SystemMessage.new
|
||||
@system_messages.content = params[:system_message][:content]
|
||||
@system_messages.description = params[:system_message][:description]
|
||||
@system_messages.subject = params[:system_message][:subject]
|
||||
@system_messages.user_id = User.current.id
|
||||
respond_to do |format|
|
||||
if @system_messages.save
|
||||
format.html {redirect_to user_message_path(User.current, :type => "system_messages")}
|
||||
format.html {redirect_to user_system_messages_path(User.current)}
|
||||
flash[:notice] = l(:notice_successful_message)
|
||||
else
|
||||
if params[:system_message][:content].empty?
|
||||
if params[:system_messages][:description].empty?
|
||||
flash[:error] = l(:label_content_blank_fail)
|
||||
else
|
||||
flash[:error] = l(:label_admin_message_fail)
|
||||
|
|
|
@ -40,7 +40,7 @@ class UsersController < ApplicationController
|
|||
:activity_score_index, :influence_score_index, :score_index,:show_new_score, :topic_new_score_index, :project_new_score_index,
|
||||
:activity_new_score_index, :influence_new_score_index, :score_new_index,:user_projects_index,:user_resource,
|
||||
:user_courses4show,:user_projects4show,:user_course_activities,:user_project_activities,:user_feedback4show,:user_visitorlist,:user_messages,:edit_brief_introduction,
|
||||
:user_import_homeworks,:user_search_homeworks,:user_import_resource]
|
||||
:user_import_homeworks,:user_search_homeworks,:user_import_resource, :user_system_messages]
|
||||
before_filter :auth_user_extension, only: :show
|
||||
#before_filter :rest_user_score, only: :show
|
||||
#before_filter :select_entry, only: :user_projects
|
||||
|
@ -101,18 +101,20 @@ class UsersController < ApplicationController
|
|||
end
|
||||
# 记录当前点击按钮的时间
|
||||
# 考虑到用户未退出刷新消息页面
|
||||
if OnclickTime.where("user_id =?", User.current).first.nil?
|
||||
message_time = OnclickTime.where("user_id =?", User.current).first
|
||||
if message_time.nil?
|
||||
message_new_time = OnclickTime.new
|
||||
message_new_time.user_id = User.current.id
|
||||
message_new_time.onclick_time = Time.now
|
||||
message_new_time.save
|
||||
else
|
||||
message_new_time = OnclickTime.where("user_id =?", User.current).first
|
||||
message_last_time = message_new_time.onclick_time
|
||||
message_new_time.update_attributes(:onclick_time => Time.now)
|
||||
# 24小时内显示
|
||||
contrast_time = Time.now - 86400
|
||||
message_time.update_attributes(:onclick_time => Time.now)
|
||||
end
|
||||
@user_system_messages = SystemMessage.where("created_at >?", message_last_time).order("created_at desc")
|
||||
@user_system_messages = SystemMessage.where("created_at >?", contrast_time).order("created_at desc")
|
||||
# 当前用户查看消息,则设置消息为已读
|
||||
# DO 待优化,只需查出符合条件的再更新
|
||||
if params[:viewed] == "all"
|
||||
course_querys = @user.course_messages
|
||||
forge_querys = @user.forge_messages
|
||||
|
@ -142,8 +144,8 @@ class UsersController < ApplicationController
|
|||
@message_alls << message_all.message
|
||||
end
|
||||
end
|
||||
when 'system_messages'
|
||||
@message_alls = SystemMessage.order("created_at desc").all
|
||||
# when 'system_messages'
|
||||
# @message_alls = SystemMessage.order("created_at desc").all
|
||||
when 'apply'
|
||||
@message_alls = ForgeMessage.where("forge_message_type =? and user_id =?" , "AppliedProject", @user).order("created_at desc")
|
||||
when 'homework'
|
||||
|
@ -193,6 +195,15 @@ class UsersController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
# 系统消息
|
||||
def user_system_messages
|
||||
@sytem_messages = SystemMessage.order("created_at desc").all
|
||||
@sytem_messages = paginateHelper @sytem_messages, 10
|
||||
respond_to do |format|
|
||||
format.html{render :layout=>'new_base_user'}
|
||||
end
|
||||
end
|
||||
|
||||
def user_projects_index
|
||||
if User.current.admin?
|
||||
memberships = @user.memberships.all(conditions: "projects.project_type = #{Project::ProjectType_project}").first
|
||||
|
@ -622,12 +633,11 @@ class UsersController < ApplicationController
|
|||
redirect_to signin_url
|
||||
return
|
||||
end
|
||||
# 更新用户留言消息状态
|
||||
@user.journals_for_messages.each do |jour_message|
|
||||
jour_message.user_feedback_messages.each do |userfeedback_message|
|
||||
if User.current.id == userfeedback_message.user_id
|
||||
userfeedback_message.update_attributes(:viewed => true)
|
||||
end
|
||||
# 自己访问自己的页面才更新消息状态
|
||||
if User.current == @user
|
||||
journals_messages = UserFeedbackMessage.where("user_id =? and journals_for_message_type =? and viewed =?", User.current.id, "JournalsForMessage", 0)
|
||||
journals_messages.each do |journals_message|
|
||||
journals_message.update_attributes(:viewed => true)
|
||||
end
|
||||
end
|
||||
# end
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
require 'zip'
|
||||
require 'zip'
|
||||
class ZipdownController < ApplicationController
|
||||
#查找项目(课程)
|
||||
before_filter :find_project_by_bid_id, :only => [:assort]
|
||||
|
|
|
@ -2368,7 +2368,7 @@ module ApplicationHelper
|
|||
end
|
||||
|
||||
def student_anonymous_comment homework
|
||||
if homework.homework_type == 1 && homework.homework_detail_manual
|
||||
if homework.homework_detail_manual
|
||||
case homework.homework_detail_manual.comment_status
|
||||
when 1
|
||||
"<span class='fr mr10 pr_join_span '>未开启匿评</span>".html_safe
|
||||
|
@ -2377,10 +2377,6 @@ module ApplicationHelper
|
|||
when 3
|
||||
"<span class='fr mr10 pr_join_span '>匿评已结束</span>".html_safe
|
||||
end
|
||||
elsif homework.homework_type == 0
|
||||
"<span class='fr mr10 pr_join_span '>未启用匿评</span>".html_safe
|
||||
elsif homework.homework_type == 2
|
||||
"<span class='fr mr10 pr_join_span '> 编程作业 </span>".html_safe
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -76,6 +76,17 @@ module ProjectsHelper
|
|||
return result
|
||||
end
|
||||
|
||||
# 被邀请成员的状态
|
||||
def status_for_ivitied(ivite_list, project)
|
||||
if ivite_list.user.member_of?(project)
|
||||
value = "已经加入了项目!"
|
||||
elsif ivite_list.user.active?
|
||||
value = "邀请已发送,等待用户加入!"
|
||||
else
|
||||
value = "邀请已发送,等待用户激活账号!"
|
||||
end
|
||||
end
|
||||
|
||||
# Added by young
|
||||
def course_settings_tabs
|
||||
tabs = [{:name => 'info', :action => :edit_project, :partial => 'projects/edit', :label => :label_information_plural, :course=>'1'},
|
||||
|
|
|
@ -6,7 +6,7 @@ module StudentWorkHelper
|
|||
def user_projects_option
|
||||
projects = User.current.projects.visible
|
||||
not_have_project = []
|
||||
not_have_project << "没有可选项目,请直接为本作品创建一个项目"
|
||||
not_have_project << "请选择关联项目"
|
||||
not_have_project << 0
|
||||
type = []
|
||||
type << not_have_project
|
||||
|
|
|
@ -8,7 +8,7 @@ class ForgeMessage < ActiveRecord::Base
|
|||
TYPE_OF_WIKI_ACT = "Wiki"
|
||||
TYPE_OF_NEWS_ACT = "News"
|
||||
|
||||
attr_accessible :forge_message_id, :forge_message_type, :project_id, :user_id, :viewed
|
||||
attr_accessible :forge_message_id, :forge_message_type, :project_id, :user_id, :viewed, :secret_key
|
||||
|
||||
belongs_to :forge_message ,:polymorphic => true
|
||||
belongs_to :project
|
||||
|
|
|
@ -4,6 +4,6 @@ class HomeworkDetailPrograming < ActiveRecord::Base
|
|||
belongs_to :homework_common
|
||||
|
||||
def language_name
|
||||
%W(c c++).at(self.language.to_i - 1)
|
||||
%W(C C++).at(self.language.to_i - 1)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
class InviteList < ActiveRecord::Base
|
||||
attr_accessible :project_id, :user_id
|
||||
attr_accessible :project_id, :user_id, :mail
|
||||
belongs_to :user
|
||||
belongs_to :project
|
||||
|
||||
|
|
|
@ -190,13 +190,45 @@ class JournalsForMessage < ActiveRecord::Base
|
|||
end
|
||||
end
|
||||
|
||||
# 课程作品留言消息通知
|
||||
# 课程/作品回复 留言消息通知
|
||||
def act_as_course_message
|
||||
if self.jour_type == 'StudentWorksScore'
|
||||
if self.user_id != self.jour.user_id
|
||||
self.course_messages << CourseMessage.new(:user_id => self.jour.user_id,:course_id => self.jour.student_work.homework_common.course.id, :viewed => false)
|
||||
end
|
||||
end
|
||||
# 课程留言
|
||||
if self.jour_type == 'Course'
|
||||
receivers = []
|
||||
teachers = []
|
||||
# 获取课程的老师
|
||||
self.jour.members.each do |m|
|
||||
if m.user.allowed_to?(:as_teacher, self.jour)
|
||||
teachers << m
|
||||
end
|
||||
end
|
||||
if self.reply_id == 0 # 主留言,即不是回复某条留言
|
||||
teachers.each do |teacher|
|
||||
if teacher.user_id != self.user_id
|
||||
receivers << teacher.user_id
|
||||
end
|
||||
end
|
||||
else # 留言回复
|
||||
reply_to = User.find(self.reply_id)
|
||||
if self.user_id != self.reply_id # 添加我回复的那个人
|
||||
receivers << reply_to.id
|
||||
end
|
||||
# 给老师发送。 过滤条件:老师自己给自己发;回复对象为老师则排除改老师
|
||||
teachers.each do |teacher|
|
||||
if teacher.user_id != self.user_id && self.reply_id != teacher.user_id
|
||||
receivers << teacher.user_id
|
||||
end
|
||||
end
|
||||
end
|
||||
receivers.each do |r|
|
||||
self.course_messages << CourseMessage.new(:user_id => r, :course_id => self.jour.id, :viewed => false)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# 用户留言消息通知
|
||||
|
|
|
@ -47,8 +47,44 @@ class Mailer < ActionMailer::Base
|
|||
MailerProxy.new(self)
|
||||
end
|
||||
|
||||
# 作业匿评开启
|
||||
def send_mail_anonymous_comment_open(homework_common)
|
||||
course = homework_common.course
|
||||
recipients ||= []
|
||||
course.student.each do |student|
|
||||
user = User.find(student.student_id)
|
||||
@subject = "#{l(:mail_homework)}#{homework_common.name} #{l(:mail_anonymous_comment_open)}"
|
||||
@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_name = homework_common.name
|
||||
@author = homework_common.user
|
||||
#收件人邮箱
|
||||
recipients << user.mail
|
||||
end
|
||||
mail :to => recipients,
|
||||
:subject => @subject
|
||||
end
|
||||
|
||||
# 作业匿评关闭
|
||||
def send_mail_anonymous_comment_close(homework_common)
|
||||
course = homework_common.course
|
||||
recipients ||= []
|
||||
course.student.each do |student|
|
||||
user = User.find(student.student_id)
|
||||
@subject = "#{l(:mail_homework)}#{homework_common.name} #{l(:mail_anonymous_comment_open)}"
|
||||
@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_name = homework_common.name
|
||||
@author = homework_common.user
|
||||
#收件人邮箱
|
||||
recipients << user.mail
|
||||
end
|
||||
mail :to => recipients,
|
||||
:subject => @subject
|
||||
end
|
||||
|
||||
# author: alan
|
||||
# 发送邀请未注册用户加入项目邮件
|
||||
# 邀请未注册用户加入项目
|
||||
# 功能: 在加入项目的同时自动注册用户
|
||||
def send_invite_in_project(email, project, invitor)
|
||||
@email = email
|
||||
|
@ -59,8 +95,8 @@ class Mailer < ActionMailer::Base
|
|||
login = login.sub(/%40/,'@')
|
||||
us = UsersService.new
|
||||
# 自动激活用户
|
||||
user = us.register_auto(login, @email, @password)
|
||||
InviteList.create(:user_id => user.id, :project_id => project.id)
|
||||
user = us.register_auto(login, email, @password)
|
||||
InviteList.create(:user_id => user.id, :project_id => project.id, :mail =>email)
|
||||
User.current = user unless User.current.nil?
|
||||
@user = user
|
||||
@token = Token.get_token_from_user(user, 'autologin')
|
||||
|
@ -76,15 +112,23 @@ class Mailer < ActionMailer::Base
|
|||
@project_name = "#{project.name}"
|
||||
@user = user
|
||||
@project = project
|
||||
inviter_lists = InviteList.where(project_id:@project.id, user_id:@user.id).all
|
||||
if inviter_lists.blank?
|
||||
InviteList.create(:user_id => user.id, :project_id => project.id)
|
||||
if InviteList.where("project_id= ? and user_id =? and mail =?", project.id, @user.id, email).first.nil?
|
||||
InviteList.create(:user_id => user.id, :project_id => project.id, :mail => email)
|
||||
end
|
||||
@token = Token.get_token_from_user(user, 'autologin')
|
||||
@project_url = url_for(:controller => 'projects', :action => 'member', :id => project.id, :user_id => user.id, :mail => true, :token => @token.value)
|
||||
# 发送消息邀请
|
||||
send_message_request_member(user,project)
|
||||
# end
|
||||
mail :to => email, :subject => @subject
|
||||
end
|
||||
|
||||
# 邀请信息消息 注:forge_message_id 为邀请人ID(特殊情况)
|
||||
def send_message_request_member(user, project)
|
||||
key = newpass(6).to_s
|
||||
ForgeMessage.create(:user_id => user.id, :project_id => project.id, :forge_message_type => "ProjectInvite",:forge_message_id => User.current.id, :viewed => false, :secret_key =>key)
|
||||
end
|
||||
|
||||
# author: alan
|
||||
# 根据用户选择发送个人日报或周报
|
||||
# 发送内容: 项目【缺陷,讨论区,新闻】,课程【通知,留言,新闻】, 贴吧, 个人留言
|
||||
|
@ -208,6 +252,20 @@ class Mailer < ActionMailer::Base
|
|||
mail :to => user.mail,:subject => subject if has_content
|
||||
end
|
||||
|
||||
# 作业截止时间邮件提醒
|
||||
def homework_endtime__added(homework_common, user_id)
|
||||
user = User.find(user_id)
|
||||
@subject = "#{l(:mail_homework)}#{homework_common.name}#{l(:mail_homework_endtime)} "
|
||||
@token = Token.get_token_from_user(user, 'autologin')
|
||||
@homework_endtime_url = url_for(student_work_index_url(:homework => homework_common.id, :token => @token.value))
|
||||
@homework_endtime_name = homework_common.name
|
||||
@author = homework_common.user
|
||||
#收件人邮箱
|
||||
recipient = user.mail
|
||||
mail :to => recipient,
|
||||
:subject => "#{l(:mail_homework)}#{homework_common.name}#{l(:mail_homework_endtime)} "
|
||||
end
|
||||
|
||||
# 公共讨论区发帖、回帖添加邮件发送信息
|
||||
def forum_message_added(memo)
|
||||
@memo = memo
|
||||
|
|
|
@ -30,6 +30,9 @@ class Member < ActiveRecord::Base
|
|||
validate :validate_role
|
||||
|
||||
before_destroy :set_issue_category_nil
|
||||
# 删除项目成员一并删除该成员的邀请记录
|
||||
after_destroy :delete_ivite_list
|
||||
|
||||
|
||||
def role
|
||||
end
|
||||
|
@ -97,6 +100,16 @@ class Member < ActiveRecord::Base
|
|||
end
|
||||
end
|
||||
|
||||
# 删除成员一并删除该成员的邀请信息
|
||||
def delete_ivite_list
|
||||
member_invite_lists = InviteList.where("user_id =? and project_id =?", self.user_id, self.project_id)
|
||||
unless member_invite_lists.nil?
|
||||
member_invite_lists.each do |member_invite_list|
|
||||
member_invite_list.destroy
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# Find or initilize a Member with an id, attributes, and for a Principal
|
||||
def self.edit_membership(id, new_attributes, principal=nil)
|
||||
@membership = id.present? ? Member.find(id) : Member.new(:principal => principal)
|
||||
|
|
|
@ -66,8 +66,8 @@ class Project < ActiveRecord::Base
|
|||
# has_many :students_for_courses, :dependent => :destroy
|
||||
has_many :student, :through => :students_for_courses, :source => :user
|
||||
has_one :course_extra, :class_name => 'Course', :foreign_key => :extra,:primary_key => :identifier, :dependent => :destroy
|
||||
has_many :applied_projects
|
||||
has_many :invite_lists
|
||||
has_many :applied_projects, :dependent => :destroy
|
||||
has_many :invite_lists, :dependent => :destroy
|
||||
has_one :dts
|
||||
|
||||
# end
|
||||
|
|
|
@ -31,9 +31,8 @@ class StudentWork < ActiveRecord::Base
|
|||
else
|
||||
self.system_score = last_test.test_score
|
||||
end
|
||||
set_final_score self.homework_common,self
|
||||
end
|
||||
|
||||
set_final_score self.homework_common,self
|
||||
end
|
||||
def set_src
|
||||
self.description = last_test.src if last_test
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
class SystemMessage < ActiveRecord::Base
|
||||
attr_accessible :content, :id, :user_id
|
||||
attr_accessible :content, :id, :user_id, :description, :subject
|
||||
belongs_to :user
|
||||
|
||||
validates :content, presence: true
|
||||
validates_length_of :content, maximum: 255
|
||||
validates :subject, presence: true
|
||||
# validates :description, presence: true
|
||||
validates_length_of :description, maximum: 10000
|
||||
end
|
||||
|
|
|
@ -140,7 +140,7 @@ class User < Principal
|
|||
has_many :issue_assigns, :class_name => 'ForgeMessage', :conditions => 'viewed=0 and forge_message_type="Issue"'
|
||||
has_many :status_updates, :class_name => 'ForgeMessage', :conditions => 'viewed=0 and forge_message_type="Journal"'
|
||||
# 邮件邀请状态
|
||||
# has_many :invite_lists
|
||||
has_many :invite_lists, :dependent => :destroy
|
||||
# end
|
||||
|
||||
######added by nie
|
||||
|
@ -213,6 +213,8 @@ class User < Principal
|
|||
# added by fq
|
||||
after_create :act_as_activity, :add_onclick_time
|
||||
# end
|
||||
# 更新邮箱用户或用户名的同事,同步更新邀请信息
|
||||
after_update :update_invite_list
|
||||
|
||||
scope :in_group, lambda {|group|
|
||||
group_id = group.is_a?(Group) ? group.id : group.to_i
|
||||
|
@ -1010,6 +1012,16 @@ class User < Principal
|
|||
end
|
||||
end
|
||||
|
||||
# 更新邮箱的同事,更新invite_lists表中的邮箱信息
|
||||
def update_invite_list
|
||||
invite_lists = InviteList.where("user_id =?",self.id).all
|
||||
unless invite_lists.blank?
|
||||
invite_lists.each do |invite_list|
|
||||
invite_list.update_attribute(:mail, self.mail)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# Removes references that are not handled by associations
|
||||
# Things that are not deleted are reassociated with the anonymous user
|
||||
def remove_references_before_destroy
|
||||
|
|
|
@ -3,11 +3,17 @@
|
|||
<%=l(:label_system_message)%>
|
||||
</h3><br/>
|
||||
<div style="padding-top: 20px; padding-left: 5px;">
|
||||
<%= form_for(@admin_messages, :html => {:id =>'system_message-form'}) do |f| %>
|
||||
<div class="field">
|
||||
<%= f.kindeditor :content,:width=>'87%',:editor_id=>'system_message_editor' %>
|
||||
<%= form_for(@admin_messages, :html => {:id =>'system_messages-form'}) do |f| %>
|
||||
<li>
|
||||
<label><span class="">*</span> <%= l(:field_title) %> :</label>
|
||||
<input type="text" name="system_message[subject]" class="hwork_input_news" id="system_message_subject" width="576px" onblur="regexTitle($(this));" maxlength="255" placeholder="255个字符以内" value="">
|
||||
<p id="title_notice_span" class="ml55"></p>
|
||||
</li>
|
||||
<li>
|
||||
<label class="fl" > <span class="c_red"></span> <%= l(:field_description) %> :</label>
|
||||
<%= f.kindeditor :description,:width=>'87.5%',:editor_id=>'system_message_editor' %>
|
||||
<p id="content_notice_span" class="ml55"></p>
|
||||
</div>
|
||||
</li>
|
||||
<div>
|
||||
<p id="content_notice_span" class="ml55"></p>
|
||||
</div>
|
||||
|
@ -19,14 +25,8 @@
|
|||
<script>
|
||||
function system_message_length() {
|
||||
var obj = system_message_editor.html();
|
||||
if (obj.length == 0) {
|
||||
$("#content_notice_span").text("内容不能为空");
|
||||
$("#content_notice_span").css('color', '#ff0000');
|
||||
$("#content_notice_span").focus();
|
||||
return false;
|
||||
}
|
||||
else if (obj.length > 255) {
|
||||
$("#content_notice_span").text("内容过长,超过255个字符");
|
||||
if (obj.length > 10000) {
|
||||
$("#content_notice_span").text("内容过长,超过10000个字符");
|
||||
$("#content_notice_span").css('color', '#ff0000');
|
||||
$("#content_notice_span").focus();
|
||||
return false;
|
||||
|
@ -37,10 +37,27 @@
|
|||
return true;
|
||||
}
|
||||
}
|
||||
function regexTitle(obj){
|
||||
var title = obj.val();
|
||||
if(title.length == 0)
|
||||
{
|
||||
$("#title_notice_span").text("标题不能为空").css("color", "#ff0000").focus();
|
||||
return false;
|
||||
}
|
||||
else if(title.length > 255)
|
||||
{
|
||||
$("#title_notice_span").text("标题长度过长,不能超过255个字符").css("color", "#ff0000").focus();
|
||||
return false;
|
||||
}
|
||||
else{
|
||||
$("#title_notice_span").text("填写正确").css("color", "#008000");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
function submit_message() {
|
||||
|
||||
if (system_message_length()) {
|
||||
$("#system_message-form").submit();
|
||||
if (system_message_length() && regexTitle($("#system_message_subject"))) {
|
||||
$("#system_messages-form").submit();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
<!-- 老师身份才可以发布作业 -->
|
||||
<div class="HomeWork mb10">
|
||||
<%= form_for @homework do |f| %>
|
||||
<input type="text" name="is_in_course" class="none" value="<%= @is_in_course%>"/>
|
||||
<div id="HomeWorkCon">
|
||||
<%= render :partial => 'users/user_homework_form', :locals => { :homework => @homework,:f => f,:edit_mode => true } %>
|
||||
</div>
|
||||
|
|
|
@ -26,8 +26,8 @@
|
|||
</p>
|
||||
<% if @is_teacher%>
|
||||
<%= homework_anonymous_comment(homework)%>
|
||||
<%= link_to(l(:label_bid_respond_delete), homework_common_path(homework),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "fr mr10 work_edit") %>
|
||||
<%= link_to(l(:button_edit),edit_homework_common_path(homework), :class => "fr mr10 work_edit") %>
|
||||
<%= link_to(l(:label_bid_respond_delete), homework_common_path(homework,:is_in_course => 1),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "fr mr10 work_edit") %>
|
||||
<%= link_to(l(:button_edit),edit_homework_common_path(homework,:is_in_course => 1), :class => "fr mr10 work_edit") %>
|
||||
<% elsif @is_student%>
|
||||
<%= student_anonymous_comment homework %>
|
||||
<%= student_new_homework homework %>
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<h3><%=h @issue.tracker %> #<%= @issue.id %></h3>
|
||||
<p>由<%= @journal.user %> 更新于 <%= format_time @journal.created_on %></p>
|
||||
|
||||
<div class="text-diff">
|
||||
<%= simple_format_without_paragraph @diff.to_html %>
|
||||
<div class="text-diff" style="word-break:break-all; word-wrap:break-word;">
|
||||
<%= @diff.to_html.gsub("<","<").gsub(">",">").gsub(""","\"").gsub("&gt;", ">").gsub("&lt;", "<").gsub("&quot;", "\"").html_safe %>
|
||||
</div>
|
||||
|
||||
<p><%= link_to l(:button_back), issue_path(@issue), :onclick => 'history.back(); return false;' %></p>
|
||||
|
|
|
@ -36,21 +36,6 @@
|
|||
<%#= render :partial => 'layouts/new_header'%>
|
||||
<div class="cl"></div>
|
||||
|
||||
<!--TopBar begin-->
|
||||
<div id="TopBar">
|
||||
<div class="topbar_info02 fl">
|
||||
<h2>
|
||||
<a href="http://<%= Setting.host_name %>" target="_blank" class="c_blue">
|
||||
<%= l(:label_projects_community) %>
|
||||
</a>
|
||||
</h2>
|
||||
<p class="hidden">
|
||||
<%= l(:label_user_location) %> :
|
||||
<%= link_to l(:field_homepage), home_path %> > <a href="http://<%= Setting.host_name %>"><%=l(:label_project_hosting_platform) %> </a>><%= link_to @project.name, project_path(@project.id) %>
|
||||
</p>
|
||||
</div>
|
||||
</div><!--TopBar end-->
|
||||
|
||||
<div id="content">
|
||||
<div id="LSide" class="fl">
|
||||
<div class="project_info">
|
||||
|
@ -113,9 +98,9 @@
|
|||
</div>
|
||||
<ul class="navContent " style="display:block" id="navContent_invit">
|
||||
<li><%= link_to l(:label_invite_new_user), :controller=>"projects", :action=>"invite_members_by_mail", :id => @project %></li>
|
||||
<% if User.current.allowed_to?(:manage_members, @project) %>
|
||||
<li><%= link_to l(:label_invite_trustie_user), :controller=>"projects", :action=>"invite_members", :id => @project %></li>
|
||||
<% end %>
|
||||
<!--<%# if User.current.allowed_to?(:manage_members, @project) %>-->
|
||||
<!--<li><%#= link_to l(:label_invite_trustie_user), :controller=>"projects", :action=>"invite_members", :id => @project %></li>-->
|
||||
<!--<%# end %>-->
|
||||
</ul>
|
||||
<% end %><!--end-->
|
||||
<!--menu 左侧工具栏 -->
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
<div class="mail_box" style="border:1px solid #c8c8c8; width:570px; height: auto; padding:15px; margin-top:10px; margin-bottom:10px;">
|
||||
<ul style="list-style-type:none; margin:0; padding:0;">
|
||||
<li style="list-style-type:none; margin:0; padding:0;"><span style="float: left;"><strong><%= l(:mail_issue_content)%></strong></span>
|
||||
<span style="float: left; width: 526px">
|
||||
<p><%=link_to @author, user_url(@author) %> 发布的作业:<%=link_to @homework_endtime_name, @homework_endtime_url%> <span style="color: red">截止时间快到了!</span></p>
|
||||
<p style="color: red;font-size: 12px;">如果您还未交作业,请赶紧提交作业!</p>
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="cl" style="margin-top: 30px; clear:both; overflow:hidden;"></div>
|
||||
</div>
|
|
@ -4,9 +4,9 @@
|
|||
|
||||
<li style="list-style-type:none; margin:0; padding:0;"><span style="float: left;"><strong><%= l(:mail_issue_content)%></strong></span>
|
||||
<span style="float: left; width: 526px">
|
||||
<p><span style="color:#1b55a7; font-weight:bold;"><%= @invitor_name %></span> 邀请您加入项目:<span style="color:#1b55a7; font-weight:bold;"><%= @project_name %></span> </p>
|
||||
<p><span style="color:#1b55a7; font-weight:bold;"><%= @invitor_name %></span> 邀请您加入项目:<span style="color:#1b55a7; font-weight:bold;"><%=link_to @project_name, project_url(@project) %></span> </p>
|
||||
<div class="cl" style="margin-top: 30px; clear:both; overflow:hidden;"></div>
|
||||
<p>点击“同意加入”按钮,即可快速加入项目!</p> <br/>
|
||||
<p>点击“同意加入”按钮,即可快速加入项目,查看项目相关信息!</p> <br/>
|
||||
<label class="mail_reply">
|
||||
<%= link_to( l(:label_agree_join_project), @project_url, :class => "mail_reply", :style =>'display:block; float:right; width:80px; text-align:center; height:30px; background:#15bccf; color:#fff; font-weight:normal; font-size:14px; line-height: 30px;') %>
|
||||
</label>
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
|
||||
<div class="mail_box" style="border:1px solid #c8c8c8; width:570px; height: auto; padding:15px; margin-top:10px; margin-bottom:10px;">
|
||||
<ul style="list-style-type:none; margin:0; padding:0;">
|
||||
|
||||
<li style="list-style-type:none; margin:0; padding:0;"><span style="float: left;"><strong><%= l(:mail_issue_content)%></strong></span>
|
||||
<span style="float: left; width: 526px">
|
||||
<p><%= @subject %> </p>
|
||||
|
@ -9,13 +7,9 @@
|
|||
<p> <%= link_to @project_url, @project_url%></p>
|
||||
<p>您的账号为:<%= @email %></p>
|
||||
<p>密码为: <%= @password %></p>
|
||||
|
||||
<p style="color: red;font-size: 12px;">为了您的账号安全,请勿将邮件信息告知他人!</p>
|
||||
</span>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<div class="cl" style="margin-top: 30px; clear:both; overflow:hidden;"></div>
|
||||
</div>
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
<div class="mail_box" style="border:1px solid #c8c8c8; width:570px; height: auto; padding:15px; margin-top:10px; margin-bottom:10px;">
|
||||
<ul style="list-style-type:none; margin:0; padding:0;">
|
||||
<li style="list-style-type:none; margin:0; padding:0;"><span style="float: left;"><strong><%= l(:mail_issue_content)%></strong></span>
|
||||
<span style="float: left; width: 526px">
|
||||
<p><%=link_to @author, user_url(@author) %> 发布的作业:<%=link_to @anonymous_comment_close_name, @anonymous_comment_close_url%> <span style="color: red; padding-left: 10px;">已经关闭了匿评!</span></p>
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="cl" style="margin-top: 30px; clear:both; overflow:hidden;"></div>
|
||||
</div>
|
|
@ -0,0 +1,10 @@
|
|||
<div class="mail_box" style="border:1px solid #c8c8c8; width:570px; height: auto; padding:15px; margin-top:10px; margin-bottom:10px;">
|
||||
<ul style="list-style-type:none; margin:0; padding:0;">
|
||||
<li style="list-style-type:none; margin:0; padding:0;"><span style="float: left;"><strong><%= l(:mail_issue_content)%></strong></span>
|
||||
<span style="float: left; width: 526px">
|
||||
<p><%=link_to @author, user_url(@author) %> 发布的作业:<%=link_to @anonymous_comment_close_name, @anonymous_comment_close_url%> <span style="color: red; padding-left: 10px;">已经开启匿评了!</span></p>
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="cl" style="margin-top: 30px; clear:both; overflow:hidden;"></div>
|
||||
</div>
|
|
@ -1,3 +1,9 @@
|
|||
<style type="text/css">
|
||||
span{
|
||||
word-break:break-all;
|
||||
word-wrap:break-word;
|
||||
}
|
||||
</style>
|
||||
<%
|
||||
btn_tips = l(:label_news_new)
|
||||
label_tips = l(:label_news)
|
||||
|
|
|
@ -31,9 +31,9 @@
|
|||
$("#valid_email").text("<%= l(:label_email_format_error)%>");
|
||||
return false;
|
||||
}
|
||||
else if(email.split('@')[0].length >= 20)
|
||||
else if(email.length > 25)
|
||||
{
|
||||
$("#valid_email").text("邮箱名过长,最长为20个字符");
|
||||
$("#valid_email").text("邮箱名过长,最长为25个字符");
|
||||
return false;
|
||||
}
|
||||
else
|
||||
|
@ -85,7 +85,39 @@
|
|||
<%= l(:label_send_email)%>
|
||||
</a>
|
||||
<% end %>
|
||||
|
||||
<%# 邀请用户的状态 %>
|
||||
<% unless @inviter_lists.blank? %>
|
||||
<div class="section">
|
||||
<div class="section-header">
|
||||
<div class="desc">项目成员邀请状态列表</div>
|
||||
</div>
|
||||
<div class="invitations-records">
|
||||
<% @inviter_lists.each do |inviter_list| %>
|
||||
<table>
|
||||
<tbody>
|
||||
<% if inviter_list.user != nil %>
|
||||
<tr>
|
||||
<td class="email"><%= inviter_list.user.mail %></td>
|
||||
<td class="text-name">
|
||||
<% if inviter_list.user.active? %>
|
||||
<%=link_to inviter_list.user.name, user_path(inviter_list.user), :class => "c_eblue" %>
|
||||
<% else %>
|
||||
<span class="unactive"><%= inviter_list.user.name %></span>
|
||||
<% end %>
|
||||
</td>
|
||||
<td class="text-status"><%= status_for_ivitied(inviter_list, @project) %></td>
|
||||
<!--<td class="text-time"><%#= time_tag(inviter_list.created_at).html_safe %></td>-->
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
|
||||
<% unless @inviter_lists.blank? %>
|
||||
<div>
|
||||
<% unless @inviters_count.nil? %>
|
||||
|
|
|
@ -57,7 +57,7 @@
|
|||
</li>
|
||||
|
||||
<!-- 成绩 -->
|
||||
<% score = student_work.respond_to?("score") ? student_work.score : student_work.final_score - student_work.absence_penalty - student_work.late_penalty%>
|
||||
<% score = student_work.respond_to?("score") ? student_work.score : (student_work.final_score || 0) - student_work.absence_penalty - student_work.late_penalty%>
|
||||
<li class="hworkList50 <%= score_color score%> student_final_scor_info">
|
||||
<%= score.nil? ? "--" : format("%.1f",score)%>
|
||||
<% unless score.nil?%>
|
||||
|
|
|
@ -87,13 +87,13 @@
|
|||
<div class="dis" id="tbc_01">
|
||||
<div class="codeList">
|
||||
<span class="fl mt3">
|
||||
<%= link_to "所有作品<font class='f12 c_red'>[共#{@homework.student_works.count}份]</font>".html_safe,student_work_index_path(:homework => @homework.id),:class => "fl f14"%>
|
||||
<%= link_to "所有作品<font class='f12 c_red'>[共#{@stundet_works.count}份]</font>".html_safe,student_work_index_path(:homework => @homework.id),:class => "fl f14"%>
|
||||
</span>
|
||||
<%if @is_teacher || @homework.homework_detail_manual.comment_status == 3%>
|
||||
<form class="resourcesSearchloadBox fr">
|
||||
<input type="text" id="course_student_name" value="<%= @name%>" placeholder="输入资源关键词进行搜索" class="searchResource" onkeypress="SearchByName('<%= student_work_index_path(:homework => @homework.id)%>',event);"/>
|
||||
<div class="resourcesSearchloadBox fr">
|
||||
<input type="text" id="course_student_name" value="<%= @name%>" placeholder="姓名、学号、邮箱" class="searchResource" onkeypress="SearchByName('<%= student_work_index_path(:homework => @homework.id)%>',event);"/>
|
||||
<a class="homepageSearchIcon" onclick="SearchByName_1('<%= student_work_index_path(:homework => @homework.id)%>');" href="javascript:void(0)"></a>
|
||||
</form>
|
||||
</div>
|
||||
<% end%>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
|
|
@ -12,13 +12,38 @@
|
|||
<% end %> TO <!--+"(课程名称)" -->
|
||||
<%= link_to activity.course.name.to_s+" | 课程作业", homework_common_index_path(:course => activity.course.id, :host=> Setting.host_course), :class => "newsBlue ml15"%>
|
||||
</div>
|
||||
<div class="homepagePostTitle break_word"> <!--+"(作业名称)"-->
|
||||
<div class="homepagePostTitle hidden m_w530 fl"> <!--+"(作业名称)"-->
|
||||
<%= link_to activity.name.to_s, student_work_index_path(:homework => activity.id,:host=> Setting.host_course), :class => "postGrey"%>
|
||||
</div>
|
||||
<% if activity.homework_detail_manual.comment_status == 1%>
|
||||
<span class="grey_btn_cir ml10">未开启匿评</span>
|
||||
<% elsif activity.homework_detail_manual.comment_status == 2%>
|
||||
<span class="green_btn_cir ml10">匿评中</span>
|
||||
<% elsif activity.homework_detail_manual.comment_status == 3%>
|
||||
<span class="grey_btn_cir ml10">匿评已结束</span>
|
||||
<% end%>
|
||||
<div class="homepagePostSubmitContainer">
|
||||
<div class="homepagePostSubmit">
|
||||
<%= student_work_activity_submit_status(homework: activity) %>
|
||||
<% is_teacher = User.current.allowed_to?(:as_teacher,activity.course) %>
|
||||
<%= user_for_homework_common activity,is_teacher %>
|
||||
</div>
|
||||
|
||||
<% if activity.homework_type == 2 && is_teacher%>
|
||||
<div class="homepagePostSubmit">
|
||||
<%= link_to "模拟答题", new_user_commit_homework_users_path(homework_id: activity.id, is_test: true), class: 'c_blue test-program-btn', title: '教师可以通过模拟答题设置作业的标准答案' %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% if activity.homework_type == 2%>
|
||||
<div class="homepagePostDeadline mr15">
|
||||
语言:
|
||||
<% if activity.homework_detail_programing.language.to_i == 1%>
|
||||
C
|
||||
<% elsif activity.homework_detail_programing.language.to_i == 2%>
|
||||
C++
|
||||
<% end%>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="homepagePostDeadline">截止时间:<%= activity.end_time.to_s %></div>
|
||||
</div>
|
||||
<div class="homepagePostIntro break_word upload_img" id="activity_description_<%= user_activity_id%>">
|
||||
|
|
|
@ -59,10 +59,10 @@
|
|||
<li class="homepagePostSettingIcon">
|
||||
<ul class="homepagePostSettiongText">
|
||||
<li>
|
||||
<%= link_to l(:button_edit),edit_homework_common_path(homework_common), :class => "postOptionLink"%>
|
||||
<%= link_to l(:button_edit),edit_homework_common_path(homework_common,:is_in_course => 0), :class => "postOptionLink"%>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to(l(:label_bid_respond_delete), homework_common_path(homework_common),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "postOptionLink") %>
|
||||
<%= link_to(l(:label_bid_respond_delete), homework_common_path(homework_common,:is_in_course => 0),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "postOptionLink") %>
|
||||
</li>
|
||||
<li>
|
||||
<%= homework_anonymous_comment homework_common %>
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
<% end %>
|
||||
|
||||
<div class="mt10">
|
||||
<span class="f12 c_red db mt5 fl">温馨提示:您可以在发布作业后,在作业“模拟答题”中进行标准代码的检测和提交。</span>
|
||||
<span class="f12 c_red db mt5 fl">温馨提示:您可以在发布作业后,在作业“模拟答题”中进行标准代码的检测。</span>
|
||||
<a href="javascript:void(0);" class="BlueCirBtn fr">确 定</a>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
|
|
@ -25,14 +25,14 @@
|
|||
<%# 系统贴吧 %>
|
||||
<li><%= link_to "用户留言",user_message_path(User.current, :type => 'user_feedback'), :class => "resourcesGrey" %></li>
|
||||
<%# 系统消息 %>
|
||||
<li><%= link_to "系统消息", user_message_path(User.current, :type => 'system_messages'), :class => "resourcesGrey" %></li>
|
||||
<li><%= link_to "系统消息", user_system_messages_path(User.current), :class => "resourcesGrey" %></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="resources mt10" id="users_setting">
|
||||
<div>
|
||||
<% if @message_alls.count >0 %>
|
||||
<% if @message_alls.count >0 || @user_system_messages.count >0 %>
|
||||
<% if params[:type].nil? || params[:type] == "unviewed" %>
|
||||
<div class="newsReadSetting">
|
||||
有 <span class="c_red"><%= unviewed_message(@user) %></span> 条未读
|
||||
|
@ -46,32 +46,38 @@
|
|||
<% @user_system_messages.each do |usm| %>
|
||||
<ul class="homepageNewsList fl">
|
||||
<li class="homepageNewsPortrait fl">
|
||||
<a href="javascript:void(0);">
|
||||
<div class="navHomepageLogo fl">
|
||||
<%= image_tag("/images/logo.png", width: "30px", height: "30px", class: "mt3") %>
|
||||
</div>
|
||||
</a>
|
||||
<a href="javascript:void(0);"><div class="navHomepageLogo fl"><%= image_tag("/images/logo.png", width: "30px", height: "30px", class: "mt3") %></div></a>
|
||||
</li>
|
||||
<li class="homepageNewsPubType fl">
|
||||
<span class="newsBlue homepageNewsPublisher">Trustie平台</span><span class="homepageNewsType fl">发布新消息:</span>
|
||||
</li>
|
||||
<li class="homepageNewsContent fl">
|
||||
<%= link_to usm.content.html_safe, user_message_path(User.current, :type => "system_messages"),
|
||||
:class => "newsRed",
|
||||
:onmouseover => "message_titile_show($(this),event);",
|
||||
<span style="color: red;float: left">【系统消息】</span><li class="homepageSystenMessageContent fl" id="content_<%= usm.id %>">
|
||||
<li class="homepageSystenMessageContent fl">
|
||||
|
||||
<%= link_to usm.subject.nil? ? (usm.content.nil? ? usm.description.html_safe : usm.content.html_safe) : usm.subject, user_system_messages_path(User.current),
|
||||
:id => "content_link_#{usm.id}",
|
||||
:onmouseover =>"message_titile_show($(this),event);",
|
||||
:onmouseout => "message_titile_hide($(this));"
|
||||
%>
|
||||
</li>
|
||||
<div style="display:none;" class="message_title_red">
|
||||
<%= usm.content.html_safe %>
|
||||
<div style="display:none;" class="message_title_red system_message_style">
|
||||
<% unless usm.subject.nil? %>
|
||||
<p><strong>标题:</strong><%= usm.subject %></p>
|
||||
<% end %>
|
||||
<% if usm.description.nil? && usm.content.nil? %>
|
||||
|
||||
<% else %>
|
||||
<div class="fl"><strong>内容:</strong></div><div class="ml36"><%= usm.description.html_safe %></div>
|
||||
<% end %>
|
||||
</div>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(usm.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<%# 课程消息 %>
|
||||
<!--总消息列表-->
|
||||
<% unless @message_alls.nil? %>
|
||||
<% @message_alls.each do |ma| %>
|
||||
<%# 课程消息 %>
|
||||
<% if ma.class == CourseMessage %>
|
||||
<% if ma.course_message_type == "News" %>
|
||||
<ul class="homepageNewsList fl">
|
||||
|
@ -80,7 +86,15 @@
|
|||
<li class="homepageNewsContent fl">
|
||||
<%= link_to ma.course_message.title, {:controller => 'news', :action => 'show', :id => ma.course_message.id },
|
||||
:class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
|
||||
:title => "#{ma.course_message.title}" %></li>
|
||||
:onmouseover =>"message_titile_show($(this),event)",
|
||||
:onmouseout => "message_titile_hide($(this))" %></li>
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
<p><strong>标题:</strong><%= ma.course_message.title %></p>
|
||||
<% unless ma.course_message.description.nil? %>
|
||||
<div class="fl"><strong>内容:</strong></div>
|
||||
<div class="ml36"><%= ma.course_message.description.html_safe %></div>
|
||||
<% end %>
|
||||
</div>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
<% end %>
|
||||
|
@ -93,18 +107,32 @@
|
|||
:class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
|
||||
:onmouseover =>"message_titile_show($(this),event)",
|
||||
:onmouseout => "message_titile_hide($(this))" %></li>
|
||||
<div style="display: none" class="message_title">
|
||||
<%= ma.course_message.comments.html_safe %>
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
<p><strong>标题:</strong><%= ma.course_message.commented.title %></p>
|
||||
<% unless ma.course_message.comments.nil? %>
|
||||
<div class="fl"><strong>内容:</strong></div>
|
||||
<div class="ml36"><%= ma.course_message.comments.html_safe %></div>
|
||||
<% end %>
|
||||
</div>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
<% end %>
|
||||
<% if ma.course_message_type == "HomeworkCommon" && ma.status != 1 %>
|
||||
<% if ma.course_message_type == "HomeworkCommon" && ma.status.nil? %>
|
||||
<ul class="homepageNewsList fl">
|
||||
<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="homepageNewsPubType fl"><%=link_to ma.course_message.user, user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher" %><span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">发布了作业:</span></li>
|
||||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||
<%= link_to ma.course_message.name, student_work_index_path(:homework => ma.course_message.id), :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", :title => "#{ma.course_message.name}" %></a></li>
|
||||
<%= link_to ma.course_message.name, student_work_index_path(:homework => ma.course_message.id),
|
||||
:class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
|
||||
:onmouseover =>"message_titile_show($(this),event)",
|
||||
:onmouseout => "message_titile_hide($(this))" %></a></li>
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
<p><strong>标题:</strong><%= ma.course_message.name %></p>
|
||||
<% unless ma.course_message.description.nil? %>
|
||||
<div class="fl"><strong>内容:</strong></div>
|
||||
<div class="ml36"><%= ma.course_message.description.html_safe %></div>
|
||||
<% end %>
|
||||
</div>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
<% end %>
|
||||
|
@ -114,17 +142,87 @@
|
|||
<li class="homepageNewsPubType fl"><%=link_to ma.course_message.user, user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher" %><span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">发布的作业:</span></li>
|
||||
<% if ma.viewed == 0 %>
|
||||
<li class="homepageHomeworkContent fl">
|
||||
<%= link_to ma.course_message.name, student_work_index_path(:homework => ma.course_message.id), :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", :title => "#{ma.course_message.name}" %>
|
||||
<%= link_to ma.course_message.name, student_work_index_path(:homework => ma.course_message.id),
|
||||
:class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
|
||||
:onmouseover =>"message_titile_show($(this),event)",
|
||||
:onmouseout => "message_titile_hide($(this))" %>
|
||||
</li>
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
<%= ma.course_message.name %>
|
||||
</div>
|
||||
<li class="homepageHomeworkContentWarn fl"> 截止时间快到了!</li>
|
||||
<% else %>
|
||||
<li class="homepageNewsContent fl">
|
||||
<%= link_to ma.course_message.name, student_work_index_path(:homework => ma.course_message.id), :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", :title => "#{ma.course_message.name}" %>
|
||||
<%= link_to ma.course_message.name, student_work_index_path(:homework => ma.course_message.id), :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
|
||||
:onmouseover =>"message_titile_show($(this),event)",
|
||||
:onmouseout => "message_titile_hide($(this))"%>
|
||||
</li>
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
<%= ma.course_message.name %>
|
||||
</div>
|
||||
<% end %>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
<% end %>
|
||||
<!--作品开启匿评 待整合:时间紧-->
|
||||
<% if ma.course_message_type == "HomeworkCommon" && ma.status == 2 %>
|
||||
<ul class="homepageNewsList fl">
|
||||
<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="homepageNewsPubType fl"><%=link_to ma.course_message.user, user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher" %><span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">发布的作业:</span></li>
|
||||
<% if ma.viewed == 0 %>
|
||||
<li class="homepageHomeworkContent fl">
|
||||
<%= link_to ma.course_message.name, student_work_index_path(:homework => ma.course_message.id),
|
||||
:class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
|
||||
:onmouseover =>"message_titile_show($(this),event)",
|
||||
:onmouseout => "message_titile_hide($(this))" %>
|
||||
</li>
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
<%= ma.course_message.name %>
|
||||
</div>
|
||||
<li class="homepageHomeworkContentWarn fl"> 开启匿评了!</li>
|
||||
<% else %>
|
||||
<li class="homepageNewsContent fl">
|
||||
<%= link_to ma.course_message.name, student_work_index_path(:homework => ma.course_message.id), :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
|
||||
:onmouseover =>"message_titile_show($(this),event)",
|
||||
:onmouseout => "message_titile_hide($(this))"%>
|
||||
</li>
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
<%= ma.course_message.name %>
|
||||
</div>
|
||||
<% end %>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
<% end %>
|
||||
<!--作品关闭匿评-->
|
||||
<% if ma.course_message_type == "HomeworkCommon" && ma.status == 3 %>
|
||||
<ul class="homepageNewsList fl">
|
||||
<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="homepageNewsPubType fl"><%=link_to ma.course_message.user, user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher" %><span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">发布的作业:</span></li>
|
||||
<% if ma.viewed == 0 %>
|
||||
<li class="homepageHomeworkContent fl">
|
||||
<%= link_to ma.course_message.name, student_work_index_path(:homework => ma.course_message.id),
|
||||
:class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
|
||||
:onmouseover =>"message_titile_show($(this),event)",
|
||||
:onmouseout => "message_titile_hide($(this))" %>
|
||||
</li>
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
<%= ma.course_message.name %>
|
||||
</div>
|
||||
<li class="homepageHomeworkContentWarn fl"> 匿评已经关闭!</li>
|
||||
<% else %>
|
||||
<li class="homepageNewsContent fl">
|
||||
<%= link_to ma.course_message.name, student_work_index_path(:homework => ma.course_message.id), :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
|
||||
:onmouseover =>"message_titile_show($(this),event)",
|
||||
:onmouseout => "message_titile_hide($(this))"%>
|
||||
</li>
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
<%= ma.course_message.name %>
|
||||
</div>
|
||||
<% end %>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
<% end %>
|
||||
|
||||
<% if ma.course_message_type == "Poll" %>
|
||||
<ul class="homepageNewsList fl">
|
||||
<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>
|
||||
|
@ -132,7 +230,11 @@
|
|||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||
<%= link_to format_activity_title(" #{ma.course_message.polls_name.nil? ? "未命名问卷" : ma.course_message.polls_name}"), poll_path(ma.course_message.id),
|
||||
:class=>"#{ma.viewed==0?"newsBlack":"newsGrey"}",
|
||||
:title => "#{ma.course_message.polls_name}" %></a></li>
|
||||
:onmouseover =>"message_titile_show($(this),event)",
|
||||
:onmouseout => "message_titile_hide($(this))" %></a></li>
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
<%= ma.course_message.polls_name %>
|
||||
</div>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
<% end %>
|
||||
|
@ -144,15 +246,27 @@
|
|||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||
<%= link_to ma.course_message.subject, 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 => ma.course_message.id),
|
||||
:class => "#{ma.viewed==0 ? "newsBlack" : "newsGrey"}",
|
||||
:title => "#{ma.course_message.subject.html_safe}" %></a></li>
|
||||
:onmouseover =>"message_titile_show($(this),event)",
|
||||
:onmouseout => "message_titile_hide($(this))" %></a></li>
|
||||
<div style="display: none" class="message_title_red system_message_style" >
|
||||
<p><strong>主题:</strong><%= ma.course_message.subject %></p>
|
||||
<% unless ma.course_message.content.nil? %>
|
||||
<div class="fl"><strong>内容:</strong></div>
|
||||
<div class="ml36"><%= ma.course_message.content.html_safe %></div>
|
||||
<% end %>
|
||||
</div>
|
||||
<% else %>
|
||||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||
<%= link_to ma.course_message.content.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 => ma.course_message.id),
|
||||
:class => "#{ma.viewed==0 ? "newsBlack" : "newsGrey"}",
|
||||
:onmouseover =>"message_titile_show($(this),event)",
|
||||
:onmouseout => "message_titile_hide($(this))" %></a></li>
|
||||
<div style="display: none" class="message_title" >
|
||||
<%= ma.course_message.content.html_safe %>
|
||||
<div style="display: none" class="message_title_red system_message_style" >
|
||||
<p><strong>主题:</strong><%= ma.course_message.subject %></p>
|
||||
<% unless ma.course_message.content.nil? %>
|
||||
<div class="fl"><strong>内容:</strong></div>
|
||||
<div class="ml36"><%= ma.course_message.content.html_safe %></div>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
|
@ -165,23 +279,62 @@
|
|||
<li class="homepageNewsPubType fl"><%=link_to ma.course_message.user, user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher" %><span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>"><%= ma.status == 0 ? "评阅了作品:" : "重新评阅了作品:" %></span></li>
|
||||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||
<% unless ma.content.nil? %>
|
||||
<%= link_to ma.content.html_safe, student_work_index_path(:homework => ma.course_message.student_work.homework_common_id), :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",:title => "#{ma.content.html_safe}" %></a></li>
|
||||
<%= link_to ma.content.html_safe, student_work_index_path(:homework => ma.course_message.student_work.homework_common_id),
|
||||
:class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
|
||||
:onmouseover =>"message_titile_show($(this),event)",
|
||||
:onmouseout => "message_titile_hide($(this))" %></a></li>
|
||||
<div style="display: none" class="message_title_red system_message_style" >
|
||||
<%= ma.content.html_safe %>
|
||||
</div>
|
||||
<% end %>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
<% end %>
|
||||
<% if ma.course_message_type == "JournalsForMessage" %>
|
||||
<% if ma.course_message.jour_type == 'Course' %>
|
||||
<ul class="homepageNewsList fl">
|
||||
<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="homepageNewsPubType fl"><%=link_to ma.course_message.user, user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher" %><span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">回复了作品评论:</span></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="homepageNewsPubType fl"><%= link_to ma.course_message.user, user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher" %>
|
||||
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">在课程中留言了:</span>
|
||||
</li>
|
||||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||
<%= link_to ma.course_message.notes, student_work_index_path(:homework => ma.course_message.jour.student_work.homework_common_id), :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",:title => "#{ma.course_message.notes}" %></a></li>
|
||||
<%= link_to ma.course_message.notes.html_safe, course_feedback_path(:id => ma.course_id),
|
||||
:class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
|
||||
:onmouseover => "message_titile_show($(this),event)",
|
||||
:onmouseout => "message_titile_hide($(this))" %></a>
|
||||
</li>
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
<%= ma.course_message.notes.html_safe %>
|
||||
</div>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
|
||||
<% else %>
|
||||
<ul class="homepageNewsList fl">
|
||||
<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="homepageNewsPubType fl"><%= link_to ma.course_message.user, user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher" %>
|
||||
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">回复了作品评论:</span>
|
||||
</li>
|
||||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||
<%= link_to ma.course_message.notes, student_work_index_path(:homework => ma.course_message.jour.student_work.homework_common_id), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
|
||||
:onmouseover => "message_titile_show($(this),event)",
|
||||
:onmouseout => "message_titile_hide($(this))" %></a>
|
||||
</li>
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
<%= ma.course_message.notes %>
|
||||
</div>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<!--项目消息-->
|
||||
<% if ma.class == ForgeMessage %>
|
||||
<!--申请加入项目-->
|
||||
<% if ma.forge_message_type == "AppliedProject" %>
|
||||
<ul class="homepageNewsList fl">
|
||||
<li class="homepageNewsPortrait fl">
|
||||
|
@ -192,8 +345,44 @@
|
|||
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">申请加入项目:</span>
|
||||
</li>
|
||||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||
<%= link_to ma.project, settings_project_path(:id => ma.project, :tab => "members"), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",:title => "#{ma.project}" %></a>
|
||||
<%= link_to ma.project, settings_project_path(:id => ma.project, :tab => "members"), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
|
||||
:onmouseover => "message_titile_show($(this),event)",
|
||||
:onmouseout => "message_titile_hide($(this))" %></a>
|
||||
</li>
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
<%= ma.project %>
|
||||
</div>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
<% end %>
|
||||
<!--邀请加入项目-->
|
||||
<% if ma.forge_message_type == "ProjectInvite" %>
|
||||
<% inviter = User.find(ma.forge_message_id) %>
|
||||
<ul class="homepageNewsList fl">
|
||||
<li class="homepageNewsPortrait fl">
|
||||
<a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(inviter), :width => "30", :height => "30"), user_path(inviter) %></a>
|
||||
</li>
|
||||
<li class="homepageNewsPubType fl">
|
||||
<%=link_to inviter, user_path(inviter), :class => "newsBlue homepageNewsPublisher" %>
|
||||
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">邀请你加入项目:</span>
|
||||
</li>
|
||||
<li class="homepageHomeworkContent fl">
|
||||
<%= link_to ma.project, project_path(ma.project),
|
||||
:class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
|
||||
:onmouseover => "message_titile_show($(this),event)",
|
||||
:onmouseout => "message_titile_hide($(this))" %>
|
||||
</li>
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
<%= ma.project %>
|
||||
</div>
|
||||
<% if User.current == @user %>
|
||||
<li class="homepageHomeworkContentWarn fl">
|
||||
<%=link_to "同意加入", {:controller => 'projects', :action => 'member', :id => ma.project_id, :message_id =>ma.id, :key => ma.secret_key},
|
||||
:value => ma.secret_key,
|
||||
:class => "green_btn_cir ml10",
|
||||
:style => "color:#fff" %>
|
||||
</li>
|
||||
<% end %>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
<% end %>
|
||||
|
@ -207,8 +396,17 @@
|
|||
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">指派了问题给你:</span>
|
||||
</li>
|
||||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||
<%= 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>
|
||||
<%= link_to ma.forge_message.subject, issue_path(:id => ma.forge_message.id), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
|
||||
:onmouseover => "message_titile_show($(this),event)",
|
||||
:onmouseout => "message_titile_hide($(this))" %></a>
|
||||
</li>
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
<p><strong>主题:</strong><%= ma.forge_message.subject %></p>
|
||||
<% unless ma.forge_message.description.nil? || ma.forge_message.description == "" %>
|
||||
<div class="fl"><strong>描述:</strong></div>
|
||||
<div class="ml36"><%= ma.forge_message.description.html_safe %></div>
|
||||
<% end %>
|
||||
</div>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
<% end %>
|
||||
|
@ -225,8 +423,14 @@
|
|||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||
<%= link_to get_issue_des_update(ma.forge_message).html_safe,
|
||||
issue_path(:id => ma.forge_message.journalized_id), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
|
||||
:title => "#{get_issue_des_update(ma.forge_message).html_safe}" %></a>
|
||||
:onmouseover =>"message_titile_show($(this),event)",
|
||||
:onmouseout => "message_titile_hide($(this))" %></a>
|
||||
</li>
|
||||
<div style="display: none" class="message_title_red system_message_style" >
|
||||
<p><strong>问题标题:</strong><%= ma.forge_message.journalized.subject %></p>
|
||||
<div class="fl"><strong>更新内容:</strong></div>
|
||||
<div class="ml60"><%= get_issue_des_update(ma.forge_message).html_safe %></div>
|
||||
</div>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
<% end %>
|
||||
|
@ -237,19 +441,31 @@
|
|||
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>"><%= ma.forge_message.parent_id.nil? ? "发布了项目帖子:" : "评论了项目帖子:" %></span></li>
|
||||
<% if ma.forge_message.parent_id.nil? %>
|
||||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||
<%=link_to ma.forge_message.subject, project_boards_path(ma.forge_message.project,
|
||||
<%= link_to ma.forge_message.subject, project_boards_path(ma.forge_message.project,
|
||||
:parent_id => ma.forge_message.parent_id ? ma.forge_message.parent_id : ma.forge_message.id,
|
||||
:topic_id => ma.forge_message.id),:class=>"#{ma.viewed==0?"newsBlack":"newsGrey"}",
|
||||
:title => "#{ma.forge_message.subject.html_safe}" %></a></li>
|
||||
:topic_id => ma.forge_message.id), :class => "#{ma.viewed==0 ? "newsBlack" : "newsGrey"}",
|
||||
:onmouseover => "message_titile_show($(this),event)",
|
||||
:onmouseout => "message_titile_hide($(this))" %></a></li>
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
<p><strong>主题:</strong><%= ma.forge_message.subject %></p>
|
||||
<% unless ma.forge_message.content.nil? %>
|
||||
<div class="fl"><strong>内容:</strong></div>
|
||||
<div class="ml36"><%= ma.forge_message.content.html_safe %></div>
|
||||
<% end %>
|
||||
</div>
|
||||
<% else %>
|
||||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||
<%=link_to ma.forge_message.content.html_safe, project_boards_path(ma.forge_message.project,
|
||||
<%= link_to ma.forge_message.content.html_safe, project_boards_path(ma.forge_message.project,
|
||||
:parent_id => ma.forge_message.parent_id ? ma.forge_message.parent_id : ma.forge_message.id,
|
||||
:topic_id => ma.forge_message.id),:class=>"#{ma.viewed==0?"newsBlack":"newsGrey"}",
|
||||
:onmouseover =>"message_titile_show($(this),event)",
|
||||
:topic_id => ma.forge_message.id), :class => "#{ma.viewed==0 ? "newsBlack" : "newsGrey"}",
|
||||
:onmouseover => "message_titile_show($(this),event)",
|
||||
:onmouseout => "message_titile_hide($(this))" %></a></li>
|
||||
<div style="display: none" class="message_title">
|
||||
<%= ma.forge_message.content.html_safe %>
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
<p><strong>主题:</strong><%= ma.forge_message.subject %></p>
|
||||
<% unless ma.forge_message.content.nil? %>
|
||||
<div class="fl"><strong>内容:</strong></div>
|
||||
<div class="ml36"><%= ma.forge_message.content.html_safe %></div>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
|
@ -265,8 +481,18 @@
|
|||
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">发布了新闻:</span>
|
||||
</li>
|
||||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||
<%= link_to ("#{ma.forge_message.title.html_safe}"), {:controller => 'news', :action => 'show', :id => ma.forge_message.id}, :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", :title => "#{ma.forge_message.title.html_safe}" %></a>
|
||||
<%= link_to ("#{ma.forge_message.title.html_safe}"), {:controller => 'news', :action => 'show', :id => ma.forge_message.id},
|
||||
:class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
|
||||
:onmouseover => "message_titile_show($(this),event)",
|
||||
:onmouseout => "message_titile_hide($(this))" %></a>
|
||||
</li>
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
<p><strong>标题:</strong><%= ma.forge_message.title %></p>
|
||||
<% unless ma.forge_message.description.nil? %>
|
||||
<div class="fl"><strong>内容:</strong></div>
|
||||
<div class="ml36"><%= ma.forge_message.description.html_safe %></div>
|
||||
<% end %>
|
||||
</div>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
<% end %>
|
||||
|
@ -278,8 +504,14 @@
|
|||
<li class="homepageNewsContent fl">
|
||||
<%= link_to "#{ma.forge_message.comments.html_safe}",
|
||||
{:controller => 'news', :action => 'show', :id => ma.forge_message.commented.id },:class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
|
||||
:title => "#{ma.forge_message.comments.html_safe}" %>
|
||||
:onmouseover => "message_titile_show($(this),event)",
|
||||
:onmouseout => "message_titile_hide($(this))" %>
|
||||
</li>
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
<p><strong>新闻标题:</strong><%= ma.forge_message.commented.title %></p>
|
||||
<div class="fl"><strong>评论内容:</strong></div>
|
||||
<div class="ml60"><%= ma.forge_message.comments.html_safe %></div>
|
||||
</div>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
<% end %>
|
||||
|
@ -298,16 +530,28 @@
|
|||
<% if ma.memo.parent_id.nil? %>
|
||||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||
<%= link_to ma.memo.subject, forum_memo_path(ma.memo.forum_id, ma.memo.parent_id ? ma.memo.parent_id: ma.memo.id), :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
|
||||
:title => "#{ma.memo.subject}" %></a>
|
||||
:onmouseover =>"message_titile_show($(this),event)",
|
||||
:onmouseout => "message_titile_hide($(this))" %></a>
|
||||
</li>
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
<p><strong>标题:</strong><%= ma.memo.subject %></p>
|
||||
<% unless ma.memo.content.nil? %>
|
||||
<div class="fl"><strong>内容:</strong></div>
|
||||
<div class="ml36"><%= ma.memo.content.html_safe %></div>
|
||||
<% end %>
|
||||
</div>
|
||||
<% else %>
|
||||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||
<%= link_to ma.memo.content.html_safe, forum_memo_path(ma.memo.forum_id, ma.memo.parent_id ? ma.memo.parent_id: ma.memo.id), :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
|
||||
:onmouseover =>"message_titile_show($(this),event)",
|
||||
:onmouseout => "message_titile_hide($(this))" %></a>
|
||||
</li>
|
||||
<div style="display: none" class="message_title">
|
||||
<%= ma.memo.content.html_safe %>
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
<p><strong>标题:</strong><%= ma.memo.subject %></p>
|
||||
<% unless ma.memo.content.nil? %>
|
||||
<div class="fl"><strong>内容:</strong></div>
|
||||
<div class="ml36"><%= ma.memo.content.html_safe %></div>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.memo.created_at).html_safe %> </li>
|
||||
|
@ -330,7 +574,7 @@
|
|||
:onmouseover =>"message_titile_show($(this),event)",
|
||||
:onmouseout => "message_titile_hide($(this))" %></a>
|
||||
</li>
|
||||
<div style="display: none" class="message_title" >
|
||||
<div style="display: none" class="message_title_red system_message_style" >
|
||||
<%= ma.journals_for_message.notes.html_safe %>
|
||||
</div>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.journals_for_message.created_on).html_safe %> </li>
|
||||
|
@ -338,30 +582,6 @@
|
|||
</ul>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<%# 系统消息 %>
|
||||
<% if ma.class == SystemMessage %>
|
||||
<ul class="homepageNewsList fl">
|
||||
<li class="homepageNewsPortrait fl">
|
||||
<a href="javascript:void(0);">
|
||||
<div class="navHomepageLogo fl">
|
||||
<%=image_tag("/images/logo.png",width:"30px", height: "30px",class: "mt3")%>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<li class="homepageNewsPubType fl"><span class="newsBlue homepageNewsPublisher" >Trustie平台</span><span class="homepageNewsType fl">发布新消息:</span></li>
|
||||
<li class="homepageNewsContent fl">
|
||||
<%= link_to ma.content.html_safe, user_message_path(User.current, :type => "system_messages"),
|
||||
:class => "#{params[:type]=="unviewed" ? "newsBlack" : "newsRed"}",
|
||||
:onmouseover =>"message_titile_show($(this),event);",
|
||||
:onmouseout => "message_titile_hide($(this));"
|
||||
%>
|
||||
</li>
|
||||
<div style="display:none;" class="message_title_red">
|
||||
<%= ma.content.html_safe%>
|
||||
</div>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<ul class="wlist" style=" border:none; padding-top: 15px;">
|
||||
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
|
||||
|
@ -386,6 +606,23 @@
|
|||
{
|
||||
obj.parent().next("div").hide();
|
||||
}
|
||||
|
||||
function show_more_system_messages(list,content, id2, id3) {
|
||||
$(list).toggleClass("show_more_li");
|
||||
$(content).toggleClass("show_more_system_message");
|
||||
var information = $(id2);
|
||||
var val = information.attr("value");
|
||||
if (val == "show_more") {
|
||||
$(id2).text("[收起]");
|
||||
information.attr("value", "hide_more");
|
||||
information.attr("style", "color:#3ca5c6");
|
||||
}
|
||||
else {
|
||||
$(id2).text("[展开]");
|
||||
information.attr("value", "show_more");
|
||||
information.attr("style", "color:#0781b4;");
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,58 @@
|
|||
<div class="homepageRightBanner">
|
||||
<div class="NewsBannerName">系统消息</div>
|
||||
<ul class="resourcesSelect">
|
||||
<li class="resourcesSelected"><a href="javascript:void(0);" class="resourcesIcon"></a>
|
||||
<ul class="newsType">
|
||||
<li><%= link_to "全部",user_message_path(User.current), :class => "resourcesGrey" %></li>
|
||||
<li><%= link_to "未读消息", user_message_path(User.current, :type => 'unviewed'), :class => "resourcesGrey" %></li>
|
||||
<li><%= link_to "用户申请", user_message_path(User.current, :type => 'apply'), :class => "resourcesGrey" %></li>
|
||||
<%# 课程相关消息 %>
|
||||
<li><%= link_to "作业消息", user_message_path(User.current, :type => 'homework'), :class => "resourcesGrey" %></li>
|
||||
<li><%= link_to "课程讨论",user_message_path(User.current, :type => 'course_message'), :class => "resourcesGrey" %></li>
|
||||
<li><%= link_to "课程通知",user_message_path(User.current, :type => 'course_news'), :class => "resourcesGrey" %></li>
|
||||
<!--<li><%#= link_to "通知回复", user_message_path(User.current, :type => 'course_news_reply'), :class => "resourcesGrey" %></li>-->
|
||||
<!--<li><%#= link_to "课程问卷", user_message_path(User.current, :type => 'poll'), :class => "resourcesGrey" %></a></li>-->
|
||||
<!--<li><%#= link_to "作品评阅", user_message_path(User.current, :type => 'works_reviewers'), :class => "resourcesGrey" %></li>-->
|
||||
<!--<li><%#= link_to "作品讨论", user_message_path(User.current, :type => 'works_reply'), :class => "resourcesGrey" %></li>-->
|
||||
<%# 项目相关消息 %>
|
||||
<li><%= link_to "项目任务", user_message_path(User.current, :type => 'issue'), :class => "resourcesGrey" %></li>
|
||||
<!--<li><%#= link_to "问题更新", user_message_path(User.current, :type => 'issue_update'), :class => "resourcesGrey" %></li>-->
|
||||
<!--<li><%#= link_to "项目讨论区", user_message_path(User.current, :type => 'forge_message'), :class => "resourcesGrey" %></li>-->
|
||||
<!--<li><%#= link_to "项目新闻", user_message_path(User.current, :type => 'forge_news'), :class => "resourcesGrey" %></li>-->
|
||||
<!--<li><%#= link_to "新闻回复", user_message_path(User.current, :type => 'forge_news_reply'), :class => "resourcesGrey" %></li>-->
|
||||
<%# 项目相关消息 %>
|
||||
<li><%= link_to "贴吧帖子", user_message_path(User.current, :type => 'forum'), :class => "resourcesGrey" %></li>
|
||||
<%# 系统贴吧 %>
|
||||
<li><%= link_to "用户留言",user_message_path(User.current, :type => 'user_feedback'), :class => "resourcesGrey" %></li>
|
||||
<%# 系统消息 %>
|
||||
<li><%= link_to "系统消息", user_system_messages_path(User.current), :class => "resourcesGrey" %></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<% @sytem_messages.each do |system_message| %>
|
||||
<div class="resources mt10">
|
||||
<div class="homepagePostBrief break_word">
|
||||
<div class="homepagePostPortrait">
|
||||
<%= image_tag("/images/logo.png", :width => "42", :height => "42",class: "mt3") %>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo break_word">
|
||||
<span class="fl"><span style="color:#0781b4;">Trustie平台 </span>发布了系统消息:</span>
|
||||
<span style="color:#0781b4; max-width:470px; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;vertical-align: top;"><%= system_message.subject.nil? ? "系统消息" : system_message.subject %></span>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<p class="homepagePostIntro break_word upload_img">
|
||||
<%= system_message.content.nil? ? system_message.description.html_safe : system_message.content.html_safe %>
|
||||
</p>
|
||||
<div class="cl"></div>
|
||||
<p class="homepagePostDeadline">截止时间:<%= format_time(system_message.created_at) %></p>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<ul class="wlist" style=" border:none; padding-top: 15px;">
|
||||
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
|
||||
</ul>
|
|
@ -103,7 +103,7 @@ default:
|
|||
# autologin_cookie_name: the name of the cookie (default: autologin)
|
||||
# autologin_cookie_path: the cookie path (default: /)
|
||||
# autologin_cookie_secure: true sets the cookie secure flag (default: false)
|
||||
autologin_cookie_name: "autologin_trustie"
|
||||
autologin_cookie_name:
|
||||
autologin_cookie_path:
|
||||
autologin_cookie_secure:
|
||||
|
||||
|
@ -197,16 +197,10 @@ default:
|
|||
#max_concurrent_ajax_uploads: 2
|
||||
#pic_types: "bmp,jpeg,jpg,png,gif"
|
||||
|
||||
repository_root_path: '/tmp/htdocs'
|
||||
|
||||
judge_server: 'http://judge.trustie.net/'
|
||||
|
||||
# specific configuration options for production environment
|
||||
# that overrides the default ones
|
||||
production:
|
||||
judge_server: 'http://192.168.80.21:8080/'
|
||||
repository_root_path: '/home/pdl/redmine-2.3.2-0/apache2/htdocs'
|
||||
cookie_domain: ".trustie.net"
|
||||
# CJK support
|
||||
rmagick_font_path: /usr/share/fonts/ipa-mincho/ipam.ttf
|
||||
email_delivery:
|
||||
delivery_method: :smtp
|
||||
|
|
|
@ -24,3 +24,7 @@ zh:
|
|||
mail_course_title_userin: "在课程"
|
||||
mail_course_homework_active: "中发布了作业"
|
||||
mail_attention: "请您关注!"
|
||||
mail_homework_endtime: "作业截止时间快到了!"
|
||||
mail_homework: "作业:"
|
||||
mail_anonymous_comment_close: "作业匿评已经关闭!"
|
||||
mail_anonymous_comment_open: "作业匿评已经开启!"
|
|
@ -347,7 +347,7 @@ zh:
|
|||
#
|
||||
# 邀请
|
||||
#
|
||||
label_invite_new_user: "发送邮件邀请新用户"
|
||||
label_invite_new_user: "邀请用户加入项目"
|
||||
label_invite_join: 邀请加入
|
||||
label_invite_email_tips: 输入好友的邮箱地址,Trustie会自动为该好友注册平台账号!
|
||||
notice_registed_error: 您输入的邮箱地址为空或者该邮箱已被注册!
|
||||
|
|
|
@ -52,6 +52,8 @@ zh:
|
|||
notice_not_authorized_archived_project: 要访问的项目已经归档。
|
||||
notice_not_authorized_message: 您访问的消息不存在!
|
||||
notice_email_sent: "邮件已发送至 %{value}"
|
||||
notice_email_login_used: 无法自动为该邮箱注册新用户,该邮箱地址已经有人作为登录名使用!
|
||||
notice_email_invited: 已经向该邮箱发送过邀请,正在等待对方的回复,三小时后您可以再次发送邀请!
|
||||
notice_email_error: "发送邮件时发生错误 (%{value})"
|
||||
notice_feeds_access_key_reseted: 您的RSS存取键已被重置。
|
||||
notice_api_access_key_reseted: 您的API访问键已被重置。
|
||||
|
|
|
@ -390,6 +390,7 @@ RedmineApp::Application.routes.draw do
|
|||
match 'users/:id/user_projects', :to => 'users#user_projects', :via => :get
|
||||
#消息
|
||||
match 'users/:id/user_messages', :to => 'users#user_messages', :via => :get, :as => "user_message"
|
||||
match 'users/:id/user_system_messages', :to => 'users#user_system_messages', :via => :get, :as => "user_system_messages"
|
||||
#match 'users/:id/user_messages/:homework', :to => 'users#user_messages_homework', :via => :get, :as => "user_message_homewrok"
|
||||
|
||||
|
||||
|
@ -446,7 +447,7 @@ RedmineApp::Application.routes.draw do
|
|||
get 'feedback', :action => 'feedback', :as => 'project_feedback'
|
||||
get 'watcherlist', :action=> 'watcherlist'
|
||||
|
||||
get 'invite_members', :action=> 'invite_members'
|
||||
# get 'invite_members', :action=> 'invite_members'
|
||||
get 'invite_members_by_mail', :action=> 'invite_members_by_mail'
|
||||
# get 'dts_repos', :aciton => 'dts_repos'
|
||||
get 'send_mail_to_member', :action => 'send_mail_to_member'
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
class AddDescriptionToSystemMessage < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :system_messages, :description, :text
|
||||
end
|
||||
end
|
|
@ -0,0 +1,5 @@
|
|||
class AddMailToInviteList < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :invite_lists, :mail, :string
|
||||
end
|
||||
end
|
|
@ -0,0 +1,5 @@
|
|||
class AddSubjectToSystemMessage < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :system_messages, :subject, :string
|
||||
end
|
||||
end
|
|
@ -0,0 +1,9 @@
|
|||
class NormalHomeworkType < ActiveRecord::Migration
|
||||
def up
|
||||
HomeworkCommon.where("homework_type = 0").update_all(:homework_type => 1)
|
||||
end
|
||||
|
||||
def down
|
||||
HomeworkCommon.where("homework_type = 0").update_all(:homework_type => 1)
|
||||
end
|
||||
end
|
|
@ -0,0 +1,5 @@
|
|||
class AddSecretKeyToForgeMessage < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :forge_messages, :secret_key, :string
|
||||
end
|
||||
end
|
48
db/schema.rb
48
db/schema.rb
|
@ -11,7 +11,7 @@
|
|||
#
|
||||
# It's strongly recommended to check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(:version => 20150917071652) do
|
||||
ActiveRecord::Schema.define(:version => 20150918134804) do
|
||||
|
||||
create_table "activities", :force => true do |t|
|
||||
t.integer "act_id", :null => false
|
||||
|
@ -476,6 +476,13 @@ ActiveRecord::Schema.define(:version => 20150917071652) do
|
|||
|
||||
add_index "delayed_jobs", ["priority", "run_at"], :name => "delayed_jobs_priority"
|
||||
|
||||
create_table "discuss_demos", :force => true do |t|
|
||||
t.string "title"
|
||||
t.text "body"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
||||
create_table "documents", :force => true do |t|
|
||||
t.integer "project_id", :default => 0, :null => false
|
||||
t.integer "category_id", :default => 0, :null => false
|
||||
|
@ -490,23 +497,26 @@ ActiveRecord::Schema.define(:version => 20150917071652) do
|
|||
add_index "documents", ["created_on"], :name => "index_documents_on_created_on"
|
||||
add_index "documents", ["project_id"], :name => "documents_project_id"
|
||||
|
||||
create_table "dts", :force => true do |t|
|
||||
t.string "IPLineCode"
|
||||
t.string "Description"
|
||||
t.string "Num"
|
||||
t.string "Variable"
|
||||
t.string "TraceInfo"
|
||||
t.string "Method"
|
||||
create_table "dts", :primary_key => "Num", :force => true do |t|
|
||||
t.string "Defect", :limit => 50
|
||||
t.string "Category", :limit => 50
|
||||
t.string "File"
|
||||
t.string "IPLine"
|
||||
t.string "Review"
|
||||
t.string "Category"
|
||||
t.string "Defect"
|
||||
t.string "PreConditions"
|
||||
t.string "StartLine"
|
||||
t.string "Method"
|
||||
t.string "Module", :limit => 20
|
||||
t.string "Variable", :limit => 50
|
||||
t.integer "StartLine"
|
||||
t.integer "IPLine"
|
||||
t.string "IPLineCode", :limit => 200
|
||||
t.string "Judge", :limit => 15
|
||||
t.integer "Review", :limit => 1
|
||||
t.string "Description"
|
||||
t.text "PreConditions", :limit => 2147483647
|
||||
t.text "TraceInfo", :limit => 2147483647
|
||||
t.text "Code", :limit => 2147483647
|
||||
t.integer "project_id"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.integer "id", :null => false
|
||||
end
|
||||
|
||||
create_table "enabled_modules", :force => true do |t|
|
||||
|
@ -565,6 +575,7 @@ ActiveRecord::Schema.define(:version => 20150917071652) do
|
|||
t.integer "viewed"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
t.string "secret_key"
|
||||
end
|
||||
|
||||
create_table "forums", :force => true do |t|
|
||||
|
@ -614,6 +625,7 @@ ActiveRecord::Schema.define(:version => 20150917071652) do
|
|||
t.integer "course_id"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
t.integer "teacher_priority", :default => 1
|
||||
end
|
||||
|
||||
create_table "homework_detail_manuals", :force => true do |t|
|
||||
|
@ -675,6 +687,7 @@ ActiveRecord::Schema.define(:version => 20150917071652) do
|
|||
t.integer "user_id"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
t.string "mail"
|
||||
end
|
||||
|
||||
create_table "issue_categories", :force => true do |t|
|
||||
|
@ -906,7 +919,6 @@ ActiveRecord::Schema.define(:version => 20150917071652) do
|
|||
t.datetime "created_on"
|
||||
t.integer "comments_count", :default => 0, :null => false
|
||||
t.integer "course_id"
|
||||
t.datetime "updated_on"
|
||||
end
|
||||
|
||||
add_index "news", ["author_id"], :name => "index_news_on_author_id"
|
||||
|
@ -1354,6 +1366,8 @@ ActiveRecord::Schema.define(:version => 20150917071652) do
|
|||
t.string "content"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
t.text "description"
|
||||
t.string "subject"
|
||||
end
|
||||
|
||||
create_table "taggings", :force => true do |t|
|
||||
|
|
|
@ -10,6 +10,8 @@ namespace :homework_endtime do
|
|||
if homework_common.end_time.day - Date.today.day < 2 && homework_common.end_time.year == Date.today.year
|
||||
homework_common.course.student.each do |s|
|
||||
homework_common.course_messages << CourseMessage.new(:user_id => s.student_id, :course_id => homework_common.course_id, :viewed => false, :status => true)
|
||||
# 发送邮件通知
|
||||
Mailer.homework_endtime__added(homework_common, s.student_id).deliver
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -17,137 +17,137 @@
|
|||
focusColor: "#333"
|
||||
//blurColor: "#999
|
||||
};
|
||||
var settings = $.extend({}, defaults, options || {});
|
||||
//页面装载CSS样式
|
||||
if(settings.autoClass && $("#mailListAppendCss").size() === 0){
|
||||
$('<style id="mailListAppendCss" type="text/css">.mailListBox{border:1px solid #369; background:#fff; font:12px/20px Arial;}.mailListDefault{padding:0 5px;cursor:pointer;white-space:nowrap;}.mailListFocus{padding:0 5px;cursor:pointer;white-space:nowrap;background:#369;color:white;}.mailListHlignt{color:red;}.mailListFocus .mailListHlignt{color:#fff;}</style>').appendTo($("head"));
|
||||
}
|
||||
var cb = settings.boxClass, cl = settings.listClass, cf = settings.focusClass, cm = settings.markCalss; //插件的class变量
|
||||
var z = settings.zIndex, newArr = mailArr = settings.mailArr, hint = settings.textHint, text = settings.hintText, fc = settings.focusColor, bc = settings.blurColor;
|
||||
// var settings = $.extend({}, defaults, options || {});
|
||||
// //页面装载CSS样式
|
||||
// if(settings.autoClass && $("#mailListAppendCss").size() === 0){
|
||||
// $('<style id="mailListAppendCss" type="text/css">.mailListBox{border:1px solid #369; background:#fff; font:12px/20px Arial;}.mailListDefault{padding:0 5px;cursor:pointer;white-space:nowrap;}.mailListFocus{padding:0 5px;cursor:pointer;white-space:nowrap;background:#369;color:white;}.mailListHlignt{color:red;}.mailListFocus .mailListHlignt{color:#fff;}</style>').appendTo($("head"));
|
||||
// }
|
||||
// var cb = settings.boxClass, cl = settings.listClass, cf = settings.focusClass, cm = settings.markCalss; //插件的class变量
|
||||
// var z = settings.zIndex, newArr = mailArr = settings.mailArr, hint = settings.textHint, text = settings.hintText, fc = settings.focusColor, bc = settings.blurColor;
|
||||
//创建邮件内部列表内容
|
||||
$.createHtml = function(str, arr, cur){
|
||||
var mailHtml = "";
|
||||
if($.isArray(arr)){
|
||||
$.each(arr, function(i, n){
|
||||
if(i === cur){
|
||||
mailHtml += '<div class="mailHover '+cf+'" id="mailList_'+i+'"><span class="'+cm+'">'+str+'</span>@'+arr[i]+'</div>';
|
||||
}else{
|
||||
mailHtml += '<div class="mailHover '+cl+'" id="mailList_'+i+'"><span class="'+cm+'">'+str+'</span>@'+arr[i]+'</div>';
|
||||
}
|
||||
});
|
||||
}
|
||||
return mailHtml;
|
||||
};
|
||||
// $.createHtml = function(str, arr, cur){
|
||||
// var mailHtml = "";
|
||||
// if($.isArray(arr)){
|
||||
// $.each(arr, function(i, n){
|
||||
// if(i === cur){
|
||||
// mailHtml += '<div class="mailHover '+cf+'" id="mailList_'+i+'"><span class="'+cm+'">'+str+'</span>@'+arr[i]+'</div>';
|
||||
// }else{
|
||||
// mailHtml += '<div class="mailHover '+cl+'" id="mailList_'+i+'"><span class="'+cm+'">'+str+'</span>@'+arr[i]+'</div>';
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
// return mailHtml;
|
||||
// };
|
||||
//一些全局变量
|
||||
var index = -1, s;
|
||||
$(this).each(function(){
|
||||
var that = $(this), i = $(".justForJs").size();
|
||||
if(i > 0){ //只绑定一个文本框
|
||||
return;
|
||||
}
|
||||
var w = that.outerWidth(), h = that.outerHeight(); //获取当前对象(即文本框)的宽高
|
||||
//样式的初始化
|
||||
that.wrap('<span style="display:inline-block;position:relative;"></span>')
|
||||
.before('<div id="mailListBox_'+i+'" class="justForJs '+cb+'" style="min-width:'+w+'px;_width:'+w+'px;position:absolute;left:-6000px;top:'+h+'px;z-index:'+z+';"></div>');
|
||||
var x = $("#mailListBox_" + i), liveValue; //列表框对象
|
||||
that.focus(function(){
|
||||
//父标签的层级
|
||||
$(this).css("color", fc).parent().css("z-index", z);
|
||||
//提示文字的显示与隐藏
|
||||
if(hint && text){
|
||||
var focus_v = $.trim($(this).val());
|
||||
if(focus_v === text){
|
||||
$(this).val("");
|
||||
}
|
||||
}
|
||||
//键盘事件
|
||||
$(this).keyup(function(e){
|
||||
s = v = $.trim($(this).val());
|
||||
if(/@/.test(v)){
|
||||
s = v.replace(/@.*/, "");
|
||||
}
|
||||
if(v.length > 0){
|
||||
//如果按键是上下键
|
||||
if(e.keyCode === 38){
|
||||
//向上
|
||||
if(index <= 0){
|
||||
index = newArr.length;
|
||||
}
|
||||
index--;
|
||||
}else if(e.keyCode === 40){
|
||||
//向下
|
||||
if(index >= newArr.length - 1){
|
||||
index = -1;
|
||||
}
|
||||
index++;
|
||||
}else if(e.keyCode === 13){
|
||||
//回车
|
||||
if(index > -1 && index < newArr.length){
|
||||
//如果当前有激活列表
|
||||
$(this).val($("#mailList_"+index).text());
|
||||
}
|
||||
}else{
|
||||
if(/@/.test(v)){
|
||||
index = -1;
|
||||
//获得@后面的值
|
||||
//s = v.replace(/@.*/, "");
|
||||
//创建新匹配数组
|
||||
var site = v.replace(/.*@/, "");
|
||||
newArr = $.map(mailArr, function(n){
|
||||
var reg = new RegExp(site);
|
||||
if(reg.test(n)){
|
||||
return n;
|
||||
}
|
||||
});
|
||||
}else{
|
||||
newArr = mailArr;
|
||||
}
|
||||
}
|
||||
x.html($.createHtml(s, newArr, index)).css("left", 0);
|
||||
if(e.keyCode === 13){
|
||||
//回车
|
||||
if(index > -1 && index < newArr.length){
|
||||
//如果当前有激活列表
|
||||
x.css("left", "-6000px");
|
||||
}
|
||||
}
|
||||
}else{
|
||||
x.css("left", "-6000px");
|
||||
}
|
||||
}).blur(function(){
|
||||
if(hint && text){
|
||||
var blur_v = $.trim($(this).val());
|
||||
if(blur_v === ""){
|
||||
$(this).val(text);
|
||||
}
|
||||
}
|
||||
$(this).css("color", bc).unbind("keyup").parent().css("z-index",0);
|
||||
x.css("left", "-6000px");
|
||||
|
||||
}).keydown(function(event){
|
||||
if(event.keyCode == 13){
|
||||
return false;
|
||||
}
|
||||
});
|
||||
//鼠标经过列表项事件
|
||||
//鼠标经过
|
||||
$(".mailHover").on("mouseover", function(){
|
||||
index = Number($(this).attr("id").split("_")[1]);
|
||||
liveValue = $("#mailList_"+index).text();
|
||||
x.children("." + cf).removeClass(cf).addClass(cl);
|
||||
$(this).addClass(cf).removeClass(cl);
|
||||
});
|
||||
$(".mailHover").on("click", function(){
|
||||
$("#mail").val($(this).html());
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
x.bind("mousedown", function(){
|
||||
that.val(liveValue);
|
||||
});
|
||||
});
|
||||
// $(this).each(function(){
|
||||
// var that = $(this), i = $(".justForJs").size();
|
||||
// if(i > 0){ //只绑定一个文本框
|
||||
// return;
|
||||
// }
|
||||
// var w = that.outerWidth(), h = that.outerHeight(); //获取当前对象(即文本框)的宽高
|
||||
// //样式的初始化
|
||||
// that.wrap('<span style="display:inline-block;position:relative;"></span>')
|
||||
// .before('<div id="mailListBox_'+i+'" class="justForJs '+cb+'" style="min-width:'+w+'px;_width:'+w+'px;position:absolute;left:-6000px;top:'+h+'px;z-index:'+z+';"></div>');
|
||||
// var x = $("#mailListBox_" + i), liveValue; //列表框对象
|
||||
// that.focus(function(){
|
||||
// //父标签的层级
|
||||
// $(this).css("color", fc).parent().css("z-index", z);
|
||||
// //提示文字的显示与隐藏
|
||||
// if(hint && text){
|
||||
// var focus_v = $.trim($(this).val());
|
||||
// if(focus_v === text){
|
||||
// $(this).val("");
|
||||
// }
|
||||
// }
|
||||
// //键盘事件
|
||||
// $(this).keyup(function(e){
|
||||
// s = v = $.trim($(this).val());
|
||||
// if(/@/.test(v)){
|
||||
// s = v.replace(/@.*/, "");
|
||||
// }
|
||||
// if(v.length > 0){
|
||||
// //如果按键是上下键
|
||||
// if(e.keyCode === 38){
|
||||
// //向上
|
||||
// if(index <= 0){
|
||||
// index = newArr.length;
|
||||
// }
|
||||
// index--;
|
||||
// }else if(e.keyCode === 40){
|
||||
// //向下
|
||||
// if(index >= newArr.length - 1){
|
||||
// index = -1;
|
||||
// }
|
||||
// index++;
|
||||
// }else if(e.keyCode === 13){
|
||||
// //回车
|
||||
// if(index > -1 && index < newArr.length){
|
||||
// //如果当前有激活列表
|
||||
// $(this).val($("#mailList_"+index).text());
|
||||
// }
|
||||
// }else{
|
||||
// if(/@/.test(v)){
|
||||
// index = -1;
|
||||
// //获得@后面的值
|
||||
// //s = v.replace(/@.*/, "");
|
||||
// //创建新匹配数组
|
||||
// var site = v.replace(/.*@/, "");
|
||||
// newArr = $.map(mailArr, function(n){
|
||||
// var reg = new RegExp(site);
|
||||
// if(reg.test(n)){
|
||||
// return n;
|
||||
// }
|
||||
// });
|
||||
// }else{
|
||||
// newArr = mailArr;
|
||||
// }
|
||||
// }
|
||||
// x.html($.createHtml(s, newArr, index)).css("left", 0);
|
||||
// if(e.keyCode === 13){
|
||||
// //回车
|
||||
// if(index > -1 && index < newArr.length){
|
||||
// //如果当前有激活列表
|
||||
// x.css("left", "-6000px");
|
||||
// }
|
||||
// }
|
||||
// }else{
|
||||
// x.css("left", "-6000px");
|
||||
// }
|
||||
// }).blur(function(){
|
||||
// if(hint && text){
|
||||
// var blur_v = $.trim($(this).val());
|
||||
// if(blur_v === ""){
|
||||
// $(this).val(text);
|
||||
// }
|
||||
// }
|
||||
// $(this).css("color", bc).unbind("keyup").parent().css("z-index",0);
|
||||
// x.css("left", "-6000px");
|
||||
//
|
||||
// }).keydown(function(event){
|
||||
// if(event.keyCode == 13){
|
||||
// return false;
|
||||
// }
|
||||
// });
|
||||
// //鼠标经过列表项事件
|
||||
// //鼠标经过
|
||||
// $(".mailHover").on("mouseover", function(){
|
||||
// index = Number($(this).attr("id").split("_")[1]);
|
||||
// liveValue = $("#mailList_"+index).text();
|
||||
// x.children("." + cf).removeClass(cf).addClass(cl);
|
||||
// $(this).addClass(cf).removeClass(cl);
|
||||
// });
|
||||
// $(".mailHover").on("click", function(){
|
||||
// $("#mail").val($(this).html());
|
||||
// });
|
||||
//
|
||||
//
|
||||
// });
|
||||
//
|
||||
// x.bind("mousedown", function(){
|
||||
// that.val(liveValue);
|
||||
// });
|
||||
// });
|
||||
};
|
||||
|
||||
})(jQuery);
|
|
@ -9,6 +9,10 @@ h4, .wiki h3 {font-size: 13px;}
|
|||
h4 {border-bottom: 1px dotted #bbb;}
|
||||
li{list-style-type:none;}
|
||||
/*huang*/
|
||||
|
||||
.hwork_input_news{ border:1px solid #64bdd9; height:22px; width:594px; background:#fff; margin-bottom:10px; padding:5px;}
|
||||
.ml55{ margin-left:55px;}
|
||||
.fl {float:left;}
|
||||
/*current position*/
|
||||
.contest_count{
|
||||
width: 20%;
|
||||
|
@ -2810,4 +2814,4 @@ img.school_avatar {
|
|||
}
|
||||
|
||||
.admin_message_warn{font-size: 12px;color: red;}
|
||||
a.btn_message_free{ background:#15BCCF; display:block; text-align:center; color:#fff; padding:3px 0; width:60px; margin-bottom:10px;}
|
||||
a.btn_message_free{ background:#15BCCF; display:block; text-align:center; color:#fff; padding:3px 0; width:60px; margin-bottom:10px;margin-left: 58px;}
|
||||
|
|
|
@ -68,6 +68,7 @@ h4{ font-size:14px; color:#3b3b3b;}
|
|||
.ml10{ margin-left:10px;}
|
||||
.ml15{ margin-left:15px;}
|
||||
.ml20{ margin-left:20px;}
|
||||
.ml36{ margin-left:36px; }
|
||||
.ml40{ margin-left:40px;}
|
||||
.ml45{ margin-left:45px;}
|
||||
.ml55{ margin-left:55px;}
|
||||
|
@ -473,7 +474,7 @@ a.homepageSearchIcon:hover {background:url(../images/nav_icon.png) -49px 3px no-
|
|||
.homepageFollow {background:url(../images/homepage_icon.png) -10px -8px no-repeat; width:20px; height:20px; position:absolute; right:9px; top:9px;}
|
||||
.homepageFollowCancel {background:url(../images/homepage_icon.png) -178px -8px no-repeat; width:20px; height:20px; position:absolute; right:9px; top:9px;}
|
||||
.homepageEditProfile {width:16px; height:16px; border-radius:2px; background-color:#888888; position:absolute; right:5px; bottom:5px; font-size:12px; filter:alpha(opacity=50); -moz-opacity:0.5; opacity: 0.5;}
|
||||
.homepageEditProfileIcon {background:url(../images/homepage_icon.png) -14px -37px no-repeat; width:20px; height:20px; display:block;}
|
||||
.homepageEditProfileIcon {background:url(../images/homepage_icon2.png) -14px -37px no-repeat; width:20px; height:20px; display:block;}
|
||||
.homepageImageName {font-size:16px; color:#484848; height:25px; float:left; font-weight: bold; max-width:90px;overflow: hidden; white-space:nowrap; text-overflow:ellipsis;}
|
||||
.homepageImageSexMan {top:116px; left:5px; width:20px; height:20px; background:url(../images/homepage_icon.png) -10px -112px no-repeat; float:left;}
|
||||
.homepageImageSexWomen {width: 20px;height: 20px;background: url(../images/homepage_icon.png) -10px -149px no-repeat;float: left;}
|
||||
|
@ -516,6 +517,7 @@ a.homepageMenuText {color:#484848; font-size:16px; margin-left:20px;}
|
|||
.homepageNewsType {width:110px; padding-left: 5px; font-size:12px; color:#888888; display:block;}
|
||||
.homepageNewsPubType {width:220px; font-size:12px; color:#888888; display: block;}
|
||||
.homepageNewsContent {width:365px; max-width:365px; margin-right:10px; font-size:12px; color:#4b4b4b; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;max-height: 49px; }
|
||||
.homepageSystenMessageContent {width:291px; max-width:291px; margin-right:10px; font-size:12px; color:#4b4b4b; display:block; overflow:hidden;text-overflow:ellipsis;max-height: 49px; }
|
||||
.homepageHomeworkContentWarn {width:110px; max-width:365px; margin-right:10px; font-size:12px; color:red; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;max-height: 49px; }
|
||||
.homepageHomeworkContent {width:245px; max-width:365px; margin-right:10px; font-size:12px; color:#4b4b4b; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;max-height: 49px; }
|
||||
|
||||
|
@ -553,7 +555,7 @@ a.homepagePostTypeAll {background:url(../images/homepage_icon.png) -185px -308px
|
|||
a.postTypeGrey {color:#888888;}
|
||||
a.postTypeGrey:hover {color:#269ac9;}
|
||||
.homepagePostBrief {width:710px; margin:0px auto; position:relative;}
|
||||
.homepagePostPortrait {float:left; width:50px;}
|
||||
.homepagePostPortrait {float:left; width:42px;}
|
||||
.homepagePostDes {float:left; width:645px; margin-left:15px;}
|
||||
.homepagePostTo {font-size:14px; color:#484848; margin-bottom:5px;}
|
||||
.homepagePostTitle {font-size:14px; color:#484848; margin-bottom:5px; font-weight:bold;}
|
||||
|
@ -990,8 +992,8 @@ img.ui-datepicker-trigger {
|
|||
text-overflow: ellipsis;
|
||||
margin-bottom: 3px;
|
||||
}
|
||||
.message_title{border: 1px solid #D4D4D4;padding: 0.6em;margin-left: 1.4em;margin-right: 0.4em;border-radius: 4px;font-family: "Microsoft YaHei";background-size: 100% 100%;margin-bottom: 5px;background-color: #E8E8E8;}
|
||||
.message_title_red{border: 1px solid #D4D4D4;padding: 0.6em;margin-left: 1.4em;margin-right: 0.4em;border-radius: 4px;font-family: "Microsoft YaHei";background-size: 100% 100%;margin-bottom: 5px;background-color: #E8E8E8;color: red}
|
||||
.message_title{border: 1px solid #9C9C9C;padding: 0.6em;margin-left: 1.4em;margin-right: 0.4em;border-radius: 4px;font-family: "Microsoft YaHei";background-size: 100% 100%;margin-bottom: 5px;background-color: #fff; max-width:400px;word-wrap:break-word; word-break:break-all;}
|
||||
.message_title_red{border: 1px solid #484848;padding: 0.6em;margin-left: 1.4em;margin-right: 0.4em;border-radius: 4px;font-family: "Microsoft YaHei";background-size: 100% 100%;margin-bottom: 5px;background-color: #fff;background-image: -moz-linear-gradient(top, #fff, #E0E0E0);}
|
||||
|
||||
.description{display: none !important;}
|
||||
.ispublic-label{display: none !important;}
|
||||
|
@ -1121,7 +1123,8 @@ a:hover.tijiao{ background:#0f99a9;}
|
|||
#cboxPrevious{position:absolute; bottom:0px; left:0; color:#444;}
|
||||
#cboxNext{position:absolute; bottom:0px; left:63px; color:#444;}
|
||||
#cboxClose{position:absolute; bottom:0; right:0; display:block; color:#444;}
|
||||
|
||||
.system_message_style {line-height: 19.1px; max-width: 681px;overflow:hidden; work-wrap: break-word; word-break: break-all;}
|
||||
.system_message_style img {max-width: 100%;}
|
||||
/*20150906关联项目LB*/
|
||||
a.RalationIcon{ background: url(../images/homepage_icon.png) -183px -396px no-repeat; width:70px; height:20px; display:block; padding-left:20px; color:#888888;}
|
||||
a:hover.RalationIcon{background: url(../images/homepage_icon.png) -183px -428px no-repeat; color:#3598db;}
|
||||
|
|
|
@ -51,6 +51,100 @@ a:hover.icon_removem{background:url(../images/img_floatbox.png) -22px -61px no-
|
|||
a.btn_free{ background:#ff5722; display:block; text-align:center; color:#fff; padding:3px 0; width:80px; margin-bottom:10px;}
|
||||
a:hover.btn_free{ background:#d63502;}
|
||||
.status_inviter{color: #3CA5C6;font-weight: bold; font-size: 14px }
|
||||
/*邮件邀请新列表*/
|
||||
.section{background-color: #FFF;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
-moz-border-top-colors: none;
|
||||
-moz-border-right-colors: none;
|
||||
-moz-border-bottom-colors: none;
|
||||
-moz-border-left-colors: none;
|
||||
border-image: none;
|
||||
border-color: #DAE1E8 #D3DDE5 #B6C8D8;
|
||||
box-shadow: 0px 1px 0px 0px rgba(56, 61, 72, 0.09);
|
||||
margin-bottom: 14px;
|
||||
border-radius: 3px;
|
||||
margin-top: 20px;}
|
||||
|
||||
.section .section-header {
|
||||
/*font-size: 24px;*/
|
||||
font-weight: 200;
|
||||
line-height: 32px;
|
||||
}
|
||||
|
||||
.section .section-header div.desc {
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
line-height: 25px;
|
||||
padding: 20px 15px;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.invitations-records {
|
||||
border-top: 1px solid #DFE4E8;
|
||||
}
|
||||
|
||||
.invitations-records table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
.invitations-records tr {
|
||||
border-bottom: 1px solid #EAEDED;
|
||||
}
|
||||
.invitations-records td.email {
|
||||
width: 178px;
|
||||
}
|
||||
.invitations-records td {
|
||||
transition-property: background;
|
||||
transition-duration: 0.3s;
|
||||
}
|
||||
.invitations-records td, .invitations-records th {
|
||||
padding: 15px;
|
||||
position: relative;
|
||||
}
|
||||
/*th, td {*/
|
||||
/*text-align: left;*/
|
||||
/*vertical-align: top;*/
|
||||
/*}*/
|
||||
.invitations-records td.email {
|
||||
max-width: 200px;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
width:200px;
|
||||
}
|
||||
.invitations-records td.text-name {
|
||||
max-width: 200px;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
width: 200px;
|
||||
}
|
||||
.invitations-records td.text-name span.unactive {
|
||||
max-width: 200px;
|
||||
color: #888;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
width: 200px;
|
||||
}
|
||||
.invitations-records td.text-status {
|
||||
max-width: 290px;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
color: #7CAD37;
|
||||
font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
|
||||
}
|
||||
.invitations-records td.text-time {
|
||||
max-width: 80px;
|
||||
font-size: 12px;
|
||||
color: #888;
|
||||
display: block;
|
||||
text-align: right;
|
||||
width: 80px;
|
||||
}
|
||||
/*成员邀请*/
|
||||
.invi_search{ }
|
||||
.invi_search_input{ border:1px solid #15bccf; width:180px; height:24px; color:#9b9b9b; padding-left:5px; margin-bottom:10px;}
|
||||
|
|
|
@ -150,6 +150,7 @@ a:hover.c_orange{color: #d33503;}
|
|||
a.c_lorange{color:#ff9900;}
|
||||
a:hover.c_lorange{color:#fff;}
|
||||
a.c_blue{ color:#15bccf;}
|
||||
a.c_eblue{color: #3784D3}
|
||||
a.c_setting_blue{color: #0781B4}
|
||||
a.c_dblue{ color:#09658c;}
|
||||
a:hover.c_dblue{ color:#15bccf;}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
FactoryGirl.define do
|
||||
factory :system_message do
|
||||
factory :system_messages do
|
||||
id 1
|
||||
user_id 1
|
||||
content "MyString"
|
||||
|
|
Loading…
Reference in New Issue