This commit is contained in:
huang 2016-12-12 10:55:19 +08:00
parent 818e63386c
commit 6e67e4a5c7
136 changed files with 2247 additions and 583 deletions

14
Gemfile
View File

@ -63,22 +63,18 @@ group :development do
if RUBY_PLATFORM =~ /w32/
gem 'win32console'
end
if RUBY_PLATFORM =~ /darwin/
gem 'puma'
end
end
group :development, :test do
unless RUBY_PLATFORM =~ /w32/
gem 'pry-rails'
if RUBY_VERSION >= '2.0.0'
gem 'pry-byebug'
gem "test-unit", "~>3.0"
end
gem 'pry-stack_explorer'
if RUBY_PLATFORM =~ /darwin/
gem 'puma'
end
end
gem 'rspec-rails', '~> 3.0'
gem 'factory_girl_rails'
end
# Gems used only for assets and not required

View File

@ -17,17 +17,18 @@ module Mobile
end
else
case field
when :download_url
"attachments/download/#{f.try(:id)}"
when :file_dir
"attachments/download/" << f.send(:id).to_s << '/'
when :attafile_size
(number_to_human_size(f.filesize)).gsub("ytes", "").to_s
when :coursename
f.course.nil? ? "" : f.course.name
f.try(:course).try(:name) || ''
when :syllabus_title
f.course.nil? ? "" : f.course.syllabus.nil? ? "" : f.course.syllabus.title
f.try(:course).try(:syllabus).try(:title) || ''
when :course_id
f.course.nil? ? 0 : f.course.id
f.try(:course).try(:id) || 0
end
end
end
@ -50,6 +51,8 @@ module Mobile
current_user_is_teacher = is_course_teacher(current_user,instance.course)
current_user_is_teacher
end
attachment_expose :download_url
end
end
end

View File

@ -180,6 +180,8 @@ module Mobile
end
end
end
expose :attachments, using: Mobile::Entities::Attachment
end
end
end

View File

@ -117,6 +117,9 @@ class ApplicationController < ActionController::Base
elsif params[:format] == 'atom' && params[:key] && request.get? && accept_rss_auth?
# RSS key authentication does not start a session
user = User.find_by_rss_key(params[:key])
elsif session[:wechat_openid]
uw = UserWechat.find_by_openid(session[:wechat_openid])
user = uw.user if uw
end
end
if user.nil? && Setting.rest_api_enabled? && accept_api_auth?
@ -509,8 +512,7 @@ class ApplicationController < ActionController::Base
# render_404
# end
def self.
model_object(model)
def self.model_object(model)
self.model_object = model
end

View File

@ -72,8 +72,10 @@ class AttachmentsController < ApplicationController
def direct_download
@attachment.increment_download
file_type = detect_content_type(@attachment)
send_file @attachment.diskfile, :filename => filename_for_content_disposition(@attachment.filename),
:type => detect_content_type(@attachment),
:type => file_type,
:disposition => 'attachment' #inline can open in browser
end
@ -130,11 +132,7 @@ class AttachmentsController < ApplicationController
def download
# modify by nwb
# 下载添加权限设置
if (params[:type] && params[:type] == "wechat" )
candown = true
else
candown = attachment_candown @attachment
end
candown = attachment_candown @attachment
if candown || User.current.admin? || User.current.id == @attachment.author_id
if stale?(:etag => @attachment.digest)

View File

@ -32,6 +32,13 @@ class CoursesController < ApplicationController
before_filter :require_login, :only => [:join, :unjoin]
#before_filter :allow_join, :only => [:join]
# 邀请码停用/启用
def set_invite_code_halt
if User.current.allowed_to?(:as_teacher, @course) || User.current.admin?
@course.update_attribute('invite_code_halt', @course.invite_code_halt == 0 ? 1 : 0)
end
end
#查找组织
def search_public_orgs_not_in_course
condition = '%%'

View File

@ -7,7 +7,7 @@ class StudentWorkController < ApplicationController
require "base64"
before_filter :find_homework, :only => [:new, :index, :create, :student_work_absence_penalty, :absence_penalty_list, :evaluation_list, :program_test,:program_test_ex,
:set_score_rule,:forbidden_anonymous_comment,:delete_work,:new_student_work_project,:student_work_project,:cancel_relate_project,
:search_course_students,:work_canrepeat,:add_group_member]
:search_course_students,:work_canrepeat,:add_group_member,:change_project]
before_filter :find_work, :only => [:edit, :update, :show, :destroy, :add_score, :praise_student_work,:retry_work,:revise_attachment]
before_filter :member_of_course, :only => [:new, :create, :show, :add_score, :praise_student_work]
before_filter :author_of_work, :only => [:edit, :update, :destroy]
@ -1060,7 +1060,7 @@ class StudentWorkController < ApplicationController
end
def forbidden_anonymous_comment
@homework.update_column('anonymous_comment', 1)
@homework.update_column('anonymous_comment', @homework.anonymous_comment == 0 ? 1 : 0)
homework_detail_manual = @homework.homework_detail_manual
homework_detail_programing = @homework.homework_detail_programing
if homework_detail_programing
@ -1092,6 +1092,7 @@ class StudentWorkController < ApplicationController
respond_to do |format|
format.js
end
@homework = @work.homework_common
end
def new_student_work_project
@ -1138,6 +1139,26 @@ class StudentWorkController < ApplicationController
end
end
# 作品更换关联项目
def change_project
work = @homework.student_works.has_committed.where("user_id = #{User.current.id}").first
project = Project.find params[:projectName].to_i
if work && project
relate_user_ids = work.student_work_projects.map{|pro| pro.user_id}
member_ids = project.members.map{|mem| mem.user_id}
if (relate_user_ids & member_ids) == relate_user_ids
work.student_work_projects.update_all(:project_id => params[:projectName].to_i)
student_works = @homework.student_works.where("user_id in #{'(' + relate_user_ids.join(',') + ')'}")
student_works.update_all(:project_id => params[:projectName].to_i)
else
@remain_user_ids = relate_user_ids - (relate_user_ids & member_ids)
end
end
respond_to do |format|
format.js
end
end
#查找课程的学生
def search_course_students
name = ""

View File

@ -42,7 +42,7 @@ class UsersController < ApplicationController
: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_system_messages,:choose_user_course,:user_courselist,:user_projectlist,:sort_syllabus_list,
:sort_project_list,:my_homeworks,:manage_or_receive_homeworks,:search_m_r_homeworks, :cancel_or_collect,:expand_courses,:homepage, :user_issues]
:sort_project_list,:my_homeworks,:manage_or_receive_homeworks,:search_m_r_homeworks, :cancel_or_collect,:expand_courses,:homepage, :user_issues, :course_community, :project_community]
before_filter :auth_user_extension, only: :show
#before_filter :rest_user_score, only: :show
#before_filter :select_entry, only: :user_projects
@ -433,7 +433,8 @@ class UsersController < ApplicationController
render_404
return
end
@message_alls = paginateHelper @message_alls,25
@message_alls = paginateHelper @message_alls, 25
respond_to do |format|
format.html{render :layout=>'new_base_user'}
end
@ -1814,22 +1815,140 @@ class UsersController < ApplicationController
end
def show
#更新用户申请成为课程老师或教辅消息的状态
if is_current_user
# 自己的主页显示消息
# 系统消息为管理员发送,我的消息中包含有系统消息
@message_alls = []
messages = MessageAll.where("(user_id =? and message_type !=?) or message_type =?" ,@user.id, "SystemMessage", "SystemMessage").includes(:message).order("created_at desc")
messages.each do |message_all|
mess = message_all.message
unless (message_all.message_type == 'CourseMessage' && mess && mess.course && mess.course.is_delete == 1)
@message_alls << mess
end
end
@message_count = @message_alls.count
@message_alls = paginateHelper @message_alls, 20
# 用户待解决的issue
@unsolved_issues = Issue.where(:assigned_to_id => @user.id, :status_id => [1, 2, 4, 6])
# 用户待完成的作业
@my_course = StudentsForCourse.where(:student_id => @user.id)
@unfinished_homework = 1
# 用户待完成的测验
@unfinished_test = 1
# 用户待完成的问卷
@unfinished_poll = 1
# 用户待匿评的作业
@anonymous_evaluation = 1
# 待评阅的作业
@unreview_homework = 1
# 待审批的作业
@unapproval_homework = 1
else
# 看别人的主页显示动态
#更新用户申请成为课程老师或教辅消息的状态
if params[:course_id] != nil
join_course_messages = CourseMessage.where("course_id =? and course_message_type =? and user_id =? and course_message_id =? and viewed =?",
params[:course_id], 'JoinCourseRequest', User.current.id, @user.id, false)
join_course_messages.update_all(:viewed => true)
end
shield_project_ids = ShieldActivity.select("shield_id").where("container_type='User' and container_id=#{@user.id} and shield_type='Project'").map(&:shield_id)
shield_course_ids = ShieldActivity.select("shield_id").where("container_type='User' and container_id=#{@user.id} and shield_type='Course'").map(&:shield_id)
@page = params[:page] ? params[:page].to_i + 1 : 0
user_project_ids = (@user.favorite_projects.visible.map{|project| project.id}-shield_project_ids).empty? ? "(-1)" : "(" + (@user.favorite_projects.visible.map{|project| project.id}-shield_project_ids).join(",") + ")"
user_course_ids = (@user.favorite_courses.visible.where("is_delete = 0").map{|course| course.id}-shield_course_ids).empty? ? "(-1)" : "(" + (@user.favorite_courses.visible.where("is_delete = 0").map{|course| course.id}-shield_course_ids).join(",") + ")"
course_types = "('Message','News','HomeworkCommon','Poll','Course','JournalsForMessage')"
project_types = "('Message','Issue','Project')"
principal_types = "JournalsForMessage"
container_type = ''
act_type = ''
# 他的动态
sql = "user_id = #{@user.id} and ((container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types}) or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types}))"
if params[:type].present?
case params[:type]
when "course_homework"
container_type = 'Course'
act_type = 'HomeworkCommon'
when "course_news"
container_type = 'Course'
act_type = 'News'
when "course_message"
container_type = 'Course'
act_type = 'Message'
when "course_poll"
container_type = 'Course'
act_type = 'Poll'
when "course_journals"
container_type = 'Course'
act_type = 'JournalsForMessage'
when "project_issue"
container_type = 'Project'
act_type = 'Issue'
when "project_message"
container_type = 'Project'
act_type = 'Message'
when "user_journals"
container_type = 'Principal'
act_type = 'JournalsForMessage'
when "current_user"
container_type = 'Principal'
act_type = 'Principal'
when "all"
container_type = 'all'
act_type = 'all'
end
end
if container_type != '' && container_type != 'all'
if container_type == 'Course'
sql = "container_type = '#{container_type}' and container_id in #{user_course_ids} and act_type = '#{act_type}'"
elsif container_type == 'Project'
sql = "container_type = '#{container_type}' and container_id in #{user_project_ids} and act_type = '#{act_type}'"
elsif container_type == 'Principal' && act_type == 'JournalsForMessage'
sql = "container_type = '#{container_type}' and act_type= '#{act_type}' and container_id = #{@user.id}"
elsif container_type == 'Principal' && act_type == 'Principal'
sql = "user_id = #{@user.id} and ((container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types}) or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types}))"
end
if User.current != @user
sql += " and user_id = #{@user.id}"
end
else
if User.current != @user
blog_ids = "("+@user.blog.id.to_s+")"
else
blog_ids = "("+@user.blog.id.to_s+","+((User.watched_by(@user.id).count == 0 )? '0' :User.watched_by(@user.id).map{|u| u.blog.id}.join(','))+")"
end
sql = "(container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types})" +
"or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types}) "+
"or (container_type = 'Principal' and act_type= '#{principal_types}' and container_id = #{@user.id}) " +
"or (container_type = 'Blog' and act_type= 'BlogComment' and container_id in #{blog_ids})"
if container_type != 'all' && User.current != @user
sql = "user_id = #{@user.id} and(" + sql + ")"
end
end
@user_activities_count = UserActivity.where("#{sql}").order('updated_at desc').count
@user_activities = UserActivity.where("#{sql}").order('updated_at desc').limit(10).offset(@page * 10)
@type = params[:type]
end
respond_to do |format|
format.js
format.html {render :layout => 'new_base_user'}
end
end
# 课程社区
def course_community
if params[:course_id] != nil
join_course_messages = CourseMessage.where("course_id =? and course_message_type =? and user_id =? and course_message_id =? and viewed =?",
params[:course_id], 'JoinCourseRequest', User.current.id, @user.id, false)
join_course_messages.update_all(:viewed => true)
end
shield_project_ids = ShieldActivity.select("shield_id").where("container_type='User' and container_id=#{@user.id} and shield_type='Project'").map(&:shield_id)
shield_course_ids = ShieldActivity.select("shield_id").where("container_type='User' and container_id=#{@user.id} and shield_type='Course'").map(&:shield_id)
@page = params[:page] ? params[:page].to_i + 1 : 0
user_project_ids = (@user.favorite_projects.visible.map{|project| project.id}-shield_project_ids).empty? ? "(-1)" : "(" + (@user.favorite_projects.visible.map{|project| project.id}-shield_project_ids).join(",") + ")"
user_course_ids = (@user.favorite_courses.visible.where("is_delete = 0").map{|course| course.id}-shield_course_ids).empty? ? "(-1)" : "(" + (@user.favorite_courses.visible.where("is_delete = 0").map{|course| course.id}-shield_course_ids).join(",") + ")"
course_types = "('Message','News','HomeworkCommon','Poll','Course','JournalsForMessage')"
project_types = "('Message','Issue','Project')"
principal_types = "JournalsForMessage"
container_type = ''
act_type = ''
if params[:type].present?
case params[:type]
when "course_homework"
@ -1847,6 +1966,63 @@ class UsersController < ApplicationController
when "course_journals"
container_type = 'Course'
act_type = 'JournalsForMessage'
when "user_journals"
container_type = 'Principal'
act_type = 'JournalsForMessage'
when "current_user"
container_type = 'Principal'
act_type = 'Principal'
when "all"
container_type = 'all'
act_type = 'all'
end
end
if container_type != '' && container_type != 'all'
if container_type == 'Course'
sql = "container_type = '#{container_type}' and container_id in #{user_course_ids} and act_type = '#{act_type}'"
elsif container_type == 'Principal' && act_type == 'JournalsForMessage'
sql = "container_type = '#{container_type}' and act_type= '#{act_type}' and container_id = #{@user.id}"
elsif container_type == 'Principal' && act_type == 'Principal'
sql = "user_id = #{@user.id} and (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types})"
end
if User.current != @user
sql += " and user_id = #{@user.id}"
end
else
if User.current != @user
blog_ids = "("+@user.blog.id.to_s+")"
else
blog_ids = "("+@user.blog.id.to_s+","+((User.watched_by(@user.id).count == 0 )? '0' :User.watched_by(@user.id).map{|u| u.blog.id}.join(','))+")"
end
sql = "(container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types})" +
"or (container_type = 'Principal' and act_type= '#{principal_types}' and container_id = #{@user.id}) " +
"or (container_type = 'Blog' and act_type= 'BlogComment' and container_id in #{blog_ids})"
if container_type != 'all' && User.current != @user
sql = "user_id = #{@user.id} and(" + sql + ")"
end
end
@user_activities_count = UserActivity.where("#{sql}").order('updated_at desc').count
@user_activities = UserActivity.where("#{sql}").order('updated_at desc').limit(10).offset(@page * 10)
@type = params[:type]
respond_to do |format|
format.js
format.html {render :layout => 'base_course_community'}
end
end
# 项目社区
def project_community
# 看别人的主页显示动态
#更新用户申请成为课程老师或教辅消息的状态
shield_project_ids = ShieldActivity.select("shield_id").where("container_type='User' and container_id=#{@user.id} and shield_type='Project'").map(&:shield_id)
@page = params[:page] ? params[:page].to_i + 1 : 0
user_project_ids = (@user.favorite_projects.visible.map{|project| project.id}-shield_project_ids).empty? ? "(-1)" : "(" + (@user.favorite_projects.visible.map{|project| project.id}-shield_project_ids).join(",") + ")"
project_types = "('Message','Issue','Project')"
principal_types = "JournalsForMessage"
container_type = ''
act_type = ''
if params[:type].present?
case params[:type]
when "project_issue"
container_type = 'Project'
act_type = 'Issue'
@ -1865,14 +2041,12 @@ class UsersController < ApplicationController
end
end
if container_type != '' && container_type != 'all'
if container_type == 'Course'
sql = "container_type = '#{container_type}' and container_id in #{user_course_ids} and act_type = '#{act_type}'"
elsif container_type == 'Project'
if container_type == 'Project'
sql = "container_type = '#{container_type}' and container_id in #{user_project_ids} and act_type = '#{act_type}'"
elsif container_type == 'Principal' && act_type == 'JournalsForMessage'
sql = "container_type = '#{container_type}' and act_type= '#{act_type}' and container_id = #{@user.id}"
elsif container_type == 'Principal' && act_type == 'Principal'
sql = "user_id = #{@user.id} and ((container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types}) or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types}))"
sql = "user_id = #{@user.id} and ((container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types}))"
end
if User.current != @user
sql += " and user_id = #{@user.id}"
@ -1884,19 +2058,18 @@ class UsersController < ApplicationController
blog_ids = "("+@user.blog.id.to_s+","+((User.watched_by(@user.id).count == 0 )? '0' :User.watched_by(@user.id).map{|u| u.blog.id}.join(','))+")"
end
sql = "(container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types})" +
"or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types}) "+
"or (container_type = 'Principal' and act_type= '#{principal_types}' and container_id = #{@user.id}) " +
"or (container_type = 'Blog' and act_type= 'BlogComment' and container_id in #{blog_ids})"
if container_type != 'all' && User.current != @user
sql = "user_id = #{@user.id} and(" + sql + ")"
end
end
@user_activities_count = UserActivity.where("#{sql}").order('updated_at desc').count
@user_activities = UserActivity.where("#{sql}").order('updated_at desc').limit(10).offset(@page * 10)
@type = params[:type]
respond_to do |format|
format.js
format.html {render :layout => 'new_base_user'}
format.html {render :layout => 'base_project_community'}
end
end
@ -3547,7 +3720,7 @@ class UsersController < ApplicationController
# @syllabus = paginateHelper @syllabus,@limit
respond_to do |format|
format.html {render :layout => 'new_base_user'}
format.html {render :layout => 'base_course_community'}
end
end
@ -3691,7 +3864,7 @@ class UsersController < ApplicationController
@my_joined_projects_count = @my_joined_projects.count
respond_to do |format|
format.html {render :layout => 'new_base_user'}
format.html {render :layout => 'base_project_community'}
end
end

View File

@ -1,4 +1,6 @@
#coding=utf-8
require 'base64'
class WechatsController < ActionController::Base
wechat_responder
@ -105,6 +107,7 @@ class WechatsController < ActionController::Base
end
on :event, with: 'unsubscribe' do |request|
unBind(request)
request.reply.success # user can not receive this message
end
@ -272,12 +275,18 @@ class WechatsController < ActionController::Base
end
end
def unBind(request)
uw = user_binded?(request[:FromUserName])
uw.try(:subscribe!)
end
def sendBind(request)
tmpurl = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=#{Wechat.config.appid}&redirect_uri=#{ROOT_URL+'/wechat/user_activities'}&response_type=code&scope=snsapi_base&state=login&connect_redirect=1#wechat_redirect"
logger.info "tmpurl!!!!!!!!!!!!!!"
logger.info tmpurl
news = (1..1).each_with_object([]) { |n, memo| memo << { title: '绑定登录', content: "欢迎使用Trustie创新实践服务平台
www.trustie.net
" } }
@ -485,9 +494,33 @@ class WechatsController < ActionController::Base
end
# 用于权限跳转
def auth
state = params[:state]
url = "#{ROOT_URL}/wechat/auth_callback"
authorize_url = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=#{Wechat.config.appid}&redirect_uri=#{url}&response_type=code&scope=snsapi_base&state=#{state}&connect_redirect=1#wechat_redirect"
redirect_to authorize_url
end
def auth_callback
path = Base64.urlsafe_decode64(params[:state])
open_id = get_openid_from_code(params[:code])
unless open_id
render 'wechats/open_wechat', layout: nil and return
end
redirect_to "/wechat/user_activities##{path}"
end
private
def get_openid_from_code(code)
return 'oCnvgvz8R7QheXE-R9Kkr39j8Ndg' if code =='only-for-test'
if code =='only-for-test'
openid = 'o3ss_wHOOnHkz1khBJxH8RF4SfPY'
session[:wechat_openid] = openid
return openid
end
openid = session[:wechat_openid]
unless openid
if code

View File

@ -37,6 +37,11 @@ module ApplicationHelper
# super
# end
# 获取多种类型的user用户名
def user_message_username user
user.try(:show_name)
end
# 超出1w后用k+形式显示
def switch_integer_into_k number
number > 10000 ? (number.to_f / 1000).round.to_s + "k" : number
@ -2815,6 +2820,37 @@ module ApplicationHelper
end
technical_title
end
# 用户项目总数
def user_project_count
@my_projects = @user.projects.select("projects.*,(SELECT MAX(updated_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS updatetime").order("updatetime DESC")
@my_project_total = @my_projects.count
end
# 用户的课程总数
def user_course_count
@my_course_count = @user.syllabuses.count
sy_courses = @user.courses.visible.not_deleted
syllabus_ids = sy_courses.empty? ? '(-1)' : "(" + sy_courses.map{|course| !course.syllabus_id.nil? && course.syllabus_id}.join(",") + ")"
syllabus_members = SyllabusMember.where("user_id = #{@user.id}")
syllabus_member_ids = syllabus_members.empty? ? "(-1)" : "(" + syllabus_members.map{|syl_mem| syl_mem.syllabus_id}.join(',') + ")"
@join_syllabuses = Syllabus.where("(id in #{syllabus_ids} or id in #{syllabus_member_ids}) and user_id != #{@user.id}")
@my_joined_course_count = @join_syllabuses.count
@user_course_total = @my_joined_course_count + @my_course_count
end
# 用户发布的issue数
def issues_author_is_self_count
@issues = Issue.where( :author_id => @user.id )
@issues_author_is_self_count = @issues.count
end
# 用户收到的issue数
def issues_assigned_is_self_count
@issues = Issue.where( :assigned_to_id => @user.id )
@issues_assigned_is_self_count = @issues.count
end
def get_user_roll user
technical_title = ""
@ -3734,7 +3770,9 @@ def get_hw_status homework_common
end
if Time.parse(homework_common.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d")
str += '<span class="green_homework_btn_cir ml5">作品提交中</span>'
elsif Time.parse(homework_common.end_time.to_s).strftime("%Y-%m-%d") < Time.now.strftime("%Y-%m-%d")
elsif Time.parse(homework_common.end_time.to_s).strftime("%Y-%m-%d") < Time.now.strftime("%Y-%m-%d") && homework_common.anonymous_comment == 1 && User.current.allowed_to?(:as_teacher, homework_common.course)
str += '<span class="green_homework_btn_cir ml5" title="目前教师和教辅正在评阅">教师评阅中</span>'
else
str += '<span class="red_homework_btn_cir ml5">作品补交中</span>'
end
elsif homework_common.homework_detail_manual.comment_status == 2

View File

@ -94,13 +94,13 @@ module UsersHelper
def pull_request_message_status ma
case ma.status
when 1
"创建了PullRequest:"
"创建了PullRequest"
when 2
"接受了PullRequest:"
"接受了PullRequest"
when 3
"重新打开了PullRequest:"
"重新打开了PullRequest"
when 4
"关闭了PullRequest:"
"关闭了PullRequest"
end
end
@ -135,11 +135,11 @@ module UsersHelper
def applied_project_tip applied_message
case applied_message.status
when 4
"拒绝申请加入项目:"
"拒绝申请加入"
when 5,3,2,1,7
"申请加入项目:"
"申请加入"
when 6
"同意申请加入项目"
"同意申请加入"
end
end
@ -159,6 +159,10 @@ module UsersHelper
end
end
def is_current_user
is_current_user = (User.current == @user)
end
def applied_project_tip_header applied_message
case applied_message.status
when 4

View File

@ -397,7 +397,7 @@ class Attachment < ActiveRecord::Base
end
def course
container
Course === container ? container : nil
end
def visible?(user=User.current)

View File

@ -135,6 +135,10 @@ class Issue < ActiveRecord::Base
after_save :after_create_from_copy
after_destroy :update_parent_attributes
def user
self.author
end
#动态的更新
def update_activity
update_user_activity(self.class, self.id)

View File

@ -106,6 +106,10 @@ class Message < ActiveRecord::Base
end
}
def description
self.content
end
def topic?
parent_id.nil?
end

View File

@ -24,4 +24,9 @@ class UserWechat < ActiveRecord::Base
BlogComment.where(author_id: old_user).update_all(author_id: u.id)
UserActivity.where(user_id: old_user).update_all(user_id: u.id)
end
def unsubscribe!
self.delete
end
end

View File

@ -584,6 +584,8 @@ class CoursesService
@state = 2
elsif course[:is_delete] == 1
@state = 11
elsif course[:invite_code_halt] == 1
@state = 14
else
if current_user.member_of_course?(course) #如果已经是成员
@state = 3

View File

@ -1,8 +1,8 @@
<% if @course %>
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_news', :locals => {:activity => @news,:user_activity_id =>@user_activity_id}) %>");
$("#activity_post_reply_<%= @user_activity_id%>").html("<%= escape_javascript(render :partial => 'users/course_news_post_reply', :locals => {:activity => @news,:user_activity_id =>@user_activity_id}) %>");
<% elsif @project %>
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'projects/project_news', :locals => {:activity => @news,:user_activity_id =>@user_activity_id}) %>");
<% else %>
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'organizations/org_subfield_news', :locals => {:activity => @news,:user_activity_id =>@user_activity_id}) %>");
$("#activity_post_reply_<%= @user_activity_id%>").html("<%= escape_javascript(render :partial => 'organizations/course_news_post_reply', :locals => {:activity => @news,:user_activity_id =>@user_activity_id}) %>");
<% end %>
sd_create_editor_from_data('<%= @user_activity_id%>',"","100%", "UserActivity");

View File

@ -62,17 +62,17 @@
<% when 'HomeworkCommon' %>
<%= render :partial => 'users/course_homework', :locals => {:activity => act, :user_activity_id => activity.id, :hw_status => 2} %>
<% when 'News' %>
<%= render :partial => 'users/course_news', :locals => {:activity => act, :user_activity_id => activity.id} %>
<%= render :partial => 'users/course_news', :locals => {:activity => act, :user_activity_id => activity.id, :is_course => 1} %>
<% when 'Message' %>
<%= render :partial => 'users/course_message', :locals => {:activity => act, :user_activity_id => activity.id,:is_course=>1,:is_board=>0} %>
<% when 'Poll' %>
<%= render :partial => 'users/course_poll', :locals => {:activity => act, :user_activity_id => activity.id} %>
<%= render :partial => 'users/course_poll', :locals => {:activity => act, :user_activity_id => activity.id, :is_course => 1} %>
<% when 'JournalsForMessage' %>
<%= render :partial => 'users/course_journalsformessage', :locals => {:activity => act, :user_activity_id => activity.id} %>
<%= render :partial => 'users/course_journalsformessage', :locals => {:activity => act, :user_activity_id => activity.id, :is_course => 1} %>
<% when 'Attachment' %>
<%= render :partial => 'users/course_attachment', :locals => {:activity => act, :user_activity_id => activity.id} %>
<% when 'Course' %>
<%= render :partial => 'users/course_create', :locals => {:activity => act, :user_activity_id => activity.id} %>
<%= render :partial => 'users/course_create', :locals => {:activity => act, :user_activity_id => activity.id, :is_course => 1} %>
<% end %>
<% end %>
<% end %>

View File

@ -4,9 +4,9 @@
<ul class="rankList">
<h3 style="font-size: 14px; font-weight: normal;">
<% if (User.current.logged? && course.open_student == 1) || (User.current.member_of_course?(course)) || User.current.admin? %>
<%= link_to "班级活跃度", course_member_path(course, :role => 2, :sort_type => 'act_score'), :class => 'fontGrey3' %>
<%= link_to "活跃度", course_member_path(course, :role => 2, :sort_type => 'act_score'), :class => 'fontGrey3' %>
<% else %>
<span class="fontGrey7"> 班级活跃度 </span>
<span class="fontGrey7"> 活跃度 </span>
<% end %>
<a class="sy_cmore fr" onmouseover ="message_titile_show2($(this),event)" onmouseout ="message_titile_hide2($(this))" style="cursor: pointer; position:relative;">积分规则</a>
<div class="cl"></div>

View File

@ -3,9 +3,9 @@
<ul class="rankList">
<h4 style="font-size: 14px; font-weight: normal;">
<% if (User.current.logged? && course.open_student == 1) || (User.current.member_of_course?(course)) || User.current.admin? %>
<%= link_to "班级英雄榜", course_member_path(course, :role => 2), :class => 'fontGrey3' %>
<%= link_to "英雄榜", course_member_path(course, :role => 2), :class => 'fontGrey3' %>
<% else %>
<span class="fontGrey7">班级英雄榜</span>
<span class="fontGrey7">英雄榜</span>
<% end %>
<a class="contributor_course" onmouseover ="message_titile_show2($(this),event)" onmouseout ="message_titile_hide2($(this))" style="cursor:pointer;">积分规则</a></h4>
<div style="cursor:pointer;" class="numIntro undis">

View File

@ -1,23 +1,26 @@
<div class="st_list">
<div class="st_box">
<a href="javascript:void(0)" class="fr fb mb5" >加入时间</a>
<a href="javascript:void(0)" class="fr fb mb5 mr70" >角色</a>
<div class="cl"></div><!--st_box_top end-->
<div class="sy_class_fenban clear">
<div class="mt5">
<div style="border-bottom: 1px solid #CCC">
<span href="javascript:void(0)" class="c_grey f14 fl fb mb5 ml65" >姓名</span>
<span href="javascript:void(0)" class="c_grey f14 fr fb mb5 mr20">加入时间</span>
<span href="javascript:void(0)" class="c_grey f14 fr fb mb5 mr70" >角色</span>
<div class="cl"></div><!--st_box_top end-->
</div>
<div class="mt10">
<% members.each do |member| %>
<div class="st_boxlist">
<%= link_to image_tag(url_to_avatar(member.user), :width => "32", :height => "32", :style => "display:block;"), user_path(member.user_id),:target => '_blank', :class => 'st_img' ,:alt => "用户头像" %>
<span class="fl ml10 c_grey"><%= l(:label_username)%></span>
<%= link_to(member.user.show_name, user_path(member.user),:class => "ml10 c_blue02") %>
<span class="fr c_grey"><%= format_date(member.created_on)%></span>
<span class="fr c_grey mr30 w45"><%= zh_course_role(h member.roles.sort.collect(&:to_s).first)%></span>
<div class="teacher_st_boxlist">
<%= link_to image_tag(url_to_avatar(member.user), :width => "50", :height => "50", :style => "display:block;", :class =>'teacher_member_img'), user_path(member.user_id), :class => 'fl' ,:alt => "用户头像" %>
<div class="fl">
<%= link_to(member.user.show_name, user_path(member.user),:class => "ml10 mt5 mb10 link-blue db") %>
<span class="c_grey ml10"><%= l(:label_username)%><%= member.user.login%></span>
</div>
<span class="fr c_grey mr15"><%= format_date(member.created_on)%></span>
<span class="fr c_grey mr55 w45" style="text-align: center"><%= zh_course_role(h member.roles.sort.collect(&:to_s).first)%></span>
</div>
<div class="cl"></div>
<% end%>
<ul class="wlist">
<%#= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
</ul>
</div>
<div class="cl"></div>
</div>
</div>

View File

@ -10,7 +10,6 @@
<li>
<label>班级邀请码:</label>
<input class=" sy_input_txt fl" name="invite_code" placeholder="请输入五位班级邀请码">
<div class="cl"></div>
</li>
<li>
@ -18,14 +17,13 @@
<input type="checkbox" name="role[]" value="9" id="join_course_role_9" class="ml5 mr5 "/><span class="mr10">教师</span>
<input type="checkbox" name="role[]" value="7" id="join_course_role_7" class="ml5 mr5"/><span class="mr10">助教</span>
<input type="checkbox" name="role[]" value="10" id="join_course_role_10" class="ml5 mr5"/><span class="mr10">学生</span>
<div class="cl"></div>
</li>
<li>
<p id="none_checked_notice" class="c_red none f12" style="margin-left: 42px;">请至少选择一个身份</p>
<li class="mt10">
<label>&nbsp;</label>
<a href="javascript:void(0);" class="sy_btn_blue fl" onclick="$('#new-watcher-form').submit();hideModal()">确&nbsp;&nbsp;定</a>
<a href="javascript:void(0);" class="sy_btn_blue fl" onclick="submit_join_course();">确&nbsp;&nbsp;定</a>
<a href="javascript:void(0);" class="sy_btn_grey fl ml20" onclick="hideModal()">取&nbsp;&nbsp;消</a>
<div class="cl"></div>
</li>
</ul>
@ -33,6 +31,16 @@
</div>
</div>
<script>
function submit_join_course(){
if ($("input[name='role[]']:checked").length >= 1){
$("#none_checked_notice").hide();
$('#new-watcher-form').submit();
hideModal();
}else{
$("#none_checked_notice").show();
}
}
$(function() {
$("#join_course_role_7").on('click', function(){
if($("#join_course_role_7").is(":checked")) {

View File

@ -79,8 +79,8 @@
<% sum = hw_score + ex_score + act_score %>
<td><%= (@page - 1) * @limit + i + 1 %></td>
<td>
<%= link_to image_tag(url_to_avatar(user), :width => "30", :height => "30", :style => "display:block;"), user_path(member.user_id), :class => 'sy_class_users_st fl mt5 mr5' ,:alt => "用户头像" %>
<span class="fl sy_class_users_st_name" title="<%= user.show_name %>"><%= user.show_name %></span>
<%= link_to image_tag(url_to_avatar(user), :width => "30", :height => "30", :style => "display:block;"), user_path(user), :class => 'sy_class_users_st fl mt5 mr5' ,:alt => "用户头像" %>
<%= link_to user.show_name, user_path(user), :class => 'fl sy_class_users_st_name' ,:title => "#{user.show_name}" %>
</td>
<td>
<span class="sy_class_users_st_num" title="<%= user.user_extensions.student_id %>"><%= user.user_extensions.student_id %></span>

View File

@ -5,77 +5,82 @@
<% if @state == 0 %>
var htmlvalue = '<div id="muban_popup_box" style="width:300px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
'<div class="clear mt15"><p class="text_c f14">加入成功</p><div class="cl"></div>'+
'<a href="javascript:void(0);" class="fr sy_btn_grey mt10" style="margin-right: 119px;" onclick="refresh_current_course();">确&nbsp;&nbsp;定</a></div></div>';
'<a href="javascript:void(0);" class="fr sy_btn_blue mt10" style="margin-right: 119px;" onclick="refresh_current_course();">确&nbsp;&nbsp;定</a></div></div>';
pop_box_new(htmlvalue, 300, 140);
<% elsif @state == 1 %>
var htmlvalue = '<div id="muban_popup_box" style="width:300px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
'<div class="clear mt15"><p class="text_c f14">密码错误</p><div class="cl"></div>'+
'<a href="javascript:void(0);" class="fr sy_btn_grey mt10" style="margin-right: 119px;" onclick="hideModal();">确&nbsp;&nbsp;定</a></div></div>';
'<a href="javascript:void(0);" class="fr sy_btn_blue mt10" style="margin-right: 119px;" onclick="hideModal();">确&nbsp;&nbsp;定</a></div></div>';
pop_box_new(htmlvalue, 300, 140);
<% elsif @state == 2 %>
var htmlvalue = '<div id="muban_popup_box" style="width:300px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
'<div class="clear mt15"><p class="text_c f14">班级已过期<br/>请联系班级管理员重启班级。(在配置班级处)</p><div class="cl"></div>'+
'<a href="javascript:void(0);" class="fr sy_btn_grey mt10" style="margin-right: 119px;" onclick="hideModal();">确&nbsp;&nbsp;定</a></div></div>';
'<a href="javascript:void(0);" class="fr sy_btn_blue mt10" style="margin-right: 119px;" onclick="hideModal();">确&nbsp;&nbsp;定</a></div></div>';
pop_box_new(htmlvalue, 300, 140);
<% elsif @state == 3 %>
var htmlvalue = '<div id="muban_popup_box" style="width:300px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
'<div class="clear mt15"><p class="text_c f14">您已经加入了班级</p><div class="cl"></div>'+
'<a href="javascript:void(0);" class="fr sy_btn_grey mt10" style="margin-right: 119px;" onclick="refresh_current_course();">确&nbsp;&nbsp;定</a></div></div>';
'<a href="javascript:void(0);" class="fr sy_btn_blue mt10" style="margin-right: 119px;" onclick="refresh_current_course();">确&nbsp;&nbsp;定</a></div></div>';
pop_box_new(htmlvalue, 300, 140);
<% elsif @state == 4 %>
var htmlvalue = '<div id="muban_popup_box" style="width:300px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
'<div class="clear mt15"><p class="text_c f14">您输入的邀请码错误</p><div class="cl"></div>'+
'<a href="javascript:void(0);" class="fr sy_btn_grey mt10" style="margin-right: 119px;" onclick="hideModal();">确&nbsp;&nbsp;定</a></div></div>';
'<a href="javascript:void(0);" class="fr sy_btn_blue mt10" style="margin-right: 119px;" onclick="hideModal();">确&nbsp;&nbsp;定</a></div></div>';
pop_box_new(htmlvalue, 300, 140);
<% elsif @state == 5 %>
var htmlvalue = '<div id="muban_popup_box" style="width:300px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
'<div class="clear mt15"><p class="text_c f14">您还未登录</p><div class="cl"></div>'+
'<a href="javascript:void(0);" class="fr sy_btn_grey mt10" style="margin-right: 119px;" onclick="hideModal();">确&nbsp;&nbsp;定</a></div></div>';
'<a href="javascript:void(0);" class="fr sy_btn_blue mt10" style="margin-right: 119px;" onclick="hideModal();">确&nbsp;&nbsp;定</a></div></div>';
pop_box_new(htmlvalue, 300, 140);
<% elsif @state == 6 %>
var htmlvalue = '<div id="muban_popup_box" style="width:300px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
'<div class="clear mt15"><p class="text_c f14">申请成功,请等待审核</p><div class="cl"></div>'+
'<a href="javascript:void(0);" class="fr sy_btn_grey mt10" style="margin-right: 119px;" onclick="hideModal();">确&nbsp;&nbsp;定</a></div></div>';
'<a href="javascript:void(0);" class="fr sy_btn_blue mt10" style="margin-right: 119px;" onclick="hideModal();">确&nbsp;&nbsp;定</a></div></div>';
pop_box_new(htmlvalue, 300, 140);
<% elsif @state == 7%>
var htmlvalue = '<div id="muban_popup_box" style="width:300px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
'<div class="clear mt15"><p class="text_c f14">您已经发送过申请了,请耐心等待</p><div class="cl"></div>'+
'<a href="javascript:void(0);" class="fr sy_btn_grey mt10" style="margin-right: 119px;" onclick="hideModal();">确&nbsp;&nbsp;定</a></div></div>';
'<a href="javascript:void(0);" class="fr sy_btn_blue mt10" style="margin-right: 119px;" onclick="hideModal();">确&nbsp;&nbsp;定</a></div></div>';
pop_box_new(htmlvalue, 300, 140);
<% elsif @state == 8%>
var htmlvalue = '<div id="muban_popup_box" style="width:300px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
'<div class="clear mt15"><p class="text_c f14">您已经是该班级的教师了</p><div class="cl"></div>'+
'<a href="javascript:void(0);" class="fr sy_btn_grey mt10" style="margin-right: 119px;" onclick="refresh_current_course();">确&nbsp;&nbsp;定</a></div></div>';
'<a href="javascript:void(0);" class="fr sy_btn_blue mt10" style="margin-right: 119px;" onclick="refresh_current_course();">确&nbsp;&nbsp;定</a></div></div>';
pop_box_new(htmlvalue, 300, 140);
<% elsif @state == 9%>
var htmlvalue = '<div id="muban_popup_box" style="width:300px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
'<div class="clear mt15"><p class="text_c f14">您已经是该班级的教辅了</p><div class="cl"></div>'+
'<a href="javascript:void(0);" class="fr sy_btn_grey mt10" style="margin-right: 119px;" onclick="refresh_current_course();">确&nbsp;&nbsp;定</a></div></div>';
'<a href="javascript:void(0);" class="fr sy_btn_blue mt10" style="margin-right: 119px;" onclick="refresh_current_course();">确&nbsp;&nbsp;定</a></div></div>';
pop_box_new(htmlvalue, 300, 140);
<% elsif @state == 10%>
var htmlvalue = '<div id="muban_popup_box" style="width:300px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
'<div class="clear mt15"><p class="text_c f14">您已经是该班级的管理员了</p><div class="cl"></div>'+
'<a href="javascript:void(0);" class="fr sy_btn_grey mt10" style="margin-right: 119px;" onclick="refresh_current_course();">确&nbsp;&nbsp;定</a></div></div>';
'<a href="javascript:void(0);" class="fr sy_btn_blue mt10" style="margin-right: 119px;" onclick="refresh_current_course();">确&nbsp;&nbsp;定</a></div></div>';
pop_box_new(htmlvalue, 300, 140);
<% elsif @state == 11%>
var htmlvalue = '<div id="muban_popup_box" style="width:300px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
'<div class="clear mt15"><p class="text_c f14">该班级已被删除</p><div class="cl"></div>'+
'<a href="javascript:void(0);" class="fr sy_btn_grey mt10" style="margin-right: 119px;" onclick="refresh_current_course();">确&nbsp;&nbsp;定</a></div></div>';
'<div class="clear mt15"><p class="text_c f14">该班级已归档,请联系老师</p><div class="cl"></div>'+
'<a href="javascript:void(0);" class="fr sy_btn_blue mt10" style="margin-right: 119px;" onclick="hideModal();">确&nbsp;&nbsp;定</a></div></div>';
pop_box_new(htmlvalue, 300, 140);
<% elsif @state == 12 %>
var htmlvalue = '<div id="muban_popup_box" style="width:300px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
'<div class="clear mt15"><p class="text_c f14">您已经发送过申请了,请耐心等待</p><div class="cl"></div>'+
'<a href="javascript:void(0);" class="fr sy_btn_grey mt10" style="margin-right: 119px;" onclick="refresh_current_course();">确&nbsp;&nbsp;定</a></div></div>';
'<a href="javascript:void(0);" class="fr sy_btn_blue mt10" style="margin-right: 119px;" onclick="hideModal();">确&nbsp;&nbsp;定</a></div></div>';
pop_box_new(htmlvalue, 300, 140);
<% elsif @state == 13 %>
var htmlvalue = '<div id="muban_popup_box" style="width:300px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
'<div class="clear mt15"><p class="text_c f14">申请成功,请等待审核</p><div class="cl"></div>'+
'<a href="javascript:void(0);" class="fr sy_btn_grey mt10" style="margin-right: 119px;" onclick="refresh_current_course();">确&nbsp;&nbsp;定</a></div></div>';
'<a href="javascript:void(0);" class="fr sy_btn_blue mt10" style="margin-right: 119px;" onclick="hideModal();">确&nbsp;&nbsp;定</a></div></div>';
pop_box_new(htmlvalue, 300, 140);
<% elsif @state == 14 %>
var htmlvalue = '<div id="muban_popup_box" style="width:300px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
'<div class="clear mt15"><p class="text_c f14">此二维码已停用,请与老师联系</p><div class="cl"></div>'+
'<a href="javascript:void(0);" class="fr sy_btn_blue mt10" style="margin-right: 119px;" onclick="hideModal();">确&nbsp;&nbsp;定</a></div></div>';
pop_box_new(htmlvalue, 300, 140);
<% else %>
var htmlvalue = '<div id="muban_popup_box" style="width:300px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
'<div class="clear mt15"><p class="text_c f14">未知错误,请稍后再试</p><div class="cl"></div>'+
'<a href="javascript:void(0);" class="fr sy_btn_grey mt10" style="margin-right: 119px;" onclick="hideModal();">确&nbsp;&nbsp;定</a></div></div>';
'<a href="javascript:void(0);" class="fr sy_btn_blue mt10" style="margin-right: 119px;" onclick="hideModal();">确&nbsp;&nbsp;定</a></div></div>';
pop_box_new(htmlvalue, 300, 140);
<% end %>
<% end %>

View File

@ -1,12 +1,11 @@
<% if @role.to_i == 1 %>
<div class="courseRSide fl" id="homework_page_right">
<div class="project_r_h">
<h2 class="project_h2 fl"><%= @subPage_title%></h2>
<div class="sy_class_r sy_class_nobg fr ml10">
<div class="sy_class_r_head mb10">
<h3 class="fl"><%= @subPage_title %></h3>
<% if User.current.allowed_to?(:as_teacher,@course) %>
<span class="fr f14 fontGrey2" style="height: 40px; line-height: 40px; margin-right: 15px;">
<%=link_to "成员管理", {:controller => 'courses', :action => 'settings', :id => @course.id, :tab=>'member'}, :class => 'hw_more_li' %>
</span>
<%=link_to "成员管理", {:controller => 'courses', :action => 'settings', :id => @course.id, :tab=>'member'}, :class => 'link-blue fr mt5' %>
<% end %>
<div class="cl"></div>
</div>
<%= render :partial => 'course_teacher', :locals => {:members => @members} %>
</div>

View File

@ -0,0 +1,2 @@
$("#project_info_<%=@course.id %>").html("<%= escape_javascript(render :partial => 'layouts/course_base_info') %>");
hideModal();

View File

@ -2,13 +2,13 @@
<thead>
<tr>
<th class="newupload_td01">&nbsp;</th>
<th class="pr">
<%= link_to "试卷标题", search_exercises_exercise_index_path(:course_id => course_id, :order => "exercise_name", :sort => @r_sort), :remote => true%>
<th class="pr tl">
<%= link_to "试卷标题", search_exercises_exercise_index_path(:course_id => course_id, :order => "exercise_name", :sort => @r_sort), :remote => true, :class => "ml5"%>
<% if order == "exercise_name" %>
<%= link_to "", search_exercises_exercise_index_path(:course_id => course_id, :order => "exercise_name", :sort => @r_sort), :class => "#{@r_sort == 'desc' ? 'sortupbtn' : 'sortdownbtn'}", :style => "position: absolute; top: 8px; left: 172px;", :remote => true %>
<% end %>
</th>
<th class="newupload_td03" style="color: #7f7f7f;">来源</th>
<th class="newupload_td03 tl" style="color: #7f7f7f;"><span class="ml5">来源</span></th>
<th class="newupload_td04 pr">
<%= link_to "创建时间", search_exercises_exercise_index_path(:course_id => course_id, :order => "created_at", :sort => @r_sort), :remote => true%>
<% if order == "created_at" %>

View File

@ -1,6 +1,2 @@
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/alert_forbidden_anonymous', :locals => {:user_activity_id => @user_activity_id,:hw_status => @hw_status}) %>');
showModal('ajax-modal', '500px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
"<a href='javascript:' onclick='clickCanel();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
$('#ajax-modal').parent().css("top","30%").css("left","30%").css("position","fixed").css("border","3px solid #269ac9");
var htmlvalue = "<%= escape_javascript(render :partial => 'student_work/alert_forbidden_anonymous', :locals => {:user_activity_id => @user_activity_id,:hw_status => @hw_status}) %>";
pop_box_new(htmlvalue, 400, 178);

View File

@ -54,14 +54,23 @@
</div>
</div>
<div class="sy_class_id fl">
<p>邀 请 码<br />
<p style="margin: <%=is_teacher ? '8px auto' : '24px auto 0px' %>">邀 请 码<br />
<span class="sy_corange">
<% if User.current.admin? || User.current.member_of_course?(@course) %>
<%=@course.generate_invite_code %>
<% if @course.invite_code_halt == 0 %>
<% if User.current.admin? || User.current.member_of_course?(@course) %>
<%=@course.generate_invite_code %>
<% else %>
<span class="f12">请询问老师</span>
<% end %>
<% else %>
<span class="f12">请询问老师</span>
已停用
<% end %>
</span>
<% if is_teacher && @course.invite_code_halt == 0 %>
<a href="javascript:void(0);" class="btn_grey_mid" style="margin-bottom: 12px;" onclick="alert_halt_code();">停&nbsp;&nbsp;&nbsp;&nbsp;用</a>
<% elsif is_teacher && @course.invite_code_halt == 1 %>
<a href="<%=set_invite_code_halt_course_path(@course) %>" data-remote="true" class="btn_grey_mid" style="margin-bottom: 12px;">启&nbsp;&nbsp;&nbsp;&nbsp;用</a>
<% end %>
</p>
</div>
<div class="sy_class_info fl ml15">
@ -102,10 +111,10 @@
</div>
<div class="cl"></div>
<% if is_teacher %>
<div class="invite_code_tip_box fontGrey2">
<div class="invite_code_tip_box fontGrey2" id="invite_code_tip_box">
<em></em>
<span></span>
<p class="mt10 mb5">请将邀请码告诉学生和教辅</p>
<p class="mb10">他们可以主动加入班级</p>
<p class="mt10 mb5"><%= @course.invite_code_halt == 0 ? "请将邀请码告诉学生和教辅" : "邀请码已停用,学生和教辅" %></p>
<p class="mb10"><%= @course.invite_code_halt == 0 ? "他们可以主动加入班级" : "不可以主动加入班级了" %></p>
</div>
<% end %>

View File

@ -7,13 +7,19 @@
<li class="navHomepageMenu fl">
<%= link_to "首页",user_activities_path(User.current), :class => "c_white f16 db p10", :title => "回到个人首页"%>
</li>
<!-- <li class="navHomepageMenu fl">
<%#= link_to "资源库", user_resource_user_path(User.current, :type => 1), :class => "c_white f16 db p10" %>
</li>-->
<li class="navHomepageMenu fl">
<%= link_to "资源库", user_resource_user_path(User.current, :type => 1), :class => "c_white f16 db p10" %>
<%= link_to "课程", user_course_community_path(User.current), :class => "c_white f16 db p10" %>
</li>
<li class="navHomepageMenu fl">
<%= link_to "项目", user_project_community_path(User.current), :class => "c_white f16 db p10" %>
</li>
<% if hidden_unproject_infos %>
<li class="navHomepageMenu fl">
<%= link_to "题库", user_homeworks_user_path(User.current), :class => "c_white f16 db p10"%>
</li>
<!-- <li class="navHomepageMenu fl">
<%#= link_to "题库", user_homeworks_user_path(User.current), :class => "c_white f16 db p10"%>
</li>-->
<% memo = Memo.where(:id => 1168).first %>
<% unless memo.nil? %>
<li class="navHomepageMenu fl mr30">
@ -72,10 +78,10 @@
</li>
<% end %>
<li>
<%= link_to "我的组织", user_organizations_user_path(:id => User.current), :class => "menuGrey"%>
<%= link_to '我的项目', {:controller => "users", :action => "user_projectlist", :id => @user}, :id => 'user_project_list', :class => "menuGrey" %>
</li>
<li>
<%= link_to "新建组织", new_organization_path, :class => "menuGrey"%>
<%= link_to "我的组织", user_organizations_user_path(:id => User.current), :class => "menuGrey"%>
</li>
<!--<li><a href="javascript:void(0);" class="menuGrey">账号设置</a> </li>-->
<li>

View File

@ -1,10 +1,10 @@
<span>
<% if user.user_extensions && user.user_extensions.brief_introduction && !user.user_extensions.brief_introduction.empty? %>
<%= user.user_extensions.brief_introduction %>
<% else%>
这个小伙伴很懒,什么都没留下~
<div class="user_info_intro">
<% if !user.user_extensions.school_id.blank? %>
<%= user.user_extensions.school.name %>
<% end %>
</div>
</span>
<% if User.current == user%>
<%= link_to image_tag("../images/signature_edit.png",width:"12px", height: "12px"), "javascript:void(0);", :onclick => "show_edit_user_introduction();"%>
<% end %>
<%# if User.current == user%>
<%#= link_to image_tag("../images/signature_edit.png",width:"12px", height: "12px"), "javascript:void(0);", :onclick => "show_edit_user_introduction();"%>
<%# end %>

View File

@ -1,18 +1,18 @@
<ul>
<% if User.current.logged?%>
<% if User.current == target%>
<li style="width: 119px; float: left; border-right: 1px solid #ddd;"><%= link_to("个人资料", my_account_path, :class => "user_editinfo") %></li>
<li style="width: 118px; float: left;"><%= link_to '个人主页', homepage_user_path(@user), :class => "user_editinfo", :target => '_blank' %></li>
<!-- <li style="width: 119px; float: left; border-right: 1px solid #ddd;"><%#= link_to("个人资料", my_account_path, :class => "user_editinfo") %></li>-->
<li><%= link_to '个人主页', homepage_user_path(@user), :class => "user_editinfo", :target => '_blank' %></li>
<li class="cl"></li>
<% else%>
<li style="width: 119px; float: left; border-right: 1px solid #ddd;">
<% if target.base_homepage.nil? %>
<!-- <li style="width: 119px; float: left; border-right: 1px solid #ddd;">
<%# if target.base_homepage.nil? %>
<a href="javascript:void(0)" class ="user_editinfo" style="color: #cccccc" title="该用户暂未设置主页">主页</a>
<% else %>
<%=link_to "主页", homepage_user_path(@user.login), :class => 'user_editinfo', :target => '_blank' %>
<% end %>
</li>
<li style="width: 118px; float: left;">
<%# else %>
<%#=link_to "主页", homepage_user_path(@user.login), :class => 'user_editinfo', :target => '_blank' %>
<%# end %>
</li>-->
<li>
<%if(target.watched_by?(User.current))%>
<%= link_to "取消关注",watch_path(:object_type=> 'user',:object_id=>target.id,:target_id=>target.id),:class => "user_editinfo", :method => "delete",:remote => "true", :title => "取消关注"%>
<% else %>

View File

@ -0,0 +1,113 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title><%= h html_title %></title>
<meta name="description" content="<%= Redmine::Info.app_name %>" />
<meta name="keywords" content="issue,bug,tracker" />
<%= csrf_meta_tag %>
<%= favicon %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common', 'css/structure','css/public', 'prettify','css/project','css/courses','css/popup','syllabus','css/moduel', 'css/user', :media => 'all' %>
<%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
<%= javascript_heads %>
<%= javascript_include_tag "bootstrap","avatars","new_user",'attachments','prettify'%>
<%= heads_for_theme %>
<%= call_hook :view_layouts_base_html_head %>
<%= yield :header_tags -%>
<!-- MathJax的配置 -->
<script type="text/javascript"
src="/javascripts/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
<!-- 配置 在生成的公式图片上去掉Math定义的右键菜单$$ $$ \( \) \[ \] 中的公式给予显示-->
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
showMathMenu: false,
showMathMenuMSIE: false,
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
});
</script>
</head>
<body onload="prettyPrint();">
<div class="navContainer">
<% is_current_user = User.current.logged? && User.current == @user%>
<% if User.current.logged? %>
<%= render :partial => 'layouts/logined_header' %>
<% else%>
<%= render :partial => 'layouts/unlogin_header' %>
<% end%>
</div>
<div class="cl"></div>
<div class="homepageContentContainer">
<!--div class="homepageRightBannerImg"></div-->
<div class="cl"></div>
<div class="homepageContent">
<div class="homepageLeft mt10" id="LSide">
<div class="user_leftnav ">
<% if hidden_unproject_infos %>
<ul class="users_accordion mb10">
<li id="user_01" class="user_icons_course">
<%= link_to '班级',{:controller => "users", :action => "user_courselist", :id => @user}, :id => "user_course_list" %>
<font class="show-all-sub"><%= link_to '全部',{:controller => "users", :action => "user_courselist", :id => @user}, :style => "color:#aaa;" %></font>
<% courses = @user.favorite_courses.visible.where("is_delete =?", 0).select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS a").order("a desc").limit(10) %>
<div class="<%= courses.empty? ? 'none' : ''%>" id="homepage_left_course_list">
<%=render :partial => 'layouts/homepage_left_course_list', :locals => {:courses => courses} %>
</div>
</li>
<% if is_current_user %>
<li id="user_02" class="user_icons_new">
<%= link_to "新建课程", new_syllabus_path(:host=> Setting.host_course), :target => "_blank", :style => "font-size:14px;" %>
</li>
<li id="user_03" class="user_icons_new">
<%= link_to "新建班级", new_course_path(:host=> Setting.host_course), :target => "_blank", :style => "font-size:14px;" %>
</li>
<li id="user_04" class="user_icons_addclass">
<%= link_to "加入班级",join_private_courses_courses_path,:remote => true, :method => "post", :style => "font-size:14px;" %>
</li>
<% end %>
</ul>
<% end %>
<ul class="users_accordion mb10">
<% if @user == User.current %>
<li id="user_05" class="user_icons_myhw">
<%=link_to '我的作业', my_homeworks_user_path(@user), :target => "_blank", :style => "font-size:14px;" %>
</li>
<li id="user_06" class="icons-doc clear">
<%= link_to "题库", user_homeworks_user_path(User.current), :target => "_blank", :style => "font-size:14px;" %>
</li>
<li id="user_07" class="icons-download clear">
<%= link_to "资源库", user_resource_user_path(User.current, :type => 1), :target => "_blank",:style => "font-size:14px;" %>
</li>
<% end %>
</ul>
</div>
<div class="user_leftnav ">
<ul class="users_accordion mb10">
<li id="user_10" class="user_icons_mes">
<%= link_to '留言', feedback_path(@user, :host=> Setting.host_user)%>
</li>
</ul>
</div>
<%# 更新访问数,刷新的时候更新访问次数 %>
<% update_visiti_count @user %>
<div class="fontGrey5 mt10 ml20">访问计数 <%= @user.visits.to_i %> 自2016年5月</div>
</div>
<div class="homepageRight">
<%= yield %>
</div>
</div>
</div>
<div class="cl"></div>
<%= render :partial => 'layouts/footer' %>
<div class="cl"></div>
<div id="ajax-modal" style="display:none;"></div>
<div id="ajax-indicator" style="display:none;">
<span><%= l(:label_loading) %></span>
</div>
<div id="nh_tx_dialog_html" class="white_content" style="display:none;">
<%=render :partial => 'layouts/upload_avatar', :locals => {:source => @user} %>
</div>
</body>
</html>

View File

@ -147,7 +147,7 @@
<%# 课程英雄榜 %>
<%= render :partial => 'courses/course_heroes', :locals => {:course => @course} %>
<div class="sy_class_leftbox" >
<h3 class="fontGrey7">班级推荐</h3>
<h3 class="fontGrey7">推荐</h3>
<%= render :partial => 'courses/recommendation', :locals => {:course => @course} %>
</div>
<%# 更新访问数,刷新的时候更新访问次数 %>
@ -279,10 +279,19 @@
function delete_confirm(){
var htmlvalue = '<div id="muban_popup_box" style="width:300px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
'<div class="clear mt15"><p class="text_c f14">您确认要退出该班级吗?</p><div class="cl"></div><a href="<%=join_path(:object_id => @course.id) %>" class="fr sy_btn_blue mr85 mt10" data-method="delete" data-remote="true">确&nbsp;&nbsp;定</a>'+
'<div class="clear mt15"><p class="text_c f14">您确认要退出该班级吗?</p><div class="cl"></div>'+
'<a href="<%=join_path(:object_id => @course.id) %>" class="fr sy_btn_blue mr85 mt10" data-method="delete" data-remote="true">确&nbsp;&nbsp;定</a>'+
'<a href="javascript:void(0);" class="fr sy_btn_grey mt10 mr10" onclick="hideModal();">取&nbsp;&nbsp;消</a></div></div>';
pop_box_new(htmlvalue, 300, 140);
}
function alert_halt_code(){
var htmlvalue = '<div id="muban_popup_box" style="width:400px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
'<div class="clear mt15"><p class="text_c f14">邀请码停用后,用户不能主动加入该班级了</p><p class="text_c mt10 f14">您是否确认停用</p><div class="cl"></div>'+
'<a href="<%=set_invite_code_halt_course_path(@course) %>" class="fr sy_btn_blue mr135 mt10" data-remote="true">确&nbsp;&nbsp;定</a>'+
'<a href="javascript:void(0);" class="fr sy_btn_grey mt10 mr10" onclick="hideModal();">取&nbsp;&nbsp;消</a></div></div>';
pop_box_new(htmlvalue, 400, 180);
}
</script>
</html>

View File

@ -0,0 +1,96 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title><%= h html_title %></title>
<meta name="description" content="<%= Redmine::Info.app_name %>" />
<meta name="keywords" content="issue,bug,tracker" />
<%= csrf_meta_tag %>
<%= favicon %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common', 'css/structure','css/public', 'prettify','css/project','css/courses','css/popup','syllabus','css/moduel', 'css/user', :media => 'all' %>
<%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
<%= javascript_heads %>
<%= javascript_include_tag "bootstrap","avatars","new_user",'attachments','prettify'%>
<%= heads_for_theme %>
<%= call_hook :view_layouts_base_html_head %>
<%= yield :header_tags -%>
<!-- MathJax的配置 -->
<script type="text/javascript"
src="/javascripts/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
<!-- 配置 在生成的公式图片上去掉Math定义的右键菜单$$ $$ \( \) \[ \] 中的公式给予显示-->
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
showMathMenu: false,
showMathMenuMSIE: false,
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
});
</script>
</head>
<body onload="prettyPrint();">
<div class="navContainer">
<% is_current_user = User.current.logged? && User.current == @user%>
<% if User.current.logged? %>
<%= render :partial => 'layouts/logined_header' %>
<% else%>
<%= render :partial => 'layouts/unlogin_header' %>
<% end%>
</div>
<div class="cl"></div>
<div class="homepageContentContainer">
<!--div class="homepageRightBannerImg"></div-->
<div class="cl"></div>
<div class="homepageContent">
<div class="homepageLeft mt10" id="LSide">
<div class="user_leftnav ">
<ul class="users_accordion mb10">
<li id="user_06" class="user_icons_project">
<%= link_to '项目',{:controller => "users", :action => "user_projectlist", :id => @user}, :id => 'user_project_list'%>
<font class="show-all-sub"><%= link_to '全部',{:controller => "users", :action => "user_projectlist", :id => @user}, :style => "color:#aaa;" %></font>
<% projects = @user.favorite_projects.visible.select("projects.*, (SELECT MAX(updated_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS a").order("a desc").limit(10)%>
<div class="<%= projects.empty? ? 'none' : ''%>" id="homepage_left_project_list">
<%=render :partial => 'layouts/homepage_left_project_list', :locals => {:projects => projects} %>
</div>
</li>
<% if is_current_user %>
<li id="user_07" class="user_icons_new">
<%= link_to "新建项目", new_project_path(:host=> Setting.host_name), :target => "_blank", :style => "font-size:14px;" %>
</li>
<li id="user_08" class="user_icons_addproject">
<%= link_to "加入项目", applied_join_project_path, :remote => true, :method => "post", :style => "font-size:14px;" %>
</li>
<li id="user_09" class="user_icons_myissues">
<%= link_to "我的Issue", user_issues_user_path(@user), :target => "_blank", :style => "font-size:14px;" %>
</li>
<% end %>
</ul>
<ul class="users_accordion mb10">
<li id="user_10" class="user_icons_mes">
<%= link_to '留言', feedback_path(@user, :host=> Setting.host_user)%>
</li>
</ul>
</div>
<%# 更新访问数,刷新的时候更新访问次数 %>
<% update_visiti_count @user %>
<div class="fontGrey5 mt10 ml20">访问计数 <%= @user.visits.to_i %> 自2016年5月</div>
</div>
<div class="homepageRight">
<%= yield %>
</div>
</div>
</div>
<div class="cl"></div>
<%= render :partial => 'layouts/footer' %>
<div class="cl"></div>
<div id="ajax-modal" style="display:none;"></div>
<div id="ajax-indicator" style="display:none;">
<span><%= l(:label_loading) %></span>
</div>
<div id="nh_tx_dialog_html" class="white_content" style="display:none;">
<%=render :partial => 'layouts/upload_avatar', :locals => {:source => @user} %>
</div>
</body>
</html>

View File

@ -7,7 +7,7 @@
<meta name="keywords" content="issue,bug,tracker" />
<%= csrf_meta_tag %>
<%= favicon %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common', 'css/structure','css/public', 'prettify','css/project','css/courses','css/popup','syllabus','css/moduel',:media => 'all' %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common', 'css/structure','css/public', 'prettify','css/project','css/courses','css/popup','syllabus','css/moduel', 'css/user', :media => 'all' %>
<%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
<%= javascript_heads %>
<%= javascript_include_tag "bootstrap","avatars","new_user",'attachments','prettify'%>
@ -88,7 +88,7 @@
<body onload="prettyPrint();">
<div class="navContainer">
<% is_current_user = User.current.logged? && User.current == @user%>
<% is_current_user = User.current.logged? && User.current == @user %>
<% if User.current.logged? %>
<%= render :partial => 'layouts/logined_header' %>
<% else%>
@ -104,7 +104,8 @@
<div class="user_leftinfo mb10">
<% if User.current.logged? && User.current == @user%>
<div class="pr" style="width: 80px; margin:0 auto;">
<%=link_to image_tag(url_to_avatar(@user),width:"74", height: "74", :id=>'nh_source_tx'), my_clear_user_avatar_temp_path, :class => "user_leftinfo_img", :remote => true%>
<%=link_to image_tag(url_to_avatar(@user),width:"74", height: "74", :id => 'nh_source_tx'),
my_clear_user_avatar_temp_path, :class => "user_leftinfo_img", :remote => true %>
<div class="homepageEditProfile undis">
<%=link_to '', my_clear_user_avatar_temp_path, :class => 'homepageEditProfileIcon', :remote => true, :title => '点击编辑Logo' %>
</div>
@ -130,23 +131,23 @@
<%= render :partial => 'layouts/user_brief_introduction', :locals => {:user => @user} %>
</div>
</div>
<textarea class="homepageSignatureTextarea none" placeholder="请编辑签名" id="user_brief_introduction_edit" onblur="edit_user_introduction('<%= edit_brief_introduction_user_path(@user.id)%>');"><%= @user.user_extensions.brief_introduction %></textarea>
<!-- <textarea class="homepageSignatureTextarea none" placeholder="请编辑签名" id="user_brief_introduction_edit" onblur="edit_user_introduction('<%#= edit_brief_introduction_user_path(@user.id)%>');"><%#= @user.user_extensions.brief_introduction %></textarea>-->
</div>
<ul class="user_atten clear">
<li>
<a href="<%=user_blogs_path(:user_id => @user) %>">
<a href="<%= user_blogs_path(:user_id => @user) %>">
<strong>博客</strong><br />
<span class="sy_cgrey"><%=@user.blog.blog_comments.where("#{BlogComment.table_name}.parent_id is null").count %></span>
<span class="sy_cgrey"><%= @user.blog.blog_comments.where("#{BlogComment.table_name}.parent_id is null").count %></span>
</a>
</li>
<li>
<a href="<%=user_watchlist_user_path(@user) %>">
<a href="<%= user_watchlist_user_path(@user) %>">
<strong>关注</strong><br />
<span class="sy_cgrey"><%=User.watched_by(@user).count %></span>
<span class="sy_cgrey"><%= User.watched_by(@user).count %></span>
</a>
</li>
<li>
<a href="<%=user_fanslist_user_path(@user) %>">
<a href="<%= user_fanslist_user_path(@user) %>">
<strong>粉丝</strong><br />
<span id="user_fans_number" class="sy_cgrey"><%= @user.watcher_users.count %></span>
</a>
@ -157,64 +158,110 @@
<%= render :partial => 'layouts/user_watch_btn', :locals => {:target => @user} %>
</div>
</div>
<div class="user_leftnav ">
<% if hidden_unproject_infos %>
<ul class="users_accordion mb10">
<li id="user_01" class="user_icons_course">
<%= link_to '班级',{:controller => "users", :action => "user_courselist", :id => @user}, :id => "user_course_list" %>
<font class="show-all-sub"><%= link_to '全部',{:controller => "users", :action => "user_courselist", :id => @user}, :style => "color:#aaa;" %></font>
<% courses = @user.favorite_courses.visible.where("is_delete =?", 0).select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS a").order("a desc").limit(10) %>
<div class="<%= courses.empty? ? 'none' : ''%>" id="homepage_left_course_list">
<%=render :partial => 'layouts/homepage_left_course_list', :locals => {:courses => courses} %>
</div>
</li>
<% if is_current_user %>
<li id="user_02" class="user_icons_new">
<%= link_to "新建课程", new_syllabus_path(:host=> Setting.host_course), :target => "_blank", :style => "font-size:14px;" %>
</li>
<li id="user_03" class="user_icons_new">
<%= link_to "新建班级", new_course_path(:host=> Setting.host_course), :target => "_blank", :style => "font-size:14px;" %>
</li>
<li id="user_04" class="user_icons_addclass">
<%= link_to "加入班级",join_private_courses_courses_path,:remote => true, :method => "post", :style => "font-size:14px;" %>
</li>
<% if @user == User.current %>
<li id="user_05" class="user_icons_myhw">
<%=link_to '我的作业', my_homeworks_user_path(@user), :target => "_blank", :style => "font-size:14px;" %>
<% if is_current_user %>
<div class="home-user-leftnav">
<h3 >
<%= link_to "课程社区", user_course_community_path(User.current), :class => "fl" %>
</h3>
<%# if hidden_unproject_infos %>
<ul>
<li class="home-user-leftnav-li icons-class clear">
<%= link_to user_course_count > 0 ? "课程<span class='issues_nav_tag ml140'>#{user_course_count}</span>".html_safe : "课程",
{:controller => "users", :action => "user_courselist", :id => @user}, :id => "user_course_list", :class => "fl" %>
<!-- <div class="user_navmore_box" >
<ul>
<li class="user_navmore_icons">
<ul class="user_navmore_txt02" >
<%# if is_current_user %>
<li>
<%#= link_to "新建课程", new_syllabus_path(:host=> Setting.host_course), :target => "_blank", :class => "user_navmore_li" %>
</li>
<li>
<%#= link_to "新建班级", new_course_path(:host=> Setting.host_course), :target => "_blank", :class => "user_navmore_li" %>
</li>
<li>
<%#= link_to "加入班级", join_private_courses_courses_path, :remote => true, :method => "post", :class => "user_navmore_li" %>
</li>
<#% end %>
</ul>
</li>
<% end %>
<% end %>
</ul>
<% end %>
</ul>
</div>-->
</li>
<li class="home-user-leftnav-li icons-homework clear">
<%=link_to '我的作业', my_homeworks_user_path(@user), :target => "_blank", :class => "fl" %>
</li>
<li class="home-user-leftnav-li icons-doc clear">
<%= link_to "题库", user_homeworks_user_path(User.current), :target => "_blank", :class => "fl" %>
</li>
<li class="home-user-leftnav-li icons-download clear">
<%= link_to "资源库", user_resource_user_path(User.current, :type => 1), :target => "_blank", :class => "fl" %>
</li>
</ul>
<%# end %>
</div>
<ul class="users_accordion mb10">
<li id="user_06" class="user_icons_project">
<%= link_to '项目',{:controller => "users", :action => "user_projectlist", :id => @user}, :id => 'user_project_list'%>
<font class="show-all-sub"><%= link_to '全部',{:controller => "users", :action => "user_projectlist", :id => @user}, :style => "color:#aaa;" %></font>
<% projects = @user.favorite_projects.visible.select("projects.*, (SELECT MAX(updated_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS a").order("a desc").limit(10)%>
<div class="<%= projects.empty? ? 'none' : ''%>" id="homepage_left_project_list">
<%=render :partial => 'layouts/homepage_left_project_list', :locals => {:projects => projects} %>
</div>
</li>
<% if is_current_user %>
<li id="user_07" class="user_icons_new">
<%= link_to "新建项目", new_project_path(:host=> Setting.host_name), :target => "_blank", :style => "font-size:14px;" %>
<div class="home-user-leftnav">
<h3 >
<%= link_to "项目社区", user_project_community_path(User.current), :class => "fl" %>
</h3>
<ul>
<li class="home-user-leftnav-li icons-project clear">
<%= link_to user_project_count > 0 ? "项目<span class='issues_nav_tag ml140'>#{user_project_count}</span>".html_safe : "项目",
{:controller => "users", :action => "user_projectlist", :id => @user}, :id => 'user_project_list', :class => "fl" %>
<!-- <div class="user_navmore_box" >
<ul>
<li class="user_navmore_icons">
<ul class="user_navmore_txt02">
<li>
<%#= link_to "新建项目", new_project_path(:host => Setting.host_name), :target => "_blank", :class => "user_navmore_li" %>
</li>
<li>
<%#= link_to "加入项目", applied_join_project_path, :remote => true, :method => "post", :class => "user_navmore_li" %>
</li>
<li>
<%#= link_to "我的关注", user_watchlist_user_path(@user), :remote => true, :method => "post", :class => "user_navmore_li" %>
</li>
&lt;!&ndash;<li><a href="javascript:void(0);" class="user_navmore_li">发现更多</a></li>&ndash;&gt;
</ul>
</li>
</ul>
</div>-->
</li>
<li id="user_08" class="user_icons_addproject">
<%= link_to "加入项目", applied_join_project_path, :remote => true, :method => "post", :style => "font-size:14px;" %>
<li class="home-user-leftnav-li icons-issue clear">
<%= link_to issues_author_is_self_count > 0 ? "我发布的issue<span class='issues_nav_tag ml80'>#{issues_author_is_self_count}</span>".html_safe : "我发布的issue",
user_issues_user_path(@user), :class => "fl" %>
</li>
<li id="user_09" class="user_icons_myissues">
<%= link_to "我的Issue", user_issues_user_path(@user), :style => "font-size:14px;" %>
<li class="home-user-leftnav-li icons-issue clear">
<%= link_to issues_assigned_is_self_count > 0 ? "我收到的issue<span class='issues_nav_tag ml80'>#{issues_assigned_is_self_count}</span>".html_safe : "我收到的issue",
user_issues_user_path(@user), :class => "fl" %>
</li>
<% end %>
</ul>
</ul>
</div>
<% else %>
<div class="home-user-leftnav">
<h3 >Ta在确实
<span class="fr mr5" style="font-size:12px;color: #7f7f7f;"><%= time_tag(@user.created_on).html_safe %></span>
</h3>
<ul>
<li class="home-user-leftnav-li icons-class clear">
<%= link_to user_course_count > 0 ? "课程<span class='issues_nav_tag ml140'>#{user_course_count}</span>".html_safe : "课程",
{:controller => "users", :action => "user_courselist", :id => @user}, :id => "user_course_list", :class => "fl" %>
</li>
<li class="home-user-leftnav-li icons-project clear">
<%= link_to user_project_count > 0 ? "项目<span class='issues_nav_tag ml140'>#{user_project_count}</span>".html_safe : "项目",
{:controller => "users", :action => "user_projectlist", :id => @user}, :id => 'user_project_list', :class => "fl" %>
</li>
</ul>
</div>
<% end %>
<div class="user_leftnav ">
<ul class="users_accordion mb10">
<li id="user_10" class="user_icons_mes">
<%= link_to '留言', feedback_path(@user, :host=> Setting.host_user)%>
</li>
</ul>
</div><!--sy_class_leftnav end-->
</div>
<%# 更新访问数,刷新的时候更新访问次数 %>
<% update_visiti_count @user %>
@ -281,4 +328,4 @@
}
</script>
</body>
</html>
</html>

View File

@ -9,10 +9,10 @@
<div class="homepagePostTo break_word">
<%= link_to activity.try(:author).show_name, user_path(activity.author_id), :class => "newsBlue mr15" %>
TO
<%= link_to activity.project.name.to_s+" | 项目资源", project_files_path(activity.project), :class => "newsBlue ml15" %>
<%= link_to activity.project.name.to_s+" | 项目资源", project_files_path(activity.course), :class => "newsBlue ml15" %>
</div>
<div class="homepagePostTitle break_word" >
<%= link_to activity.filename, project_files_path(activity.project), :class => "postGrey" %>
<%= link_to activity.filename, project_files_path(activity.course), :class => "postGrey" %>
</div>
<div class="homepagePostSubmitContainer">
<div class="homepagePostDeadline mr15">

View File

@ -7,17 +7,26 @@
<% parents_rely = get_reply_parents parents_rely, comment %>
<% length = parents_rely.length %>
<div id="comment_reply_<%=comment.id %>">
<% if length <= 2 %>
<% if length <= 5 %>
<%=render :partial => 'projects/project_issue_comments_reply', :locals => {:comment => comment.parent, :user_activity_id => user_activity_id, :parent_id => comment.id} %>
<% else %>
<div class="orig_cont clearfix">
<div class="orig_cont clearfix">
<%=render :partial => 'projects/project_issue_comments_reply_detail', :locals => {:comment => parents_rely[length - 1], :user_activity_id => user_activity_id, :parent_id => comment.id} %>
</div>
<div class="orig_cont_hide_issue clearfix">
<span class="orig_icon" >&darr; </span>
<span class="orig_icon" style="display:none;" > &uarr;</span><span class="">已经隐藏<%=(length - 2).to_s %>个楼层</span>
<%= link_to '[点击展开]', show_all_replies_users_path(:comment => comment, :type => 'is_project_issue', :user_activity_id => user_activity_id, :parent_id => comment.id), :remote=>true, :class => 'linkBlue2' %>
<div class="orig_cont clearfix">
<div class="orig_cont clearfix">
<div class="orig_cont clearfix">
<%=render :partial => 'projects/project_issue_comments_reply_detail', :locals => {:comment => parents_rely[length - 1], :user_activity_id => user_activity_id, :parent_id => comment.id} %>
</div>
<div class="orig_cont_hide clearfix">
<span class="orig_icon" >&darr; </span>
<span class="orig_icon" style="display:none;" > &uarr;</span><span class="">已经隐藏<%=(length - 5).to_s %>个楼层</span>
<%= link_to '[点击展开]', show_all_replies_users_path(:comment => comment, :type => 'is_project_issue', :user_activity_id => user_activity_id, :parent_id => comment.id), :remote=>true, :class => 'linkBlue2' %>
</div>
<%=render :partial => 'projects/project_issue_comments_reply_detail', :locals => {:comment => parents_rely[3], :user_activity_id => user_activity_id, :parent_id => comment.id} %>
</div>
<%=render :partial => 'projects/project_issue_comments_reply_detail', :locals => {:comment => parents_rely[2], :user_activity_id => user_activity_id, :parent_id => comment.id} %>
</div>
<%=render :partial => 'projects/project_issue_comments_reply_detail', :locals => {:comment => parents_rely[1], :user_activity_id => user_activity_id, :parent_id => comment.id} %>
</div>
<%=render :partial => 'projects/project_issue_comments_reply_detail', :locals => {:comment => parents_rely[0], :user_activity_id => user_activity_id, :parent_id => comment.id} %>
</div>

View File

@ -7,17 +7,26 @@
<% parents_rely = get_reply_parents_no_root parents_rely, comment %>
<% length = parents_rely.length %>
<div id="comment_reply_<%=comment.id %>">
<% if length <= 2 %>
<% if length <= 5 %>
<%=render :partial => 'projects/journal_comment_reply', :locals => {:comment => comment.parent, :user_activity_id => user_activity_id, :parent_id => comment.id} %>
<% else %>
<div class="orig_cont clearfix">
<div class="orig_cont clearfix">
<%=render :partial => 'projects/comment_reply_detail', :locals => {:comment => parents_rely[length - 1], :user_activity_id => user_activity_id, :parent_id => comment.id} %>
</div>
<div class="orig_cont_hide_issue clearfix">
<span class="orig_icon" >&darr; </span>
<span class="orig_icon" style="display:none;" > &uarr;</span><span class="">已经隐藏<%=(length - 2).to_s %>个楼层</span>
<%= link_to '[点击展开]', show_all_replies_users_path(:comment => comment, :type => 'is_project_message', :user_activity_id => user_activity_id, :parent_id => comment.id), :remote=>true, :class => 'linkBlue2' %>
<div class="orig_cont clearfix">
<div class="orig_cont clearfix">
<div class="orig_cont clearfix">
<%=render :partial => 'projects/comment_reply_detail', :locals => {:comment => parents_rely[length - 1], :user_activity_id => user_activity_id, :parent_id => comment.id} %>
</div>
<div class="orig_cont_hide clearfix">
<span class="orig_icon" >&darr; </span>
<span class="orig_icon" style="display:none;" > &uarr;</span><span class="">已经隐藏<%=(length - 5).to_s %>个楼层</span>
<%= link_to '[点击展开]', show_all_replies_users_path(:comment => comment, :type => 'is_project_message', :user_activity_id => user_activity_id, :parent_id => comment.id), :remote=>true, :class => 'linkBlue2' %>
</div>
<%=render :partial => 'projects/comment_reply_detail', :locals => {:comment => parents_rely[3], :user_activity_id => user_activity_id, :parent_id => comment.id} %>
</div>
<%=render :partial => 'projects/comment_reply_detail', :locals => {:comment => parents_rely[2], :user_activity_id => user_activity_id, :parent_id => comment.id} %>
</div>
<%=render :partial => 'projects/comment_reply_detail', :locals => {:comment => parents_rely[1], :user_activity_id => user_activity_id, :parent_id => comment.id} %>
</div>
<%=render :partial => 'projects/comment_reply_detail', :locals => {:comment => parents_rely[0], :user_activity_id => user_activity_id, :parent_id => comment.id} %>
</div>

View File

@ -1,16 +1,19 @@
<div id="popbox02">
<div class="ni_con">
<h2>禁用匿评</h2>
<p>
禁用匿评后学生将不能对作品进行互评,且匿评不能再开启,是否确定禁用匿评?
</p>
<div class="ni_btn">
<a href="javascript:" class="tijiao" onclick="clickOK('<%= forbidden_anonymous_comment_student_work_path(:homework=>@homework, :user_activity_id => user_activity_id, :hw_status => hw_status)%>');" style="margin-bottom: 20px;" >
确&nbsp;&nbsp;定
</a>
<a href="javascript:" class="tijiao" onclick="clickCanel();" style="margin-bottom: 20px;">
取&nbsp;&nbsp;消
</a>
</div>
<div id="muban_popup_box" style="width:400px;">
<div class="muban_popup_top">
<h3 class="fl">
提示
</h3>
<a href="javascript:void(0);" class="muban_icons_close fr"></a>
<div class="cl"></div>
</div>
</div>
<div class="muban_popup_con ml30 mr30 mt20 mb10 clear" >
<p class="mb10 f14 text_c">评分比例将恢复默认值,您可以在评分设置中进行修改</p>
<% if @homework.anonymous_comment == 0%>
<p class="mb10 f14 text_c">是否确定禁用匿评</p>
<% else %>
<p class="mb10 f14 text_c">是否确定启用匿评</p>
<% end %>
<a href="javascript:void(0);" class="fl sy_btn_blue" style="margin-left: 114px;" onclick="clickOK('<%= forbidden_anonymous_comment_student_work_path(:homework=>@homework, :user_activity_id => user_activity_id, :hw_status => hw_status)%>');">确定</a>
<a href="javascript:void(0);" class="fl sy_btn_grey ml5" onclick="hideModal();">取消</a>
</div>
</div>

View File

@ -0,0 +1,64 @@
<div id="muban_popup_box" style="width:400px;">
<div class="muban_popup_top">
<h3 class="fl">更换项目</h3>
<a href="javascript:void(0);" class="muban_icons_close fr"></a>
<div class="cl"></div>
</div>
<div class="muban_popup_con clear ml30 mr30 mt10">
<%= form_for('new_form',:url =>{:controller => 'student_work',:action => 'change_project',:homework => @homework.id},:method => "post", :remote => true) do |f|%>
<input type="text" name="project" placeholder="输入项目名称进行搜索" class="searchResourcePopup mb10" />
<div class="cl"></div>
<p id="no_search_result" class="c_red f14" style="width:320px;display: none">您当前尚未创建任何项目,请先创建项目再关联。</p>
<ul id="search_project_list" class="maxHeight200"></ul>
<p id="notes" class="c_red"></p>
<a href="javascript:void(0);" class="sy_btn_blue fr" onclick="clickOK();">确定</a>
<a href="javascript:void(0);" class="sy_btn_grey fr mr5" onclick="clickCanel();">取消</a>
<div class="cl"></div>
<% end %>
</div>
</div>
<script type="text/javascript">
var lastSearchCondition = '';
var count = 0;
function search_pros(e){
if($(e.target).val().trim() == lastSearchCondition && lastSearchCondition != '')
{
return;
}
lastSearchCondition = $(e.target).val().trim();
$.ajax({
url: '<%= url_for(:controller => 'student_work', :action => 'search_user_projects') %>'+'?name='+ e.target.value,
type:'get'
});
}
function throttle(method,context,e){
clearTimeout(method.tId);
method.tId=setTimeout(function(){
method.call(context,e);
},500);
}
//查询项目
$("input[name='project']").on('input', function (e) {
throttle(search_pros,window,e);
});
$(document).ready(function(){
$.ajax({
url: '<%= url_for(:controller => 'student_work', :action => 'search_user_projects') %>'+'?first=1',
type:'get'
});
});
function clickOK() {
var radio = $("input[name='projectName']:checked");
if(radio.length < 1) {
$("#notes").html("请先选择一个项目");
return false;
} else {
$("#muban_popup_box").find('form').submit();
hideModal();
}
}
</script>

View File

@ -5,16 +5,15 @@
<div class="syllabus_class_w fontGrey3" style="cursor: pointer;" onclick="show_student_work('<%= student_work_path(st)%>')">
<%= link_to(image_tag(url_to_avatar(st.user),:width =>"40",:height => "40", :style => "display:block;"),user_activities_path(st.user), :class => "fl") %>
<% if !is_expand %>
<span class="fl student_work_<%= st.id%>" style="width:120px;">
<span class="fl hidden ml5" style="max-width:75px;"><%= st.user.show_name %></span>
<span class="fl">(组长)</span>
<span class="fl" style="width:120px;">
<%= link_to st.user.show_name + "(组长)", user_path(st.user), :class => "fl hidden ml5 linkGrey", :style => "max-width:75px;" %>
</span>
<span class="fl hidden student_work_<%= st.id%>" style="width:105px; text-align: center">
<%= st.user.user_extensions.student_id.nil? || st.user.user_extensions.student_id == "" ? "--" : st.user.user_extensions.student_id%>
</span>
<% else %>
<span class="fl student_work_<%= st.id%>" style="width:120px;">
<span class="fl hidden ml5" style="max-width:75px;"><%= st.user.show_name %></span>
<span class="fl" style="width:120px;">
<%= link_to st.user.show_name, user_path(st.user), :class => "fl hidden ml5 linkGrey", :style => "max-width:75px;" %>
</span>
<span class="fl student_work_<%= st.id%> hidden" style="width:105px; text-align: center">
<%= st.user.user_extensions.student_id.nil? || st.user.user_extensions.student_id == "" ? "--" : st.user.user_extensions.student_id%>

View File

@ -13,15 +13,15 @@
<%= link_to(image_tag(url_to_avatar(student_work.user),:width =>"40",:height => "40",:style => "display:block;"),user_activities_path(student_work.user)) %>
</td>
<% if @homework.homework_type != 3 %>
<td class="<%= @homework.homework_type == 1 ? (@homework.anonymous_comment == 1 ? 'hworkStName130' : 'hworkStName100') : (@homework.anonymous_comment == 1 ? 'hworkStName110' : 'hworkStName') %> pr10 float-none student_work_<%= student_work.id%>" title="<%= student_work.user.show_name%>" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor:pointer;">
<%= student_work.user.show_name%>
<td class="<%= @homework.homework_type == 1 ? (@homework.anonymous_comment == 1 ? 'hworkStName130' : 'hworkStName100') : (@homework.anonymous_comment == 1 ? 'hworkStName110' : 'hworkStName') %> pr10 float-none" title="<%= student_work.user.show_name%>" style="cursor:pointer;">
<%= link_to student_work.user.show_name ,user_path(student_work.user) %>
</td>
<td class="<%= @homework.homework_type == 1 ? (@homework.anonymous_comment == 1 ? 'hworkStName130' : 'hworkStID90') : (@homework.anonymous_comment == 1 ? 'hworkStID100' : 'hworkStID') %> pr10 float-none student_work_<%= student_work.id%>" title="<%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id%>" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor:pointer;">
<%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id%>
</td>
<% else %>
<% if @homework.homework_detail_group.base_on_project == 1 %>
<td class="hworkName float-none pr10 student_work_<%= student_work.id%> width130" style="cursor: pointer;" onclick="show_student_work('<%= student_work_path(student_work)%>');">
<td class="hworkName float-none pr10 width130" style="cursor: pointer;" onclick="show_student_work('<%= student_work_path(student_work)%>');">
<div>
<%= link_to student_work.user.show_name,"javascript:void(0)" ,:title => student_work.user.show_name, :class => "StudentName break_word"%>
</div>
@ -40,7 +40,7 @@
</td>
<% end %>
<% elsif @homework.homework_detail_group.base_on_project == 0 %>
<td class="hworkName float-none pr10 student_work_<%= student_work.id%> <%=@homework.anonymous_comment == 1 ? 'width280' : 'width210' %>" style="cursor: pointer;" onclick="show_student_work('<%= student_work_path(student_work)%>');">
<td class="hworkName float-none pr10 <%=@homework.anonymous_comment == 1 ? 'width280' : 'width210' %>" style="cursor: pointer;" onclick="show_student_work('<%= student_work_path(student_work)%>');">
<div>
<%= link_to student_work.user.show_name,"javascript:void(0)" ,:title => student_work.user.show_name, :class => "StudentName break_word #{@homework.homework_type == 2 ? '' : 'width165'}"%>
</div>

View File

@ -4,8 +4,6 @@
<div class="homepagePostDes">
<div class="homepagePostTo break_word mt-4">
<%= link_to homework.user.show_name, user_activities_path(homework.user_id), :class => "newsBlue mr15"%>
TO
<%= link_to homework.course.name, course_path(homework.course_id), :class => "newsBlue"%>
</div>
<div class="homepagePostTitle hidden fl m_w505">
<% index = get_hw_index(homework, is_teacher) %>

View File

@ -121,13 +121,8 @@
<% end %>
});
function show_upload(){
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'student_work/upload_attachment' ,:locals => {:work=>work})%>');
showModal('ajax-modal', '452px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='closeModal();' style='margin-left: 435px;' class='resourceClose'></a>");
$('#ajax-modal').parent().css("top","40%").css("left","46%");
$('#ajax-modal').parent().addClass("resourceUploadPopup");
$('#ajax-modal').css("padding-left","16px").css("padding-bottom","16px");
var htmlvalue = "<%= escape_javascript( render :partial => 'student_work/upload_attachment' ,:locals => {:work=>work})%>";
pop_box_new(htmlvalue, 500, 230);
}
function regex_des() {
if ($.trim($("#attachment_des").val()) == "") {

View File

@ -1,16 +1,21 @@
<div id="popbox02" style="">
<span class="f16 fontBlue">关联项目</span>
<a href="javascript:void(0);" class="popClose" onclick="clickCanel();"></a>
<%=form_tag url_for(:controller=>'student_work',:action=>'student_work_project',:homework=>@homework.id,:user_activity_id=>@user_activity_id,:hw_status =>@hw_status),:id =>'student_work_relate_project',:class=>'resourcesSearchBox',:remote => true do %>
<input type="text" name="project" placeholder="输入项目名称进行搜索" class="searchResourcePopup mb10" />
<div class="cl"></div>
<p id="no_search_result" class="c_red" style="width:220px;display: none">您当前尚未创建任何项目,请先创建项目再关联。</p>
<ul id="search_project_list" class="maxHeight100"></ul>
<p id="notes" class="c_red"></p>
<div class="courseSendSubmit mt10"><a href="javascript:void(0);" class="sendSourceText" onclick="clickOK();">确定</a></div>
<div class="courseSendCancel mt10"><a href="javascript:void(0);" class="sendSourceText" onclick="clickCanel();">取消</a></div>
<div class="cl"></div>
<% end %>
<div id="muban_popup_box" style="width:400px;">
<div class="muban_popup_top">
<h3 class="fl">关联项目</h3>
<a href="javascript:void(0);" class="muban_icons_close fr"></a>
<div class="cl"></div>
</div>
<div class="muban_popup_con clear ml30 mr30 mt10">
<%= form_for('new_form',:url =>{:controller => 'student_work',:action => 'student_work_project',:homework => @homework.id,:user_activity_id=>@user_activity_id,:hw_status =>@hw_status},:method => "post", :remote => true) do |f|%>
<input type="text" name="project" placeholder="输入项目名称进行搜索" class="searchResourcePopup mb10" />
<div class="cl"></div>
<p id="no_search_result" class="c_red f14" style="width:320px;display: none">您当前尚未创建任何项目,请先创建项目再关联。</p>
<ul id="search_project_list" class="maxHeight200"></ul>
<p id="notes" class="c_red"></p>
<a href="javascript:void(0);" class="sy_btn_blue fr" onclick="clickOK();">确定</a>
<a href="javascript:void(0);" class="sy_btn_grey fr mr5" onclick="clickCanel();">取消</a>
<div class="cl"></div>
<% end %>
</div>
</div>
<script type="text/javascript">
var lastSearchCondition = '';
@ -52,7 +57,7 @@
$("#notes").html("请先选择一个项目");
return false;
} else {
$("#student_work_relate_project").submit();
$("#muban_popup_box").find('form').submit();
}
}
</script>

View File

@ -3,18 +3,22 @@
<% allow_visit = project.status != 9 && (project.is_public || User.current.member_of?(project) || User.current.admin? || User.current.allowed_to?(:as_teacher, @homework.course)) %>
<div class="syllabus_courses_list" style="cursor: default">
<div class="sy_courses_open">
<% projectUser = User.where("id=?",project.user_id).first %>
<% is_change = project.status == 9 && projectUser == User.current && @homework.student_works.has_committed.where("user_id = #{User.current.id}").count == 1 %>
<h3>
<% if allow_visit %>
<%= link_to "#{project.name}", project_path(project.id,:host=>Setting.host_name), :target => '_blank', :class => "new_project_title fl",:id => "show_project_#{project.id}", :title => (project.is_public? ? "公开项目:":"私有项目:") + project.name%>
<% elsif project.status != 9 %>
<a href="javascript:void(0)" class="new_project_title fl" title="私有项目不可访问"><%=project.name %></a>
<% else %>
<a href="javascript:void(0)" class="new_project_title fl" title="项目已删除"><%=project.name %></a>
<a href="javascript:void(0)" onclick="alert_notice_box();" class="new_project_title fl <%= is_change ? 'mw380' : '' %>" title="项目已删除"><%=project.name %></a>
<% end %>
</h3>
<span class="<%= project.is_public? ? 'syllabus_class_open' : 'syllabus_class_private' %> fl ml10 mt3 syllabus_class_property"><%= project.is_public? ? '公开' : '私有' %></span>
<% projectUser = User.where("id=?",project.user_id).first %>
<%=link_to "<span class='fr grayTxt'>创建者:#{projectUser.try(:realname) != " " ? projectUser.lastname + projectUser.firstname : projectUser.try(:login)}</span>".html_safe, user_path(projectUser) %>
<% if is_change %>
<a href="javascript:void(0)" onclick="alert_change_project();" class="btn_grey_mid mt-5 ml10 fr">更换项目</a>
<% end %>
<%=link_to "<span class='fr grayTxt hidden mw150'>创建者:#{projectUser.show_name}</span>".html_safe, user_path(projectUser), :title => "#{projectUser.show_name}" %>
<div class="cl"></div>
</div>
<div>
@ -30,4 +34,16 @@
<div class="cl"></div>
</div>
<% end %>
</div><!--syllabus_courses_box end-->
</div><!--syllabus_courses_box end-->
<script>
function alert_notice_box(){
var htmlvalue = '<div id="muban_popup_box" style="width:300px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
'<div class="clear mt15"><p class="text_c f14">项目已删除,链接无效</p><div class="cl"></div>'+
'<a href="javascript:void(0);" class="fr sy_btn_blue mt10" style="margin-right: 119px;" onclick="hideModal();">确&nbsp;&nbsp;定</a></div></div>';
pop_box_new(htmlvalue, 300, 140);
}
function alert_change_project(){
var htmlvalue = "<%= escape_javascript(render :partial => 'student_work/change_project') %>";
pop_box_new(htmlvalue, 400, 285);
}
</script>

View File

@ -1,31 +1,33 @@
<% revise_attachment = work.attachments.where("attachtype = 7").first %>
<% if @homework.end_time < Date.today %>
<% if revise_attachment && @is_teacher %>
<% if revise_attachment && work.user != User.current %>
<div class="resubAtt mb15">
<span class="resubTitle">追加修订附件</span>
<span class="resubTitle">作业修订附件</span>
</div>
<div class="mb10" id="revise_attachment_div_<%=revise_attachment.id %>">
<span class="tit_fb"> 追加附件:</span>
<%= render :partial => 'work_attachments_status', :locals => {:attachments => work.attachments.where("attachtype = 7"), :status => 2} %>
<span class="tit_fb">追加时间:</span><%=format_time revise_attachment.created_on.to_s %>&nbsp;&nbsp;(<%=revise_attachment_status @homework,revise_attachment %>)<br />
<% unless revise_attachment.description == "" %>
<span class="tit_fb break_word">追加理由:</span><p class="showHworkP"><%=revise_attachment.description %></p>
<% end %>
</div>
<div class="cl"></div>
<div class="_notice_box ml5 text_c">注意:此处的附件是在作业截止日期过后提交的</div>
<div class="cl"></div>
<% end %>
<% if work.user == User.current && !User.current.allowed_to?(:as_teacher, @homework.course) %>
<div class="resubAtt mb15">
<span class="resubTitle">追加修订附件</span>
<span class="resubTitle">作业修订附件</span>
</div>
<% if revise_attachment %>
<div class="mb10" id="revise_attachment_div_<%=revise_attachment.id %>">
<span class="tit_fb"> 追加附件:</span>
<%= render :partial => 'work_attachments_status', :locals => {:attachments => work.attachments.where("attachtype = 7"), :status => 1} %>
<span class="tit_fb">追加时间:</span><%=format_time revise_attachment.created_on.to_s %><br />
<% unless revise_attachment.description == "" %>
<span class="tit_fb break_word">追加理由:</span><p class="showHworkP"><%=revise_attachment.description %></p>
<% end %>
<div class="cl"></div>
<div class="_notice_box ml5 text_c">注意:此处的附件是在作业截止日期过后提交的</div>
</div>
<% end %>
<div class="cl"></div>

View File

@ -125,13 +125,8 @@
<% end %>
});
function show_upload(){
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'student_work/upload_attachment' ,:locals => {:work=>work})%>');
showModal('ajax-modal', '452px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='closeModal();' style='margin-left: 435px;' class='resourceClose'></a>");
$('#ajax-modal').parent().css("top","40%").css("left","46%");
$('#ajax-modal').parent().addClass("resourceUploadPopup");
$('#ajax-modal').css("padding-left","16px").css("padding-bottom","16px");
var htmlvalue = "<%= escape_javascript( render :partial => 'student_work/upload_attachment' ,:locals => {:work=>work})%>";
pop_box_new(htmlvalue, 500, 230);
}
function regex_des() {
if ($.trim($("#attachment_des").val()) == "") {

View File

@ -17,7 +17,7 @@
<%=link_to "提交作品", new_student_work_url_without_domain(@homework.id),:class => 'blueCir ml5 f12' %>
<% end %>
<% elsif !@is_teacher && my_work &&Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(Time.now.to_s).strftime("%Y-%m-%d") && !@stundet_works.empty?%>
<span class="f12 c_red">已提交且不可修改,因为截止日期已过</span>
<span class="f12 c_red">截止日期已过,已提交且不可修改</span>
<% elsif !@is_teacher && my_work &&Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.parse(Time.now.to_s).strftime("%Y-%m-%d") && !@stundet_works.empty?%>
<% if @homework.homework_type == 3 %>
<span class="f12 c_red">组长已提交,组长还可修改</span>

View File

@ -1,7 +1,7 @@
<ul class="ping_box_ul <%= is_last ? '' : 'ping_line'%> fl">
<% show_real_name = @is_teacher || score.user == User.current || score.reviewer_role != 3 %>
<%= link_to image_tag(url_to_avatar(show_real_name ? score.user : ""), :width => "34", :height => "34"), show_real_name ? user_path(score.user) : "javascript:void(0)",:class => "ping_pic fl" %>
<% show_real_score = @homework.score_open == 1 || @is_teacher || score.student_work.user == User.current %>
<% show_real_score = @homework.score_open == 1 || @is_teacher || score.student_work.user == User.current || score.user == User.current %>
<div class="pingBoxTit">
<%= link_to show_real_name ? score.user.show_name : "匿名", show_real_name ? user_path(score.user) : "javascript:void(0)", :title => show_real_name ? score.user.show_name : "匿评用户", :class => "linkBlue fl" %>
<span class="ml5 fl">

View File

@ -1,7 +1,12 @@
<!--<div class="resourceUploadPopup">-->
<span class="uploadDialogText">上传附件</span>
<!--<div class="resourcePopupClose"> <a href="javascript:void(0);" class="resourceClose" onclick="closeModal();"></a></div>-->
<div class="uploadBoxContainer">
<div id="muban_popup_box" style="width:500px;">
<div class="muban_popup_top">
<h3 class="fl">
上传附件
</h3>
<a href="javascript:void(0);" class="muban_icons_close fr"></a>
<div class="cl"></div>
</div>
<div class="muban_popup_con ml50 mt20 mb10 uploadBoxContainer">
<%= form_tag(revise_attachment_student_work_path(work.id), :multipart => true,:remote => !ie8?,:name=>"upload_form",:id=>'upload_form') do %>
<div>
<span id="attachments_fields" xmlns="http://www.w3.org/1999/html">
@ -43,15 +48,11 @@
<div class="cl"></div>
<p id="hint_message"></p>
<div class="cl"></div>
<div style="margin-top: 10px" >
<div class="courseSendSubmit">
<a href="javascript:void(0);" id="upload_files_submit_btn" class="sendSourceText" onclick="submit_revise_files();">确定</a>
<%#= submit_tag '确定',:onclick=>'submit_revise_files();',:onfocus=>'this.blur()',:id=>'upload_files_submit_btn',:class=>'sendSourceText' %>
</div>
<div class="courseSendCancel">
<a href="javascript:void(0);" id="upload_files_cancle_btn" class="sendSourceText" onclick="closeModal();">取消</a>
</div>
<div style="margin-top: 10px">
<a href="javascript:void(0);" id="upload_files_cancle_btn" class="fl sy_btn_grey mr10" onclick="closeModal();">取消</a>
<a href="javascript:void(0);" id="upload_files_submit_btn" class="fl sy_btn_blue" onclick="submit_revise_files();">确定</a>
</div>
<% end %>
</div>
<div class="cl"></div>
</div>

View File

@ -5,7 +5,9 @@
<%= link_to_short_attachment attachment,:length=> 58, :class => 'hidden link_file_a fl newsBlue mw360', :download => true -%>
</span>
</span>
<%= link_to('&nbsp;'.html_safe, attachment_path(attachment, :format => 'js'), :method => 'delete', :remote => true, :title => '删除', :class => 'remove-upload fl', :confirm => l(:text_are_you_sure)) if attachment.id && User.current == attachment.author && status != 2 %>
<% if attachment.id && User.current == attachment.author && (attachment.attachtype == 7 || @homework.end_time >= Date.today) %>
<%= link_to('&nbsp;'.html_safe, attachment_path(attachment, :format => 'js'), :method => 'delete', :remote => true, :title => '删除', :class => 'remove-upload fl', :confirm => l(:text_are_you_sure)) %>
<% end %>
<span class="postAttSize">(<%= number_to_human_size attachment.filesize %>)</span>
<span class="author">
<%= format_time(attachment.created_on) %>

View File

@ -0,0 +1,17 @@
<% if @remain_user_ids %>
<% str = "" %>
<% @remain_user_ids.each do |user_id| %>
<% user = User.find user_id %>
<% if str == "" %>
<% str += user.show_name.to_s + "(" + user.login.to_s + ")" %>
<% else %>
<% str += "、" + user.show_name.to_s + "(" + user.login.to_s + ")" %>
<% end %>
<% end %>
var htmlvalue = '<div id="muban_popup_box" style="width:350px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
'<div class="clear mt15"><p class="text_c f14">以下组员还不是项目成员,请先前往项目添加成员</p><p class="text_c f14"><%=str %></p><div class="cl"></div>'+
'<a href="javascript:void(0);" class="fr sy_btn_blue mt10" style="margin-right: 144px;" onclick="hideModal();">确&nbsp;&nbsp;定</a></div></div>';
pop_box_new(htmlvalue, 350, 140);
<% else %>
window.location.href = "<%=student_work_index_url(:homework => @homework.id, :tab => 3) %>";
<% end %>

View File

@ -3,4 +3,12 @@ $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(r
sd_create_editor_from_data(<%= @user_activity_id%>,"","100%", "UserActivity");
<% else %>
sd_create_editor_from_data(<%= @homework.id%>,"","100%", "<%=@homework.class.to_s%>");
<% end %>
<% if @homework.anonymous_comment == 0 %>
var htmlvalue = '<div id="muban_popup_box" style="width:400px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
'<div class="muban_popup_con ml30 mr30 mt20 mb10 clear"><p class="mb10 f14 text_c">将于7天后自动启动该作业的匿评</p><p class="mb10 f14 text_c">您可以在匿评设置中进行修改</p>' +
'<a href="javascript:void(0);" class="btn btn-blue mt10" style="margin-left: 142px;" onclick="hideModal();">知道啦</a></div></div>';
pop_box_new(htmlvalue, 400, 178);
<% else %>
hideModal();
<% end %>

View File

@ -186,8 +186,10 @@
<% if @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %>
<div class="undis" id="student_work_con3">
<% project_ids = @homework.student_work_projects.blank? ? "(-1)" : "(" + @homework.student_work_projects.map{|pro| pro.project_id}.join(",") + ")" %>
<% projects = Project.where("id in #{project_ids}") %>
<% student_work_ids = @homework.student_works.has_committed.blank? ? "(-1)" : "(" + @homework.student_works.has_committed.map{|st| st.id}.join(",") + ")" %>
<% student_work_projects = @homework.student_work_projects.where("student_work_id in #{student_work_ids} or student_work_id is null") %>
<% project_ids = student_work_projects.blank? ? "(-1)" : "(" + student_work_projects.map{|pro| pro.project_id}.join(",") + ")" %>
<% projects = Project.where("id in #{project_ids}").order("updated_on desc") %>
<%= render :partial => "student_work/relate_projects", :locals => {:projects => projects}%>
</div>
<% end %>

View File

@ -1,5 +1,2 @@
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/relate_project') %>');
showModal('ajax-modal', '320px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').parent().css("top","").css("left","");
$('#ajax-modal').parent().addClass("groupPopUp");
var htmlvalue = "<%= escape_javascript(render :partial => 'student_work/relate_project') %>";
pop_box_new(htmlvalue, 400, 285);

View File

@ -3,7 +3,7 @@
<% else %>
$("#search_project_list").html("");
<% @project_ids.each do |project|%>
link = "<li><label><input type='radio' class='courseSendCheckbox' name='projectName' value='<%=project.id%>'/><span class='sendCourseName'> <%=project.name %> </span></label></li>";
$("#search_project_list").append(link );
link = "<li><input type='radio' class='courseSendCheckbox fl' name='projectName' value='<%=project.id%>'/><a href='<%=project_path(project) %>' target='_blank' class='hidden fl' style='padding-top: 8px; max-width: 300px;'> <%=project.name %> </a><div class='cl'></div></li>";
$("#search_project_list").append(link);
<% end %>
<% end %>

View File

@ -9,7 +9,9 @@
<%= link_to project.name, project_path(ma.project_id), :class => "link-blue", :target => '_blank', :title => "#{project.name}" %>
</a>
</li>
<li class="fl" style="width:71px; height:49px;">
<li class="homepageNewsTime fr"><%= time_tag(ma.created_at).html_safe %> </li>
<li class="fr" style="width:71px; height:49px;">
<span><%= render :partial => "users/user_message_applide_action", :locals =>{:ma => ma} %></span>
</li>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>

View File

@ -24,4 +24,4 @@
<%end %>
</span>
</li>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
<li class="homepageNewsTime fr"><%= time_tag(ma.created_at).html_safe %> </li>

View File

@ -35,4 +35,4 @@
<%end %>
</span>
</li>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
<li class="homepageNewsTime fr"><%= time_tag(ma.created_at).html_safe %> </li>

View File

@ -30,5 +30,5 @@
<%= link_to link_str, user_resource_user_path(User.current, :type => 2), :title => link_str,:class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey "}" %>
</a>
</li>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
<li class="homepageNewsTime fr"><%= time_tag(ma.created_at).html_safe %> </li>
</ul>

View File

@ -12,7 +12,7 @@
<%= link_to activity.try(:author).try(:realname), user_path(activity.author_id), :class => "newsBlue mr15" %>
<% end %>
TO
<%= link_to activity.course.name.to_s+" | 班级资源", course_files_path(activity.course), :class => "newsBlue" %>
<%= link_to "班级资源", course_files_path(activity.course), :class => "newsBlue ml15" %>
</div>
<div class="homepagePostTitle break_word" >
<%= link_to activity.filename, course_files_path(activity.course), :class => "postGrey" %>

View File

@ -12,7 +12,8 @@
<%= link_to activity.try(:teacher).try(:realname), user_path(activity.teacher), :class => "newsBlue mr15" %>
<% end %>
TO
<%= link_to activity.name.to_s+" | 班级", course_path(activity.id,:host=>Setting.host_course), :class => "newsBlue" %>
<% str = defined?(is_course) && is_course == 1 ? "班级" : "#{activity.name.to_s} | 班级" %>
<%= link_to str, course_path(activity.id,:host=>Setting.host_course), :class => "newsBlue ml15" %>
</div>
<div class="homepagePostTitle break_word" >
<%= link_to activity.name, course_path(activity.id,:host=>Setting.host_course), :class => "postGrey" %>

View File

@ -9,10 +9,10 @@
<div class="homepagePostTo break_word">
<%= link_to activity.user.show_name, user_path(activity.user,:host=>Setting.host_user), :class => "newsBlue mr15" %>
TO <!--+"(课程名称)" -->
<% if hw_status == 3 || hw_status == 5 %>
<%= link_to activity.course.name, course_path(activity.course_id), :class => "newsBlue"%>
<% if hw_status == 3 || hw_status == 2 %>
<%= link_to "班级作业", homework_common_index_path(:course => activity.course.id, :host=> Setting.host_course), :class => "newsBlue ml15"%>
<% else %>
<%= link_to activity.course.name.to_s+" | 班级作业", homework_common_index_path(:course => activity.course.id, :host=> Setting.host_course), :class => "newsBlue"%>
<%= link_to activity.course.name.to_s+" | 班级作业", homework_common_index_path(:course => activity.course.id, :host=> Setting.host_course), :class => "newsBlue ml15"%>
<% end %>
</div>
<div class="homepagePostTitle hidden fl m_w505"> <!--+"(作业名称)"-->

View File

@ -9,7 +9,8 @@
<%= link_to activity.user.show_name, user_path(activity.user), :class => "newsBlue mr15" %>
TO
<% course=Course.find(activity.jour_id) %>
<%= link_to course.name.to_s+" | 班级留言", course_feedback_path(course), :class => "newsBlue" %>
<% str = defined?(is_course) && is_course == 1 ? "班级留言" : "#{course.name.to_s} | 班级留言" %>
<%= link_to str, course_feedback_path(course), :class => "newsBlue ml15" %>
</div>
<!--<div class="homepagePostTitle break_word list_style upload_img">
<%# if activity.parent %>

View File

@ -8,7 +8,8 @@
<div class="homepagePostTo break_word">
<%= link_to activity.author.show_name, user_path(activity.author, :host=>Setting.host_user), :class => "newsBlue mr15" %>
TO
<%= link_to activity.course.name.to_s+" | #{activity.board.parent.nil? ? '班级讨论区' : activity.board.name}", course_boards_path(activity.course,:host=> Setting.host_course), :class => "newsBlue mr5"%>
<% str = is_course == 1 ? "#{activity.board.parent.nil? ? '班级讨论区' : activity.board.name}" : activity.course.name.to_s+" | #{activity.board.parent.nil? ? '班级讨论区' : activity.board.name}" %>
<%= link_to str, course_boards_path(activity.course,:host=> Setting.host_course), :class => "newsBlue ml15"%>
</div>
<div class="homepagePostTitle hidden m_w530 fl">
<% if activity.parent_id.nil? %> <!--+"(帖子标题)"-->

View File

@ -8,7 +8,8 @@
<div class="homepagePostTo break_word">
<%= link_to activity.author.show_name, user_path(activity.author), :class => "newsBlue mr15" %>
TO <!--+"(课程名称)"-->
<%= link_to activity.course.name.to_s+" | 班级通知", course_news_index_path(activity.course), :class => "newsBlue" %>
<% str = defined?(is_course) && is_course == 1 ? "班级通知" : "#{activity.course.name.to_s} | 班级通知" %>
<%= link_to str, course_news_index_path(activity.course), :class => "newsBlue ml15" %>
</div>
<div class="homepagePostTitle break_word hidden fl m_w600"> <!--+"(通知标题)"-->
<%= link_to activity.title.to_s, news_path(activity), :class => "postGrey" %>

View File

@ -17,7 +17,8 @@
<% end %>
TO
<% course = Course.find(activity.polls_group_id) %>
<%= link_to course.name.to_s+" | 问卷", poll_index_path(:polls_type => "Course", :polls_group_id => activity.polls_group_id), :class => "newsBlue" %>
<% str = defined?(is_course) && is_course == 1 ? "班级问卷" : "#{course.name.to_s} | 班级问卷" %>
<%= link_to str, poll_index_path(:polls_type => "Course", :polls_group_id => activity.polls_group_id), :class => "newsBlue ml15" %>
<!--<a href="javascript:void(0);" class="newsBlue ml15">分布式计算环境(课程名称)</a>-->
</div>
<div class="homepagePostTitle break_word" >

View File

@ -111,6 +111,11 @@
<%= link_to("禁用匿评", alert_forbidden_anonymous_comment_homework_common_path(activity,:user_activity_id => user_activity_id),:class => "wpostOptionLink",
:title => "匿评是同学之间的双盲互评过程:每个同学将评阅系统分配给他/她的若干个作品", :remote => true)%>
</li>
<% elsif activity.anonymous_comment == 1 %>
<li>
<%= link_to("启用匿评", alert_forbidden_anonymous_comment_homework_common_path(activity,:user_activity_id => user_activity_id),:class => "wpostOptionLink",
:title => "匿评是同学之间的双盲互评过程:每个同学将评阅系统分配给他/她的若干个作品", :remote => true)%>
</li>
<% end %>
<% if (activity.anonymous_comment == 1 && activity.is_open == 0) || (activity.anonymous_comment == 0 && comment_status == 3 && activity.is_open == 0) %>
<li>

View File

@ -1,7 +1,7 @@
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><div class="navHomepageLogo fl"><%= image_tag("/images/trustie_logo1.png", width: "30px", height: "30px", class: "mt3") %></div></a></li>
<li class="homepageNewsPubType fl">
<span class="newsBlue homepageNewsPublisher">系统提示</span>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">您有了新的班级成员申请:</span>
<span class="homepageNewsType fl">您有了新的班级成员申请:</span>
</li>
<li class="<%=(ma.status == 0 || ma.status.nil?) ? 'homepageHomeworkContent2' : 'homepageHomeworkContent' %> fl">
<a href="javascript:void(0);" class="newsGrey">
@ -22,7 +22,8 @@
<div class="ml60"><%= Course.find(ma.course_id).description.html_safe if Course.find(ma.course_id).description %></div>
<p>申请职位:<%=ma.content && ma.content.include?('9') ? "教师" : "助教"%></p>
</div>
<li class="<%=(ma.status == 0 || ma.status.nil?) ? 'homepageHomeworkContentWarn2' : 'homepageHomeworkContentWarn' %> fl">
<li class="homepageNewsTime fr"><%= time_tag(ma.created_at).html_safe %> </li>
<li class="<%=(ma.status == 0 || ma.status.nil?) ? 'homepageHomeworkContentWarn2' : 'homepageHomeworkContentWarn' %> fr">
<span id="deal_info_<%=ma.id%>">
<% if ma.status == 0 || ma.status.nil?%>
<%= link_to '同意',dealwith_apply_request_user_path(User.current,:agree=>'Y',:msg_id=>ma.id),:remote=>'true',:class=>'linkBlue'%>
@ -35,4 +36,3 @@
<%end %>
</span>
</li>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>

View File

@ -7,20 +7,26 @@
<% parents_rely = get_reply_parents_no_root parents_rely, comment %>
<% length = parents_rely.length %>
<div id="comment_reply_<%=comment.id %>">
<% if length <= 2 %>
<% if length <= 5 %>
<%=render :partial => 'users/journal_comment_reply', :locals => {:comment => comment.parent, :type => type, :user_activity_id => user_activity_id, :parent_id => comment.id} %>
<% else %>
<div class="orig_cont clearfix">
<div class="orig_cont clearfix">
<!--<div>-->
<!--<%#=render :partial => 'users/journal_comment_reply', :locals => {:comment => parents_rely[length - 1]} %>-->
<!--</div>-->
<%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[length - 1], :type => type, :user_activity_id => user_activity_id, :parent_id => comment.id} %>
</div>
<div class="orig_cont_hide clearfix">
<span class="orig_icon" >&darr; </span>
<span class="orig_icon" style="display:none;" > &uarr;</span><span class="">已经隐藏<%=(length - 2).to_s %>个楼层</span>
<%= link_to '[点击展开]', show_all_replies_users_path(:comment => comment, :type => comment.class, :user_activity_id => user_activity_id, :parent_id => comment.id),:remote=>true, :class => 'linkBlue2' %>
<div class="orig_cont clearfix">
<div class="orig_cont clearfix">
<div class="orig_cont clearfix">
<%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[length - 1], :type => type, :user_activity_id => user_activity_id, :parent_id => comment.id} %>
</div>
<div class="orig_cont_hide clearfix">
<span class="orig_icon" >&darr; </span>
<span class="orig_icon" style="display:none;" > &uarr;</span><span class="">已经隐藏<%=(length - 5).to_s %>个楼层</span>
<%= link_to '[点击展开]', show_all_replies_users_path(:comment => comment, :type => comment.class, :user_activity_id => user_activity_id, :parent_id => comment.id),:remote=>true, :class => 'linkBlue2' %>
</div>
<%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[3], :type => type, :user_activity_id => user_activity_id, :parent_id => comment.id} %>
</div>
<%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[2], :type => type, :user_activity_id => user_activity_id, :parent_id => comment.id} %>
</div>
<%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[1], :type => type, :user_activity_id => user_activity_id, :parent_id => comment.id} %>
</div>
<%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[0], :type => type, :user_activity_id => user_activity_id, :parent_id => comment.id} %>
</div>

View File

@ -0,0 +1,27 @@
<% message_alls.each do |ma| %>
<%# 系统消息 %>
<%= render :partial => 'users/user_message_system', :locals => {:ma => ma} %>
<%= render :partial => 'users/user_at_message', :locals => {:ma => ma} %>
<%# 课程消息 %>
<%= render :partial => 'users/user_message_course', :locals => {:ma => ma} %>
<!--项目消息-->
<%= render :partial => 'users/user_message_forge', :locals => {:ma => ma} %>
<!--公共贴吧-->
<%= render :partial => 'users/user_message_forum', :locals => {:ma => ma} %>
<!--用户留言-->
<%= render :partial => 'users/user_message_userfeedaback', :locals => {:ma => ma} %>
<%= render :partial => 'users/user_message_org', :locals => {:ma => ma} %>
<%# 申请类消息 %>
<%= render :partial => 'users/user_message_applied', :locals => {:ma => ma} %>
<% end %>
<ul class="pages" style="width: auto;display: table;margin-left: auto;margin-right: auto; padding-top: 10px">
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true, :is_new => true %>
</ul>

View File

@ -0,0 +1,27 @@
<% message_alls.each do |ma| %>
<%# 系统消息 %>
<%= render :partial => 'users/user_message_system', :locals => {:ma => ma} %>
<%= render :partial => 'users/user_at_message', :locals => {:ma => ma} %>
<%# 课程消息 %>
<%= render :partial => 'users/user_message_course', :locals => {:ma => ma} %>
<!--项目消息-->
<%= render :partial => 'users/user_message_forge', :locals => {:ma => ma} %>
<!--公共贴吧-->
<%= render :partial => 'users/user_message_forum', :locals => {:ma => ma} %>
<!--用户留言-->
<%= render :partial => 'users/user_message_userfeedaback', :locals => {:ma => ma} %>
<%= render :partial => 'users/user_message_org', :locals => {:ma => ma} %>
<%# 申请类消息 %>
<%= render :partial => 'users/user_message_applied', :locals => {:ma => ma} %>
<% end %>
<ul class="pages" style="width: auto;display: table;margin-left: auto;margin-right: auto; padding-top: 10px">
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true, :is_new => true %>
</ul>

View File

@ -0,0 +1,27 @@
<% message_alls.each do |ma| %>
<%# 系统消息 %>
<%= render :partial => 'users/user_message_system', :locals => {:ma => ma} %>
<%= render :partial => 'users/user_at_message', :locals => {:ma => ma} %>
<%# 课程消息 %>
<%= render :partial => 'users/user_message_course', :locals => {:ma => ma} %>
<!--项目消息-->
<%= render :partial => 'users/user_message_forge', :locals => {:ma => ma} %>
<!--公共贴吧-->
<%= render :partial => 'users/user_message_forum', :locals => {:ma => ma} %>
<!--用户留言-->
<%= render :partial => 'users/user_message_userfeedaback', :locals => {:ma => ma} %>
<%= render :partial => 'users/user_message_org', :locals => {:ma => ma} %>
<%# 申请类消息 %>
<%= render :partial => 'users/user_message_applied', :locals => {:ma => ma} %>
<% end %>
<ul class="pages" style="width: auto;display: table;margin-left: auto;margin-right: auto; padding-top: 10px">
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true, :is_new => true %>
</ul>

View File

@ -7,20 +7,26 @@
<% parents_rely = get_reply_parents parents_rely, comment %>
<% length = parents_rely.length %>
<div id="comment_reply_<%=comment.id %>">
<% if length <= 2 %>
<% if length <= 5 %>
<%=render :partial => 'users/comment_reply', :locals => {:comment => comment.parent, :type => type, :user_activity_id => user_activity_id, :parent_id => comment.id} %>
<% else %>
<div class="orig_cont clearfix">
<div class="orig_cont clearfix">
<!--<div>-->
<!--<%#=render :partial => 'users/comment_reply', :locals => {:comment => parents_rely[length - 1]} %>-->
<!--</div>-->
<%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[length - 1], :type => type, :user_activity_id => user_activity_id, :parent_id => comment.id} %>
</div>
<div class="orig_cont_hide clearfix">
<span class="orig_icon" >&darr; </span>
<span class="orig_icon" style="display:none;" > &uarr;</span><span class="">已经隐藏<%=(length - 2).to_s %>个楼层</span>
<%= link_to '[点击展开]', show_all_replies_users_path(:comment => comment, :type => comment.class, :user_activity_id => user_activity_id, :parent_id => comment.id), :remote=>true, :class => 'linkBlue2' %>
<div class="orig_cont clearfix">
<div class="orig_cont clearfix">
<div class="orig_cont clearfix">
<%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[length - 1], :type => type, :user_activity_id => user_activity_id, :parent_id => comment.id} %>
</div>
<div class="orig_cont_hide clearfix">
<span class="orig_icon" >&darr; </span>
<span class="orig_icon" style="display:none;" > &uarr;</span><span class="">已经隐藏<%=(length - 5).to_s %>个楼层</span>
<%= link_to '[点击展开]', show_all_replies_users_path(:comment => comment, :type => comment.class, :user_activity_id => user_activity_id, :parent_id => comment.id),:remote=>true, :class => 'linkBlue2' %>
</div>
<%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[3], :type => type, :user_activity_id => user_activity_id, :parent_id => comment.id} %>
</div>
<%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[2], :type => type, :user_activity_id => user_activity_id, :parent_id => comment.id} %>
</div>
<%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[1], :type => type, :user_activity_id => user_activity_id, :parent_id => comment.id} %>
</div>
<%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[0], :type => type, :user_activity_id => user_activity_id, :parent_id => comment.id} %>
</div>

View File

@ -0,0 +1,4 @@
<div class="pro_new_info mt50" style="width:748px;height:405px;">
<div class="icons_tishi"><img src="/images/new_project/icons_smile.png" width="110" height="110" alt=""></div>
<p class="sy_tab_con_p ">该用户无公开动态~</p>
</div>

View File

@ -0,0 +1,4 @@
<div class="pro_new_info mt50" style="width:748px;height:405px;">
<div class="icons_tishi"><img src="/images/new_project/icons_smile.png" width="110" height="110" alt=""></div>
<p class="sy_tab_con_p ">该用户无公开动态~</p>
</div>

View File

@ -0,0 +1,4 @@
<div class="pro_new_info mt50" style="width:748px;height:405px;">
<div class="icons_tishi"><img src="/images/new_project/icons_smile.png" width="110" height="110" alt=""></div>
<p class="sy_tab_con_p ">该用户无公开动态~</p>
</div>

View File

@ -109,7 +109,8 @@
<!--
<div id="show_more_activities" class="loadMore mt10 f_grey">点击展开更多<%#=link_to "", user_activities_path(@user.id,:type => type,:page => page),:id => "more_activities_link",:remote => "true",:class => "none" %></div>
-->
<%= link_to "点击展开更多",user_activities_path(@user.id,:type => type,:page => page),:id => "show_more_activities",:remote => "true",:class => "loadMore mt10 f_grey"%>
<%= link_to "点击展开更多", action == "project_community" ? user_project_community_path(@user.id, :type => type, :page => page) : user_course_community_path(@user.id, :type => type,:page => page),
:id => "show_more_activities", :remote => "true", :class => "loadMore mt10 f_grey" %>
<% end%>
<!--

View File

@ -23,6 +23,6 @@
<%= link_to ma.subject.html_safe, ma.url, :class =>"#{ma.viewed? ? "newsGrey" : "newsBlack"}", :onmouseover =>"message_titile_show($(this),event)", :onmouseout => "message_titile_hide($(this))" %>
<% end %>
</li>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
<li class="homepageNewsTime fr"><%= time_tag(ma.created_at).html_safe %> </li>
</ul>
<% end %>

View File

@ -1,13 +1,15 @@
<% ma = ma.nil? ? @applied_message : ma %>
<% if allow_to_show(ma) %>
<%= link_to "同意", allow_to_join_project_project_memberships_path(:project_id => ma.project_id, :applied_message_id => ma.id), :remote => true, :method => :post, :class => "link-blue"%> |
<%= link_to "拒绝", refused_allow_to_join_project_project_memberships_path(:project_id => ma.project_id, :applied_message_id => ma.id), :remote => true, :method => :get, :class => "link-blue" %>
<%= link_to "同意", allow_to_join_project_project_memberships_path(:project_id => ma.project_id, :applied_message_id => ma.id),
:remote => true, :method => :post, :class => "link-blue", :style => "font-size: 14px;" %> |
<%= link_to "拒绝", refused_allow_to_join_project_project_memberships_path(:project_id => ma.project_id, :applied_message_id => ma.id),
:remote => true, :method => :get, :class => "link-blue",:style => "font-size: 14px;" %>
<% elsif ma.status == 4 %>
<span class="fontGrey3">被拒绝</span>
<span class="fontGrey3" style="font-size:14px">被拒绝</span>
<% elsif ma.status == 5 %>
<span class="fontGrey3">您已拒绝</span>
<span class="fontGrey3" style="font-size:14px">您已拒绝</span>
<% elsif ma.status == 6 %>
<span class="fontGrey3">已通过</span>
<span class="fontGrey3" style="font-size:14px">已通过</span>
<% elsif ma.status == 7 %>
<span class="fontGrey3">您已同意</span>
<span class="fontGrey3" style="font-size:14px">您已同意</span>
<% end %>

View File

@ -17,7 +17,7 @@
<li class = "homepageNewsContent fl">
<%= render :partial => "users/user_message_applied_school_action", :locals =>{:ma => ma} %>
</li>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
<li class="homepageNewsTime fr"><%= time_tag(ma.created_at).html_safe %> </li>
</li>
</ul>
<!-- 申请加入项目 -->

View File

@ -4,4 +4,4 @@
<% else %>
<%=link_to User.where("id=?", ma.applied_user_id).first.show_name, user_path(ma.applied_user_id), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
<% end %>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>"><%= applied_school_tip(ma) %></span>
<span class="homepageNewsType fl"><%= applied_school_tip(ma) %></span>

View File

@ -8,7 +8,7 @@
</li>
<li class="homepageNewsPubType fl">
<%=link_to ma.course_message.author.try(:show_name), user_path(ma.course_message.author), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">发布了通知:</span>
<span class="homepageNewsType fl">发布了通知:</span>
</li>
<li class="homepageNewsContent fl">
<%= link_to ma.course_message.title, {:controller => 'news', :action => 'show', :id => ma.course_message.id },
@ -23,9 +23,10 @@
<div class="ml36"><%= ma.course_message.description.html_safe %></div>
<% end %>
</div>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
<li class="homepageNewsTime fr"><%= time_tag(ma.created_at).html_safe %> </li>
</ul>
<% end %>
<% if ma.course_message_type == "Comment" && ma.course_message %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl">
@ -35,7 +36,7 @@
</li>
<li class="homepageNewsPubType fl">
<%=link_to User.find(ma.course_message.author_id).show_name, user_path(ma.course_message.author), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">评论了通知:</span>
<span class="homepageNewsType fl">评论了通知:</span>
</li>
<li class="homepageNewsContent fl">
<%= link_to ma.course_message.commented.title, {:controller => 'news', :action => 'show', :id => ma.course_message.commented.id },
@ -50,7 +51,7 @@
<div class="ml60"><%= ma.course_message.comments.html_safe %></div>
<% end %>
</div>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
<li class="homepageNewsTime fr"><%= time_tag(ma.created_at).html_safe %> </li>
</ul>
<% end %>
<% if ma.course_message_type == "HomeworkCommon" && ma.status.nil? && ma.course_message %>
@ -62,7 +63,7 @@
</li>
<li class="homepageNewsPubType fl">
<%=link_to ma.course_message.user.lastname + ma.course_message.user.firstname + "老师", user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">发布了班级作业:</span>
<span class="homepageNewsType fl">发布了班级作业:</span>
</li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<% if !User.current.allowed_to?(:as_teacher, ma.course_message.course) && cur_user_works_for_homework(ma.course_message).nil? %>
@ -114,7 +115,7 @@
</p>
<% end %>
</div>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
<li class="homepageNewsTime fr"><%= time_tag(ma.created_at).html_safe %> </li>
</ul>
<% end %>
<% if ma.course_message_type == "HomeworkCommon" && ma.status == 1 && ma.course_message %>
@ -122,7 +123,7 @@
<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), :target => '_blank' %></a></li>
<li class="homepageNewsPubType fl"><%=link_to ma.course_message.user.lastname + ma.course_message.user.firstname + '老师',
user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher", :title => "#{ma.course_message.user.lastname + ma.course_message.user.firstname}老师", :target => '_blank' %>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">发布的作业:</span></li>
<span class="homepageNewsType fl">发布的作业:</span></li>
<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"}", :target => '_blank' %>
@ -148,7 +149,7 @@
<% end %>
</div>
<li class="homepageHomeworkContentWarn fl"> &nbsp;&nbsp; 截止时间快到啦</li>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
<li class="homepageNewsTime fr"><%= time_tag(ma.created_at).html_safe %> </li>
</ul>
<% end %>
<!--作品开启匿评 待整合:时间紧-->
@ -160,7 +161,7 @@
<li class="homepageNewsPubType fl">
<%= link_to ma.course_message.user.lastname + ma.course_message.user.firstname + "老师",
user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">启动了作业匿评:</span>
<span class="homepageNewsType fl">启动了作业匿评:</span>
</li>
<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"}",
@ -183,7 +184,7 @@
<p>例如,您缺评了两份作品,则您的最终成绩将被扣除 <%= ma.course_message.homework_detail_manual.absence_penalty %> * 2 = <%= ma.course_message.homework_detail_manual.absence_penalty * 2 %>分</p>
<% end%>
</div>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
<li class="homepageNewsTime fr"><%= time_tag(ma.created_at).html_safe %> </li>
</ul>
<% end %>
<!--作品关闭匿评-->
@ -192,7 +193,8 @@
<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), :target => '_blank' %></a></li>
<li class="homepageNewsPubType fl">
<%=link_to ma.course_message.user.lastname + ma.course_message.user.firstname + "老师",
user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %><span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">关闭了作业匿评:</span></li>
user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
<span class="homepageNewsType fl">关闭了作业匿评:</span></li>
<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"}", :target => '_blank' %>
<!--:onmouseover =>"message_titile_show($(this),event)",-->
@ -214,7 +216,7 @@
<p>祝您的教学活动高效、顺利、愉快!</p>
<% end %>
</div>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
<li class="homepageNewsTime fr"><%= time_tag(ma.created_at).html_safe %> </li>
</ul>
<% end %>
@ -226,7 +228,7 @@
<li class="homepageNewsPubType fl">
<%= link_to ma.course_message.user.lastname + ma.course_message.user.firstname + "老师",
user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">启动作业匿评失败</span>
<span class="homepageNewsType fl">启动作业匿评失败</span>
</li>
<li class="homepageNewsContent fl">
<%= link_to truncate(ma.course_message.name,:length=>25)+'(失败原因提交作品的人数低于2人)', student_work_index_path(:homework => ma.course_message.id), :class => "#{ma.viewed == 0 ? "c_red" : "newsGrey "}", :target => '_blank' %>
@ -245,7 +247,7 @@
<li>提交截止:<span style="color:Red;"><%= ma.course_message.end_time%>&nbsp;&nbsp;23:59</span></li>
</ul>
</div>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
<li class="homepageNewsTime fr"><%= time_tag(ma.created_at).html_safe %> </li>
</ul>
<% end %>
<% if ma.course_message_type == "HomeworkCommon" && ma.status == 5 %>
@ -293,7 +295,7 @@
<!--:onmouseout => "message_titile_hide($(this))" %>-->
</a>
</li>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
<li class="homepageNewsTime fr"><%= time_tag(ma.created_at).html_safe %> </li>
</ul>
<% end %>
<% if ma.course_message_type == "Poll" && ma.course_message %>
@ -305,7 +307,7 @@
</li>
<li class="homepageNewsPubType fl">
<%=link_to ma.course_message.user.try(:show_name), user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">发布了问卷:</span>
<span class="homepageNewsType fl">发布了问卷:</span>
</li>
<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),
@ -316,7 +318,7 @@
<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>
<li class="homepageNewsTime fr"><%= time_tag(ma.created_at).html_safe %> </li>
</ul>
<% end %>
<% if ma.course_message_type == "Message" && !ma.nil? && !ma.course_message.nil? %>
@ -328,7 +330,7 @@
</li>
<li class="homepageNewsPubType fl">
<%=link_to ma.course_message.author.try(:show_name), user_path(ma.course_message.author), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">
<span class="homepageNewsType fl">
<%= ma.course_message.parent_id.nil? ? "发布了班级帖子:" : "评论了班级帖子:" %></span></li>
<% if ma.course_message.parent_id.nil? %>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
@ -359,7 +361,7 @@
<% end %>
</div>
<% end %>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
<li class="homepageNewsTime fr"><%= time_tag(ma.created_at).html_safe %> </li>
</ul>
<% end %>
@ -410,7 +412,7 @@
</p>
</div>
<% end %>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
<li class="homepageNewsTime fr"><%= time_tag(ma.created_at).html_safe %> </li>
</ul>
<% end %>
<% if ma.course_message_type == "JournalsForMessage" && ma.course_message %>
@ -424,7 +426,7 @@
</li>
<li class="homepageNewsPubType fl">
<%= link_to ma.course_message.user.try(:show_name), user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">在班级中留言了:</span>
<span class="homepageNewsType fl">在班级中留言了:</span>
</li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to message_content(ma.course_message.notes), course_feedback_path(:id => ma.course_id),
@ -436,7 +438,7 @@
<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>
<li class="homepageNewsTime fr"><%= time_tag(ma.created_at).html_safe %> </li>
</ul>
<% end %>
<% elsif ma.course_message.jour_type == 'HomeworkCommon' %>
@ -452,7 +454,7 @@
<% if ma.course_message.m_parent_id.nil? %>
回复了您的<span class="fontBlue2" title="作业:<%=ma.course_message.jour.name %>">作业</span>
<% else %>
<span class="fontBlue2" title="作业:<%=ma.course_message.jour.name %>">作业</span>中回复了您
<span title="作业:<%=ma.course_message.jour.name %>">作业中回复了您</span>
<% end %>
</span>
</li>
@ -466,7 +468,7 @@
<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>
<li class="homepageNewsTime fr"><%= time_tag(ma.created_at).html_safe %> </li>
</ul>
<% else %>
<ul class="homepageNewsList fl">
@ -479,7 +481,7 @@
<%= link_to ma.course_message.user.lastname + ma.course_message.user.firstname +
"#{ma.course_message.user.allowed_to?(:as_teacher, ma.course)?"老师":"同学"}",
user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">回复了作品评论:</span>
<span class="homepageNewsType fl">回复了作品评论:</span>
</li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to message_content(ma.course_message.notes), student_work_index_path(:homework => ma.course_message.jour.student_work.homework_common_id,:show_work_id => ma.course_message.jour.student_work_id), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", :target => '_blank' %>
@ -500,7 +502,7 @@
<li>作业标题:<span style="color:Red;"><%=ma.course_message.jour.student_work.homework_common.name %></span></li>
</ul>
</div>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
<li class="homepageNewsTime fr"><%= time_tag(ma.created_at).html_safe %> </li>
</ul>
<% end %>
<% end %>
@ -547,7 +549,7 @@
<li class="homepageNewsPubType fl">
<%= link_to ma.course_message.user.lastname + ma.course_message.user.firstname + "同学",
user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">重新提交了作品:</span>
<span class="homepageNewsType fl">重新提交了作品:</span>
</li>
<li class="homepageNewsContent fl">
<%= link_to "作业标题:" + ma.course_message.name, student_work_index_path(:homework => ma.course_message.homework_common_id, :show_work_id => ma.course_message_id),
@ -556,7 +558,7 @@
<!--:onmouseover => "message_titile_show($(this),event)",-->
<!--:onmouseout => "message_titile_hide($(this))" %>-->
</li>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
<li class="homepageNewsTime fr"><%= time_tag(ma.created_at).html_safe %> </li>
</ul>
<% end %>
<!-- 学生追加作品附件 -->
@ -568,7 +570,7 @@
<li class="homepageNewsPubType fl">
<%= link_to ma.course_message.user.show_name+ "同学",
user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">追加新附件了:</span>
<span class="homepageNewsType fl">追加新附件了:</span>
</li>
<li class="homepageNewsContent fl">
<%= link_to "作业标题:" + ma.course_message.homework_common.name, student_work_index_path(:homework => ma.course_message.homework_common_id, :show_work_id => ma.course_message_id),
@ -576,7 +578,7 @@
<!--:onmouseover => "message_titile_show($(this),event)",-->
<!--:onmouseout => "message_titile_hide($(this))" %>-->
</li>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
<li class="homepageNewsTime fr"><%= time_tag(ma.created_at).html_safe %> </li>
</ul>
<% end %>
<!-- 创建课程消息 -->
@ -587,7 +589,7 @@
</li>
<li class="homepageNewsPubType fl">
<span class="newsBlue homepageNewsPublisher">系统提示</span>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">您成功创建了班级:</span>
<span class="homepageNewsType fl">您成功创建了班级:</span>
</li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to "班级名称:" + ma.course_message.name, course_path(ma.course_message),
@ -612,7 +614,7 @@
<p>您的班级是私有的,非班级成员不能访问您的班级。如果想设置为公开,您可以在配置中设置。</p>
<% end %>
</div>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
<li class="homepageNewsTime fr"><%= time_tag(ma.created_at).html_safe %> </li>
</ul>
<% end %>
@ -650,7 +652,7 @@
<div class="ml60"><%= Course.find(ma.course_id).description.nil? ? "" : Course.find(ma.course_id).description.html_safe %></div>
<p>申请职位:<%= ma.content == '9' ? "教师" : "教辅"%></p>
</div>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
<li class="homepageNewsTime fr"><%= time_tag(ma.created_at).html_safe %> </li>
</ul>
<% end %>
@ -662,7 +664,7 @@
</li>
<li class="homepageNewsPubType fl">
<%=link_to User.find(ma.course_message_id).show_name, user_path(User.find(ma.course_message_id)), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">将您加入了班级:</span>
<span class="homepageNewsType fl">将您加入了班级:</span>
</li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to ma.course.name, course_member_path(ma.course), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", :target => '_blank' %>
@ -684,7 +686,7 @@
</p>
<% end %>
</div>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
<li class="homepageNewsTime fr"><%= time_tag(ma.created_at).html_safe %> </li>
</ul>
<% end %>
@ -696,7 +698,7 @@
</li>
<li class="homepageNewsPubType fl">
<span class="newsBlue homepageNewsPublisher">系统提示</span>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">您增加了新的班级成员:</span>
<span class="homepageNewsType fl">您增加了新的班级成员:</span>
</li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to User.find(ma.course_message_id).login+"("+(User.find(ma.course_message_id).realname ? User.find(ma.course_message_id).realname : User.find(ma.course_message_id).login) +")", {:controller => 'courses', :action => 'settings', :id => ma.course_id, :tab=>'member'}, :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", :target => '_blank' %>
@ -718,7 +720,7 @@
</p>
<% end %>
</div>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
<li class="homepageNewsTime fr"><%= time_tag(ma.created_at).html_safe %> </li>
</ul>
<% end %>
@ -730,7 +732,7 @@
</li>
<li class="homepageNewsPubType fl">
<%=link_to User.find(ma.course_message_id).show_name, user_path(User.find(ma.course_message_id)), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">将您移出了班级:</span>
<span class="homepageNewsType fl">将您移出了班级:</span>
</li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to ma.course.name, member_course_path(ma.course), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", :target => '_blank' %>
@ -753,7 +755,7 @@
</p>
<% end %>
</div>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
<li class="homepageNewsTime fr"><%= time_tag(ma.created_at).html_safe %> </li>
</ul>
<% end %>
@ -763,7 +765,9 @@
<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), :target => '_blank' %></a></li>
<li class="homepageNewsPubType fl">
<span><%=link_to ma.course_message.user.lastname + ma.course_message.user.firstname + "老师",
user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %></span><span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">发布了班级测验 </span></li>
user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %></span>
<span class="homepageNewsType fl">发布了班级测验:</span>
</li>
<li class="homepageNewsContent fl">
<%= link_to "测验题目:" + ma.course_message.exercise_name, exercise_path(:id => ma.course_message.id), :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", :target => '_blank' %>
<!--:onmouseover =>"message_titile_show($(this),event)",-->
@ -790,7 +794,7 @@
<% end %>
</ul>
</div>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
<li class="homepageNewsTime fr"><%= time_tag(ma.created_at).html_safe %> </li>
</ul>
<% end %>
@ -800,7 +804,8 @@
<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), :target => '_blank' %></a></li>
<li class="homepageNewsPubType fl">
<span> <%=link_to ma.course_message.user.lastname + ma.course_message.user.firstname + "老师",
user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %></span><span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">发布的测验:</span></li>
user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %></span>
<span class="homepageNewsType fl">发布的测验:</span></li>
<li class="homepageHomeworkContent fl">
<%= link_to "测验题目:" + ma.course_message.exercise_name, exercise_path(:id => ma.course_message.id), :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", :target => '_blank' %>
<!--:onmouseover =>"message_titile_show($(this),event)",-->
@ -823,7 +828,7 @@
</ul>
</div>
<li class="homepageHomeworkContentWarn fl">截止时间快到啦 </li>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
<li class="homepageNewsTime fr"><%= time_tag(ma.created_at).html_safe %> </li>
</ul>
<% end %>
<% end %>

View File

@ -3,11 +3,11 @@
<% if ma.forge_message_type == "AppliedProject" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl">
<a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.forge_message.user), :width => "30", :height => "30"), user_path(ma.forge_message.user), :target => '_blank' %></a>
<a href="javascript:void(0);"><%= link_to image_tag(url_to_avatar(ma.forge_message.user), :width => "30", :height => "30"), user_path(ma.forge_message.user), :target => '_blank' %></a>
</li>
<li class="homepageNewsPubType fl">
<%=link_to ma.forge_message.user, user_path(ma.forge_message.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">申请加入项目</span>
<span class="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"}", :target => '_blank' %>
@ -15,7 +15,7 @@
<!--:onmouseout => "message_titile_hide($(this))" %>-->
</a>
</li>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
<li class="homepageNewsTime fr"><%= time_tag(ma.created_at).html_safe %> </li>
</ul>
<% end %>
<!--被管理员拉入项目-->
@ -27,7 +27,7 @@
</li>
<li class="homepageNewsPubType fl">
<%=link_to User.find(ma.forge_message_id).show_name, user_path(User.find(ma.forge_message_id)), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">将您加入了项目:</span>
<span class="homepageNewsType fl">将您加入了项目:</span>
</li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to ma.project, project_member_path(ma.project), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", :target => '_blank' %>
@ -35,7 +35,7 @@
<!--:onmouseout => "message_titile_hide($(this))" %>-->
</a>
</li>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
<li class="homepageNewsTime fr"><%= time_tag(ma.created_at).html_safe %> </li>
</ul>
<% end %>
<% end %>
@ -48,7 +48,7 @@
</li>
<li class="homepageNewsPubType fl">
<%=link_to User.find(ma.forge_message_id).show_name, user_path(User.find(ma.forge_message_id)), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">将您移出了项目:</span>
<span class="homepageNewsType fl">将您移出了项目:</span>
</li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to ma.project, member_project_path(ma.project), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", :target => '_blank' %>
@ -56,7 +56,7 @@
<!--:onmouseout => "message_titile_hide($(this))" %>-->
</a>
</li>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
<li class="homepageNewsTime fr"><%= time_tag(ma.created_at).html_safe %> </li>
</ul>
<% end %>
<% end %>
@ -123,7 +123,7 @@
<li class="homepageNewsPubType fl">
<%=link_to User.find(ma.forge_message.author_id).show_name, user_path(ma.forge_message.author),
:class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">
<span class="homepageNewsType fl">
<%= ma.forge_message.tracker_id == 5 ? "发布了周报:":"指派了问题给你:"%>
</span>
</li>
@ -133,7 +133,7 @@
<!--:onmouseout => "message_titile_hide($(this))" %>-->
</a>
</li>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
<li class="homepageNewsTime fr"><%= time_tag(ma.created_at).html_safe %> </li>
</ul>
<% end %>
<% end %>
@ -146,8 +146,7 @@
</li>
<li class="homepageNewsPubType fl">
<%= link_to User.find(ma.forge_message.user_id).show_name, user_path(ma.forge_message.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">
更新了问题状态:</span>
<span class="homepageNewsType fl">更新了问题状态:</span>
</li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to ma.forge_message.journalized.subject,
@ -156,21 +155,21 @@
<!--:onmouseout => "message_titile_hide($(this))" %>-->
</a>
</li>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
<li class="homepageNewsTime fr"><%= time_tag(ma.created_at).html_safe %> </li>
</ul>
<% end %>
<% if ma.forge_message_type == "Message" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.forge_message.author), :width => "30", :height => "30"), user_path(ma.forge_message.author), :target => '_blank' %></a></li>
<li class="homepageNewsPubType fl"><%=link_to ma.forge_message.author.try(:show_name), user_path(ma.forge_message.author), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>"><%= ma.forge_message.parent_id.nil? ? "发布了项目帖子:" : "评论了项目帖子:" %></span></li>
<span class="homepageNewsType fl"><%= ma.forge_message.parent_id.nil? ? "发布了项目帖子:" : "评论了项目帖子:" %></span></li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to ma.forge_message.subject, board_message_path(ma.forge_message.board_id, ma.forge_message.parent_id ? ma.forge_message.parent_id : ma.forge_message.id), :class => "#{ma.viewed==0 ? "newsBlack" : "newsGrey"}", :target => '_blank' %>
<!--:onmouseover => "message_titile_show($(this),event)",-->
<!--:onmouseout => "message_titile_hide($(this))" %>-->
</a>
</li>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
<li class="homepageNewsTime fr"><%= time_tag(ma.created_at).html_safe %> </li>
</ul>
<% end %>
<% if ma.forge_message_type == "Comment" %>
@ -183,7 +182,7 @@
<li class="homepageNewsPubType fl">
<%=link_to ma.forge_message.author.try(:show_name), user_path(ma.forge_message.author),
:class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">评论了新闻:</span>
<span class="homepageNewsType fl">评论了新闻:</span>
</li>
<li class="homepageNewsContent fl">
<%= link_to "#{ma.forge_message.commented.title}",
@ -191,7 +190,7 @@
<!--:onmouseover => "message_titile_show($(this),event)",-->
<!--:onmouseout => "message_titile_hide($(this))" %>-->
</li>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
<li class="homepageNewsTime fr"><%= time_tag(ma.created_at).html_safe %> </li>
</ul>
<% end %>
@ -216,7 +215,7 @@
:class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", :target => '_blank' %>
</li>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
<li class="homepageNewsTime fr"><%= time_tag(ma.created_at).html_safe %> </li>
</ul>
<% end %>
<% end %>

View File

@ -6,21 +6,22 @@
</li>
<li class="homepageNewsPubType fl">
<%=link_to ma.organization.name, organization_path(ma.organization_id), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
<span class='<%= ma.viewed == 0 ? 'homepageNewsTypeNotRead fl' : 'homepageNewsType fl' %>'>申请子域名:</span>
<span class='homepageNewsType fl'>申请子域名:</span>
</li>
<li class="homepageHomeworkContent fl">
<%= ma.content %>
</li>
<li class="homepageHomeworkContentWarn fl">
<li class="homepageNewsTime fr"><%= time_tag(ma.created_at).html_safe %> </li>
<li class="homepageHomeworkContentWarn fr">
<%=link_to (Secdomain.where("sub_type=2 and pid=?", ma.organization.id).count == 0 || (Secdomain.where("sub_type=2 and pid=?", ma.organization.id).count > 0 && Secdomain.where("sub_type=2 and pid=?", ma.organization.id).first.subname != ma.content)) ? "同意申请":"申请已批准",
agree_apply_subdomain_organizations_path( :organization_id => ma.organization_id, :org_domain => ma.content, :user_id => ma.sender_id, :act_id => ma.id ),
:id => "agree_apply_subdomain_#{ma.id}",
:method => 'post',
:remote => true,
:class => "green_btn_cir ml10",
:style => "color:#fff" %>
:class => 'link-blue fr'
%>
</li>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
</ul>
<% end %>
<% if ma.message_type == 'AgreeApplySubdomain'%>
@ -29,12 +30,12 @@
<a href="javascript:void(0);"><div class="navHomepageLogo fl"><%= image_tag("/images/trustie_logo1.png", width: "30px", height: "30px", class: "mt3") %></div></a>
</li>
<li class="homepageNewsPubType fl">
<span class='<%= ma.viewed == 0 ? 'homepageNewsTypeNotRead fl' : 'homepageNewsType fl' %>'>管理员同意了您的子域名申请:</span>
<span class='homepageNewsType fl'>管理员同意了您的子域名申请:</span>
</li>
<li class="homepageNewsContent fl">
<%= ma.content %>
</li>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
<li class="homepageNewsTime fr"><%= time_tag(ma.created_at).html_safe %> </li>
</ul>
<% end %>
<% end %>

View File

@ -5,9 +5,9 @@
<a href="javascript:void(0);"><div class="navHomepageLogo fl"><%= image_tag("/images/trustie_logo1.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>
<span style="color: red;float: left">系统消息:</span>
<!-- <span class="homepageNewsType fl">发布新消息:</span>-->
</li>
<span style="color: red;float: left">【系统消息】</span>
<li class="homepageSystenMessageContent fl">
<%= link_to ma.subject.blank? ? (ma.content.nil? ? ma.description.html_safe : ma.content.html_safe) : ma.subject, user_system_messages_path(User.current, :anchor => "position_#{ma.id}"),
@ -15,7 +15,7 @@
<!--:onmouseover =>"message_titile_show($(this),event);",-->
<!--:onmouseout => "message_titile_hide($(this));"-->
</li>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
<li class="homepageNewsTime fr"><%= time_tag(ma.created_at).html_safe %> </li>
</ul>
<%# end %>
<% end %>

View File

@ -9,7 +9,7 @@
</li>
<li class="homepageNewsPubType fl">
<%=link_to User.find(ma.journals_for_message.user_id).show_name, user_path(ma.journals_for_message.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">
<span class="homepageNewsType fl">
<%= ma.journals_for_message.reply_id == 0 ? "给你留言了:" : "回复了你的留言:" %>
</span>
</li>
@ -26,7 +26,7 @@
<div class="ml60"><%= ma.journals_for_message.notes.html_safe %></div>
<% end %>
</div>
<li class="homepageNewsTime fl"><%= time_tag(ma.journals_for_message.created_on).html_safe %> </li>
<li class="homepageNewsTime fr"><%= time_tag(ma.journals_for_message.created_on).html_safe %> </li>
</ul>
<% end %>
<% end %>

View File

@ -48,8 +48,8 @@
}
if (inputs.length == outputs.length) {
for (var i=0; i<inputs.length; i++) {
autoTextarea2(inputs[i], outputs[i]);
autoTextarea2(outputs[i], inputs[i]);
autoTextarea2(inputs[i], outputs[i], 0, 140);
autoTextarea2(outputs[i], inputs[i], 0, 140);
}
}
$(inputs[inputs.length - 1]).focus();
@ -61,7 +61,16 @@
<% if !edit_mode %>
var text = document.getElementById("textarea_input_test");
var text2 = document.getElementById("textarea_output_test");
autoTextarea2(text,text2);
autoTextarea2(text2,text);
autoTextarea2(text,text2, 0, 140);
autoTextarea2(text2,text, 0, 140);
<% else %>
var inputs = document.getElementsByName("program[input][]");
var outputs = document.getElementsByName("program[output][]");
if (inputs.length == outputs.length) {
for (var i=0; i<inputs.length; i++) {
autoTextarea2(inputs[i], outputs[i], 0, 140);
autoTextarea2(outputs[i], inputs[i], 0, 140);
}
}
<% end %>
</script>

View File

@ -0,0 +1,39 @@
<script src="/javascripts/i18n/jquery.ui.datepicker-zh-CN.js" type="text/javascript"></script>
<input type="hidden" value="<%= @type%>" name="type" id="user_activities_type">
<div class="homepageRightBanner">
<div class="NewsBannerName">消息动态</div>
<ul class="resourcesSelect">
<li class="resourcesSelected"><a href="javascript:void(0);" class="resourcesIcon"></a>
<ul class="homepagePostType" style="margin-left:95px; width:80px" >
<li>
<ul class="homepagePostTypeHomework fl">
<% if hidden_unproject_infos %>
<li><%= link_to "全部动态", {:controller => "users", :action => "course_community", :type => "all"}, :class => "homepagePostTypeAll postTypeGrey" %></li>
<li><%= link_to @user == User.current ? "我的动态" : "他的动态", {:controller => "users", :action => "course_community", :type => "current_user"}, :class => "homepagePostTypeMine postTypeGrey" %></li>
<li><%= link_to "作业动态", {:controller => "users", :action => "course_community", :type => "course_homework"}, :class => "homepagePostTypeAssignment postTypeGrey" %></li>
<li><%= link_to "通知动态", {:controller => "users", :action => "course_community", :type => "course_news"}, :class => "homepagePostTypeNotice postTypeGrey" %></li>
<li><%= link_to "论坛动态", {:controller => "users", :action => "course_community", :type => "course_message"}, :class => "homepagePostTypeForum postTypeGrey" %></li>
<li><%= link_to "问卷动态", {:controller => "users", :action => "course_community", :type => "course_poll"}, :class => "homepagePostTypeQuiz postTypeGrey" %></li>
<li><%= link_to "班级留言", {:controller => "users", :action => "course_community", :type => "course_journals"}, :class => "homepagePostTypeMessage postTypeGrey" %></li>
<li><%= link_to "个人留言", {:controller => "users", :action => "course_community", :type => "user_journals"}, :class => "homepagePostTypeMessage postTypeGrey" %></li>
<% end %>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<!--显示个人主页-->
<%# if @user.blog.homepage_id and BlogComment.where("id=?", @user.blog.homepage_id).count > 0 %>
<%# homepage = BlogComment.find(@user.blog.homepage_id) %>
<%#= render :partial => 'blogs/homepage', :locals => {:activity => homepage, :user_activity_id => homepage.id} %>
<%# end %>
<% if @user_activities_count > 0 %>
<%= render :partial => 'users/user_activities', :locals => {:user_activities => @user_activities, :page => 0, :type => @type,
:user_id => (@user.type == "AnonymousUser" ? User.current.id : @user.id), :action => params[:action] } %>
<% else %>
<div class="mb10">
<%= render :partial => 'users/no_data' %>
</div>
<% end %>

View File

@ -0,0 +1,6 @@
$("#show_more_activities").replaceWith("<%= escape_javascript( render :partial => 'users/user_activities',
:locals => {:user_activities => @user_activities,
:page => @page,
:type => @type,
:user_id => (@user.type == "AnonymousUser" ? User.current.id : @user.id),
:action => "course_community"} )%>");

View File

@ -0,0 +1,37 @@
<script src="/javascripts/i18n/jquery.ui.datepicker-zh-CN.js" type="text/javascript"></script>
<input type="hidden" value="<%= @type%>" name="type" id="user_activities_type">
<div class="homepageRightBanner">
<div class="NewsBannerName">消息动态</div>
<ul class="resourcesSelect">
<li class="resourcesSelected"><a href="javascript:void(0);" class="resourcesIcon"></a>
<ul class="homepagePostType" style="margin-left:95px; width:80px" >
<li>
<ul class="homepagePostTypeHomework fl">
<% if hidden_unproject_infos %>
<li><%= link_to "全部动态", {:controller => "users", :action => "project_community", :type => "all"}, :class => "homepagePostTypeAll postTypeGrey" %></li>
<li><%= link_to @user == User.current ? "我的动态" : "他的动态", {:controller => "users", :action => "project_community", :type => "current_user"},
:class => "homepagePostTypeMine postTypeGrey" %></li>
<li><%= link_to "问题动态", {:controller => "users", :action => "project_community", :type => "project_issue"}, :class => "homepagePostTypeQuestion postTypeGrey"%></li>
<li><%= link_to "论坛动态", {:controller => "users", :action => "project_community", :type => "project_message"}, :class => "homepagePostTypeForum postTypeGrey"%></li>
<li><%= link_to "个人留言", {:controller => "users", :action => "project_community", :type => "user_journals"}, :class => "homepagePostTypeMessage postTypeGrey" %></li>
<% end %>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<!--显示个人主页-->
<%# if @user.blog.homepage_id and BlogComment.where("id=?", @user.blog.homepage_id).count > 0 %>
<%# homepage = BlogComment.find(@user.blog.homepage_id) %>
<%#= render :partial => 'blogs/homepage', :locals => {:activity => homepage, :user_activity_id => homepage.id} %>
<%# end %>
<% if @user_activities_count > 0 %>
<%= render :partial => 'users/user_activities', :locals => { :user_activities => @user_activities, :page => 0, :type => @type,
:user_id => (@user.type == "AnonymousUser" ? User.current.id : @user.id), :action => params[:action] } %>
<% else %>
<div class="mb10">
<%= render :partial => 'users/no_data' %>
</div>
<% end %>

View File

@ -0,0 +1,6 @@
$("#show_more_activities").replaceWith("<%= escape_javascript( render :partial => 'users/user_activities',
:locals => {:user_activities => @user_activities,
:page => @page,
:type => @type,
:user_id => (@user.type == "AnonymousUser" ? User.current.id : @user.id),
:action => "project_community"} )%>");

View File

@ -0,0 +1,6 @@
$("#show_more_activities").replaceWith("<%= escape_javascript( render :partial => 'users/user_activities',
:locals => {:user_activities => @user_activities,
:page => @page,
:type => @type,
:user_id => (@user.type == "AnonymousUser" ? User.current.id : @user.id),
:action => "project_community"} )%>");

View File

@ -0,0 +1,6 @@
$("#show_more_activities").replaceWith("<%= escape_javascript( render :partial => 'users/user_activities',
:locals => {:user_activities => @user_activities,
:page => @page,
:type => @type,
:user_id => (@user.type == "AnonymousUser" ? User.current.id : @user.id),
:action => "project_community"} )%>");

View File

@ -1,51 +1,106 @@
<script src="/javascripts/i18n/jquery.ui.datepicker-zh-CN.js" type="text/javascript"></script>
<input type="hidden" value="<%= @type%>" name="type" id="user_activities_type">
<div class="homepageRightBanner">
<div class="NewsBannerName">最新动态</div>
<ul class="resourcesSelect">
<li class="resourcesSelected"><a href="javascript:void(0);" class="resourcesIcon"></a>
<ul class="homepagePostType">
<li>
<ul class="homepagePostTypeHomework fl">
<% if hidden_unproject_infos %>
<li class="f14">班级动态</li>
<li><%= link_to "作业动态", {:controller => "users", :action => "show", :type => "course_homework"}, :class => "homepagePostTypeAssignment postTypeGrey"%>
<!--<a href="javascript:void(0);" class="homepagePostTypeAssignment postTypeGrey">作业动态</a>--></li>
<li><%= link_to "通知动态", {:controller => "users", :action => "show", :type => "course_news"}, :class => "homepagePostTypeNotice postTypeGrey"%>
<!--<li><a href="javascript:void(0);" class="homepagePostTypeNotice postTypeGrey">通知动态</a></li>-->
<li><%= link_to "论坛动态", {:controller => "users", :action => "show", :type => "course_message"}, :class => "homepagePostTypeForum postTypeGrey"%>
<li><%= link_to "问卷动态", {:controller => "users", :action => "show", :type => "course_poll"}, :class => "homepagePostTypeQuiz postTypeGrey"%>
<li><%= link_to "班级留言", {:controller => "users", :action => "show", :type => "course_journals"}, :class =>"homepagePostTypeMessage postTypeGrey"%>
<!--<li><a href="javascript:void(0);" class="homepagePostTypeForum postTypeGrey">论坛动态</a></li>-->
<!--<li><a href="javascript:void(0);" class="homepagePostTypeQuiz postTypeGrey">问卷动态</a></li>-->
<% end %>
</ul>
</li>
<li>
<ul class="homepagePostTypeProject fl">
<li class="f14">项目动态</li>
<li><%= link_to "问题动态", {:controller => "users", :action => "show", :type => "project_issue"}, :class => "homepagePostTypeQuestion postTypeGrey"%>
<li><%= link_to "论坛动态", {:controller => "users", :action => "show", :type => "project_message"}, :class => "homepagePostTypeForum postTypeGrey"%>
<!--<li><a href="javascript:void(0);" class="homepagePostTypeQuestion postTypeGrey">问题动态</a></li>
<li><a href="javascript:void(0);" class="homepagePostTypeForum postTypeGrey">论坛动态</a></li>-->
</ul>
</li>
<li>
<ul class="homepagePostTypeProject fl">
<li class="f14">更多</li>
<li class="mt-4"><%= link_to "个人留言", {:controller => "users", :action => "show", :type => "user_journals"}, :class =>"homepagePostTypeMessage postTypeGrey"%>
<li class="mt-4"><%= link_to @user == User.current ? "我的动态" : "他的动态", {:controller => "users", :action => "show", :type => "current_user"}, :class =>"homepagePostTypeMine postTypeGrey"%>
<li class="mt-4"><%= link_to "全部动态", {:controller => "users", :action => "show", :type => "all"}, :class =>"homepagePostTypeAll postTypeGrey"%>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<input type="hidden" value="<%= @type %>" name="type" id="user_activities_type">
<% if is_current_user %>
<div class="homepagetopBanner mb10">
<div class="flex-container_homepage" style="width:750px;">
<div class="flex-cell_homepage" id="user_homepage_tab_01" style="padding-top: 10px">
<li class="homepage_issue_tab ml20 mb5"><span class="ml35" style="font-size: 20px;">248</span></li>
待解决Issue<br />
</div>
<div class="flex-cell_homepage" id="user_homepage_tab_02" style="padding-top: 10px">
<li class="homepage_work_tab ml20 mb5"><span class="ml35" style="font-size: 20px;">21</span></li>
待完成作业<br />
</div>
<div class="flex-cell_homepage" id="user_homepage_tab_03" style="padding-top: 10px">
<li class="homepage_test_tab ml20 mb5"><span class="ml35" style="font-size: 20px;">18</span></li>
待完成测验<br />
</div>
<div class="flex-cell_homepage" id="user_homepage_tab_04" style="padding-top: 10px">
<li class="homepage_poll_tab ml20 mb5"><span class="ml35" style="font-size: 20px;">11</span></li>
待完成问卷<br />
</div>
<div class="flex-cell_homepage" id="user_homepage_tab_05" style="padding-top: 10px">
<li class="homepage_anonymity_tab ml20 mb5"><span class="ml35" style="font-size: 20px;">16</span></li>
待匿评作业<br />
</div>
<div class="flex-cell_homepage" id="user_homepage_tab_06" style="padding-top: 10px">
<li class="homepage_review_tab ml20 mb5"><span class="ml35" style="font-size: 20px;">13</span></li>
待评阅作业<br />
</div>
<div class="flex-cell_homepage" id="user_homepage_tab_07" style="padding-top: 10px">
<li class="homepage_apply_tab ml20 mb5"><span class="ml35" style="font-size: 20px;">16</span></li>
待审批申请<br />
</div>
</div>
</div>
<div class="homepageRightBanner">
<div class="NewsBannerName">
消息动态
</div>
<span class="fr" style="margin-top:5px;">
共 <span style="color: red;"><%= @message_count %></span> 个消息
</span>
</div>
<div class="resources">
<div>
<%= render :partial => 'users/new_user_message', :locals => { :message_alls => @message_alls } %>
</div>
</div>
<!--显示个人主页-->
<% else %>
<div class="homepageRightBanner">
<div class="NewsBannerName">Ta的动态</div>
<!-- <ul class="resourcesSelect">
<li class="resourcesSelected"><a href="javascript:void(0);" class="resourcesIcon"></a>
<ul class="homepagePostType">
<li>
<ul class="homepagePostTypeHomework fl">
<%# if hidden_unproject_infos %>
<li class="f14">班级动态</li>
<li><%#= link_to "作业动态", {:controller => "users", :action => "show", :type => "course_homework"}, :class => "homepagePostTypeAssignment postTypeGrey"%>
&lt;!&ndash;<a href="javascript:void(0);" class="homepagePostTypeAssignment postTypeGrey">作业动态</a>&ndash;&gt;</li>
<li><%#= link_to "通知动态", {:controller => "users", :action => "show", :type => "course_news"}, :class => "homepagePostTypeNotice postTypeGrey"%>
&lt;!&ndash;<li><a href="javascript:void(0);" class="homepagePostTypeNotice postTypeGrey">通知动态</a></li>&ndash;&gt;
<li><%#= link_to "论坛动态", {:controller => "users", :action => "show", :type => "course_message"}, :class => "homepagePostTypeForum postTypeGrey"%>
<li><%#= link_to "问卷动态", {:controller => "users", :action => "show", :type => "course_poll"}, :class => "homepagePostTypeQuiz postTypeGrey"%>
<li><%#= link_to "班级留言", {:controller => "users", :action => "show", :type => "course_journals"}, :class =>"homepagePostTypeMessage postTypeGrey"%>
&lt;!&ndash;<li><a href="javascript:void(0);" class="homepagePostTypeForum postTypeGrey">论坛动态</a></li>&ndash;&gt;
&lt;!&ndash;<li><a href="javascript:void(0);" class="homepagePostTypeQuiz postTypeGrey">问卷动态</a></li>&ndash;&gt;
<%# end %>
</ul>
</li>
<li>
<ul class="homepagePostTypeProject fl">
<li class="f14">项目动态</li>
<li><%#= link_to "问题动态", {:controller => "users", :action => "show", :type => "project_issue"}, :class => "homepagePostTypeQuestion postTypeGrey"%>
<li><%#= link_to "论坛动态", {:controller => "users", :action => "show", :type => "project_message"}, :class => "homepagePostTypeForum postTypeGrey"%>
&lt;!&ndash;<li><a href="javascript:void(0);" class="homepagePostTypeQuestion postTypeGrey">问题动态</a></li>
<li><a href="javascript:void(0);" class="homepagePostTypeForum postTypeGrey">论坛动态</a></li>&ndash;&gt;
</ul>
</li>
<li>
<ul class="homepagePostTypeProject fl">
<li class="f14">更多</li>
<li class="mt-4"><%#= link_to "个人留言", {:controller => "users", :action => "show", :type => "user_journals"}, :class =>"homepagePostTypeMessage postTypeGrey"%>
<li class="mt-4"><%#= link_to @user == User.current ? "我的动态" : "他的动态", {:controller => "users", :action => "show", :type => "current_user"}, :class =>"homepagePostTypeMine postTypeGrey"%>
<li class="mt-4"><%#= link_to "全部动态", {:controller => "users", :action => "show", :type => "all"}, :class =>"homepagePostTypeAll postTypeGrey"%>
</ul>
</li>
</ul>
</li>
</ul>-->
</div>
<!--显示个人主页-->
<%# if @user.blog.homepage_id and BlogComment.where("id=?", @user.blog.homepage_id).count > 0 %>
<%# homepage = BlogComment.find(@user.blog.homepage_id) %>
<%#= render :partial => 'blogs/homepage', :locals => {:activity => homepage, :user_activity_id => homepage.id} %>
<%# end %>
<%= render :partial => 'users/user_activities', :locals => {:user_activities => @user_activities,:page => 0,:type => @type, :user_id => (@user.type == "AnonymousUser" ? User.current.id : @user.id)} %>
<% if @user_activities_count > 0 %>
<%= render :partial => 'users/user_activities', :locals => {:user_activities => @user_activities, :page => 0, :type => @type, :user_id => (@user.type == "AnonymousUser" ? User.current.id : @user.id)} %>
<% else %>
<div class="mb10">
<%= render :partial => 'users/no_data' %>
</div>
<% end %>
<% end %>

Some files were not shown because too many files have changed in this diff Show More