Merge remote-tracking branch 'origin/szzh' into guange_dev

This commit is contained in:
guange 2015-06-10 15:20:52 +08:00
commit 25ac0100c7
47 changed files with 1558 additions and 1509 deletions

View File

@ -10,7 +10,7 @@ module Mobile
else
f[field]
end
elsif f.is_a?(::Bid)
elsif f.is_a?(::HomeworkCommon)
if f.respond_to?(field)
f.send(field)
else

View File

@ -15,11 +15,10 @@ class ActivityNotifysController < ApplicationController
end
if( query != nil )
logger.info('xxoo')
limit = 10;
@obj_count = query.count();
@obj_pages = Paginator.new @obj_count,limit,params['page']
list = query.order('id desc').limit(limit).offset(@obj_pages.offset).all();
list = query.order('is_read,id desc').limit(limit).offset(@obj_pages.offset).all();
events=[];
for item in list
event = item.activity;
@ -29,7 +28,6 @@ class ActivityNotifysController < ApplicationController
end
@events_by_day = events.group_by {|event| User.current.time_to_date(event.event_datetime)}
@controller_name = 'ActivityNotifys'
logger.info('aavv')
end
respond_to do |format|
format.html {render :template => 'courses/show', :layout => 'base_courses'}

View File

@ -216,13 +216,13 @@ class AttachmentsController < ApplicationController
if @attachment.container.is_a?(News)
format.html { redirect_to_referer_or news_path(@attachment.container) }
elsif @attachment.container.is_a?(StudentWorksScore)
@is_destroy = true #根据ID删除页面对应的数据js刷新页面
@is_destroy = true unless params[:attachment_id] #根据ID删除页面对应的数据js刷新页面
format.js
elsif @attachment.container.is_a?(HomeworkCommon)
@is_destroy = true #根据ID删除页面对应的数据js刷新页面
@is_destroy = true unless params[:attachment_id] #根据ID删除页面对应的数据js刷新页面
format.js
elsif @attachment.container.is_a?(StudentWork)
@is_destroy = true #根据ID删除页面对应的数据js刷新页面
@is_destroy = true unless params[:attachment_id] #根据ID删除页面对应的数据js刷新页面
format.js
elsif @attachment.container.is_a?(Message)
format.html { redirect_to_referer_or new_board_message_path(@attachment.container) }
@ -246,7 +246,7 @@ class AttachmentsController < ApplicationController
end
format.js
end
end
end
def delete_homework

File diff suppressed because it is too large Load Diff

View File

@ -6,6 +6,7 @@ class CoursesController < ApplicationController
helper :members
helper :words
helper :attachments
helper :activity_notifys
before_filter :auth_login1, :only => [:show, :feedback]
menu_item :overview

View File

@ -94,12 +94,12 @@ class MessagesController < ApplicationController
update_kindeditor_assets_owner ids,@message.id,OwnerTypeHelper::MESSAGE
end
# 与我相关动态的记录add start
if(@board.course_id>0) #项目的先不管
teachers = searchTeacherAndAssistant(@board.course);
if(@board && @board.course) #项目的先不管
teachers = searchTeacherAndAssistant(@board.course)
for teacher in teachers
if(teacher.user_id != User.current.id)
notify = ActivityNotify.new()
if(@board.course_id>0)
if(@board.course)
notify.activity_container_id = @board.course_id
notify.activity_container_type = 'Course'
else
@ -178,7 +178,7 @@ class MessagesController < ApplicationController
end
# 与我相关动态的记录add start
if(@board.course_id>0) #项目的先不管
if(@board && @board.course) #项目的先不管
notifyto_arr = {}
notifyto_arr[@topic.author_id] = @topic.author_id
if( params[:parent_topic] != nil && params[:parent_topic] != '')
@ -188,7 +188,7 @@ class MessagesController < ApplicationController
notifyto_arr.each do |k,user_id|
if(user_id != User.current.id)
notify = ActivityNotify.new()
if(@board.course_id>0)
if(@board.course)
notify.activity_container_id = @board.course_id
notify.activity_container_type = 'Course'
else

View File

@ -365,6 +365,21 @@ class ProjectsController < ApplicationController
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
@is_zhuce = false
respond_to do |format|
format.html

View File

@ -25,7 +25,7 @@ class UsersController < ApplicationController
menu_item :user_course, :only => :user_courses
menu_item :user_homework, :only => :user_homeworks
menu_item :user_project, :only => [:user_projects, :watch_projects]
menu_item :requirement_focus, :only => :watch_bids
# menu_item :requirement_focus, :only => :watch_bids
menu_item :requirement_focus, :only => :watch_contests
menu_item :user_newfeedback, :only => :user_newfeedback
@ -36,14 +36,14 @@ class UsersController < ApplicationController
#
before_filter :can_show_course, :only => [:user_courses,:user_homeworks]
before_filter :require_admin, :except => [:show, :index, :search, :tag_save, :tag_saveEx,:user_projects, :user_newfeedback, :user_comments, :watch_bids, :watch_contests, :info,
before_filter :require_admin, :except => [:show, :index, :search, :tag_save, :tag_saveEx,:user_projects, :user_newfeedback, :user_comments, :watch_contests, :info,
:user_watchlist, :user_fanslist,:update, :user_courses, :user_homeworks, :watch_projects, :show_score, :topic_score_index, :project_score_index,
: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,:update_score,:user_activities,:user_projects_index]
#edit has been deleted by huang, 2013-9-23
before_filter :find_user, :only => [:user_fanslist, :user_watchlist, :show, :edit, :update, :destroy, :edit_membership, :user_courses,
:user_homeworks, :destroy_membership, :user_activities, :user_projects, :user_newfeedback, :user_comments,
:watch_bids, :watch_contests, :info, :watch_projects, :show_score, :topic_score_index, :project_score_index,
:watch_contests, :info, :watch_projects, :show_score, :topic_score_index, :project_score_index,
: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]
before_filter :auth_user_extension, only: :show
@ -141,25 +141,25 @@ class UsersController < ApplicationController
##added by fq
def watch_bids
cond = 'bids.reward_type <> 1'
@bids = Bid.watched_by(@user).where('reward_type = ?', 1) # added by huang
@offset, @limit = api_offset_and_limit({:limit => 10})
@bid_count = @bids.count
@bid_pages = Paginator.new @bid_count, @limit, params['page']
@offset ||= @bid_pages.reverse_offset
unless @offset == 0
@bid = @bids.offset(@offset).limit(@limit).all.reverse
else
limit = @bid_count % @limit
@bid = @bids.offset(@offset).limit(limit).all.reverse
end
respond_to do |format|
format.html {
render :layout => 'base_users'
}
format.api
end
# cond = 'bids.reward_type <> 1'
# @bids = Bid.watched_by(@user).where('reward_type = ?', 1) # added by huang
# @offset, @limit = api_offset_and_limit({:limit => 10})
# @bid_count = @bids.count
# @bid_pages = Paginator.new @bid_count, @limit, params['page']
# @offset ||= @bid_pages.reverse_offset
# unless @offset == 0
# @bid = @bids.offset(@offset).limit(@limit).all.reverse
# else
# limit = @bid_count % @limit
# @bid = @bids.offset(@offset).limit(limit).all.reverse
# end
#
# respond_to do |format|
# format.html {
# render :layout => 'base_users'
# }
# format.api
# end
end
#new add by linchun
@ -215,24 +215,24 @@ class UsersController < ApplicationController
# added by huang
def user_homeworks
@membership = @user.memberships.all(:conditions => Project.visible_condition(User.current))
@memberships = []
@membership.each do |membership|
if membership.project.project_type == 1
@memberships << membership
end
end
@bid = []
@memberships.each do |membership|
@bid += membership.project.homeworks
end
@bid = @bid.group_by {|bid| bid.courses.first.id}
unless User.current.admin?
if !@user.active?
render_404
return
end
end
# @membership = @user.memberships.all(:conditions => Project.visible_condition(User.current))
# @memberships = []
# @membership.each do |membership|
# if membership.project.project_type == 1
# @memberships << membership
# end
# end
# @bid = []
# @memberships.each do |membership|
# @bid += membership.project.homeworks
# end
# @bid = @bid.group_by {|bid| bid.courses.first.id}
# unless User.current.admin?
# if !@user.active?
# render_404
# return
# end
# end
end
@ -757,7 +757,7 @@ class UsersController < ApplicationController
when '3' then
@obj = Issue.find_by_id(@obj_id)
when '4' then
@obj = Bid.find_by_id(@obj_id)
# @obj = Bid.find_by_id(@obj_id)
when '5' then
@obj = Forum.find_by_id(@obj_id)
when '6'
@ -800,7 +800,7 @@ class UsersController < ApplicationController
when '3' then
@obj = Issue.find_by_id(@obj_id)
when '4' then
@obj = Bid.find_by_id(@obj_id)
# @obj = Bid.find_by_id(@obj_id)
when '5' then
@obj = Forum.find_by_id(@obj_id)
when '6'

View File

@ -30,8 +30,7 @@ class ZipdownController < ApplicationController
if file_count > 0
zipfile = zip_bid bid
else
render file: 'public/no_file_found.html'
return
zipfile = {:message => "no file"}
end
elsif params[:obj_class] == "HomeworkCommon"
homework = HomeworkCommon.find params[:obj_id]
@ -41,8 +40,7 @@ class ZipdownController < ApplicationController
if file_count > 0
zipfile = zip_homework_common homework
else
render file: 'public/no_file_found.html'
return
zipfile = {:message => "no file"}
end
else
logger.error "[ZipDown#assort] ===> #{params[:obj_class]} unKown !!"
@ -62,7 +60,7 @@ class ZipdownController < ApplicationController
unless homework.attachments.empty?
zipfile = zip_homework_by_user homework
send_file zipfile.file_path, :filename => ((homework.user.user_extensions.nil? || homework.user.user_extensions.student_id.nil?) ? "" : homework.user.user_extensions.student_id) +
"_" + (homework.user.lastname.nil? ? "" : homework.user.lastname) + (homework.user.firstname.nil? ? "" : homework.user.firstname) +
"_" + homework.user.show_name +
"_" + homework.name + ".zip", :type => detect_content_type(zipfile.file_path) if(zipfile)
else
render file: 'public/no_file_found.html'
@ -150,7 +148,7 @@ class ZipdownController < ApplicationController
end
end
out_file = find_or_pack(homework_attach.bid_id, homework_attach.user_id, digests.sort){
zipping("#{homework_attach.user.lastname}#{homework_attach.user.firstname}_#{((homework_attach.user.user_extensions.nil? || homework_attach.user.user_extensions.student_id.nil?) ? "" : homework_attach.user.user_extensions.student_id)}_#{Time.now.to_i.to_s}.zip",
zipping("#{homework_attach.user.show_name}_#{((homework_attach.user.user_extensions.nil? || homework_attach.user.user_extensions.student_id.nil?) ? "" : homework_attach.user.user_extensions.student_id)}_#{Time.now.to_i.to_s}.zip",
homeworks_attach_path, OUTPUT_FOLDER, true, not_exist_file)
}
end
@ -170,7 +168,7 @@ class ZipdownController < ApplicationController
end
end
out_file = find_or_pack(work.homework_common_id, work.user_id, digests.sort){
zipping("#{work.user.lastname}#{work.user.firstname}_#{((work.user.user_extensions.nil? || work.user.user_extensions.student_id.nil?) ? "" : work.user.user_extensions.student_id)}_#{Time.now.to_i.to_s}.zip",
zipping("#{work.user.show_name}_#{((work.user.user_extensions.nil? || work.user.user_extensions.student_id.nil?) ? "" : work.user.user_extensions.student_id)}_#{Time.now.to_i.to_s}.zip",
homeworks_attach_path, OUTPUT_FOLDER, true, not_exist_file)
}
end

View File

@ -0,0 +1,7 @@
module ActivityNotifysHelper
def get_new_notify_count(container,type)
logger.info('xxoo')
query = ActivityNotify.where('activity_container_id=? and activity_container_type=? and notify_to=?',container.id,type,User.current.id);
return query.count()
end
end

View File

@ -115,30 +115,39 @@ class Mailer < ActionMailer::Base
count = courses.count
count = count - 1
for i in 0..count do
bids = courses[i].homeworks.where("bids.created_on between '#{date_from}' and '#{date_to}'").order("bids.created_on desc")
bids = courses[i].homework_commons.where("homework_commons.created_at between '#{date_from}' and '#{date_to}'").order("homework_commons.created_at desc")
attachments = courses[i].attachments.where("attachments.created_on between '#{date_from}' and '#{date_to}'").order('attachments.created_on DESC')
@bids += bids if bids.count > 0
@attachments += attachments if attachments.count > 0
end
end
# user 提交的作业
@homeworks = HomeworkAttach.where("user_id=#{user.id} and (created_at between '#{date_from}' and '#{date_to}')").order("created_at desc")
# @homeworks = HomeworkAttach.where("user_id=#{user.id} and (created_at between '#{date_from}' and '#{date_to}')").order("created_at desc")
# 查询user在课程。项目中发布的讨论帖子
messages = Message.find_by_sql("select me.* from messages me, boards b, members m where
b.id = me.board_id and b.project_id = m.project_id and m.user_id = '#{user.id}' and (me.created_on between '#{date_from}' and '#{date_to}') order by created_on desc")
# 查询user在课程中发布的讨论帖子
course_mesages = Message.find_by_sql("select distinct me.* from messages me, boards b, members m where
b.id = me.board_id and b.course_id = m.course_id
and b.course_id is not Null and m.user_id = '#{user.id}'
and (me.created_on between '#{date_from}' and '#{date_to}') order by created_on desc")
# 查询user在项目中发布的讨论帖子
project_messages = Message.find_by_sql("select distinct me.* from messages me, boards b, members m where
b.id = me.board_id and b.project_id = m.project_id
and b.project_id != '-1' and m.user_id = '#{user.id}' and (me.created_on between '#{date_from}' and '#{date_to}') order by created_on desc")
# messages = Message.find_by_sql("select DISTINCT * from messages where author_id = #{user.id} and (created_on between '#{date_from}' and '#{date_to}') order by created_on desc")
@course_messages ||= []
@project_messages ||= []
unless messages.first.nil?
messages.each do |msg|
if msg.project
@project_messages << msg
elsif msg.course
@course_messages << msg
end
unless course_mesages.first.nil?
course_mesages.each do |msg|
@course_messages << msg
end
end
unless project_messages.first.nil?
project_messages.each do |msg|
@project_messages << msg
end
end
# wiki
# 查询user在课程中发布的通知项目中发的新闻
@course_news = (course_ids && !course_ids.empty?) ? News.find_by_sql("select DISTINCT n.* from news n
@ -157,7 +166,7 @@ class Mailer < ActionMailer::Base
@memos = Memo.find_by_sql("select DISTINCT m.* from memos m, forums f where (m.author_id = #{user.id} or (m.forum_id = f.id and f.creator_id = #{user.id}))
and (m.created_at between '#{date_from}' and '#{date_to}') order by m.created_at desc")
has_content = [@issues,@homeworks,@course_messages,@project_messages,@course_news,@project_news,
has_content = [@issues,@course_messages,@project_messages,@course_news,@project_news,
@course_journal_messages,@user_journal_messages,@forums,@memos,@attachments,@bids].any? {|o| !o.empty?}
mylogger.debug "Sent activity mail : #{user.mail} - #{has_content}"
#有内容才发,没有不发
@ -198,8 +207,8 @@ class Mailer < ActionMailer::Base
@title = "#@user #{t(:label_leave_your_message, :locale => 'zh')}"
@issue_author_url = url_for(user_activities_url(@user))
@url = case journals_for_message.jour.class.to_s.to_sym # 判断留言的对象所属类型
when :Bid
course_for_bid_url(journals_for_message.jour, anchor: "word_li_#{journals_for_message.id}")
# when :Bid
# course_for_bid_url(journals_for_message.jour, anchor: "word_li_#{journals_for_message.id}")
when :Project
return -1 if journals_for_message.jour.project_type == Project::ProjectType_project
project_feedback_url(journals_for_message.jour, anchor: "word_li_#{journals_for_message.id}")
@ -235,12 +244,12 @@ class Mailer < ActionMailer::Base
mail :to => @recipients,
:subject => "#{l(:label_your_course)}#{journals_for_message.jour.name}#{l(:label_have_message)} ",
:filter => true
elsif journals_for_message.jour.class.to_s.to_sym == :Bid
if !journals_for_message.jour.author.notify_about? journals_for_message
return -1
end
mail :to => recipients, :subject => @title,:filter => true
# elsif journals_for_message.jour.class.to_s.to_sym == :Bid
# if !journals_for_message.jour.author.notify_about? journals_for_message
# return -1
# end
#
# mail :to => recipients, :subject => @title,:filter => true
elsif journals_for_message.jour.class.to_s.to_sym == :Contest
if !journals_for_message.jour.author.notify_about? journals_for_message
return -1

View File

@ -277,15 +277,18 @@ class User < Principal
end
def show_name
name = ""
unless self.user_extensions.nil?
if self.user_extensions.identity == 2
firstname
name = firstname
else
lastname+firstname
name = lastname+firstname
end
else
lastname+firstname
name = lastname+firstname
end
name = name.empty? || name.nil? ? login : name
name
end
## end

View File

@ -330,7 +330,7 @@ class CoursesService
def homework_list params,current_user
course = Course.find(params[:id])
if course.is_public != 0 || current_user.member_of_course?(course)
bids = course.homeworks.order('deadline DESC')
bids = course.homework_commons.order('end_time DESC')
bids = bids.like(params[:name]) if params[:name].present?
homeworks = []
bids.each do |bid|
@ -375,9 +375,9 @@ class CoursesService
unless latest_attachment.nil?
latest_course_dynamics << {:type => 3,:time => latest_attachment.created_on,:message =>latest_attachment.author.realname<< l(:label_recently_updated_courseware,:locale => get_user_language(current_user))<<""<<latest_attachment.filename}
end
latest_bid = course.homeworks.order('updated_on DESC').first
latest_bid = course.homework_commons.order('updated_at DESC').first
unless latest_bid.nil?
latest_course_dynamics << {:type => 4,:time => latest_bid.updated_on,:message => latest_bid.author.realname<<l(:label_recently_updated_homework,:locale => get_user_language(current_user))<<""<<latest_bid.name}
latest_course_dynamics << {:type => 4,:time => latest_bid.updated_at,:message => latest_bid.user.realname<<l(:label_recently_updated_homework,:locale => get_user_language(current_user))<<""<<latest_bid.name}
end
# Time 2015-04-07 14:58:30
@ -390,24 +390,24 @@ class CoursesService
#每个作业中的最新留言
messages = []
course.homeworks.each do |bid|
jour = bid.journals_for_messages.order("created_on desc").first
unless jour.nil?
messages << jour
end
end
unless messages.count == 0
messages.sort!{|order,newer| newer.created_on <=> order.created_on}
end
latest_bid_message = messages.first
unless latest_bid_message.nil?
latest_course_dynamics << {:type => 4,:time => latest_bid_message.created_on,:message => l(:label_recently_updated_message,:locale => get_user_language(current_user))}
end
# messages = []
# course.homework_commons.each do |hc|
# jour = hc.journals_for_messages.order("created_on desc").first
# unless jour.nil?
# messages << jour
# end
# end
# unless messages.count == 0
# messages.sort!{|order,newer| newer.created_on <=> order.created_on}
# end
# latest_bid_message = messages.first
# unless latest_bid_message.nil?
# latest_course_dynamics << {:type => 4,:time => latest_bid_message.created_on,:message => l(:label_recently_updated_message,:locale => get_user_language(current_user))}
# end
#每个作业中学生最后提交的作业
homeworks = []
course.homeworks.each do |bid|
homework_attach = bid.homeworks.order('updated_at DESC').first
course.homework_commons.each do |bid|
homework_attach = bid.student_works.order('updated_at DESC').first
unless homework_attach.nil?
homeworks << homework_attach
end
@ -533,21 +533,21 @@ class CoursesService
mems
end
def show_homework_info course,bid,current_user,is_course_teacher
author_real_name = bid.author.lastname + bid.author.firstname
many_times = course.homeworks.index(bid) + 1
author_real_name = bid.user.lastname + bid.user.firstname
many_times = course.homework_commons.index(bid) + 1
name = bid.name
homework_count = bid.homeworks.count #已提交的作业数量
student_questions_count = bid.journals_for_messages.where('m_parent_id IS NULL').count
homework_count = bid.student_works.count #已提交的作业数量
#student_questions_count = bid.journals_for_messages.where('m_parent_id IS NULL').count
description = bid.description
#if is_course_teacher(User.current, course) && @bid.open_anonymous_evaluation == 1 && @bid.homeworks.count >= 2
state = bid.comment_status
state = bid.homework_detail_manual.comment_status
unless is_course_teacher
homework_for_anonymous_comments = get_student_batch_homework_list bid,current_user
end
#end
open_anonymous_evaluation = bid.open_anonymous_evaluation
{:course_name => course.name,:course_id => course.id,:id => bid.id, :author => bid.author,:author_real_name => author_real_name, :homework_times => many_times, :homework_name => name, :homework_count => homework_count,:student_questions_count => student_questions_count,
:description => description, :homework_state => state,:open_anonymous_evaluation => open_anonymous_evaluation,:homework_for_anonymous_comments => homework_for_anonymous_comments,:created_on => bid.created_on,:deadline => bid.deadline}
open_anonymous_evaluation = bid.homework_detail_manual.comment_status
{:course_name => course.name,:course_id => course.id,:id => bid.id, :author => bid.user,:author_real_name => author_real_name, :homework_times => many_times, :homework_name => name, :homework_count => homework_count,:student_questions_count => 0,
:description => description, :homework_state => state,:open_anonymous_evaluation => open_anonymous_evaluation,:homework_for_anonymous_comments => homework_for_anonymous_comments,:created_on => bid.created_at,:deadline => bid.end_time}
end

View File

@ -14,21 +14,21 @@ class HomeworkService
# state=1 关闭匿评
# state=2 匿评结束
def show_homework params
@bid = Bid.find(params[:id])
course = @bid.courses.first
author = @bid.author.lastname + @bid.author.firstname
many_times = course.homeworks.index(@bid) + 1
@bid = HomeworkCommon.find(params[:id])
course = @bid.course
author = @bid.user.lastname + @bid.user.firstname
many_times = course.homework_commons.index(@bid) + 1
name = @bid.name
homework_count = @bid.homeworks.count #已提交的作业数量
student_questions_count = @bid.journals_for_messages.where('m_parent_id IS NULL').count
homework_count = @bid.student_works.count #已提交的作业数量
#student_questions_count = @bid.journals_for_messages.where('m_parent_id IS NULL').count
description = @bid.description
#if is_course_teacher(User.current, course) && @bid.open_anonymous_evaluation == 1 && @bid.homeworks.count >= 2
state = @bid.comment_status
state = @bid.homework_detail_manual.comment_status
#end
open_anonymous_evaluation = @bid.open_anonymous_evaluation
jours = @bid.journals_for_messages.where('m_parent_id IS NULL').order('created_on DESC')
{:course_name => course.name,:course_id => course.id,:id => @bid.id, :author => @bid.author,:author_real_name =>author, :homework_times => many_times, :homework_name => name, :homework_count => homework_count,:student_questions_count => student_questions_count,
:description => description, :homework_state => state,:open_anonymous_evaluation => open_anonymous_evaluation,:created_on => @bid.created_on,:deadline => @bid.deadline,:jours => jours}
open_anonymous_evaluation = @bid.homework_type
#jours = @bid.journals_for_messages.where('m_parent_id IS NULL').order('created_on DESC')
{:course_name => course.name,:course_id => course.id,:id => @bid.id, :author => @bid.user,:author_real_name =>author, :homework_times => many_times, :homework_name => name, :homework_count => homework_count,:student_questions_count => 0,
:description => description, :homework_state => state,:open_anonymous_evaluation => open_anonymous_evaluation,:created_on => @bid.created_at,:deadline => @bid.end_time,:jours => nil}
end
# 启动作业匿评前提示信息

View File

@ -255,7 +255,9 @@ class UsersService
watcher.push(params[:user_id])
scope = scope.where("id not in (?)",watcher)
end
scope = scope.like(params[:name],search_by)
#scope = scope.like(params[:name],search_by)
scope = scope.where("( LOWER(login) LIKE ? or LOWER(concat(lastname, firstname)) LIKE ? or LOWER(mail) LIKE ? )",
"%#{params[:name]}%","%#{params[:name]}%","%#{params[:name]}%")
end
#modify by yutao 2015/5/18 没有params[:user_id]参数时去掉"id not in (?)"条件 end
else

View File

@ -1,11 +1,11 @@
<style type="text/css">
div.ke-toolbar{display:none;width:400px;border:none;background:none;padding:0px 0px;}
/*div.ke-toolbar{display:none;width:400px;border:none;background:none;padding:0px 0px;}
span.ke-toolbar-icon{line-height:26px;font-size:14px;padding-left:26px;}
span.ke-toolbar-icon-url{background-image:url( /images/public_icon.png )}
div.ke-toolbar .ke-outline{padding:0px 0px;line-height:26px;font-size:14px;}
span.ke-icon-emoticons{background-position:0px -671px;width:50px;height:26px;}
span.ke-icon-emoticons:hover{background-position:-79px -671px;width:50px;height:26px;}
div.ke-toolbar .ke-outline{border:none;}
div.ke-toolbar .ke-outline{border:none;}*/
.break_word {width:100%;}
</style>
<script type="text/javascript">
@ -33,7 +33,8 @@
else if (window.attachEvent)
window.attachEvent("onload", buildsubmenus)
</script>
<%= javascript_include_tag "/assets/kindeditor/kindeditor-min" %>
<%= javascript_include_tag "/assets/kindeditor/kindeditor" %>
<%#= javascript_include_tag "/assets/kindeditor/kindeditor-min" %>
<% if @project %>
<%= render :partial => 'project_show', locals: {project: @project} %>
@ -103,7 +104,8 @@ function nh_check_field(params){
result=false;
}
if(params.content.html()!=params.textarea.html() || params.issubmit==true){
params.textarea.html(params.content.html());
// params.textarea.html(params.content.html()); //用这个ie11提交到服务器居然木有值 真特么旧梦已尘风
params.content.sync(); //但是这个貌似编辑器没内容时不会同步到textarea中 新愁不言中...
if(params.content.isEmpty()){
params.contentmsg.html('内容不能为空');
params.contentmsg.css({color:'#ff0000'});
@ -123,21 +125,20 @@ function nh_init_board(params){
if(params.textarea.data('init') == undefined){
//初始化编辑器
var editor = params.kindutil.create(params.textarea, {
resizeType : 1,
allowPreviewEmoticons : false,
allowImageUpload : false,
minWidth:"1px",
width:"565px",
items : ['emoticons'],
// allowPreviewEmoticons : false,
// allowImageUpload : false,
resizeType : 1,minWidth:"1px",width:"565px",height:"150px",
allowFileManager:true,uploadJson:"/kindeditor/upload",
fileManagerJson:"/kindeditor/filemanager",
afterChange:function(){//按键事件
nh_check_field({content:this,contentmsg:params.contentmsg,textarea:params.textarea});
},
afterCreate:function(){
var toolbar = $("div[class='ke-toolbar']",params.about_talk);
$(".ke-outline>.ke-toolbar-icon",toolbar).append('表情');
params.toolbar_container.append(toolbar);
// var toolbar = $("div[class='ke-toolbar']",params.about_talk);
// $(".ke-outline>.ke-toolbar-icon",toolbar).append('表情');
// params.toolbar_container.append(toolbar);
}
});
}).loadPlugin('paste');
//主题输入框按键事件
params.inputsubject.keyup(function(){

View File

@ -1,14 +1,20 @@
<div class="project_r_h">
<% if @controller_name=='ActivityNotifys' %>
<a class="fl about_me" href="<%=course_path(@course)%>"><%= l(:label_activity)%></a>
<h2 class="fl project_h2">与我相关</h2>
<a class="fl about_me" style="width:80px;" href="<%=course_path(@course)%>"><%= l(:label_activity)%></a>
<h2 class="fl project_h2" style="width:100px;">与我相关
<span class="c_orange f12" style="display:none;">(<font id="new_notify_count"><%=get_new_notify_count(@course,'Course')%></font>)</span>
</h2>
<div class="fr mt10 mr5 c_grey02">
<label class="mr5" style="cursor:pointer;" data-href="<%= course_activity_notifys_path(@course) %>/chang_read_flag" nhname='nh_act_link_all'>全部标为已读</label>
<a class="c_dblue">
<label class="mr5" style="cursor:pointer;" data-href="<%= course_activity_notifys_path(@course) %>/chang_read_flag" nhname='nh_act_link_all'>全部标为已读</label>
</a>
</div>
<% else %>
<h2 class="fl project_h2"><%= l(:label_activity)%></h2>
<% if User.current.logged? %>
<a class="fl about_me" href="<%=course_activity_notifys_path(@course)%>">与我相关</a>
<a class="fl about_me" href="<%=course_activity_notifys_path(@course)%>">与我相关
<span class="c_orange f12" style="display:none;">(<font id="new_notify_count"><%=get_new_notify_count(@course,'Course')%></font>)</span>
</a>
<% end %>
<% end %>
</div>
@ -35,7 +41,7 @@
:class => "problem_tit c_dblue fl fb",'data-type'=>e.event_type,
'data-notify-id'=>(e.respond_to?('get_notify_id') ? e.get_notify_id : ''),:nhname=>"nh_act_link",
'data-href'=>(course_activity_notifys_path(@course)+"/chang_read_flag?an_id="+(e.respond_to?('get_notify_id') ? e.get_notify_id : '').to_s)%>
<%if @controller_name=='ActivityNotifys' && !e.get_notify_is_read%>
<%if @controller_name=='ActivityNotifys' && e.get_notify_is_read!=1%>
<span nhname="nh_act_flag" class="ml10 fl"><img src="/images/new.png" width="35" height="15"/></span>
<%end%>
<br />
@ -49,6 +55,8 @@
</div><!--课程动态 end-->
<% end%>
<% end%>
<% elsif @controller_name=='ActivityNotifys' %>
<p class="nodata"><%= l(:label_no_data) %></p>
<% end%>
<% if @obj_pages.next_page.nil? && @controller_name!='ActivityNotifys' %>
<div class="problem_main">
@ -76,6 +84,14 @@
<script type="text/javascript">
$(function(){
function nh_new_notify_count_show(){
var new_notify_count = $("#new_notify_count").html();
if(new_notify_count>0){
$("#new_notify_count").parent('span').show();
}else{
$("#new_notify_count").parent('span').hide();
}
}
$("div[nhname='container']").each(function(){
var container = $(this);
var btn = $("a[nhname='nh_act_link']",container);
@ -88,6 +104,8 @@
$.ajax({url:url,dataType:'text',success:function(data){
if(data == 'true'){
flag.remove();
$("#new_notify_count").html($("#new_notify_count").html()-1);
nh_new_notify_count_show();
}
}});
}
@ -100,8 +118,11 @@
$.ajax({url:url,dataType:'text',success:function(data){
if(data == 'true'){
$("span[nhname='nh_act_flag']").remove();
$("#new_notify_count").html('0');
nh_new_notify_count_show();
}
}});
});
nh_new_notify_count_show();
});
</script>

View File

@ -31,7 +31,7 @@
}
showModal('ajax-modal', '513px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("<span style='float: right;cursor:pointer;padding-left: 513px;'><a href='javascript:void(0)' onclick='closeModal()'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='closeModal()' style='margin-left: 480px;'><img src='/images/bid/close.png' width='26px' height='26px' /></a>");
$('#ajax-modal').parent().css("top","").css("left","");
$('#ajax-modal').parent().addClass("popbox_polls");
}

View File

@ -5,7 +5,7 @@
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'upload_show_project',:locals => {:project => project}) %>');
showModal('ajax-modal', '513px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("<span style='float: right;cursor:pointer;padding-left: 513px;'><a href='javascript:void(0)' onclick='closeModal()'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='closeModal()' style='margin-left: 480px;'><img src='/images/bid/close.png' width='26px' height='26px' /></a>");
$('#ajax-modal').parent().css("top","40%").css("left","36%");
$('#ajax-modal').parent().addClass("popbox_polls");
}

View File

@ -6,6 +6,6 @@
showModal('ajax-modal', '513px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("<span style='float: right;cursor:pointer;padding-left: 513px;'><a href='javascript:void(0)' onclick='closeModal()'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='closeModal()' style='margin-left: 480px;'><img src='/images/bid/close.png' width='26px' height='26px' /></a>");
$('#ajax-modal').parent().css("top","").css("left","");
$('#ajax-modal').parent().addClass("popbox_polls");

View File

@ -6,6 +6,6 @@
showModal('ajax-modal', '513px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("<span style='float: right;cursor:pointer;padding-left: 513px;'><a href='javascript:void(0)' onclick='closeModal()'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='closeModal()' style='margin-left: 480px;'><img src='/images/bid/close.png' width='26px' height='26px' /></a>");
$('#ajax-modal').parent().css("top","30%").css("left","35%");
$('#ajax-modal').parent().addClass("popbox_polls");

View File

@ -16,9 +16,9 @@
<div class="problem_main">
<%= link_to(image_tag(url_to_avatar(homework.user), :width => "42", :height => "42"), user_path(homework.user), :class => "problem_pic fl") %>
<div class="problem_txt fl mt5">
<%= link_to(homework.user.lastname+homework.user.firstname, user_path(homework.user),:class => 'problem_name fl') %>
<%= link_to(homework.user.lastname+homework.user.firstname, user_path(homework.user),:class => 'problem_name fl',:target => "_blank") %>
<span class="fl"> <%= l(:label_user_create_project_homework) %></span>
<%= link_to(homework.name, student_work_index_path(:homework => homework.id), :class => 'problem_tit fl fb c_dblue') %>
<%= link_to(homework.name, student_work_index_path(:homework => homework.id), :class => 'problem_tit fl fb c_dblue',:target => "_blank") %>
<div class="cl mb5"></div>
<p class="fl ">
<%= l(:lebel_homework_commit)%>

View File

@ -218,9 +218,8 @@
</td>
</tr>
<% end %>
<% unless @user.user_extensions.nil?&&@user.user_extensions.location.empty?%>
<% if @user.user_extensions && @user.user_extensions.location && !@user.user_extensions.location.empty?%>
<tr>
<td style=" float: right" width="70px">
<span style="float: right"> <%= l(:label_location) %></span>
</td>

View File

@ -23,7 +23,7 @@
</li>
<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">
<%= @message.content %>
<%= @message.content.html_safe %>
</span>
</li>

View File

@ -3,88 +3,66 @@
<%= @subject %>
</h4>
<% if @attachments.first || @course_news.first || @bids.first ||
@homeworks.first || @course_journal_messages.first|| @course_messages.first %>
@course_journal_messages.first|| @course_messages.first %>
<div class="wmail_main" style="padding:20px 10px 0px;">
<h2 class="wmail_h2" style="color:#15bccf; "><%= l(:label_course_overview)%></h2>
<h3 class="wmail_h2" style="color:#15bccf; "><%= l(:label_course_overview)%></h3>
<% unless @course_news.first.nil? %>
<ul class="wmail_ul" style=" list-style-type:none;clear: both;margin-left:10px; border-bottom:1px dashed #cfcfcf; padding-bottom:15px; width:720px; margin-bottom:15px;">
<h4 class="wmail_h4" style="color:#474646; font-size:14px; margin-bottom:5px;" >
<ul class="wmail_ul" style=" list-style-type:none;clear: both;margin-left:10px; border-bottom:1px dashed #cfcfcf; padding-bottom:15px; width:1020px; margin-bottom:15px;">
<span class="wmail_h4" style="color:#474646; font-size:14px; margin-bottom:5px;" >
<%= l(:label_course_news) %>
<span class="wmail_num" style="color:#fe3f0c; margin-left:5px; font-weight:normal;">(<%= @course_news.count %>)</span>
</h4>
<!--<span class="wmail_num" style="color:#fe3f0c; margin-left:5px; font-weight:normal;">(<%#= @course_news.count %>)</span>-->
</span>
<% @course_news.each do |course_new|%>
<li style="clear: both; list-style: none;">
<span class="wmail_dis" style="float:left; color:#000000; margin-right:5px;">▪</span>
<span class="wmail_b" style="color:#1b55a7; font-weight:bold; float:left;">[</span>
<span class="wmail_b" style="color:#666; font-weight:bold; float:left;">[</span>
<%= link_to truncate(course_new.course.name,length: 30,omission: '...'), course_url(course_new.course, :token => @token.value),
:class=> "wmail_column",
:style=> " font-weight: bold; display:block; float:left; color:#1b55a7;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
<span class="wmail_b" style="color:#1b55a7; font-weight:bold; float:left;">]</span>
:style=> " font-weight: bold; display:block; float:left; color:#666;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
<span class="wmail_b" style="color:#666; font-weight:bold; float:left;">]</span>
<%= link_to course_new.author, user_activities_url(course_new.author,:token => @token.value), :class => "wmail_name",
:style => "color:#fe5722; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%>
<span class="wmail_txt" style="float:left; margin-right:5px;color:#6e6e6e;"><%= l(:label_project_notice) %></span>
:style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%>
<span class="wmail_txt" style="float:left; margin-right:5px;color:#ACAEB1;"><%= l(:label_project_notice) %></span>
<%= link_to truncate(course_new.title,length: 30,omission: '...'), news_url(course_new,:token => @token.value),
:class => 'wmail_info',
:style => "color:#5a5a5a; float:left; margin-right:5px; display:block;color:#1b55a7;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"
:style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"
%>
<span class="wmail_date" style="color:#6e6e6e; float:right;display:block; margin-left:10px;"><%= format_time(course_new.created_on) %></span>
</li>
<% end %>
<div class="cl"></div>
</ul><!--课程通知 end-->
<% end %>
<!--课程作业-->
<% if !@bids.first.nil? || !@homeworks.first.nil? %>
<ul class="wmail_ul" style="clear: both;margin-left:10px; border-bottom:1px dashed #cfcfcf; padding-bottom:15px; width:720px; margin-bottom:15px;">
<h4 class="wmail_h4" style="color:#474646; font-size:14px; margin-bottom:5px;"><%= l(:label_homework_overview) %><span class="wmail_num" style="color:#fe3f0c; margin-left:5px; font-weight:normal;">(<%= @bids.count %>)</span></h4>
<% unless @bids.empty? %>
<ul class="wmail_ul" style="clear: both;margin-left:10px; border-bottom:1px dashed #cfcfcf; padding-bottom:15px; width:1020px; margin-bottom:15px;">
<span class="wmail_h4" style="color:#474646; font-size:14px; margin-bottom:5px;">
<%= l(:label_homework_overview) %>
<!--<span class="wmail_num" style="color:#fe3f0c; margin-left:5px; font-weight:normal;">(<%#= @bids.count %>)</span>-->
</span>
<% unless @bids.first.nil?%>
<% @bids.each do |bid| %>
<li style="clear: both; list-style: none;">
<span class="wmail_dis" style="float:left; color:#000000; margin-right:5px;">▪</span>
<span class="wmail_b" style="color:#1b55a7; font-weight:bold; float:left;">[</span>
<span class="wmail_b" style="color:#666; font-weight:bold; float:left;">[</span>
<%= link_to truncate(bid.courses.first.name,length: 30,omission: '...'), course_url(bid.courses.first, :token => @token.value),
<%= link_to truncate(bid.course.name,length: 30,omission: '...'), course_url(bid.course, :token => @token.value),
:class=> "wmail_column",
:style=> " font-weight: bold; display:block; float:left; color:#1b55a7;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
<span class="wmail_b" style="color:#1b55a7; font-weight:bold; float:left;">]</span>
:style=> " font-weight: bold; display:block; float:left; color:#666;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
<span class="wmail_b" style="color:#666; font-weight:bold; float:left;">]</span>
<%= link_to bid.author, user_activities_url(bid.author,:token => @token.value), :class => "wmail_name",
:style => "color:#fe5722; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%>
<span class="wmail_txt" style="float:left; margin-right:5px;color:#6e6e6e;"><%= l(:label_course_homework) %></span>
<%= link_to bid.user, user_activities_url(bid.user,:token => @token.value), :class => "wmail_name",
:style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%>
<span class="wmail_txt" style="float:left; margin-right:5px;color:#ACAEB1;"><%= l(:label_course_homework) %></span>
<%= link_to truncate(bid.name,length: 30,omission: '...'), course_for_bid_url(:id => bid.id,:token => @token.value),
<%= link_to truncate(bid.name,length: 30,omission: '...'), student_work_index_path(:homework => bid.id,:token => @token.value),
:class => 'wmail_info',
:style => "color:#5a5a5a; float:left; margin-right:5px; display:block;color:#1b55a7;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"
:style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"
%>
<span class="wmail_date" style="color:#6e6e6e; float:right;display:block; margin-left:10px;"><%= format_time(bid.created_on) %></span>
</li>
<% end %>
<% end %>
<% unless @homeworks.first.nil? %>
<% @homeworks.each do |homework| %>
<li style="clear: both; list-style: none;">
<span class="wmail_dis" style="float:left; color:#000000; margin-right:5px;">▪</span>
<span class="wmail_b" style="color:#1b55a7; font-weight:bold; float:left;">[</span>
<%= link_to truncate(homework.bid.courses.first.name,length: 30,omission: '...'), course_url(homework.bid.courses.first, :token => @token.value),
:class=> "wmail_column",
:style=> " font-weight: bold; display:block; float:left; color:#1b55a7;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
<span class="wmail_b" style="color:#1b55a7; font-weight:bold; float:left;">]</span>
<%= link_to homework.user, user_activities_url(homework.user,:token => @token.value), :class => "wmail_name",
:style => "color:#fe5722; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%>
<span class="wmail_txt" style="float:left; margin-right:5px;color:#6e6e6e;"><%= l(:label_course_submit_homework) %></span>
<%= link_to truncate(homework.name,length: 30,omission: '...'), course_for_bid_url(:id => homework.bid.id,:token => @token.value),
:class => 'wmail_info',
:style => "color:#5a5a5a; float:left; margin-right:5px; display:block;color:#1b55a7;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"
%>
<span class="wmail_date" style="color:#6e6e6e; float:right;display:block; margin-left:10px;"><%= format_time(homework.created_at) %></span>
<span class="wmail_date" style="color:#6e6e6e; float:right;display:block; margin-left:10px;"><%= format_time(bid.created_at) %></span>
</li>
<% end %>
<% end %>
@ -95,29 +73,29 @@
<!-- 课程留言 -->
<% unless @course_journal_messages.first.nil? %>
<ul class="wmail_ul" style="clear: both;margin-left:10px; border-bottom:1px dashed #cfcfcf; padding-bottom:15px; width:720px; margin-bottom:15px;">
<h4 class="wmail_h4" style="color:#474646; font-size:14px; margin-bottom:5px;" >
<ul class="wmail_ul" style="clear: both;margin-left:10px; border-bottom:1px dashed #cfcfcf; padding-bottom:15px; width:1020px; margin-bottom:15px;">
<span class="wmail_h4" style="color:#666; font-size:14px; margin-bottom:5px;" >
<%= l(:view_course_journals_for_messages) %>
<span class="wmail_num" style="color:#fe3f0c; margin-left:5px; font-weight:normal;">(<%= @course_journal_messages.count %>)</span>
</h4>
<!--<span class="wmail_num" style="color:#fe3f0c; margin-left:5px; font-weight:normal;">(<%#= @course_journal_messages.count %>)</span>-->
</span>
<% @course_journal_messages.each do |course_journal_message|%>
<li style="clear: both; list-style: none;">
<span class="wmail_dis" style="float:left; color:#000000; margin-right:5px;">▪</span>
<span class="wmail_b" style="color:#1b55a7; font-weight:bold; float:left;">[</span>
<span class="wmail_b" style="color:#666; font-weight:bold; float:left;">[</span>
<%= link_to truncate(course_journal_message.course.name,length: 30,omission: '...'), course_url(course_journal_message.course, :token => @token.value),
:class=> "wmail_column",
:style=> " font-weight: bold; display:block; float:left; color:#1b55a7;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
<span class="wmail_b" style="color:#1b55a7; font-weight:bold; float:left;">]</span>
:style=> " font-weight: bold; display:block; float:left; color:#666;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
<span class="wmail_b" style="color:#666; font-weight:bold; float:left;">]</span>
<%= link_to course_journal_message.user, user_activities_url(course_journal_message.user,:token => @token.value), :class => "wmail_name",
:style => "color:#fe5722; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%>
<span class="wmail_txt" style="float:left; margin-right:5px;color:#6e6e6e;"><%= l(:label_send_course_journals_for_messages) %></span>
:style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%>
<span class="wmail_txt" style="float:left; margin-right:5px;color:#ACAEB1;"><%= l(:label_send_course_journals_for_messages) %></span>
<%= link_to truncate(course_journal_message.notes,length: 30,omission: '...'), course_feedback_url(course_journal_message.course,:token => @token.value),
:class => 'wmail_info',
:style => "color:#5a5a5a; float:left; margin-right:5px; display:block;color:#1b55a7;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"
:style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"
%>
<span class="wmail_date" style="color:#6e6e6e; float:right;display:block; margin-left:10px;"><%= format_time(course_journal_message.created_on) %></span>
</li>
@ -128,25 +106,25 @@
<!-- 课程讨论区 -->
<% unless @course_messages.first.nil? %>
<ul class="wmail_ul" style="margin-left:10px; border-bottom:1px dashed #cfcfcf; padding-bottom:15px; width:720px; margin-bottom:15px;">
<h4 class="wmail_h4" style="color:#474646; font-size:14px; margin-bottom:5px;" >
<ul class="wmail_ul" style="margin-left:10px; border-bottom:1px dashed #cfcfcf; padding-bottom:15px; width:1020px; margin-bottom:15px;">
<span class="wmail_h4" style="color:#666; font-size:14px; margin-bottom:5px;" >
<%= l(:view_borad_course) %>
<span class="wmail_num" style="color:#fe3f0c; margin-left:5px; font-weight:normal;">(<%= @course_journal_messages.count %>)</span>
</h4>
<!--<span class="wmail_num" style="color:#fe3f0c; margin-left:5px; font-weight:normal;">(<%#= @course_messages.count %>)</span>-->
</span>
<% @course_messages.each do |course_message|%>
<li style="clear: both; list-style: none;">
<span class="wmail_dis" style="float:left; color:#000000; margin-right:5px;">▪</span>
<span class="wmail_b" style="color:#1b55a7; font-weight:bold; float:left;">[</span>
<span class="wmail_b" style="color:#666; font-weight:bold; float:left;">[</span>
<%= link_to truncate(course_message.course.name,length: 30,omission: '...'), course_url(course_message.course.id, :token => @token.value),
:class=> "wmail_column",
:style=> " font-weight: bold; display:block; float:left; color:#1b55a7;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
<span class="wmail_b" style="color:#1b55a7; font-weight:bold; float:left;">]</span>
:style=> " font-weight: bold; display:block; float:left; color:#666;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
<span class="wmail_b" style="color:#666; font-weight:bold; float:left;">]</span>
<%= link_to course_message.author, user_activities_url(course_message.author,:token => @token.value), :class => "wmail_name",
:style => "color:#fe5722; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%>
<span class="wmail_txt" style="float:left; margin-right:5px;color:#6e6e6e;"><%= l(:label_send_course_messages) %></span>
:style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%>
<span class="wmail_txt" style="float:left; margin-right:5px;color:#ACAEB1;"><%= l(:label_send_course_messages) %></span>
<%= link_to truncate(course_message.subject,length: 30,omission: '...'),board_message_url(course_message, :board_id => course_message.board_id,:token => @token.value),
:class => 'wmail_info',
:style => "color:#5a5a5a; float:left; margin-right:5px; display:block;color:#1b55a7;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
:style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
<span class="wmail_date" style="color:#6e6e6e; float:right;display:block; margin-left:10px;"><%= format_time(course_message.created_on) %></span>
</li>
<% end %>
@ -156,29 +134,28 @@
<!-- 课件 -->
<% unless @attachments.first.nil? %>
<ul class="wmail_ul" style="margin-left:10px; border-bottom:1px dashed #cfcfcf; padding-bottom:15px; width:720px; margin-bottom:15px;">
<h4 class="wmail_h4" style="color:#474646; font-size:14px; margin-bottom:5px;" >
<ul class="wmail_ul" style="margin-left:10px; border-bottom:1px dashed #cfcfcf; padding-bottom:15px; width:1020px; margin-bottom:15px;">
<span class="wmail_h4" style="color:#666; font-size:14px; margin-bottom:5px;" >
<%= l(:label_course_attendingcontestwork_download) %>
<span class="wmail_num" style="color:#fe3f0c; margin-left:5px; font-weight:normal;">(<%= @attachments.count %>)</span>
</h4>
<!--<span class="wmail_num" style="color:#fe3f0c; margin-left:5px; font-weight:normal;">(<%#= @attachments.count %>)</span>-->
</span>
<% @attachments.each do |attachment|%>
<li style="clear: both; list-style: none;">
<span class="wmail_dis" style="float:left; color:#000000; margin-right:5px;">▪</span>
<span class="wmail_b" style="color:#1b55a7; font-weight:bold; float:left;">[</span>
<span class="wmail_b" style="color:#666; font-weight:bold; float:left;">[</span>
<%= link_to truncate(attachment.course.name,length: 30,omission: '...'), course_url(attachment.course, :token => @token.value),
:class=> "wmail_column",
:style=> " font-weight: bold; display:block; float:left; color:#1b55a7;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
<span class="wmail_b" style="color:#1b55a7; font-weight:bold; float:left;">]</span>
:style=> " font-weight: bold; display:block; float:left; color:#666;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
<span class="wmail_b" style="color:#666; font-weight:bold; float:left;">]</span>
<%= link_to attachment.author, user_activities_url(attachment.author,:token => @token.value), :class => "wmail_name",
:style => "color:#fe5722; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%>
<span class="wmail_txt" style="float:left; margin-right:5px;color:#6e6e6e;"><%= l(:label_course_file_upload) %></span>
:style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%>
<span class="wmail_txt" style="float:left; margin-right:5px;color:#ACAEB1;"><%= l(:label_course_file_upload) %></span>
<%= link_to truncate(attachment.filename,length: 30,omission: '...'),course_files_url(attachment.course,:token => @token.value),
:class => 'wmail_info',
:style => "color:#5a5a5a; float:left; margin-right:5px; display:block;color:#1b55a7;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"
:style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"
%>
<span class="wmail_date" style="color:#6e6e6e; float:right;display:block; margin-left:10px;"><%= format_time(attachment.created_on) %></span>
</li>
@ -189,32 +166,29 @@
</div>
<% end %>
<!--项目相关-->
<% if @issues.first || @project_messages.first %>
<div class="wmail_main" style="padding:20px 10px 0px;">
<h2 class="wmail_h2" style="color:#15bccf; "><%= l(:label_project_overview_new)%></h2>
<h3 class="wmail_h2" style="color:#15BCCF; "><%= l(:label_project_overview_new)%></h3>
<% unless @issues.first.nil? %>
<ul class="wmail_ul" style="margin-left:10px; border-bottom:1px dashed #cfcfcf; padding-bottom:15px; width:720px; margin-bottom:15px;">
<h4 class="wmail_h4" style="color:#474646; font-size:14px; margin-bottom:5px;" >
<ul class="wmail_ul" style="margin-left:10px; border-bottom:1px dashed #cfcfcf; padding-bottom:15px; width:1020px; margin-bottom:15px;">
<span class="wmail_h4" style="color:#666; font-size:14px; margin-bottom:5px;" >
<%= l(:label_issue_tracking) %>
<span class="wmail_num" style="color:#fe3f0c; margin-left:5px; font-weight:normal;">(<%= @issues.count %>)</span>
</h4>
<!--<span class="wmail_num" style="color:#fe3f0c; margin-left:5px; font-weight:normal;">(<%#= @issues.count %>)</span>-->
</span>
<% @issues.each do |issue|%>
<li style="clear: both; list-style: none;">
<span class="wmail_dis" style="float:left; color:#000000; margin-right:5px;">▪</span>
<span class="wmail_b" style="color:#1b55a7; font-weight:bold; float:left;">[</span>
<span class="wmail_b" style="color:#666; font-weight:bold; float:left;">[</span>
<%= link_to truncate(issue.project.name,length: 30,omission: '...'), project_url(issue.project, :token => @token.value),
:class=> "wmail_column",
:style=> " font-weight: bold; display:block; float:left; color:#1b55a7;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
<span class="wmail_b" style="color:#1b55a7; font-weight:bold; float:left;">]</span>
:style=> " font-weight: bold; display:block; float:left; color:#666;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
<span class="wmail_b" style="color:#666; font-weight:bold; float:left;">]</span>
<%= link_to issue.author, user_activities_url(issue.author,:token => @token.value), :class => "wmail_name",
:style => "color:#fe5722; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%>
<span class="wmail_txt" style="float:left; margin-right:5px;color:#6e6e6e;"><%= l(:label_project_issue) %></span>
:style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%>
<span class="wmail_txt" style="float:left; margin-right:5px;color:#ACAEB1;"><%= l(:label_project_issue) %></span>
<%= link_to truncate(issue.subject,length: 30,omission: '...'),issue_url(issue, :token => @token.value),
:class => 'wmail_info',
:style => "color:#5a5a5a; float:left; margin-right:5px; display:block;color:#1b55a7;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"
:style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"
%>
<span class="wmail_date" style="color:#6e6e6e; float:right;display:block; margin-left:10px;"><%= format_time(issue.created_on) %></span>
</li>
@ -226,29 +200,28 @@
<!-- 讨论区 -->
<% unless @project_messages.first.nil? %>
<ul class="wmail_ul" style="margin-left:10px; border-bottom:1px dashed #cfcfcf; padding-bottom:15px; width:720px; margin-bottom:15px;">
<h4 class="wmail_h4" style="color:#474646; font-size:14px; margin-bottom:5px;" >
<ul class="wmail_ul" style="margin-left:10px; border-bottom:1px dashed #cfcfcf; padding-bottom:15px; width:1020px; margin-bottom:15px;">
<span class="wmail_h4" style="color:#666; font-size:14px; margin-bottom:5px;" >
<%= l(:project_moule_boards_show) %>
<span class="wmail_num" style="color:#fe3f0c; margin-left:5px; font-weight:normal;">(<%= @project_messages.count %>)</span>
</h4>
<!--<span class="wmail_num" style="color:#fe3f0c; margin-left:5px; font-weight:normal;">(<%#= @project_messages.count %>)</span>-->
</span>
<% @project_messages.each do |project_message|%>
<li style="clear: both; list-style: none;">
<span class="wmail_dis" style="float:left; color:#000000; margin-right:5px;">▪</span>
<span class="wmail_b" style="color:#1b55a7; font-weight:bold; float:left;">[</span>
<span class="wmail_b" style="color:#666; font-weight:bold; float:left;">[</span>
<%= link_to truncate(project_message.project.name,length: 30,omission: '...'), project_url(project_message.project, :token => @token.value),
:class=> "wmail_column",
:style=> " font-weight: bold; display:block; float:left; color:#1b55a7;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
:style=> " font-weight: bold; display:block; float:left; color:#666;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
<span class="wmail_b" style="color:#1b55a7; font-weight:bold; float:left;">]</span>
<%= link_to project_message.author, user_activities_url(project_message.author,:token => @token.value), :class => "wmail_name",
:style => "color:#fe5722; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%>
<span class="wmail_txt" style="float:left; margin-right:5px;color:#6e6e6e;"><%= l(:label_send_course_messages) %></span>
:style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%>
<span class="wmail_txt" style="float:left; margin-right:5px;color:#ACAEB1;"><%= l(:label_send_course_messages) %></span>
<%= link_to truncate(project_message.subject,length: 30,omission: '...'),board_message_url(project_message, :board_id => project_message.board_id,:token => @token.value),
:class => 'wmail_info',
:style => "color:#5a5a5a; float:left; margin-right:5px; display:block;color:#1b55a7;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"
:style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"
%>
<span class="wmail_date" style="color:#6e6e6e; float:right;display:block; margin-left:10px;"><%= format_time(project_message.created_on) %></span>
</li>
@ -260,28 +233,27 @@
<!--项目新闻-->
<% unless @project_news.first.nil? %>
<ul class="wmail_ul" style=" list-style-type:none;clear: both;margin-left:10px; border-bottom:1px dashed #cfcfcf; padding-bottom:15px; width:720px; margin-bottom:15px;">
<h4 class="wmail_h4" style="color:#474646; font-size:14px; margin-bottom:5px;" >
<%= l(:label_course_news) %>
<span class="wmail_num" style="color:#fe3f0c; margin-left:5px; font-weight:normal;">(<%= @project_news.count %>)</span>
</h4>
<ul class="wmail_ul" style=" list-style-type:none;clear: both;margin-left:10px; border-bottom:1px dashed #cfcfcf; padding-bottom:15px; width:1020px; margin-bottom:15px;">
<span class="wmail_h4" style="color:#666; font-size:14px; margin-bottom:5px;" >
<%= l(:label_project_news) %>
<!--<span class="wmail_num" style="color:#fe3f0c; margin-left:5px; font-weight:normal;">(<%#= @project_news.count %>)</span>-->
</span>
<% @project_news.each do |project_new|%>
<li style="clear: both; list-style: none;">
<span class="wmail_dis" style="float:left; color:#000000; margin-right:5px;">▪</span>
<span class="wmail_b" style="color:#1b55a7; font-weight:bold; float:left;">[</span>
<span class="wmail_b" style="color:#666; font-weight:bold; float:left;">[</span>
<%= link_to truncate(project_new.project.name,length: 30,omission: '...'), project_url(project_new.project, :token => @token.value),
:class=> "wmail_column",
:style=> " font-weight: bold; display:block; float:left; color:#1b55a7;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
<span class="wmail_b" style="color:#1b55a7; font-weight:bold; float:left;">]</span>
:style=> " font-weight: bold; display:block; float:left; color:#666;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
<span class="wmail_b" style="color:#666; font-weight:bold; float:left;">]</span>
<%= link_to project_new.author, user_activities_url(project_new.author,:token => @token.value), :class => "wmail_name",
:style => "color:#fe5722; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%>
<span class="wmail_txt" style="float:left; margin-right:5px;color:#6e6e6e;"><%= l(:label_project_notice) %></span>
:style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%>
<span class="wmail_txt" style="float:left; margin-right:5px;color:#ACAEB1;"><%= l(:label_project_notice) %></span>
<%= link_to truncate(project_new.title,length: 30,omission: '...'), news_url(project_new,:token => @token.value),
:class => 'wmail_info',
:style => "color:#5a5a5a; float:left; margin-right:5px; display:block;color:#1b55a7;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"
%>
:style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
<span class="wmail_date" style="color:#6e6e6e; float:right;display:block; margin-left:10px;"><%= format_time(project_new.created_on) %></span>
</li>
<% end %>
@ -295,13 +267,13 @@
<!-- 用户留言 -->
<% unless @user_journal_messages.first.nil? %>
<div class="wmail_main" style="padding:20px 10px 0px;">
<h2 class="wmail_h2" style="color:#15bccf; "><%= l(:label_activities) %></h2>
<h3 class="wmail_h2" style="color:#15bccf; "><%= l(:label_activities) %></h3>
<ul class="wmail_ul" style="margin-left:10px; border-bottom:1px dashed #cfcfcf; padding-bottom:15px; width:720px; margin-bottom:15px;">
<h4 class="wmail_h4" style="color:#474646; font-size:14px; margin-bottom:5px;" >
<ul class="wmail_ul" style="margin-left:10px; border-bottom:1px dashed #cfcfcf; padding-bottom:15px; width:1020px; margin-bottom:15px;">
<span class="wmail_h4" style="color:#666; font-size:14px; margin-bottom:5px;" >
<%= l(:label_user_message) %>
<span class="wmail_num" style="color:#fe3f0c; margin-left:5px; font-weight:normal;">(<%= @user_journal_messages.count %>)</span>
</h4>
<!--<span class="wmail_num" style="color:#fe3f0c; margin-left:5px; font-weight:normal;">(<%#= @user_journal_messages.count %>)</span>-->
</span>
<% @user_journal_messages.each do |user_journal_message|%>
<li style="clear: both; list-style: none;">
@ -309,12 +281,12 @@
<%= link_to user_journal_message.user, user_activities_url(user_journal_message.user,:token => @token.value),
:class => "wmail_name",
:style => "color:#fe5722; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
<span class="wmail_txt" style="float:left; margin-right:5px;color:#6e6e6e;"><%= l(:label_show_your_message) %></span>
:style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
<span class="wmail_txt" style="float:left; margin-right:5px;color:#ACAEB1;"><%= l(:label_show_your_message) %></span>
<%= link_to truncate(user_journal_message.notes,length: 30,omission: '...'),feedback_url(@user,:token => @token.value),
:class => 'wmail_info',
:style => "color:#5a5a5a; float:left; margin-right:5px; display:block;color:#1b55a7;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"
:style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"
%>
<span class="wmail_date" style="color:#6e6e6e; float:right;display:block; margin-left:10px;"><%= format_time(user_journal_message.created_on) %></span></li>
@ -327,13 +299,13 @@
<% end %>
<% if @forums.first || @memos.first %>
<div class="wmail_main" style="padding:20px 10px 0px;">
<h2 class="wmail_h2" style="color:#15bccf; "><%= l(:lable_bar_active) %></h2>
<h3 class="wmail_h2" style="color:#15bccf; "><%= l(:lable_bar_active) %></h3>
<% unless @forums.first.nil? %>
<ul class="wmail_ul" style="margin-left:10px; border-bottom:1px dashed #cfcfcf; padding-bottom:15px; width:720px; margin-bottom:15px;">
<h4 class="wmail_h4" style="color:#474646; font-size:14px; margin-bottom:5px;" >
<ul class="wmail_ul" style="margin-left:10px; border-bottom:1px dashed #cfcfcf; padding-bottom:15px; width:1020px; margin-bottom:15px;">
<span class="wmail_h4" style="color:#474646; font-size:14px; margin-bottom:5px;" >
<%= l(:label_user_forum) %>
<span class="wmail_num" style="color:#fe3f0c; margin-left:5px; font-weight:normal;">(<%= @forums.count %>)</span>
</h4>
<span class="wmail_num" style="color:#666; margin-left:5px; font-weight:normal;">(<%= @forums.count %>)</span>
</span>
<% @forums.each do |forum|%>
<li style="clear: both; list-style: none;">
@ -341,12 +313,12 @@
<%= link_to forum.creator, user_activities_url(forum.creator,:token => @token.value),
:class => "wmail_name",
:style => "color:#fe5722; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
<span class="wmail_txt" style="float:left; margin-right:5px;color:#6e6e6e;"><%= l(:label_forum_new) %></span>
:style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
<span class="wmail_txt" style="float:left; margin-right:5px;color:#ACAEB1;"><%= l(:label_forum_new) %></span>
<%= link_to truncate(forum.name,length: 30,omission: '...'),forum_url(forum,:token => @token.value),
:class => 'wmail_info',
:style => "color:#5a5a5a; float:left; margin-right:5px; display:block;color:#1b55a7;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"
:style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"
%>
<span class="wmail_date" style="color:#6e6e6e; float:right;display:block; margin-left:10px;"><%= format_time(forum.created_at) %></span></li>
@ -356,11 +328,11 @@
</ul><!-- 新建贴吧 end-->
<% end %>
<% unless @memos.first.nil? %>
<ul class="wmail_ul" style="margin-left:10px; border-bottom:1px dashed #cfcfcf; padding-bottom:15px; width:720px; margin-bottom:15px;">
<h4 class="wmail_h4" style="color:#474646; font-size:14px; margin-bottom:5px;" >
<ul class="wmail_ul" style="margin-left:10px; border-bottom:1px dashed #cfcfcf; padding-bottom:15px; width:1020px; margin-bottom:15px;">
<span class="wmail_h4" style="color:#474646; font-size:14px; margin-bottom:5px;" >
<%= l(:label_user_message_forum) %>
<span class="wmail_num" style="color:#fe3f0c; margin-left:5px; font-weight:normal;">(<%= @memos.count %>)</span>
</h4>
<!--<span class="wmail_num" style="color:#fe3f0c; margin-left:5px; font-weight:normal;">(<%#= @memos.count %>)</span>-->
</span>
<% @memos.each do |memo|%>
<li style="clear: both; list-style: none;">
@ -368,12 +340,12 @@
<%= link_to memo.author, user_activities_url(memo.author,:token => @token.value),
:class => "wmail_name",
:style => "color:#fe5722; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
<span class="wmail_txt" style="float:left; margin-right:5px;color:#6e6e6e;"><%= memo.parent_id.nil? ? l(:label_memo_new_from_forum) : l(:label_reply) %></span>
:style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
<span class="wmail_txt" style="float:left; margin-right:5px;color:#ACAEB1;"><%= memo.parent_id.nil? ? l(:label_memo_new_from_forum) : l(:label_reply) %></span>
<%= link_to truncate(memo.subject,length: 30,omission: '...'),forum_memo_url(memo.forum, (memo.parent_id.nil? ? memo : memo.parent_id)),
:class => 'wmail_info',
:style => "color:#5a5a5a; float:left; margin-right:5px; display:block;color:#1b55a7;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"
:style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"
%>
<span class="wmail_date" style="color:#6e6e6e; float:right;display:block; margin-left:10px;"><%= format_time(memo.created_at) %></span></li>
@ -385,6 +357,7 @@
</div><!--贴吧动态 end-->
<% end %>
<div class="wmail_foot" style="margin-top:20px;color:#2775d2; margin-left:10px;">
<span style="color:#666;"><%= l(:label_mail_policy) %></span>
<% [:label_user_mail_option_all, :label_user_mail_option_day, :label_user_mail_option_none].each do |mail_option| %>
<% if Hash[*User::MAIL_NOTIFICATION_OPTIONS.flatten][@user.mail_notification] == mail_option %>
<label style="margin-top:20px;color:gray; margin-left:10px;"><%= l(mail_option) %></label>

View File

@ -1,6 +1,6 @@
<%= @subject %>
<% if @attachments.first || @course_news.first || @bids.first ||
@homeworks.first || @course_journal_messages.first|| @course_messages.first %>
@course_journal_messages.first|| @course_messages.first %>
<%= l(:label_course_overview)%>
<% unless @course_news.first.nil? %>
<%= l(:label_course_news) %>
@ -27,50 +27,30 @@
<% end %>
<% end %>
<% if !@bids.first.nil? || !@homeworks.first.nil? %>
<% unless @bids.empty? %>
<%= l(:label_homework_overview) %><%= @bids.count %>
<% unless @bids.first.nil?%>
<% @bids.each do |bid| %>
[
<%= link_to truncate(bid.courses.first.name,length: 30,omission: '...'),course_url(bid.courses.first, :token => @token.value)
<%= link_to truncate(bid.course.name,length: 30,omission: '...'),course_url(bid.course, :token => @token.value)
%>
]
<%= link_to bid.author, user_activities_url(bid.author,:token => @token.value)
<%= link_to bid.user, user_activities_url(bid.user,:token => @token.value)
%>
<%= l(:label_course_homework) %>
<%= link_to truncate(bid.name,length: 30,omission: '...'), course_for_bid_url(bid,:token => @token.value)
<%= link_to truncate(bid.name, length: 30,omission: '...'), student_work_index_path(:homework => bid.id,:token => @token.value)
%>
<%= format_time(bid.created_on) %>
<%= format_time(bid.created_at) %>
<% end %>
<% end %>
<% unless @homeworks.first.nil? %>
<% @homeworks.each do |homework| %>
▪[
<%= link_to truncate(homework.bid.courses.first.name,length: 30,omission: '...'), course_url(homework.bid.courses.first, :token => @token.value)
%>
]
<%= link_to homework.user, user_activities_url(homework.user,:token => @token.value)
%>
<%= l(:label_course_submit_homework) %>
<%= link_to truncate(homework.name,length: 30,omission: '...'), course_for_bid_url(homework.bid,:token => @token.value)
%>
<%= format_time(homework.created_at) %>
<% end %>
<% end %>
<!--作业动态 end-->
@ -108,7 +88,7 @@
<% unless @course_messages.first.nil? %>
<%= l(:view_borad_course) %>
(<%= @course_journal_messages.count %>)
(<%= @course_messages.count %>)
<% @course_messages.each do |course_message|%>

View File

@ -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><%= @subject %> </p>
<p> <%= link_to @project_url, @project_url%></p>
<p>点击链接后,将自动为您注册账号</p>
<p><%= @subject %> </p>
<p style="color: #15BCCF ">点击下面的链接即可激活账号系统会根据给出的密码和账号自动登录Trustie平台。</p>
<p> <%= link_to @project_url, @project_url%></p>
<p>您的账号为:<%= @email %></p>
<p>密码为: <%= @password %></p>

View File

@ -1,3 +1,3 @@
<p><%= l(:mail_body_wiki_content_added, :id => link_to(h(@wiki_content.page.pretty_title), @wiki_content_url),
:author => h(@wiki_content.author)).html_safe %><br />
<em><%=h @wiki_content.comments %></em></p>
<em><%=h @wiki_content.comments.html_safe %></em></p>

View File

@ -79,19 +79,21 @@
<% end %>
<%# 邀请用户的状态 %>
<% unless @inviter_lists.blank? %>
<div>
<span class="status_inviter">已邀请的用户</span><br/>
<% @inviter_lists.each do |inviter_list| %>
<%= inviter_list.user.name %><br/>
<div>
<% unless @inviters_count.nil? %>
<span class="status_inviter">已加入项目的用户</span><br/>
<% @inviters.each do |inv| %>
<%= inv.name unless inv.nil? %><br/>
<% end %>
</br>
<% end %>
</br>
<% unless @waiters_count.nil? %>
<span class="status_inviter">等待加入项目的用户</span><br/>
<% @inviter_lists.each do |inviter_list| %>
<% unless inviter_list.user.member_of?(@project) %>
<%= inviter_list.user.name %><br/>
<% end %>
<% @waiters.each do |wai| %>
<%= wai.name unless wai.nil?%><br/>
<% end %>
</div>
<% end %>
</div>
<% end %>
</div>

View File

@ -6,13 +6,15 @@
<span>
<%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id%>
</span>
<% else%>
<span class="ml30">--</span>
<% end%>
</li>
<li class="hwork_name">
<% if is_my_work%>
<%= link_to student_work.user.show_name,user_path(student_work.user),:title => student_work.user.show_name %>
<%= link_to student_work.user.show_name,user_path(student_work.user),:title => student_work.user.show_name, :class => "c_blue02" %>
<% else%>
<%= link_to "匿名","javascript:void(0)"%>
<%= link_to "匿名","javascript:void(0)", :class => "c_blue02"%>
<% end%>
</li>
<li class=" hwork_tit_e" style="width: 410px">

View File

@ -6,7 +6,7 @@
</span>
</li>
<li class=" hwork_name ">
<%= link_to student_work.user.show_name,user_path(student_work.user),:title => student_work.user.show_name%>
<%= link_to student_work.user.show_name,user_path(student_work.user),:title => student_work.user.show_name, :class => "c_blue02"%>
</li>
<li class=" hwork_tit">
<%= link_to student_work.name, student_work_path(student_work),:remote => true,:title => student_work.name, :class => "c_blue02"%>

View File

@ -36,7 +36,7 @@
</span>
<% if @show_all%>
<input type="text" value="<%= @name%>" placeholder="昵称、学号、姓名搜索" class="min_search ml10 fl" onkeypress="SearchByName($(this),'<%= student_work_index_path(:homework => @homework.id)%>',event);">
<a class="student_work_search fl" onclick="SearchByName($(this).prev(),'<%= student_work_index_path(:homework => @homework.id)%>');" href="javascript:void(0)">搜索</a>
<a class="student_work_search fl" onclick="SearchByName_1($(this).prev(),'<%= student_work_index_path(:homework => @homework.id)%>');" href="javascript:void(0)">搜索</a>
<% end%>
<% if @is_teacher%>
<div class="fr">

View File

@ -30,8 +30,8 @@
<td rowspan="2" >
<div class="project-search" style="float: right">
<!--label for="user_browse_label"><%#= l(:label_user_search_type) %></label-->
<%= select_tag(:search_by,options_for_select([["昵称","0"],["姓名","1"],["邮箱","2"]],@search_by), :onchange => "searchByChange();" ) %>
<%= text_field_tag 'name', params[:name], :size => 30 %>
<%= select_tag(:search_by,options_for_select([["昵称","0"],["姓名","1"],["邮箱","2"]],@search_by), :onchange => "searchByChange();",:style=>'display:none;' ) %>
<%= text_field_tag 'name', params[:name], :size => 30, :placeholder=>'昵称/姓名/邮箱' %>
<input type="text" name="search_by_input" hidden="hidden;" id="search_by_input" value="0">
<input type="button" class="enterprise" value="<%= l(:label_search) %>" onclick="searchUser();"/>
<%#= submit_tag l(:label_search), :class => "enterprise", :name => nil %>

View File

@ -73,11 +73,13 @@ form #search_by
{
if($("#search_type").val() == "users")
{
$("#search_by").show();
$("#q").attr('placeholder','昵称/姓名/邮箱');
// $("#search_by").show();
}
else
{
$("#search_by").hide();
$("#q").attr('placeholder',"<%=l('welcome.search.information')%>");
}
}
@ -93,7 +95,7 @@ form #search_by
<%= text_field_tag :q, nil, :placeholder => l('welcome.search.information'), style:"float:left; width:185px;" %>
<input type="text" name="search_by_input" style="display: none" id="search_by_input" value="0">
<%= select_tag(:search_type, options_for_select(select_option), :onchange => "searchTypeChange();", :style => "float:right" ) %>
<%= select_tag(:search_by,options_for_select([[l('welcome.search.select.userinfo.nickname'),"0"],[l('welcome.search.select.userinfo.showname'),"1"],[l('welcome.search.select.userinfo.email'),"2"]]), :onchange => "searchByChange();",:style => "float:right" ) %>
<%= select_tag(:search_by,options_for_select([[l('welcome.search.select.userinfo.nickname'),"0"],[l('welcome.search.select.userinfo.showname'),"1"],[l('welcome.search.select.userinfo.email'),"2"]]), :onchange => "searchByChange();",:style => "float:right;display:none;" ) %>
</div>
<%#= hidden_field_tag 'project_type', project_type %>
</div>

View File

@ -86,7 +86,7 @@ zh:
label_roadmap: 里程碑 #版本路线图
project_module_dts: DTS测试工具
label_project_tool_response: 用户反馈
label_course_news: 项目新闻
label_project_news: 项目新闻
label_project_overview: "项目简介"
label_expend_information: 展开更多信息

View File

@ -736,6 +736,7 @@ zh:
label_date_to:
label_language_based: 根据用户的语言
label_mail_policy: 邮件策略
label_send_test_email: 发送测试邮件
label_feeds_access_key: RSS存取键
label_missing_feeds_access_key: 缺少RSS存取键

View File

@ -257,7 +257,6 @@ RedmineApp::Application.routes.draw do
post 'boards/:board_id/topics/:id/edit', :to => 'messages#edit'
post 'boards/:board_id/topics/:id/destroy', :to => 'messages#destroy'
# boards end
# delete 'bids/homework', :to => 'bids#homework_destroy'
# Misc issue routes. TODO: move into resources
match '/issues/auto_complete', :to => 'auto_completes#issues', :via => :get, :as => 'auto_complete_issues'
@ -764,7 +763,6 @@ RedmineApp::Application.routes.draw do
delete 'attachment/:id', :to => 'attachments#delete_homework'
match 'new_join', :to => 'courses#new_join', :as => 'try_join'
match 'new_join_group', :to => 'courses#new_join_group', :as => 'try_join_group'
# match 'new_join_in_contest', :to => 'bids#new_join', :as => 'try_join_in_contest'
match 'projects/:id/respond', :to => 'projects#project_respond', :via => :post
########################

View File

@ -451,7 +451,7 @@ Redmine::MenuManager.map :user_enterprise_menu do |menu|
menu.push :user_project, {:controller => 'users', :action => 'user_projects', :host => Setting.host_name}
menu.push :requirement_focus, {:controller => 'users', :action => 'watch_bids', :host => Setting.host_user}
# menu.push :requirement_focus, {:controller => 'users', :action => 'watch_bids', :host => Setting.host_user}
menu.push :user_newfeedback, {:controller => 'users', :action => 'user_newfeedback', :host => Setting.host_user}
end
@ -459,7 +459,7 @@ Redmine::MenuManager.map :user_menu_self do |menu|
menu.push :activity, {:controller => 'users', :action => 'show', :host => Setting.host_name }
menu.push :user_information, {:controller => 'users', :action => 'info', :host => Setting.host_user}
menu.push :user_project, {:controller => 'users', :action => 'user_projects', :host => Setting.host_name}
menu.push :requirement_focus, {:controller => 'users', :action => 'watch_bids', :host => Setting.host_user}
# menu.push :requirement_focus, {:controller => 'users', :action => 'watch_bids', :host => Setting.host_user}
menu.push :user_newfeedback, {:controller => 'users', :action => 'user_newfeedback', :host => Setting.host_user}
end

View File

@ -1,3 +1,10 @@
//function dump_obj(myObject) {
// var s = "";
// for (var property in myObject) {
// s = s + "\n "+property +": " + myObject[property] ;
// }
// alert(s);
//}
/*******************************************************************************
* KindEditor - WYSIWYG HTML Editor for Internet
* Copyright (C) 2006-2013 kindsoft.net
@ -3909,14 +3916,22 @@ _extend(KToolbar, KWidget, {
});
},
get : function(name) {
//if(this._itemMap[name])return this._itemMap[name];
//return this._itemMap[name]=K("span.ke-icon-"+name,this.div).parent()
// if (this._itemMap[name]) {
// return this._itemMap[name];
// }
if($("#define").css('display') == 'block'){
pdiv = $("#define")
}else if($("#full").css('display') == 'block'){
pdiv = $("#full")
}
// if($("#define").css('display') == 'block'){
// pdiv = $("#define")
// }else if($("#full").css('display') == 'block'){
// pdiv = $("#full")
// }
var container = this.div;
if(!$("#define",container).is(':hidden')){
pdiv = $("#define",container);
}else if(!$("#full",container).is(':hidden')){
pdiv = $("#full",container);
}
return (this._itemMap[name] = K('span.ke-icon-' + name, pdiv).parent());
},
select : function(name) {
@ -4142,6 +4157,7 @@ function KUploadButton(options) {
}
_extend(KUploadButton, {
init : function(options) {
//dump_obj(options);
var self = this,
button = K(options.button),
fieldName = options.fieldName || 'file',
@ -4172,6 +4188,7 @@ _extend(KUploadButton, {
button.hide();
button.before(div);
self.div = div;
if(options.ops!=undefined)options.ops.up_file_div = div;//options.ops是KindEditor.create()的options参数
self.button = button;
self.iframe = options.target ? K('iframe[name="' + target + '"]') : K('iframe', div);
self.form = options.form ? K(options.form) : K('form', div);
@ -4865,6 +4882,7 @@ KEditor.prototype = {
});
return self;
}
//if(name=='more')alert(fn);
return self.handler(key, fn);
},
updateState : function() {
@ -4972,13 +4990,13 @@ KEditor.prototype = {
'emoticons',
'source','plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist', '|',
'formatblock', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',
'italic', 'underline', 'removeformat', '|','imagedirectupload','table', 'link', "less",
'italic', 'underline', 'removeformat', '|','imagedirectupload','table', 'media', "less",
'/',
'undo', 'redo', '|', 'preview', 'print', 'template',
'justifyfull', 'insertunorderedlist', 'indent', 'outdent', 'subscript',
'superscript', 'clearhtml', 'quickformat', 'selectall', 'fontname',
'superscript', 'clearhtml', 'quickformat', /* 'selectall',*/ 'fontname',
'strikethrough', 'lineheight', 'hr', 'pagebreak',
'anchor' , 'unlink'
'anchor' , 'link','unlink'
]
K.each(fullItems, function(i, name) {
if (name == '|') {
@ -5593,8 +5611,11 @@ _plugin('core', function(K) {
inputObj.setAttribute('type', 'button');
inputObj.setAttribute('style', 'visibility:hidden');
document.body.appendChild(inputObj);
window.uploadButton = K.uploadbutton({
button: inputObj,
//window.uploadButton = K.uploadbutton({
self.uploadButton = K.uploadbutton({
ops:self, //self 是KindEditor.create()的options参数
button: inputObj,
fieldName:'imgFile',
url:K.addParam('/kindeditor/upload', 'dir=image'),
afterUpload : function(data) {
@ -5616,8 +5637,8 @@ _plugin('core', function(K) {
alert('error: ' + str);
}
});
uploadButton.fileBox.change(function(e) {
uploadButton.submit();
self.uploadButton.fileBox.change(function(e) {
self.uploadButton.submit();
});
if (self.fullscreenShortcut) {
@ -5654,7 +5675,7 @@ _plugin('core', function(K) {
});
});
self.clickToolbar('imagedirectupload', function() {
$('.ke-upload-file').focus().trigger('click');
$('.ke-upload-file',this.up_file_div).trigger('click');
});
self.clickToolbar('formatblock', function() {

View File

@ -2,13 +2,16 @@ KindEditor.plugin('less', function(K) {
var self = this, name = 'less';
self.plugin.less = {
click : function(){
if($("#define").css('display') == 'block'){
$("#define").css('display','none')
$("#full").css('display','block')
}else if($("#full").css('display') == 'block'){
$("#full").css('display','none')
$("#define").css('display','block')
}
var container = self.toolbar.div;
$("#full",container).hide();
$("#define",container).show();
//if($("#define").css('display') == 'block'){
// $("#define").css('display','none')
// $("#full").css('display','block')
//}else if($("#full").css('display') == 'block'){
// $("#full").css('display','none')
// $("#define").css('display','block')
//}
}
}
self.clickToolbar(name,self.plugin.less.click)

View File

@ -2,13 +2,16 @@ KindEditor.plugin('more', function(K) {
var self = this, name = 'more';
self.plugin.more = {
click : function(){
if($("#define").css('display') == 'block'){
$("#define").css('display','none')
$("#full").css('display','block')
}else if($("#full").css('display') == 'block'){
$("#full").css('display','none')
$("#define").css('display','block')
}
var container = self.toolbar.div;
$("#define",container).hide();
$("#full",container).show();
//if($("#define").css('display') == 'block'){
// $("#define").css('display','none')
// $("#full").css('display','block')
//}else if($("#full").css('display') == 'block'){
// $("#full").css('display','none')
// $("#define").css('display','block')
//}
}
}
self.clickToolbar(name,self.plugin.more.click)

View File

@ -901,24 +901,30 @@ $(function(){
$('#download_homework_attachments').bind('ajax:complete', function (event, data, status, xhr) {
if(status == 'success'){
var res = JSON.parse(data.responseText);
if(res.length<1){
if(res.length == null){
alert("该作业没有任何附件可下载");
}
else if(res.length<1){
return;
}
if(res.length==1){
location.href = '/zipdown/download?file='+res[0].file;return;
}
document.getElementById('light').style.display='block';
$container = $('#light .upload_box_ul');
$container.empty();
for(var i = 0; i <res.length; ++i){
var des = '';
if(res.count > 1){
des = '第'+res[i].index+'-'+(res[i].count+res[i].index-1)+'个学生的作品下载';
} else {
des = '第'+res[i].index+'个学生的作品下载';
else
{
if(res.length==1){
location.href = '/zipdown/download?file='+res[0].file;return;
}
$('<li><span class="upload_box_span" >'+(i+1)+'.</span> <a href="/zipdown/download?file='+res[i].file+'">'+des+'</a><span class="c_grey">&nbsp;&nbsp;(共'+res[i].size+'M</span> </li>').appendTo($container);
document.getElementById('light').style.display='block';
$container = $('#light .upload_box_ul');
$container.empty();
for(var i = 0; i <res.length; ++i){
var des = '';
if(res.count > 1){
des = '第'+res[i].index+'-'+(res[i].count+res[i].index-1)+'个学生的作品下载';
} else {
des = '第'+res[i].index+'个学生的作品下载';
}
$('<li><span class="upload_box_span" >'+(i+1)+'.</span> <a href="/zipdown/download?file='+res[i].file+'">'+des+'</a><span class="c_grey">&nbsp;&nbsp;(共'+res[i].size+'M</span> </li>').appendTo($container);
}
}
}
});

View File

@ -470,7 +470,15 @@ $(function(){
//老师提交 新建/修改 作业
function submit_homework(id)
{
if(regex_homework_name()&&regex_evaluation_num())
if(!regex_homework_name())
{
$("#homework_name").focus();
}
else if(!regex_evaluation_num())
{
$("#evaluation_num").focus();
}
else
{
homework_description_editor.sync();
$("#"+id).submit();
@ -757,8 +765,8 @@ function goTopEx() {
}
}
//匿评评分提示
$(function(){
//匿评评分提示
$(".student_score_info").bind("mouseover",function(e){
//alert($(this).html());
$(this).find("div").show();
@ -769,6 +777,8 @@ $(function(){
//alert($(this).html());
$(this).find("div").hide();
});
$("#about_project label").eq(1).remove();
});
//匿评弹框取消按钮
@ -793,11 +803,7 @@ function SearchByName(obj,url,event)
location.href = url + "&name=" + obj.val();
}
}
function SearchByName(obj,url)
function SearchByName_1(obj,url)
{
location.href = url + "&name=" + obj.val();
}
$(function(){
$("#about_project label").eq(1).remove();
});

View File

@ -380,8 +380,6 @@ span.add_attachment {font-size: 80%;line-height: 2.5em;}
.attachments_fields span .boldSpan{display:block; white-space:nowrap; font-family:'微软雅黑';}
.attachments_fields div.ui-progressbar { width: 100px; height:14px; margin: 2px 0 -5px 8px; display: inline-block; }
a.remove-upload:hover {text-decoration:none !important;}
.attachments_fields input.is_public_checkbox {width:20px;}
.attachments_fields span.ispublic-label {display: inline-block;width: 30px;margin-left: 10px;}
a.remove-upload {background: url(../images/delete.png) no-repeat 1px 50%;width: 1px;display: inline-block;padding-left: 16px;}
@ -679,7 +677,7 @@ input#score{ width:40px;}
/* 与我相关 */
.new_icon{background:url(../images/new_icon.png) 0px 0px no-repeat; width:35px; height:15px; display:block;}
a.about_me{ width:80px;text-align:center;font-size:16px; color:#64bdd9; margin:10px 0 0 10px;}
a.about_me{text-align:center;font-size:16px; color:#64bdd9; margin:10px 0 0 10px;}
a:hover.about_me{ color:#0781b4;}

View File

@ -241,8 +241,6 @@ blockquote {background: #eeeeee;padding: 10px;margin-bottom: 10px;}
#attachments_fields span .boldSpan{display:block; white-space:nowrap; font-family:'微软雅黑';}
#attachments_fields div.ui-progressbar { width: 100px; height:14px; margin: 2px 0 -5px 8px; display: inline-block; }
a.remove-upload:hover {text-decoration:none !important;}
#attachments_fields input.is_public_checkbox {width:20px;}
#attachments_fields span.ispublic-label {display: inline-block;width: 30px;margin-left: 10px;}
a.remove-upload {background: url(../images/delete.png) no-repeat 1px 50%;width: 1px;display: inline-block;padding-left: 16px;}

View File

@ -438,3 +438,4 @@ a.box_close{background:url(../images/img_floatbox.png) -22px 0 no-repeat;}
.tl{text-align: left;}
img{max-width: 100%;}
.attachments {clear: both;}
.is_public_checkbox{margin-left: 15px;margin-right: 10px;}

View File

@ -2,16 +2,16 @@
#
#:author_id, :budget, :deadline, :name, :description, :homework_type, :password
FactoryGirl.define do
factory :homework, class: Bid do
name "test homework"
budget 0
deadline {(Time.now+1.days).strftime('%Y-%m-%d')}
description "description"
homework_type 3
reward_type 3
end
factory :homework_attach, class: HomeworkAttach do
end
end
# FactoryGirl.define do
# factory :homework, class: Bid do
# name "test homework"
# budget 0
# deadline {(Time.now+1.days).strftime('%Y-%m-%d')}
# description "description"
# homework_type 3
# reward_type 3
# end
#
# factory :homework_attach, class: HomeworkAttach do
# end
# end