Merge branch 'weixin_guange' of https://git.trustie.net/jacknudt/trustieforge into weixin_guange
Conflicts: public/assets/wechat/login_tip.html
This commit is contained in:
commit
5eb397aa2a
|
@ -14,66 +14,172 @@ module Mobile
|
|||
requires :token, type: String
|
||||
end
|
||||
post ':id' do
|
||||
authenticate!
|
||||
# authenticate!
|
||||
|
||||
unless current_user
|
||||
#如果当前用户不存在
|
||||
openid = session[:wechat_openid]
|
||||
raise "无法获取到openid,请在微信中打开本页面" unless openid
|
||||
us = UsersService.new
|
||||
#login mail password
|
||||
openid_length = openid.length
|
||||
|
||||
login = openid[0..10]+openid[openid_length-3..openid_length-1]+Time.now.to_i.to_s
|
||||
|
||||
access_token = session[:access_token]
|
||||
|
||||
logger.info "session!!!!!!!!!"
|
||||
logger.info session
|
||||
|
||||
if access_token
|
||||
userinfo = Wechat.api.web_userinfo(access_token,openid)
|
||||
name = userinfo[:nickname]
|
||||
else
|
||||
name = openid[0..3]+"***"+openid.last
|
||||
end
|
||||
|
||||
user = us.register ({:login=>login, :mail=>login+"@163.com",
|
||||
:password=>"12345678", :password_confirmation=>"12345678",
|
||||
:should_confirmation_password => true})
|
||||
|
||||
user.update_attributes(:lastname=>name)
|
||||
|
||||
raise user.errors.full_messages.first if user.new_record?
|
||||
UserWechat.create!(
|
||||
openid: openid,
|
||||
user: user,
|
||||
bindtype: 1
|
||||
)
|
||||
end
|
||||
|
||||
status = 0
|
||||
tip = 0 #0班级1项目
|
||||
type = params[:type]
|
||||
result = 1
|
||||
if params[:content]!="" && current_user
|
||||
case type
|
||||
when "HomeworkCommon"
|
||||
homework_common = HomeworkCommon.find(params[:id])
|
||||
|
||||
#如果是私有的 并且不是成员则不能回复
|
||||
# is_public = homework_common.course.is_public
|
||||
# if is_public == 0 && !current_user.member_of_course?(homework_common.course)
|
||||
# status = -1
|
||||
# tip = 0
|
||||
# else
|
||||
# feedback = HomeworkCommon.add_homework_jour(current_user, params[:content], params[:id])
|
||||
# if (feedback.errors.empty?)
|
||||
# homework_common.update_column(:updated_at, Time.now)
|
||||
# result = 2
|
||||
# end
|
||||
# end
|
||||
feedback = HomeworkCommon.add_homework_jour(current_user, params[:content], params[:id])
|
||||
if (feedback.errors.empty?)
|
||||
homework_common.update_column(:updated_at, Time.now)
|
||||
result = 2
|
||||
end
|
||||
|
||||
when "News"
|
||||
news = News.find(params[:id])
|
||||
comment = Comment.new
|
||||
comment.comments = params[:content]
|
||||
comment.author = current_user
|
||||
if news.comments << comment
|
||||
result = 2
|
||||
|
||||
# if news.project
|
||||
# if news.project.is_public == false && !current_user.member_of?(news.project)
|
||||
# status = -1
|
||||
# tip = 1
|
||||
# end
|
||||
# elsif news.course
|
||||
# if news.course.is_public == 0 && !current_user.member_of_course?(news.course)
|
||||
# status = -1
|
||||
# tip = 0
|
||||
# end
|
||||
# end
|
||||
|
||||
if status == 0
|
||||
comment = Comment.new
|
||||
comment.comments = params[:content]
|
||||
comment.author = current_user
|
||||
if news.comments << comment
|
||||
result = 2
|
||||
end
|
||||
end
|
||||
when "Message"
|
||||
message = Message.find(params[:id])
|
||||
board = Board.find(message.board_id)
|
||||
topic = message.root
|
||||
reply = Message.new
|
||||
reply.author = current_user
|
||||
reply.board = board
|
||||
reply.content = params[:content]
|
||||
reply.parent_id = params[:id]
|
||||
reply.subject = "RE: #{topic.subject}"
|
||||
if topic.children << reply
|
||||
result = 2
|
||||
|
||||
# if message.project
|
||||
# if message.project.is_public == false && !current_user.member_of?(message.project)
|
||||
# status = -1
|
||||
# tip = 1
|
||||
# end
|
||||
# elsif message.course
|
||||
# if message.course.is_public == 0 && !current_user.member_of_course?(message.course)
|
||||
# status = -1
|
||||
# tip = 0
|
||||
# end
|
||||
# end
|
||||
|
||||
if status == 0
|
||||
topic = message.root
|
||||
reply = Message.new
|
||||
reply.author = current_user
|
||||
reply.board = board
|
||||
reply.content = params[:content]
|
||||
reply.parent_id = params[:id]
|
||||
reply.subject = "RE: #{topic.subject}"
|
||||
if topic.children << reply
|
||||
result = 2
|
||||
end
|
||||
end
|
||||
when "JournalsForMessage"
|
||||
jour = JournalsForMessage.find params[:id]
|
||||
parent_id = params[:id]
|
||||
author_id = current_user.id
|
||||
reply_user_id = jour.user_id
|
||||
reply_id = params[:id]
|
||||
content = params[:content]
|
||||
options = {:user_id => author_id,
|
||||
:status => true,
|
||||
:m_parent_id => parent_id,
|
||||
:m_reply_id => reply_id,
|
||||
:reply_id => reply_user_id,
|
||||
:notes => content,
|
||||
:is_readed => false}
|
||||
jfm = jour.user.add_jour(nil, nil, nil, options)
|
||||
if jfm.errors.empty?
|
||||
(JournalsForMessage.find parent_id).update_attribute(:updated_on,Time.now)
|
||||
result = 2
|
||||
|
||||
# if jour.jour_type == "Project"
|
||||
# if jour.project.is_public == false && !current_user.member_of?(jour.project)
|
||||
# status = -1
|
||||
# tip = 1
|
||||
# end
|
||||
# elsif jour.jour_type == "Course"
|
||||
# if jour.course.is_public == 0 && !current_user.member_of_course?(jour.course)
|
||||
# status = -1
|
||||
# tip = 0
|
||||
# end
|
||||
# end
|
||||
|
||||
if status == 0
|
||||
parent_id = params[:id]
|
||||
author_id = current_user.id
|
||||
reply_user_id = jour.user_id
|
||||
reply_id = params[:id]
|
||||
content = params[:content]
|
||||
options = {:user_id => author_id,
|
||||
:status => true,
|
||||
:m_parent_id => parent_id,
|
||||
:m_reply_id => reply_id,
|
||||
:reply_id => reply_user_id,
|
||||
:notes => content,
|
||||
:is_readed => false}
|
||||
jfm = jour.user.add_jour(nil, nil, nil, options)
|
||||
if jfm.errors.empty?
|
||||
(JournalsForMessage.find parent_id).update_attribute(:updated_on,Time.now)
|
||||
result = 2
|
||||
end
|
||||
end
|
||||
when 'Issue'
|
||||
issue = Issue.find params[:id]
|
||||
is_jour = Journal.new
|
||||
is_jour.user_id = current_user.id
|
||||
is_jour.notes = params[:content]
|
||||
is_jour.journalized = issue
|
||||
if is_jour.save
|
||||
result = 2
|
||||
|
||||
# if issue.project.is_public == false && !current_user.member_of?(issue.project)
|
||||
# status = -1
|
||||
# tip = 1
|
||||
# end
|
||||
|
||||
if status == 0
|
||||
is_jour = Journal.new
|
||||
is_jour.user_id = current_user.id
|
||||
is_jour.notes = params[:content]
|
||||
is_jour.journalized = issue
|
||||
if is_jour.save
|
||||
result = 2
|
||||
end
|
||||
end
|
||||
when 'BlogComment'
|
||||
blog = BlogComment.find(params[:id]).root
|
||||
|
@ -97,7 +203,8 @@ module Mobile
|
|||
result = 3
|
||||
end
|
||||
present :result, result
|
||||
present :status, 0
|
||||
present :status, status
|
||||
present :tip, tip
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -20,8 +20,8 @@ module Mobile
|
|||
|
||||
if news.project
|
||||
is_public = news.project.is_public
|
||||
elsif news.project
|
||||
is_public = news.project.is_public
|
||||
elsif news.course
|
||||
is_public = news.course.is_public
|
||||
end
|
||||
|
||||
present :data, news, with: Mobile::Entities::News,user: user,type: type,page: page
|
||||
|
|
|
@ -27,8 +27,7 @@ module Mobile
|
|||
post 'wxbind' do
|
||||
openid = session[:wechat_openid]
|
||||
logger.debug "openid ============== #{openid}"
|
||||
# raise "无法获取到openid,请在微信中打开本页面" unless openid
|
||||
raise "请在微信中关注公众号'Trustie创新实践平台'后再打开本页面" unless openid
|
||||
raise "无法获取到openid,请在微信中打开本页面" unless openid
|
||||
uw = UserWechat.where(openid: openid).first
|
||||
raise "此微信号已绑定用户(#{uw.user.login}), 不能重复绑定" if uw
|
||||
|
||||
|
@ -54,21 +53,33 @@ module Mobile
|
|||
requires :password, type: String, desc: 'password'
|
||||
end
|
||||
post do
|
||||
|
||||
openid = session[:wechat_openid]
|
||||
logger.debug "openid ============== #{openid}"
|
||||
# raise "无法获取到openid,请在微信中打开本页面" unless openid
|
||||
raise "请在微信中关注Trustie创新实践平台后再打开本页面" unless openid
|
||||
raise "无法获取到openid,请在微信中打开本页面" unless openid
|
||||
|
||||
uw = UserWechat.where(openid: openid).first
|
||||
if uw
|
||||
uw.bindtype = 0
|
||||
uw.save
|
||||
user = uw.user
|
||||
user[:login] = params[:login]
|
||||
user[:mail] = params[:mail]
|
||||
user[:password] = params[:password]
|
||||
user[:password_confirmation] = params[:password]
|
||||
user[:should_confirmation_password] = true
|
||||
user.save!
|
||||
else
|
||||
us = UsersService.new
|
||||
user = us.register params.merge(:password_confirmation => params[:password],
|
||||
:should_confirmation_password => true)
|
||||
raise user.errors.full_messages.first if user.new_record?
|
||||
|
||||
UserWechat.create!(
|
||||
openid: openid,
|
||||
user: user
|
||||
)
|
||||
end
|
||||
|
||||
us = UsersService.new
|
||||
user = us.register params.merge(:password_confirmation => params[:password],
|
||||
:should_confirmation_password => true)
|
||||
raise user.errors.full_messages.first if user.new_record?
|
||||
UserWechat.create!(
|
||||
openid: openid,
|
||||
user: user
|
||||
)
|
||||
ws = WechatService.new
|
||||
ws.binding_succ_notice(user.id, "您已成功绑定Trustie平台。", user.login, Time.now.strftime("%Y-%m-%d"))
|
||||
present :data, user, with: Mobile::Entities::User
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
# Place all the behaviors and hooks related to the matching controller here.
|
||||
# All this logic will automatically be available in application.js.
|
||||
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
|
|
@ -0,0 +1,3 @@
|
|||
// Place all the styles related to the pull_requests controller here.
|
||||
// They will automatically be included in application.css.
|
||||
// You can use Sass (SCSS) here: http://sass-lang.com/
|
|
@ -62,6 +62,7 @@ class AdminController < ApplicationController
|
|||
course = Course.where("id = #{params[:course_id].to_i}").first
|
||||
unless course.nil?
|
||||
course.update_column('syllabus_id', params[:syllabus_id].to_i)
|
||||
Rails.logger.error "update_syllabus_id: admin_controller/select_scourse_syllabus"
|
||||
@flag = true
|
||||
end
|
||||
end
|
||||
|
@ -83,6 +84,7 @@ class AdminController < ApplicationController
|
|||
syllabus.description = Message.where("id = 19412").first.nil? ? nil : Message.where("id = 19412").first.content
|
||||
if syllabus.save
|
||||
course.update_column('syllabus_id', syllabus.id)
|
||||
Rails.logger.error "update_syllabus_id: admin_controller/create_syllabus"
|
||||
@flag = params[:flag].to_i
|
||||
@course = course
|
||||
respond_to do |format|
|
||||
|
@ -616,9 +618,14 @@ class AdminController < ApplicationController
|
|||
# 未审批tab页
|
||||
# status: 0 未审批; 1 已批阅; 2已更改; 3拒绝;
|
||||
def applied_schools
|
||||
# 更新消息状态
|
||||
if params[:flag]
|
||||
applied_message = AppliedMessage.where(:id => params[:applied_message_id]).first
|
||||
applied_message.update_attribute(:viewed, true)
|
||||
end
|
||||
|
||||
@name = params[:name] || ""
|
||||
condition = "#{@name.strip}".gsub(" ","")
|
||||
|
||||
@apply_status = ApplyAddSchools.where("status = 0 and name like '%#{condition}%'").order('created_at desc')
|
||||
@apply_count = @apply_status.count
|
||||
@apply_pages = Paginator.new @apply_count, 30, params['page'] || 1
|
||||
|
@ -655,7 +662,7 @@ class AdminController < ApplicationController
|
|||
applied_school.update_column('status', 1) unless applied_school.nil?
|
||||
school = applied_school.school
|
||||
school.update_attribute("province", applied_school.province)
|
||||
AppliedMessage.create(:user_id => applied_school.user_id, :status => 1, :viewed => true, :applied_id => applied_school.id, :applied_type => "ApplyAddSchools", :name => applied_school.name )
|
||||
AppliedMessage.create(:user_id => applied_school.user_id, :status => 1, :viewed => 0, :applied_id => applied_school.id, :applied_type => "ApplyAddSchools", :name => applied_school.name )
|
||||
# School.create(:user_id => applied_school.user_id, :status => 1, :viewed => true, :applied_id => applied_school.id, :applied_type => "ApplyAddSchools", :name => applied_school.name )
|
||||
respond_to do |format|
|
||||
format.html{ redirect_to unapplied_schools_url }
|
||||
|
@ -663,8 +670,8 @@ class AdminController < ApplicationController
|
|||
end
|
||||
|
||||
# 单位审核:更改
|
||||
# REDO: 修改该字段
|
||||
# REDO: 同步修改使用了改名称的用户单位
|
||||
# 修改该字段
|
||||
# 同步修改使用了改名称的用户单位
|
||||
def edit_applied_schools
|
||||
aas = ApplyAddSchools.find(params[:applied_id])
|
||||
# aas.update_attribute(:name, params[:name])
|
||||
|
@ -672,11 +679,9 @@ class AdminController < ApplicationController
|
|||
school = School.find params[:school_id]
|
||||
begin
|
||||
aas.update_attribute(:status, 2)
|
||||
AppliedMessage.create(:user_id => aas.user_id, :status => 2, :viewed => true, :applied_id => aas.id, :applied_type => "ApplyAddSchools", :name => school[0].name )
|
||||
AppliedMessage.create(:user_id => aas.user_id, :status => 2, :viewed => 0, :applied_id => aas.id, :applied_type => "ApplyAddSchools", :name => school[0].name )
|
||||
users = UserExtensions.where("school_id = #{aas.school_id}")
|
||||
users.each do |user|
|
||||
user.update_column("school_id", school[0].id)
|
||||
end
|
||||
users.update_all(:school_id => school[0].id)
|
||||
if aas.school_id != school[0].id.to_i
|
||||
aas.school.destroy
|
||||
end
|
||||
|
@ -709,28 +714,19 @@ class AdminController < ApplicationController
|
|||
end
|
||||
|
||||
# 单位审核:删除
|
||||
# REDO: destroy关联删除
|
||||
# REDO: 删除确认提示,是否删除
|
||||
# REDO: 给申请人发送消息
|
||||
def delete_applied_schools
|
||||
applied_school = ApplyAddSchools.find(params[:id])
|
||||
applied_school.update_attribute(:status, 3)
|
||||
# 未审批删除
|
||||
if params[:tip] == "unapplied"
|
||||
AppliedMessage.create(:user_id => applied_school.user_id, :status => 3, :viewed => true, :applied_id => applied_school.id, :applied_type => "ApplyAddSchools", :name => applied_school.name )
|
||||
# 删除学校的用户
|
||||
users = UserExtensions.where("school_id = #{applied_school.school_id}")
|
||||
users.each do |user|
|
||||
user.update_column("school_id", nil)
|
||||
end
|
||||
AppliedMessage.create(:user_id => applied_school.user_id, :status => 3, :viewed => 0, :applied_id => applied_school.id, :applied_type => "ApplyAddSchools", :name => applied_school.name )
|
||||
# 删除学校的用户
|
||||
users = UserExtensions.where("school_id = #{applied_school.school_id}")
|
||||
users.update_all(:school_id => nil)
|
||||
applied_school.school.destroy
|
||||
redirect_to unapplied_schools_url
|
||||
# 已审批删除
|
||||
elsif params[:tip] == "applied"
|
||||
users = UserExtensions.where("school_id = #{applied_school.school_id}")
|
||||
users.each do |user|
|
||||
user.update_column("school_id", nil)
|
||||
end
|
||||
applied_school.destroy
|
||||
redirect_to applied_schools_url
|
||||
end
|
||||
|
|
|
@ -45,7 +45,7 @@ class AppliedProjectController < ApplicationController
|
|||
end
|
||||
|
||||
# @flage:提示语标志(1:邀请码错误;2:已经是项目成员; 3:角色没有选择; 4:申请成功)
|
||||
# role:成员角色 => 0(4:管理人员;5:开发人员;6:报告人员)
|
||||
# role:成员角色 => 0(3:管理人员;4:开发人员;5:报告人员)
|
||||
# 申请成功则发送消息
|
||||
def applied_project_info
|
||||
if params[:project_id].nil?
|
||||
|
@ -61,6 +61,22 @@ class AppliedProjectController < ApplicationController
|
|||
@flag = 3
|
||||
elsif !AppliedProject.where(:project_id => @project.id, :user_id => User.current.id).first.nil?
|
||||
@flag = 5
|
||||
elsif params[:member] == "member_reporter" && params[:invite_code].upcase.to_s == @project.invite_code
|
||||
# 项目报告人员直接加入项目
|
||||
@flag = 6
|
||||
members = []
|
||||
user_grades = []
|
||||
project_info = []
|
||||
members << Member.new(:role_ids => ["5"], :user_id => User.current.id)
|
||||
user_grades << UserGrade.new(:user_id => User.current.id, :project_id => @project.id)
|
||||
role = Role.find(5)
|
||||
project_info << ProjectInfo.new(:project_id => @project.id, :user_id => User.current.id) if role.allowed_to?(:is_manager)
|
||||
@project.members << members
|
||||
@project.project_infos << project_info
|
||||
@project.user_grades << user_grades unless user_grades.first.user_id.nil?
|
||||
|
||||
ps = ProjectsService.new
|
||||
ps.send_wechat_join_project_notice User.current,@project,5,0
|
||||
else
|
||||
@flag = 4
|
||||
role = params[:member] == "member_manager" ? 3 : (params[:member] == "member_developer" ? 4 :5)
|
||||
|
|
|
@ -58,9 +58,10 @@ class HomeworkCommonController < ApplicationController
|
|||
|
||||
def edit
|
||||
@user = User.current
|
||||
@is_in_course = params[:is_in_course].to_i
|
||||
@is_in_course = params[:is_in_course]
|
||||
@is_manage = params[:is_manage]
|
||||
@course_activity = params[:course_activity].to_i
|
||||
if @is_in_course == 1 || @course_activity == 1
|
||||
if @is_in_course.to_i == 1 || @course_activity == 1
|
||||
@left_nav_type = 3
|
||||
respond_to do |format|
|
||||
format.html{render :layout => 'base_courses'}
|
||||
|
@ -144,7 +145,11 @@ class HomeworkCommonController < ApplicationController
|
|||
@homework_detail_programing.save if @homework_detail_programing
|
||||
@homework_detail_group.save if @homework_detail_group
|
||||
|
||||
if params[:is_in_course] == "1"
|
||||
if params[:is_manage] == "1"
|
||||
redirect_to manage_or_receive_homeworks_user_path(User.current.id)
|
||||
elsif params[:is_manage] == "2"
|
||||
redirect_to my_homeworks_user_path(User.current.id)
|
||||
elsif params[:is_in_course] == "1"
|
||||
redirect_to homework_common_index_path(:course => @course.id)
|
||||
elsif params[:is_in_course] == "0"
|
||||
redirect_to user_homeworks_user_path(User.current.id)
|
||||
|
|
|
@ -108,6 +108,12 @@ class MyController < ApplicationController
|
|||
|
||||
# Edit user's account
|
||||
def account
|
||||
# 更新消息状态
|
||||
if params[:flag]
|
||||
applied_message = AppliedMessage.where(:id => params[:applied_message_id]).first
|
||||
applied_message.update_attribute(:viewed, true)
|
||||
end
|
||||
|
||||
@user = User.current
|
||||
|
||||
lg=@user.login
|
||||
|
|
|
@ -0,0 +1,135 @@
|
|||
|
||||
class PullRequestsController < ApplicationController
|
||||
before_filter :find_project_and_repository
|
||||
before_filter :connect_gitlab, :only => [:index, :show, :create, :accept_pull_request, :pull_request_commits, :pull_request_changes, :new]
|
||||
layout "base_projects"
|
||||
include PullRequestsHelper
|
||||
include ApplicationHelper
|
||||
|
||||
# 返回json格式
|
||||
def index
|
||||
type = params[:type]
|
||||
case type
|
||||
when nil, "1"
|
||||
@requests = @g.merge_requests(@project.gpid).select{|request| request.state == "opened" || request.state == "reopened"}
|
||||
when "2"
|
||||
@requests = @g.merge_requests(@project.gpid).select{|request| request.state == "merged"}
|
||||
end
|
||||
@requests_opened_count = @requests.count
|
||||
@requests_merged_count = params[:type] ? @requests.count : @g.merge_requests(@project.gpid).select{|request| request.state == "merged"}.count
|
||||
respond_to do |format|
|
||||
format.html
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
# 主要取源项目和目标项目分支及标识(用户名/版本库名)
|
||||
def new
|
||||
identifier = get_rep_identifier_by_project @project
|
||||
@source_project_name = "#{get_user_name(@project.user_id)}/#{identifier}"
|
||||
@source_rev = @g.branches(@project.gpid).map{|b| b.name}
|
||||
|
||||
# 获取forked源项目信息
|
||||
if @project.forked_from_project_id
|
||||
@forked_project = Project.find(@project.forked_from_project_id)
|
||||
identifier = get_rep_identifier_by_project @forked_project
|
||||
@forked_project_name = "#{get_user_name(@forked_project.user_id)}/#{identifier}"
|
||||
@forked_rev = @g.branches(@forked_project.gpid).map{|b| b.name}
|
||||
end
|
||||
end
|
||||
|
||||
# Creates a merge request.
|
||||
# If the operation is successful, 200 and the newly created merge request is returned. If an error occurs, an error number and a message explaining the reason is returned.
|
||||
#
|
||||
# @example
|
||||
# Gitlab.create_merge_request(5, 'New merge request',
|
||||
# :source_branch => 'source_branch', :target_branch => 'target_branch')
|
||||
# Gitlab.create_merge_request(5, 'New merge request',
|
||||
# :source_branch => 'source_branch', :target_branch => 'target_branch', :assignee_id => 42)
|
||||
#
|
||||
# @param [Integer] project The ID of a project.
|
||||
# @param [String] title The title of a merge request.
|
||||
# @param [Hash] options A customizable set of options.
|
||||
# @option options [String] :source_branch (required) The source branch name.
|
||||
# @option options [String] :target_branch (required) The target branch name.
|
||||
# @option options [Integer] :assignee_id (optional) The ID of a user to assign merge request.
|
||||
# @return [Gitlab::ObjectifiedHash] Information about created merge request.
|
||||
def create
|
||||
title = params[:title]
|
||||
description = params[:description]
|
||||
source_branch = params[:source_branch]
|
||||
target_branch = params[:target_branch]
|
||||
begin
|
||||
# 如果传送了目标项目ID,则PR请求发至目标项目
|
||||
if params[:forked_project_id] && params[:source_project] == "forked_project_name"
|
||||
target_project_id = params[:forked_project_id].to_i
|
||||
request = @g.create_merge_request(@project.gpid, title, User.current.gid, :description => description, :source_branch => source_branch, :target_branch => target_branch, :target_project_id => target_project_id)
|
||||
@fork_project_name = Project.find(@project.forked_from_project_id).try(:name)
|
||||
@fork_pr_message = true if @fork_project_name
|
||||
else
|
||||
request = @g.create_merge_request(@project.gpid, title, User.current.gid, :description => description, :source_branch => source_branch, :target_branch => target_branch)
|
||||
respond_to do |format|
|
||||
format.js{redirect_to project_pull_request_path(request.id, :project_id => @project.id)}
|
||||
end
|
||||
end
|
||||
rescue Exception => e
|
||||
@message = e.message
|
||||
end
|
||||
end
|
||||
|
||||
def show
|
||||
@type = params[:type]
|
||||
@request = @g.merge_request(@project.gpid, params[:id])
|
||||
@commits = @g.merge_request_commits(@project.gpid, params[:id].to_i)
|
||||
@commits_count = @commits.count
|
||||
@changes = @g.merge_request_changes(@project.gpid, params[:id]).try(:changes)
|
||||
@changes_count = @changes.count
|
||||
end
|
||||
|
||||
# Accept a merge request.
|
||||
# If merge success you get 200 OK.
|
||||
# Accept a merge request.
|
||||
#
|
||||
# @example
|
||||
# Gitlab.accept_pull_rquest(5, 1)
|
||||
#
|
||||
# @param [Integer] project The ID of a project.
|
||||
# @param [Integer] id The ID of a merge request.
|
||||
# @return [Gitlab::ObjectifiedHash]
|
||||
def accept_pull_request
|
||||
begin
|
||||
status = @g.accept_merge_rquest(@project.gpid, params[:id], User.current.gid)
|
||||
respond_to do |format|
|
||||
format.js{redirect_to project_pull_request_path(status.id, :project_id => @project.id)}
|
||||
end
|
||||
rescue Exception => e
|
||||
@message = e.message
|
||||
end
|
||||
end
|
||||
|
||||
# 获取某次请求的提交次数
|
||||
def pull_request_commits
|
||||
@type = parms[:type]
|
||||
@commits = @g.merge_request_commits(@project.gpid, params[:id].to_i)
|
||||
end
|
||||
|
||||
# 获取某次请求的改动
|
||||
def pull_request_changes
|
||||
@changes = @g.merge_request_changes(@project.gpid, params[:id]).try(:changes)
|
||||
@changes_count = @changes.count
|
||||
end
|
||||
|
||||
private
|
||||
def connect_gitlab
|
||||
@g = Gitlab.client
|
||||
end
|
||||
|
||||
def find_project_and_repository
|
||||
@project = Project.find(params[:project_id])
|
||||
render_404 if @project.gpid.blank?
|
||||
@repository = Repository.where(:project_id => @project.id, :type => "Repository::Gitlab")
|
||||
rescue ActiveRecord::RecordNotFound
|
||||
render_404
|
||||
end
|
||||
|
||||
end
|
|
@ -188,11 +188,12 @@ class SchoolController < ApplicationController
|
|||
user_extention.school_id = school.id
|
||||
user_extention.save!
|
||||
|
||||
# status=4 向管理员发送信息
|
||||
# 向管理员发送信息
|
||||
users = User.where(:admin => 1)
|
||||
users.each do |user|
|
||||
AppliedMessage.create(:user_id => user.id, :status => 0, :applied_user_id => User.current.id, :viewed => true, :applied_id => school.id, :applied_type => "ApplyAddSchools", :name => school.name )
|
||||
AppliedMessage.create(:user_id => user.id, :status => 0, :applied_user_id => User.current.id, :viewed => 0, :applied_id => school.id, :applied_type => "ApplyAddSchools", :name => school.name )
|
||||
end
|
||||
|
||||
else
|
||||
data[:result] = 3
|
||||
end
|
||||
|
|
|
@ -775,30 +775,33 @@ class StudentWorkController < ApplicationController
|
|||
end
|
||||
|
||||
def retry_work
|
||||
if @work.destroy
|
||||
if @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1
|
||||
pros = @work.student_work_projects.where("is_leader = 0")
|
||||
pros.each do |pro|
|
||||
pro.destroy
|
||||
end
|
||||
project = @work.student_work_projects.where("is_leader = 1").first
|
||||
project.update_attributes(:student_work_id => nil)
|
||||
elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 0
|
||||
@work.student_work_projects.each do |pro2|
|
||||
pro2.destroy
|
||||
if @homework.homework_type == 3
|
||||
if @work.destroy
|
||||
if @homework.homework_detail_group.base_on_project == 1
|
||||
pros = @work.student_work_projects.where("is_leader = 0")
|
||||
pros.each do |pro|
|
||||
pro.destroy
|
||||
end
|
||||
project = @work.student_work_projects.where("is_leader = 1").first
|
||||
project.update_attributes(:student_work_id => nil)
|
||||
elsif @homework.homework_detail_group.base_on_project == 0
|
||||
@work.student_work_projects.each do |pro2|
|
||||
pro2.destroy
|
||||
end
|
||||
end
|
||||
end
|
||||
@student_work = StudentWork.new
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
elsif @homework.homework_type == 1
|
||||
@work.update_attributes(:work_status => 0, :name => "#{@homework.name}的作品提交", :description => nil, :late_penalty => 0)
|
||||
end
|
||||
@student_work = StudentWork.new
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
#添加评分,已评分则为修改评分
|
||||
def add_score
|
||||
@is_last = params[:is_last] == "true"
|
||||
render_403 and return if User.current == @work.user #不可以匿评自己的作品
|
||||
@is_teacher = User.current.allowed_to?(:as_teacher,@course) || User.current.admin?
|
||||
#老师、教辅可以随时评分,学生只能在匿评作业的匿评阶段进行评分
|
||||
render_403 and return unless @is_teacher || @homework.homework_detail_manual.comment_status == 2
|
||||
|
@ -828,7 +831,7 @@ class StudentWorkController < ApplicationController
|
|||
if User.current.admin?
|
||||
@new_score.reviewer_role = 1
|
||||
else
|
||||
role = User.current.members.where("course_id = ?",@course.id).first.roles.first.name
|
||||
role = User.current.members.where("course_id = ?",@course.id).first.roles.where("is_current = 1").first.name
|
||||
@new_score.reviewer_role = get_role_by_name(role)
|
||||
end
|
||||
if @score
|
||||
|
|
|
@ -41,7 +41,8 @@ class UsersController < ApplicationController
|
|||
:activity_score_index, :influence_score_index, :score_index,:show_new_score, :topic_new_score_index, :project_new_score_index,
|
||||
:activity_new_score_index, :influence_new_score_index, :score_new_index,:user_projects_index,:user_resource,
|
||||
:user_courses4show,:user_projects4show,:user_course_activities,:user_project_activities,:user_feedback4show,:user_visitorlist,:user_messages,:edit_brief_introduction,
|
||||
:user_import_homeworks,:user_search_homeworks,:user_import_resource, :user_system_messages,:choose_user_course,:user_courselist,:user_projectlist,:sort_syllabus_list]
|
||||
:user_import_homeworks,:user_search_homeworks,:user_import_resource, :user_system_messages,:choose_user_course,:user_courselist,:user_projectlist,:sort_syllabus_list,
|
||||
:my_homeworks,:manage_or_receive_homeworks,:search_m_r_homeworks]
|
||||
before_filter :auth_user_extension, only: :show
|
||||
#before_filter :rest_user_score, only: :show
|
||||
#before_filter :select_entry, only: :user_projects
|
||||
|
@ -613,23 +614,25 @@ class UsersController < ApplicationController
|
|||
|
||||
#用户作业列表
|
||||
def user_homeworks
|
||||
@order,@b_sort = params[:order] || "created_at",params[:sort] || "desc"
|
||||
@order,@b_sort = params[:order] || "publish_time",params[:sort] || "desc"
|
||||
@user = User.current
|
||||
@r_sort = @b_sort == "desc" ? "asc" : "desc"
|
||||
if(params[:type].blank? || params[:type] == "1") #我的题库
|
||||
@homeworks = HomeworkCommon.where("user_id = #{@user.id} and publish_time <= '#{Date.today}'").order("#{@order} #{@b_sort}")
|
||||
elsif params[:type] == "2" #题库
|
||||
courses = @user.courses.where("is_delete = 1")
|
||||
course_ids = courses.empty? ? "(-1)" : "(" + courses.map{|course| course.id}.join(",") + ")"
|
||||
@homeworks = HomeworkCommon.where("user_id = #{@user.id} and course_id not in #{course_ids}").order("#{@order} #{@b_sort}")
|
||||
elsif params[:type] == "2" #公共题库
|
||||
visible_course = Course.where("is_delete = 0")
|
||||
visible_course_ids = visible_course.empty? ? "(-1)" : "(" + visible_course.map{|course| course.id}.join(",") + ")"
|
||||
@homeworks = HomeworkCommon.where("course_id in #{visible_course_ids} and publish_time <= '#{Date.today}'").order("#{@order} #{@b_sort}")
|
||||
end
|
||||
@type = params[:type]
|
||||
@limit = 25
|
||||
@limit = 10
|
||||
@is_remote = true
|
||||
@hw_count = @homeworks.count
|
||||
@hw_pages = Paginator.new @hw_count, @limit, params['page'] || 1
|
||||
@offset ||= @hw_pages.offset
|
||||
@homeworks = paginateHelper @homeworks,25
|
||||
@homeworks = paginateHelper @homeworks,10
|
||||
respond_to do |format|
|
||||
format.js
|
||||
format.html {render :layout => 'static_base'}
|
||||
|
@ -662,15 +665,15 @@ class UsersController < ApplicationController
|
|||
end
|
||||
|
||||
def choose_user_course
|
||||
homework = HomeworkCommon.find params[:send_id].to_i
|
||||
if homework.user != User.current && homework.course.is_public == 0 && !User.current.allowed_to?(:as_teacher,homework.course)
|
||||
ah = ApplyHomework.where("user_id = ? and homework_common_id = ?", User.current.id, params[:send_id].to_i)
|
||||
if ah.empty?
|
||||
@status = 2
|
||||
elsif ah.first.status != 2
|
||||
@status = ah.first.status
|
||||
end
|
||||
end
|
||||
homework = HomeworkCommon.find params[:homework].to_i
|
||||
# if homework.user != User.current && homework.course.is_public == 0 && !User.current.allowed_to?(:as_teacher,homework.course)
|
||||
# ah = ApplyHomework.where("user_id = ? and homework_common_id = ?", User.current.id, params[:send_id].to_i)
|
||||
# if ah.empty?
|
||||
# @status = 2
|
||||
# elsif ah.first.status != 2
|
||||
# @status = ah.first.status
|
||||
# end
|
||||
# end
|
||||
if !params[:search].nil?
|
||||
search = "%#{params[:search].to_s.strip.downcase}%"
|
||||
@course = @user.courses.where("is_delete = 0 and #{Course.table_name}.id != #{homework.course_id} and (#{Course.table_name}.id = #{params[:search].to_i } or #{Course.table_name}.name like :p)",:p=>search).select { |course| @user.allowed_to?(:as_teacher,course)}
|
||||
|
@ -679,7 +682,7 @@ class UsersController < ApplicationController
|
|||
end
|
||||
@search = params[:search]
|
||||
#这里仅仅是传递需要发送的资源id
|
||||
@send_id = params[:send_id]
|
||||
@send_id = params[:homework]
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
|
@ -758,7 +761,7 @@ class UsersController < ApplicationController
|
|||
#@user_homeworks = HomeworkCommon.where(:user_id => @user.id).order("created_at desc")
|
||||
courses = @user.courses.where("is_delete = 1")
|
||||
course_ids = courses.empty? ? "(-1)" : "(" + courses.map{|course| course.id}.join(",") + ")"
|
||||
@homeworks = HomeworkCommon.where("user_id = #{@user.id} and publish_time <= '#{Date.today}' and course_id not in #{course_ids}").order("#{@order} #{@b_sort}")
|
||||
@homeworks = HomeworkCommon.where("user_id = #{@user.id} and course_id not in #{course_ids}").order("#{@order} #{@b_sort}")
|
||||
@type = params[:type]
|
||||
@limit = 15
|
||||
@is_remote = true
|
||||
|
@ -772,30 +775,26 @@ class UsersController < ApplicationController
|
|||
end
|
||||
|
||||
def user_homework_type
|
||||
@order,@b_sort = params[:order] || "created_at",params[:sort] || "desc"
|
||||
@order,@b_sort = params[:order] || "publish_time",params[:sort] || "desc"
|
||||
@r_sort = @b_sort == "desc" ? "asc" : "desc"
|
||||
@user = User.current
|
||||
if(params[:type].blank? || params[:type] == "1") #我的题库
|
||||
courses = @user.courses.where("is_delete = 1")
|
||||
course_ids = courses.empty? ? "(-1)" : "(" + courses.map{|course| course.id}.join(",") + ")"
|
||||
@homeworks = HomeworkCommon.where("user_id = #{@user.id} and publish_time <= '#{Date.today}' and course_id not in #{course_ids}").order("#{@order} #{@b_sort}")
|
||||
elsif params[:type] == "2" #题库
|
||||
if params[:is_import].to_i == 1
|
||||
visible_course = Course.where("is_public = 1 && is_delete = 0")
|
||||
elsif params[:is_import].to_i == 0
|
||||
visible_course = Course.where("is_delete = 0")
|
||||
end
|
||||
@homeworks = HomeworkCommon.where("user_id = #{@user.id} and course_id not in #{course_ids}").order("#{@order} #{@b_sort}")
|
||||
elsif params[:type] == "2" #公共题库
|
||||
visible_course = Course.where("is_public = 1 && is_delete = 0")
|
||||
visible_course_ids = visible_course.empty? ? "(-1)" : "(" + visible_course.map{|course| course.id}.join(",") + ")"
|
||||
@homeworks = HomeworkCommon.where("course_id in #{visible_course_ids} and publish_time <= '#{Date.today}'").order("#{@order} #{@b_sort}")
|
||||
elsif params[:type] == "3" #申请题库
|
||||
none_visible_course = Course.where("is_delete = 1")
|
||||
none_visible_course_ids = none_visible_course.empty? ? "(-1)" : "(" + none_visible_course.map{|course| course.id}.join(",") + ")"
|
||||
#apply_homeworks = ApplyHomework.where("user_id = ?",@user.id).order('created_at desc')
|
||||
#homework_ids = apply_homeworks.empty? ? "(-1)" : "(" + apply_homeworks.map{|ah| ah.homework_common_id}.join(",") + ")"
|
||||
#@homeworks = HomeworkCommon.where("id in #{homework_ids} and course_id not in #{none_visible_course_ids}")
|
||||
|
||||
sql = "SELECT homework_commons.* FROM homework_commons INNER JOIN apply_homeworks as ah ON homework_commons.id = ah.homework_common_id where ah.user_id = #{@user.id} and homework_commons.course_id not in #{none_visible_course_ids} order by ah.created_at desc"
|
||||
@homeworks = HomeworkCommon.find_by_sql(sql)
|
||||
# elsif params[:type] == "3" #申请题库
|
||||
# none_visible_course = Course.where("is_delete = 1")
|
||||
# none_visible_course_ids = none_visible_course.empty? ? "(-1)" : "(" + none_visible_course.map{|course| course.id}.join(",") + ")"
|
||||
# #apply_homeworks = ApplyHomework.where("user_id = ?",@user.id).order('created_at desc')
|
||||
# #homework_ids = apply_homeworks.empty? ? "(-1)" : "(" + apply_homeworks.map{|ah| ah.homework_common_id}.join(",") + ")"
|
||||
# #@homeworks = HomeworkCommon.where("id in #{homework_ids} and course_id not in #{none_visible_course_ids}")
|
||||
#
|
||||
# sql = "SELECT homework_commons.* FROM homework_commons INNER JOIN apply_homeworks as ah ON homework_commons.id = ah.homework_common_id where ah.user_id = #{@user.id} and homework_commons.course_id not in #{none_visible_course_ids} order by ah.created_at desc"
|
||||
# @homeworks = HomeworkCommon.find_by_sql(sql)
|
||||
end
|
||||
if params[:property]
|
||||
all_homework_ids = @homeworks.empty? ? "(-1)" : "(" + @homeworks.map{|h| h.id}.join(",") + ")"
|
||||
|
@ -813,7 +812,7 @@ class UsersController < ApplicationController
|
|||
@type = params[:type]
|
||||
@property = params[:property]
|
||||
@is_import = params[:is_import]
|
||||
@limit = params[:is_import].to_i == 1 ? 15 : 25
|
||||
@limit = params[:is_import].to_i == 1 ? 15 : 10
|
||||
@is_remote = true
|
||||
@hw_count = @homeworks.count
|
||||
@hw_pages = Paginator.new @hw_count, @limit, params['page'] || 1
|
||||
|
@ -848,28 +847,24 @@ class UsersController < ApplicationController
|
|||
|
||||
#用户主页过滤作业
|
||||
def user_search_homeworks
|
||||
@order,@b_sort = params[:order] || "created_at",params[:sort] || "desc"
|
||||
@order,@b_sort = params[:order] || "publish_time",params[:sort] || "desc"
|
||||
@r_sort = @b_sort == "desc" ? "asc" : "desc"
|
||||
@user = User.current
|
||||
search = params[:name].to_s.strip.downcase
|
||||
type_ids = params[:property]=="" || params[:property].nil? ? "(1, 2, 3)" : "(" + params[:property] + ")"
|
||||
type_ids = (params[:property]=="" || params[:property].nil? || params[:property]=="0") ? "(1, 2, 3)" : "(" + params[:property] + ")"
|
||||
if(params[:type].blank? || params[:type] == "1") #我的题库
|
||||
courses = @user.courses.where("is_delete = 1")
|
||||
course_ids = courses.empty? ? "(-1)" : "(" + courses.map{|course| course.id}.join(",") + ")"
|
||||
if @order == "course_name"
|
||||
sql = "SELECT homework_commons.* FROM homework_commons INNER JOIN courses ON homework_commons.course_id = courses.id where homework_commons.course_id not in #{course_ids} and homework_commons.user_id = #{@user.id} and homework_type in #{type_ids} and publish_time <= '#{Date.today}' and (homework_commons.name like '%#{search}%') order by CONVERT (courses.name USING gbk) COLLATE gbk_chinese_ci #{@b_sort}"
|
||||
sql = "SELECT homework_commons.* FROM homework_commons INNER JOIN courses ON homework_commons.course_id = courses.id where homework_commons.course_id not in #{course_ids} and homework_commons.user_id = #{@user.id} and homework_type in #{type_ids} and (homework_commons.name like '%#{search}%') order by CONVERT (courses.name USING gbk) COLLATE gbk_chinese_ci #{@b_sort}"
|
||||
@homeworks = HomeworkCommon.find_by_sql(sql)
|
||||
elsif @order == "user_name"
|
||||
@homeworks = HomeworkCommon.where("user_id = #{@user.id} and course_id not in #{course_ids} and publish_time <= '#{Date.today}' and (name like '%#{search}%') and homework_type in #{type_ids}").joins(:user).order("CONVERT (lastname USING gbk) COLLATE gbk_chinese_ci #{@b_sort}, CONVERT (firstname USING gbk) COLLATE gbk_chinese_ci #{@b_sort},login #{@b_sort}")
|
||||
@homeworks = HomeworkCommon.where("user_id = #{@user.id} and course_id not in #{course_ids} and (name like '%#{search}%') and homework_type in #{type_ids}").joins(:user).order("CONVERT (lastname USING gbk) COLLATE gbk_chinese_ci #{@b_sort}, CONVERT (firstname USING gbk) COLLATE gbk_chinese_ci #{@b_sort},login #{@b_sort}")
|
||||
else
|
||||
@homeworks = HomeworkCommon.where("user_id = #{@user.id} and course_id not in #{course_ids} and publish_time <= '#{Date.today}' and (name like '%#{search}%') and homework_type in #{type_ids}").order("#{@order} #{@b_sort}")
|
||||
@homeworks = HomeworkCommon.where("user_id = #{@user.id} and course_id not in #{course_ids} and (name like '%#{search}%') and homework_type in #{type_ids}").order("#{@order} #{@b_sort}")
|
||||
end
|
||||
elsif params[:type] == "2" #题库
|
||||
if params[:is_import].to_i == 1
|
||||
visible_course = Course.where("is_public = 1 && is_delete = 0")
|
||||
elsif params[:is_import].to_i == 0
|
||||
visible_course = Course.where("is_delete = 0")
|
||||
end
|
||||
visible_course = Course.where("is_public = 1 && is_delete = 0")
|
||||
visible_course_ids = visible_course.empty? ? "(-1)" : "(" + visible_course.map{|course| course.id}.join(",") + ")"
|
||||
all_homeworks = HomeworkCommon.where("course_id in #{visible_course_ids} and publish_time <= '#{Date.today}'")
|
||||
all_user_ids = all_homeworks.map{|hw| hw.user_id}
|
||||
|
@ -907,7 +902,7 @@ class UsersController < ApplicationController
|
|||
end
|
||||
=end
|
||||
@type = params[:type]
|
||||
@limit = params[:is_import].to_i == 1 ? 15 : 25
|
||||
@limit = params[:is_import].to_i == 1 ? 15 : 10
|
||||
@is_remote = true
|
||||
@hw_count = @homeworks.count
|
||||
@hw_pages = Paginator.new @hw_count, @limit, params['page'] || 1
|
||||
|
@ -921,6 +916,19 @@ class UsersController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
#检查改作业是否可以选用
|
||||
def check_homework
|
||||
homework = HomeworkCommon.find_by_id params[:homework]
|
||||
student_ids = homework.course.student.empty? ? [] : homework.course.student.map{|student| student.student_id}.join(',')
|
||||
resultObj = {status: 2}
|
||||
if student_ids.include?(User.current.id.to_s)
|
||||
resultObj[:status] = 1
|
||||
else
|
||||
resultObj[:status] = 0
|
||||
end
|
||||
render :json => resultObj
|
||||
end
|
||||
|
||||
#导入作业,确定按钮
|
||||
def user_select_homework
|
||||
homework = HomeworkCommon.find_by_id params[:checkMenu]
|
||||
|
@ -1465,26 +1473,15 @@ class UsersController < ApplicationController
|
|||
#显示更多用户课程
|
||||
def user_courses4show
|
||||
@page = params[:page].to_i + 1
|
||||
@type = params[:type]
|
||||
if @type == 'User'
|
||||
@courses = @user.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(5).offset(@page * 5)
|
||||
@all_count = @user.courses.visible.where("is_delete =?", 0).count
|
||||
elsif @type == 'Syllabus'
|
||||
@syllabus = Syllabus.where("id = #{params[:syllabus]}").first
|
||||
if User.current == @syllabus.user || User.current.admin?
|
||||
all_courses = @syllabus.courses.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")
|
||||
else
|
||||
all_courses = User.current.courses.visible.where("is_delete =? and syllabus_id =?", 0, @syllabus.id).select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS a").order("a desc")
|
||||
end
|
||||
@courses = all_courses.limit(5).offset(@page * 5)
|
||||
@all_count = all_courses.count
|
||||
end
|
||||
@courses = @user.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).offset(@page * 10)
|
||||
@all_count = @user.courses.visible.where("is_delete =?", 0).count
|
||||
end
|
||||
|
||||
#显示更多用户项目
|
||||
def user_projects4show
|
||||
@page = params[:page].to_i + 1
|
||||
@projects = @user.projects.visible.select("projects.*,(SELECT MAX(updated_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS a").order("a desc").limit(5).offset(@page * 5)
|
||||
@projects = @user.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).offset(@page * 10)
|
||||
@all_count = @user.projects.visible.count
|
||||
end
|
||||
|
||||
def user_course_activities
|
||||
|
@ -1550,6 +1547,107 @@ class UsersController < ApplicationController
|
|||
render :action=>'user_course_activities',:layout=>nil
|
||||
end
|
||||
|
||||
#首页-》我的作业
|
||||
def my_homeworks
|
||||
tea_courses = @user.courses.visible.not_deleted.select{|course| @user.has_teacher_role(course)}
|
||||
tea_course_ids = tea_courses.empty? ? "(-1)" : "(" + tea_courses.map{|course| course.id}.join(',') + ")"
|
||||
@manage_homeworks = HomeworkCommon.where("course_id in #{tea_course_ids}").order("created_at desc").limit(5)
|
||||
stu_courses = @user.courses.visible.not_deleted.select{|course| @user.has_student_role(course)}
|
||||
stu_course_ids = stu_courses.empty? ? "(-1)" : "(" + stu_courses.map{|course| course.id}.join(',') + ")"
|
||||
@receive_homeworks = HomeworkCommon.where("course_id in #{stu_course_ids} and publish_time <= '#{Date.today}'").order("created_at desc").limit(5)
|
||||
if (@manage_homeworks.empty? && @receive_homeworks.empty?) || (@receive_homeworks.empty?) || (!@manage_homeworks.empty? && !@receive_homeworks.empty? && @manage_homeworks.first.publish_time > @receive_homeworks.first.publish_time)
|
||||
@manage_pre = true
|
||||
else
|
||||
@manage_pre = false
|
||||
end
|
||||
respond_to do |format|
|
||||
format.js
|
||||
format.html {render :layout => 'static_base'}
|
||||
end
|
||||
end
|
||||
|
||||
#我管理/收到的作业
|
||||
def manage_or_receive_homeworks
|
||||
@order,@b_sort,@type = params[:order] || "created_at",params[:sort] || "desc",params[:type] || 1
|
||||
@r_sort = @b_sort == "desc" ? "asc" : "desc"
|
||||
@type = @type.to_i
|
||||
if @type == 1
|
||||
tea_courses = @user.courses.visible.not_deleted.select{|course| @user.has_teacher_role(course)}
|
||||
tea_course_ids = tea_courses.empty? ? "(-1)" : "(" + tea_courses.map{|course| course.id}.join(',') + ")"
|
||||
@homeworks = HomeworkCommon.where("course_id in #{tea_course_ids}").order("#{@order} #{@b_sort}")
|
||||
else
|
||||
stu_courses = @user.courses.visible.not_deleted.select{|course| @user.has_student_role(course)}
|
||||
stu_course_ids = stu_courses.empty? ? "(-1)" : "(" + stu_courses.map{|course| course.id}.join(',') + ")"
|
||||
@homeworks = HomeworkCommon.where("course_id in #{stu_course_ids} and publish_time <= '#{Date.today}'").order("#{@order} #{@b_sort}")
|
||||
end
|
||||
if params[:property]
|
||||
all_homework_ids = @homeworks.empty? ? "(-1)" : "(" + @homeworks.map{|h| h.id}.join(",") + ")"
|
||||
if params[:property] == "1"
|
||||
@homeworks = HomeworkCommon.find_by_sql("select * from homework_commons where id in #{all_homework_ids} and homework_type = 1")
|
||||
elsif params[:property] == "2"
|
||||
@homeworks = HomeworkCommon.find_by_sql("select * from homework_commons where id in #{all_homework_ids} and homework_type = 2")
|
||||
elsif params[:property] == "3"
|
||||
@homeworks = HomeworkCommon.find_by_sql("select * from homework_commons where id in #{all_homework_ids} and homework_type = 3")
|
||||
end
|
||||
end
|
||||
@limit = 10
|
||||
@is_remote = true
|
||||
@hw_count = @homeworks.count
|
||||
@hw_pages = Paginator.new @hw_count, @limit, params['page'] || 1
|
||||
@offset ||= @hw_pages.offset
|
||||
@homeworks = paginateHelper @homeworks,@limit
|
||||
@search = ""
|
||||
@property = params[:property]
|
||||
respond_to do |format|
|
||||
format.js
|
||||
format.html {render :layout => 'static_base'}
|
||||
end
|
||||
end
|
||||
|
||||
#搜索作业
|
||||
def search_m_r_homeworks
|
||||
@order,@b_sort,@type = params[:order] || "created_at",params[:sort] || "desc",params[:type].to_i || 1
|
||||
@r_sort = @b_sort == "desc" ? "asc" : "desc"
|
||||
search = params[:name].to_s.strip.downcase
|
||||
type_ids = (params[:property]=="" || params[:property].nil? || params[:property]=="0") ? "(1, 2, 3)" : "(" + params[:property] + ")"
|
||||
if @type == 1
|
||||
tea_courses = @user.courses.visible.not_deleted.select{|course| @user.has_teacher_role(course)}
|
||||
tea_course_ids = tea_courses.empty? ? "(-1)" : "(" + tea_courses.map{|course| course.id}.join(',') + ")"
|
||||
#user_ids = hw_publisher_user_ids search, tea_course_ids
|
||||
@homeworks = HomeworkCommon.where("course_id in #{tea_course_ids} and homework_type in #{type_ids} and name like '%#{search}%'").order("#{@order} #{@b_sort}")
|
||||
else
|
||||
stu_courses = @user.courses.visible.not_deleted.select{|course| @user.has_student_role(course)}
|
||||
stu_course_ids = stu_courses.empty? ? "(-1)" : "(" + stu_courses.map{|course| course.id}.join(',') + ")"
|
||||
#user_ids = hw_publisher_user_ids search, stu_course_ids
|
||||
@homeworks = HomeworkCommon.where("course_id in #{stu_course_ids} and homework_type in #{type_ids} and publish_time <= '#{Date.today}' and name like '%#{search}%'")
|
||||
if @order == "status"
|
||||
@homeworks.each do |homework|
|
||||
work = cur_user_works_for_homework homework
|
||||
if work.blank?
|
||||
homework[:infocount] = 0
|
||||
else
|
||||
homework[:infocount] = 1
|
||||
end
|
||||
end
|
||||
@b_sort == "asc" ? (@homeworks = @homeworks.sort{|x,y| x[:infocount] <=> y[:infocount] }) : (@homeworks = @homeworks.sort{|x,y| y[:infocount] <=> x[:infocount]})
|
||||
@homeworks = sortby_time_countcommon_nosticky @homeworks,"created_at"
|
||||
else
|
||||
@homeworks = @homeworks.order("#{@order} #{@b_sort}")
|
||||
end
|
||||
end
|
||||
@limit = 10
|
||||
@is_remote = true
|
||||
@hw_count = @homeworks.count
|
||||
@hw_pages = Paginator.new @hw_count, @limit, params['page'] || 1
|
||||
@offset ||= @hw_pages.offset
|
||||
@homeworks = paginateHelper @homeworks,@limit
|
||||
@search = search
|
||||
@property = params[:property]
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
def user_feedback4show
|
||||
query = @user.journals_for_messages
|
||||
if params[:lastid]!=nil && !params[:lastid].empty?
|
||||
|
@ -3268,6 +3366,7 @@ class UsersController < ApplicationController
|
|||
@join_syllabuses = syllabus_course_list_sort @join_syllabuses
|
||||
@my_syllabuses = @my_syllabuses.sort{|x,y| y[:last_update] <=> x[:last_update]}
|
||||
@join_syllabuses = @join_syllabuses.sort{|x,y| y[:last_update] <=> x[:last_update]}
|
||||
@is_course = 1
|
||||
|
||||
#分页
|
||||
# @limit = 10
|
||||
|
@ -3377,6 +3476,7 @@ class UsersController < ApplicationController
|
|||
@atta_pages = Paginator.new @atta_count, @limit, params['page'] || 1
|
||||
@offset ||= @atta_pages.offset
|
||||
@projects = paginateHelper @projects,@limit
|
||||
@is_project = 1
|
||||
|
||||
respond_to do |format|
|
||||
format.js
|
||||
|
|
|
@ -284,7 +284,7 @@ class WechatsController < ActionController::Base
|
|||
end
|
||||
|
||||
news = (1..1).each_with_object([]) { |n, memo| memo << { title: '恭喜您成功加入班级,开始学习吧!',
|
||||
content: "课程名称:#{course.syllabus.name}\n班级名称:#{course.name}\n任课老师:#{course.teacher.show_name}\n进入班级,和小伙伴愉快的学习吧!"} }
|
||||
content: "课程名称:#{course.syllabus.title}\n班级名称:#{course.name}\n任课老师:#{course.teacher.show_name}\n进入班级,和小伙伴愉快的学习吧!"} }
|
||||
return request.reply.news(news) do |article, n, index| # article is return object
|
||||
url = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=#{Wechat.config.appid}&redirect_uri=#{ROOT_URL+'/wechat/user_activities#/class?id='+course.id.to_s}&response_type=code&scope=snsapi_base&state=myclass#wechat_redirect"
|
||||
pic_url = "#{ROOT_URL}/images/wechat/class.jpg"
|
||||
|
@ -314,7 +314,7 @@ class WechatsController < ActionController::Base
|
|||
creator = User.find(project.user_id)
|
||||
|
||||
news = (1..1).each_with_object([]) { |n, memo| memo << { title: '恭喜您成功加入项目,开始研发吧!',
|
||||
content: "项目名称:#{project.name}\n发起人:#{creator.name}\n进入项目,和小伙伴轻松的研发吧!"} }
|
||||
content: "项目名称:#{project.name}\n发起人:#{creator.show_name}\n进入项目,和小伙伴轻松的研发吧!"} }
|
||||
return request.reply.news(news) do |article, n, index| # article is return object
|
||||
url = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=#{Wechat.config.appid}&redirect_uri=#{ROOT_URL+'/wechat/user_activities#/project?id='+project.id.to_s}&response_type=code&scope=snsapi_base&state=myproject#wechat_redirect"
|
||||
pic_url = "#{ROOT_URL}/images/wechat/project.jpg"
|
||||
|
@ -338,7 +338,7 @@ class WechatsController < ActionController::Base
|
|||
raise "请在微信中关注Trustie创新实践平台后再打开本页面" unless openid
|
||||
|
||||
uw = UserWechat.where(openid: openid).first
|
||||
raise "还未绑定trustie帐户" unless uw
|
||||
raise "还未绑定trustie帐户" unless (uw && uw.bindtype == 0)
|
||||
logger.debug "get_bind ============= #{uw}"
|
||||
|
||||
user = uw.user
|
||||
|
@ -424,7 +424,14 @@ class WechatsController < ActionController::Base
|
|||
|
||||
session[:wechat_openid] = open_id
|
||||
if params[:code]
|
||||
redirect_to "/wechat/user_activities##{@path}?id=#{params[:id]}" and return
|
||||
if params[:userid]
|
||||
redirect_to "/wechat/user_activities##{@path}?id=#{params[:id]}&userid=#{params[:userid]}" and return
|
||||
elsif params[:id]
|
||||
redirect_to "/wechat/user_activities##{@path}?id=#{params[:id]}" and return
|
||||
else
|
||||
redirect_to "/wechat/user_activities##{@path}" and return
|
||||
end
|
||||
# redirect_to "/wechat/user_activities##{@path}?id=#{params[:id]}" and return
|
||||
end
|
||||
# end
|
||||
render 'wechats/user_activities', layout: nil
|
||||
|
@ -435,10 +442,15 @@ class WechatsController < ActionController::Base
|
|||
def get_openid_from_code(code)
|
||||
return 'oCnvgvz8R7QheXE-R9Kkr39j8Ndg' if code =='only-for-test'
|
||||
openid = session[:wechat_openid]
|
||||
|
||||
unless openid
|
||||
if code
|
||||
openid = wechat.web_access_token(code)["openid"]
|
||||
#不能联系调两次web_access_token 否则会提示请在微信客户端打开次链接
|
||||
info = wechat.web_access_token(code)
|
||||
openid =info["openid"]
|
||||
access_token =info["access_token"]
|
||||
if access_token
|
||||
session[:access_token] = access_token
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -451,6 +463,7 @@ class WechatsController < ActionController::Base
|
|||
|
||||
def user_binded?(openid)
|
||||
uw = UserWechat.where(openid: openid).first
|
||||
uw && uw.bindtype == 0
|
||||
end
|
||||
|
||||
def current_url
|
||||
|
|
|
@ -43,6 +43,12 @@ module ApplicationHelper
|
|||
user.nil? ? User.find(2) : user
|
||||
end
|
||||
|
||||
# 通过系统外部用户名查找用户,如果用户不存在则用邮箱替换
|
||||
def get_user_by_login_and login
|
||||
user = User.find_by_login(login)
|
||||
user.nil? ? User.find(2) : user
|
||||
end
|
||||
|
||||
# 历史数据(老版本库数据)处理完则可以修改该放放
|
||||
def get_rep_identifier_by_project project
|
||||
identifier = Repository.where(:project_id => project.id, :type => "Repository::Gitlab").first.try(:identifier)
|
||||
|
@ -814,6 +820,18 @@ module ApplicationHelper
|
|||
return @result
|
||||
end
|
||||
|
||||
# 必须是项目成,项目必须提交过代码
|
||||
def allow_pull_request project
|
||||
return false if project.gpid.nil?
|
||||
g = Gitlab.client
|
||||
count = g.user_static(project.gpid, :rev => "master").count
|
||||
if User.current.member_of?(project) && count > 0
|
||||
true
|
||||
else
|
||||
false
|
||||
end
|
||||
end
|
||||
|
||||
# 判断版本库是否初始为gitlab
|
||||
def rep_is_gitlab?(project)
|
||||
rep = project.repositories.where("type =?", "Repository::Gitlab")
|
||||
|
@ -2736,7 +2754,39 @@ module ApplicationHelper
|
|||
else
|
||||
link_to "作品(#{count})",student_work_index_url_in_org(homework.id),:class => "c_blue"
|
||||
end
|
||||
end
|
||||
|
||||
#根据传入作业确定显示为提交作品、补交作品、查看作品等
|
||||
def student_for_homework_common homework
|
||||
if User.current.member_of_course?(homework.course)
|
||||
work = cur_user_works_for_homework homework
|
||||
project = cur_user_projects_for_homework homework
|
||||
if work.nil? && Time.parse(homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d")
|
||||
if homework.homework_type ==3 && project.nil? && homework.homework_detail_group.base_on_project == 1
|
||||
link_to "查看详情", homework_common_index_path(:course_id => homework.course_id), :class => 'hw_btn_green2 fr mt5',:title => '查看分组作业详情', :target => '_blank'
|
||||
else
|
||||
link_to "提交作品", new_student_work_url_without_domain(homework.id),:class => 'hw_btn_green2 fr mt5', :target => '_blank'
|
||||
end
|
||||
elsif work.nil? && Time.parse(homework.end_time.to_s).strftime("%Y-%m-%d") < Time.now.strftime("%Y-%m-%d")
|
||||
if homework.homework_type ==3 && project.nil? && homework.homework_detail_group.base_on_project == 1
|
||||
link_to "查看详情", homework_common_index_path(:course_id => homework.course_id), :class => 'hw_btn_green2 fr mt5',:title => '查看分组作业详情', :target => '_blank'
|
||||
else
|
||||
link_to "补交作品", new_student_work_url_without_domain(homework.id),:class => 'btn_orange_big fr mt5', :target => '_blank'
|
||||
end
|
||||
else
|
||||
if homework.homework_detail_manual && homework.homework_detail_manual.comment_status == 2 #匿评作业,且作业状态不是在开启匿评之前
|
||||
link_to "作品匿评", student_work_index_url_in_org(homework.id), :class => 'hw_btn_green2 fr mt5', :title => "开启匿评后不可修改作品", :target => '_blank'
|
||||
elsif homework.homework_detail_manual && homework.homework_detail_manual.comment_status == 3
|
||||
link_to "查看作品",student_work_index_url_in_org(homework.id), :class => 'hw_btn_green2 fr mt5', :title => "匿评已结束", :target => '_blank'
|
||||
elsif homework.homework_type == 2 && Time.parse(homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d")#编程作业不能修改作品
|
||||
link_to "修改作品", new_student_work_url_without_domain(homework.id),:class => 'hw_btn_green2 fr mt5', :target => '_blank'
|
||||
elsif Time.parse(homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d") && work.user_id == User.current.id
|
||||
link_to "修改作品", edit_student_work_url_without_domain(work.id),:class => 'hw_btn_green2 fr mt5', :target => '_blank'
|
||||
else
|
||||
link_to "查看作品", student_work_index_url_in_org(homework.id), :class => 'hw_btn_green2 fr mt5', :title => "作业截止后不可修改作品", :target => '_blank'
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def relate_project homework,is_teacher,is_in_course,user_activity_id,course_activity
|
||||
|
@ -2788,6 +2838,17 @@ module ApplicationHelper
|
|||
homework.student_work_projects.where("user_id = ?",User.current).first
|
||||
end
|
||||
|
||||
#获取当前作业的提交截止时间/互评截止时间
|
||||
def cur_homework_end_time homework
|
||||
str = ""
|
||||
if homework.anonymous_comment == 0 && homework.end_time < Date.today && homework.homework_detail_manual
|
||||
str = "互评截止:#{format_date homework.homework_detail_manual.evaluation_end}"
|
||||
else
|
||||
str = "提交截止:#{homework.end_time ? (format_date homework.end_time) : ' -- '}"
|
||||
end
|
||||
str
|
||||
end
|
||||
|
||||
def file_preview_tag(file, html_options={})
|
||||
if %w(pdf pptx doc docx xls xlsx).any?{|x| file.filename.downcase.end_with?(x)}
|
||||
link_to '预览', download_named_attachment_path(file.id, file.filename, preview: true),html_options
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
module PullRequestsHelper
|
||||
|
||||
# 获取diff内容行号
|
||||
def diff_line_num content
|
||||
content.scan(/@@ -(\d+),\d+ \+\d+,\d+ @@/).first.nil? ? "" : content.scan(/@@ -(\d+),\d+ \+\d+,\d+ @@/).first.join("").to_i
|
||||
end
|
||||
|
||||
# 处理内容
|
||||
def diff_content content
|
||||
content.gsub!(/.*@@ -\d+,\d+ \+\d+,\d+ @@\n/m,'')
|
||||
end
|
||||
|
||||
def get_user_name user_id
|
||||
User.find(user_id).try(:login)
|
||||
end
|
||||
|
||||
end
|
|
@ -105,6 +105,22 @@ module UsersHelper
|
|||
end
|
||||
end
|
||||
|
||||
# 单位申请消息:通过用户的状态判断
|
||||
# status(0:申请消息;1,2,3:系统消息)
|
||||
def applied_school_users applied_message
|
||||
user = User.find(applied_message.applied_user_id)
|
||||
end
|
||||
|
||||
# 单位申请消息通过状态判断tip描述
|
||||
def applied_school_tip applied_message
|
||||
case applied_message.status
|
||||
when 1,2,3
|
||||
"您添加新的单位:"
|
||||
when 0
|
||||
"申请了单位:"
|
||||
end
|
||||
end
|
||||
|
||||
def applied_project_tip_header applied_message
|
||||
case applied_message.status
|
||||
when 4
|
||||
|
@ -117,6 +133,7 @@ module UsersHelper
|
|||
end
|
||||
|
||||
|
||||
|
||||
def get_resource_origin attach
|
||||
type = attach.container_type
|
||||
content = attach.container
|
||||
|
@ -767,4 +784,17 @@ module UsersHelper
|
|||
end
|
||||
syllabuses
|
||||
end
|
||||
|
||||
#获取按作业的发布者排序的用户ID
|
||||
def hw_publisher_user_ids search, course_ids
|
||||
if search && search != ""
|
||||
all_homeworks = HomeworkCommon.where("course_id in #{course_ids}")
|
||||
all_user_ids = all_homeworks.map{|hw| hw.user_id}
|
||||
user_str_ids = search_user_by_name all_user_ids, search
|
||||
user_ids = user_str_ids.empty? ? "(-1)" : "(" + user_str_ids.join(",") + ")"
|
||||
else
|
||||
user_ids = "(-1)"
|
||||
end
|
||||
return user_ids
|
||||
end
|
||||
end
|
||||
|
|
|
@ -34,6 +34,20 @@ class HomeworkCommon < ActiveRecord::Base
|
|||
after_save :act_as_course_activity
|
||||
after_destroy :delete_kindeditor_assets
|
||||
|
||||
#作业类型
|
||||
def homework_type_ch
|
||||
type = self.homework_type
|
||||
case type
|
||||
when 1
|
||||
type = "普通"
|
||||
when 2
|
||||
type = "编程"
|
||||
when 3
|
||||
type = "分组"
|
||||
end
|
||||
type
|
||||
end
|
||||
|
||||
def act_as_activity
|
||||
self.acts << Activity.new(:user_id => self.user_id)
|
||||
end
|
||||
|
|
|
@ -173,7 +173,7 @@ class News < ActiveRecord::Base
|
|||
count = ShieldWechatMessage.where("container_type='User' and container_id=#{m.user_id} and shield_type='Course' and shield_id=#{self.course_id}").count
|
||||
if count == 0
|
||||
ws = WechatService.new
|
||||
content = self.title.html_safe, 200
|
||||
content = self.title
|
||||
ws.class_notice m.user_id, "course_notice", self.id, "#{l(:label_new_notice_template)}", self.course.name, self.author.show_name, format_time(self.created_on), content, "点击查看通知详情"
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1236,8 +1236,7 @@ class Project < ActiveRecord::Base
|
|||
# 创建项目后在项目下同步创建一个讨论区
|
||||
def create_board_sync
|
||||
@board = self.boards.build
|
||||
self.name=" #{l(:label_borad_project) }"
|
||||
@board.name = self.name
|
||||
@board.name = " #{l(:label_borad_project) }"
|
||||
@board.description = self.name.to_s
|
||||
if @board.save
|
||||
logger.debug "[Project Model] ===> #{@board.to_json}"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#学生提交作品表
|
||||
class StudentWork < ActiveRecord::Base
|
||||
attr_accessible :name, :description, :homework_common_id, :user_id, :final_score, :teacher_score, :student_score, :teaching_asistant_score, :project_id, :is_test, :simi_id, :simi_value
|
||||
attr_accessible :name, :description, :homework_common_id, :user_id, :final_score, :teacher_score, :student_score, :teaching_asistant_score, :project_id, :is_test, :simi_id, :simi_value, :work_status
|
||||
|
||||
belongs_to :homework_common
|
||||
belongs_to :user
|
||||
|
|
|
@ -926,6 +926,13 @@ class User < Principal
|
|||
!role.blank?
|
||||
end
|
||||
|
||||
#是否具有学生角色
|
||||
def has_student_role(course)
|
||||
member = course.members.where("user_id = #{self.id}").first
|
||||
role = MemberRole.where("member_id = #{member.id} and role_id = 10")
|
||||
!role.blank?
|
||||
end
|
||||
|
||||
# Return true if the user is allowed to do the specified action on a specific context
|
||||
# Action can be:
|
||||
# * a parameter-like Hash (eg. :controller => 'projects', :action => 'edit')
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
class UserWechat < ActiveRecord::Base
|
||||
attr_accessible :subscribe, :openid, :nickname, :sex, :language, :city, :province, :country,
|
||||
:headimgurl, :subscribe_time, :unionid, :remark, :groupid, :user, :user_id
|
||||
:headimgurl, :subscribe_time, :unionid, :remark, :groupid, :user, :user_id, :bindtype
|
||||
|
||||
belongs_to :user
|
||||
end
|
||||
|
|
|
@ -357,6 +357,7 @@ class CoursesService
|
|||
#@course.password = params[:course][:password]
|
||||
@course.tea_id = current_user.id
|
||||
@course.syllabus_id = params[:syllabus_id].to_i
|
||||
Rails.logger.error "update_syllabus_id: courses_service/create_course"
|
||||
@course.term = params[:term]
|
||||
@course.time = params[:time]
|
||||
@course.end_term = params[:end_term]
|
||||
|
@ -416,6 +417,7 @@ class CoursesService
|
|||
#course.safe_attributes = params[:course]
|
||||
#course.password = params[:course][:password]
|
||||
course.syllabus_id = params[:syllabus_id].to_i
|
||||
Rails.logger.error "update_syllabus_id: courses_service/edit_course"
|
||||
course.time = params[:time]
|
||||
course.term = params[:term]
|
||||
course.end_time = params[:end_time]
|
||||
|
@ -537,29 +539,25 @@ class CoursesService
|
|||
count = ShieldWechatMessage.where("container_type='User' and container_id=#{user.id} and shield_type='Course' and shield_id=#{course.id}").count
|
||||
if count == 0
|
||||
ws = WechatService.new
|
||||
if role_id == 10 && result == 0
|
||||
|
||||
role_name = role_id == 7 ? "助教" : role_id == 9 ? "教师" : "学生"
|
||||
result_name = result == 0 ? "通过" : "被拒绝"
|
||||
content = "您以"+role_name+"身份加入班级的申请已"+result_name+"。"
|
||||
|
||||
if result == 0
|
||||
title = "恭喜您加入班级成功。"
|
||||
ws.join_class_notice user.id, "class", course.id,title, course.syllabus.name,course.name,course.teacher.show_name, "点击查看班级详情。"
|
||||
remark = "点击查看班级详情。"
|
||||
uid = 0
|
||||
type = "class"
|
||||
else
|
||||
|
||||
role_name = role_id == 7 ? "助教" : "教师"
|
||||
result_name = result == 0 ? "通过" : "被拒绝"
|
||||
content = "您以"+role_name+"身份加入班级的申请已"+result_name+"。"
|
||||
|
||||
if result == 0
|
||||
title = "恭喜您加入班级成功。"
|
||||
remark = "点击查看班级详情。"
|
||||
uid = 0
|
||||
type = "class"
|
||||
else
|
||||
title = "很遗憾您未能成功加入班级。"
|
||||
remark = "点击查看申请详情。"
|
||||
uid = user.id
|
||||
type = "review_class_member"
|
||||
end
|
||||
ws = WechatService.new
|
||||
ws.class_notice user.id, type, course.id, title, course.name, user.show_name, format_time(Time.now), content, remark,uid
|
||||
title = "很遗憾您未能成功加入班级。"
|
||||
remark = "点击查看申请详情。"
|
||||
uid = user.id
|
||||
type = "review_class_member"
|
||||
end
|
||||
ws = WechatService.new
|
||||
ws.class_notice user.id, type, course.id, title, course.name, user.show_name, format_time(Time.now), content, remark,uid
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -149,6 +149,10 @@ class ProjectsService
|
|||
if current_user.member_of?(project) #如果已经是成员
|
||||
member = project.member_principals.includes(:roles, :principal).where("user_id=?",current_user.id).first
|
||||
status = member.member_roles[0].role_id
|
||||
|
||||
#将之前的申请都改为已拒绝
|
||||
applied_messages = AppliedMessage.where(:project_id => project.id, :status => true, :applied_user_id=>current_user.id,:applied_type => "AppliedProject")
|
||||
applied_messages.update_all(:status=>5)
|
||||
else
|
||||
if params[:invite_code].present?
|
||||
|
||||
|
@ -168,6 +172,10 @@ class ProjectsService
|
|||
|
||||
status = 0
|
||||
send_wechat_join_project_notice current_user,project,5,0
|
||||
|
||||
#将之前的申请都改为已拒绝
|
||||
applied_messages = AppliedMessage.where(:project_id => project.id, :status => true, :applied_user_id=>current_user.id,:applied_type => "AppliedProject")
|
||||
applied_messages.update_all(:status=>5)
|
||||
else
|
||||
if !AppliedProject.where(:project_id => project.id, :user_id => current_user.id).first.nil?
|
||||
status = 8
|
||||
|
|
|
@ -86,12 +86,14 @@ class SyllabusesService
|
|||
courses.each do |course|
|
||||
if ::Course === course
|
||||
course.syllabus_id = sy.id
|
||||
Rails.logger.error "update_syllabus_id: syllabus_service/create"
|
||||
course.save!
|
||||
send_wechat_create_class_notice user,course
|
||||
elsif Hash === course
|
||||
c = ::Course.new(course)
|
||||
c.tea_id = user.id
|
||||
c.syllabus_id = sy.id
|
||||
Rails.logger.error "update_syllabus_id: syllabus_service/create"
|
||||
c.update_default_value
|
||||
c.is_public = 0
|
||||
c.save!
|
||||
|
@ -136,6 +138,7 @@ class SyllabusesService
|
|||
course.name = c
|
||||
course.tea_id = user.id
|
||||
course.syllabus_id = sy.id
|
||||
Rails.logger.error "update_syllabus_id: syllabus_service/edit"
|
||||
course.update_default_value
|
||||
course.is_public = 0
|
||||
course.save!
|
||||
|
|
|
@ -112,9 +112,11 @@ class WechatService
|
|||
end
|
||||
|
||||
def two_keys_template(openid, template_id, type, id, first, key1, key2, remark="",uid)
|
||||
tmpurl = "#{Setting.protocol}://#{Setting.host_name}/wechat/user_activities#/#{type}/#{id}"
|
||||
# tmpurl = "#{Setting.protocol}://#{Setting.host_name}/wechat/user_activities#/#{type}?id=#{id}"
|
||||
tmpurl = Wechat.config.auto_openid_url_1+"?id="+id.to_s+Wechat.config.auto_openid_url_2+type+Wechat.config.auto_openid_url_3
|
||||
if uid && uid != 0
|
||||
tmpurl = "#{Setting.protocol}://#{Setting.host_name}/wechat/user_activities#/#{type}?id=#{id}"+ "&user_id="+uid.to_s
|
||||
# tmpurl = "#{Setting.protocol}://#{Setting.host_name}/wechat/user_activities#/#{type}?id=#{id}"+ "&user_id="+uid.to_s
|
||||
tmpurl = Wechat.config.auto_openid_url_1+"?id="+id.to_s+ "&user_id="+uid.to_s+Wechat.config.auto_openid_url_2+type+Wechat.config.auto_openid_url_3
|
||||
end
|
||||
data = {
|
||||
touser:openid,
|
||||
|
@ -144,9 +146,11 @@ class WechatService
|
|||
end
|
||||
|
||||
def three_keys_template(openid, template_id, type, id, first, key1, key2, key3, remark="",uid)
|
||||
tmpurl = "#{Setting.protocol}://#{Setting.host_name}/wechat/user_activities#/#{type}/#{id}"
|
||||
# tmpurl = "#{Setting.protocol}://#{Setting.host_name}/wechat/user_activities#/#{type}?id=#{id}"
|
||||
tmpurl = Wechat.config.auto_openid_url_1+"?id="+id.to_s+Wechat.config.auto_openid_url_2+type+Wechat.config.auto_openid_url_3
|
||||
if uid && uid != 0
|
||||
tmpurl = "#{Setting.protocol}://#{Setting.host_name}/wechat/user_activities#/#{type}?id=#{id}"+ "&user_id="+uid.to_s
|
||||
# tmpurl = "#{Setting.protocol}://#{Setting.host_name}/wechat/user_activities#/#{type}?id=#{id}"+ "&user_id="+uid.to_s
|
||||
tmpurl = Wechat.config.auto_openid_url_1+"?id="+id.to_s+ "&user_id="+uid.to_s+Wechat.config.auto_openid_url_2+type+Wechat.config.auto_openid_url_3
|
||||
end
|
||||
|
||||
data = {
|
||||
|
@ -181,9 +185,11 @@ class WechatService
|
|||
end
|
||||
|
||||
def four_keys_template(openid, template_id, type, id, first, key1, key2, key3, key4, remark="",uid)
|
||||
tmpurl = "#{Setting.protocol}://#{Setting.host_name}/wechat/user_activities#/#{type}/#{id}"
|
||||
# tmpurl = "#{Setting.protocol}://#{Setting.host_name}/wechat/user_activities#/#{type}?id=#{id}"
|
||||
tmpurl = Wechat.config.auto_openid_url_1+"?id="+id.to_s+Wechat.config.auto_openid_url_2+type+Wechat.config.auto_openid_url_3
|
||||
if uid && uid != 0
|
||||
tmpurl = "#{Setting.protocol}://#{Setting.host_name}/wechat/user_activities#/#{type}?id=#{id}"+ "&user_id="+uid.to_s
|
||||
# tmpurl = "#{Setting.protocol}://#{Setting.host_name}/wechat/user_activities#/#{type}?id=#{id}"+ "&user_id="+uid.to_s
|
||||
tmpurl = Wechat.config.auto_openid_url_1+"?id="+id.to_s+ "&user_id="+uid.to_s+Wechat.config.auto_openid_url_2+type+Wechat.config.auto_openid_url_3
|
||||
end
|
||||
|
||||
data = {
|
||||
|
@ -227,7 +233,7 @@ class WechatService
|
|||
data = {
|
||||
touser:uw.openid,
|
||||
template_id:Wechat.config.binding_succ_notice,
|
||||
url:"#{Setting.protocol}://#{Setting.host_name}/wechat/user_activities",
|
||||
url:Wechat.config.auto_openid_url_1+Wechat.config.auto_openid_url_2+"activites"+Wechat.config.auto_openid_url_3,
|
||||
topcolor:"#FF0000",
|
||||
data:{
|
||||
first: {
|
||||
|
@ -296,18 +302,18 @@ class WechatService
|
|||
end
|
||||
end
|
||||
|
||||
def join_class_notice(user_id, type, id, first, key1, key2, key3,remark="")
|
||||
uw = UserWechat.where(user_id: user_id).first
|
||||
unless uw.nil?
|
||||
data = three_keys_template uw.openid,Wechat.config.join_class_notice, type, id, first, key1, key2, key3, remark
|
||||
begin
|
||||
req = Wechat.api.template_message_send Wechat::Message.to(uw.openid).template(data)
|
||||
rescue Exception => e
|
||||
Rails.logger.error "[join_class__notice] ===> #{e}"
|
||||
end
|
||||
Rails.logger.info "send over. #{req}"
|
||||
end
|
||||
end
|
||||
# def join_class_notice(user_id, type, id, first, key1, key2, key3,remark="")
|
||||
# uw = UserWechat.where(user_id: user_id).first
|
||||
# unless uw.nil?
|
||||
# data = three_keys_template uw.openid,Wechat.config.join_class_notice, type, id, first, key1, key2, key3, remark
|
||||
# begin
|
||||
# req = Wechat.api.template_message_send Wechat::Message.to(uw.openid).template(data)
|
||||
# rescue Exception => e
|
||||
# Rails.logger.error "[join_class__notice] ===> #{e}"
|
||||
# end
|
||||
# Rails.logger.info "send over. #{req}"
|
||||
# end
|
||||
# end
|
||||
|
||||
def create_class_notice(user_id, type, id, first, key1, key2, key3, remark="")
|
||||
uw = UserWechat.where(user_id: user_id).first
|
||||
|
@ -315,7 +321,7 @@ class WechatService
|
|||
data = {
|
||||
touser:uw.openid,
|
||||
template_id:Wechat.config.create_class_notice,
|
||||
url:"#{Setting.protocol}://#{Setting.host_name}/wechat/user_activities#/class?id="+id.to_s,
|
||||
url:Wechat.config.auto_openid_url_1+"?id="+id.to_s+Wechat.config.auto_openid_url_2+"class"+Wechat.config.auto_openid_url_3,
|
||||
topcolor:"#FF0000",
|
||||
data:{
|
||||
first: {
|
||||
|
@ -356,7 +362,7 @@ class WechatService
|
|||
data = {
|
||||
touser:uw.openid,
|
||||
template_id:Wechat.config.create_project_notice,
|
||||
url:"#{Setting.protocol}://#{Setting.host_name}/wechat/user_activities#/project?id="+id.to_s,
|
||||
url:Wechat.config.auto_openid_url_1+"?id="+id.to_s+Wechat.config.auto_openid_url_2+"project"+Wechat.config.auto_openid_url_3,
|
||||
topcolor:"#FF0000",
|
||||
data:{
|
||||
first: {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<div>
|
||||
<%#= hidden_field_tag(:send_id, edit_id) %>
|
||||
<div class="courseReferContainer">
|
||||
<% if !schools.empty? %>
|
||||
<% if !schools.empty? && !@search.nil? %>
|
||||
<% schools.each do |school| %>
|
||||
<ul class="courseSend">
|
||||
<li class="" style="display:inline-block">
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
<% if params[:search].nil? %>
|
||||
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'admin/all_schools', :locals => {:schools => @schools, :edit_id => @edit_id}) %>');
|
||||
showModal('ajax-modal', '452px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal();' style='margin-left: 435px;' class='resourceClose'></a>");
|
||||
$('#ajax-modal').parent().css("top","50%").css("left","50%");
|
||||
$('#ajax-modal').parent().addClass("popbox").addClass("resourceUploadPopup");
|
||||
$('#ajax-modal').css("padding-left","16px").css("padding-bottom","16px");
|
||||
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'admin/all_schools', :locals => {:schools => @schools, :edit_id => @edit_id}) %>');
|
||||
showModal('ajax-modal', '452px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal();' style='margin-left: 435px;' class='resourceClose'></a>");
|
||||
$('#ajax-modal').parent().css("top","50%").css("left","50%");
|
||||
$('#ajax-modal').parent().addClass("popbox").addClass("resourceUploadPopup");
|
||||
$('#ajax-modal').css("padding-left","16px").css("padding-bottom","16px");
|
||||
<% else %>
|
||||
$("#schools_list").html("<%= escape_javascript(render :partial => 'admin/update_school_form', :locals => {:schools => @schools, :edit_id => @edit_id}) %>");
|
||||
$("#schools_list").html("<%= escape_javascript(render :partial => 'admin/update_school_form', :locals => {:schools => @schools, :edit_id => @edit_id}) %>");
|
||||
<% end %>
|
|
@ -11,7 +11,7 @@
|
|||
</label>
|
||||
<%= text_field_tag 'name', params[:name], :size => 30, :placeholder => '输入单位名称进行搜索' %>
|
||||
<%= submit_tag l(:button_apply ), :class => "small", :name => nil %>
|
||||
<%= link_to l(:button_clear), {:controller => 'admin', :action => 'applied_shcools'}, :class => 'icon icon-reload' %>
|
||||
<%= link_to l(:button_clear), {:controller => 'admin', :action => 'applied_schools'}, :class => 'icon icon-reload' %>
|
||||
</fieldset>
|
||||
<% end %>
|
||||
|
||||
|
@ -60,7 +60,7 @@
|
|||
<td class="center">
|
||||
<% user = User.where("id=?", apply.user_id).first %>
|
||||
<% unless user.nil? %>
|
||||
<%=link_to user.show_name, user_path(user),:target => '_blank' %>
|
||||
<%=link_to user.show_name, user_path(user),:target => '_blank', :class => "application-default-link" %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td class="center">
|
||||
|
@ -132,7 +132,7 @@
|
|||
<td>
|
||||
|
||||
</td>
|
||||
<td style="text-align: left;" colspan="6">
|
||||
<td style="text-align: left;" colspan="7">
|
||||
<%= apply.remarks %>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
</label>
|
||||
<%= text_field_tag 'name', params[:name], :size => 30, :placeholder => '输入单位名称进行搜索' %>
|
||||
<%= submit_tag l(:button_apply ), :class => "small", :name => nil %>
|
||||
<%= link_to l(:button_clear), {:controller => 'admin', :action => 'applied_shcools'}, :class => 'icon icon-reload' %>
|
||||
<%= link_to l(:button_clear), {:controller => 'admin', :action => 'has_applied_schools'}, :class => 'icon icon-reload' %>
|
||||
</fieldset>
|
||||
<% end %>
|
||||
|
||||
|
@ -20,7 +20,7 @@
|
|||
<table class="list" style="width: 100%;table-layout: fixed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 20px;">
|
||||
<th style="width: 25px;">
|
||||
序号
|
||||
</th>
|
||||
<th style="width: 80px;">
|
||||
|
|
|
@ -17,10 +17,16 @@
|
|||
<p>您的申请已提交,请等待项目管理员审批</p>
|
||||
<% elsif @flag == 5 %>
|
||||
<p>您已经申请加入该项目了,请耐心等待</p>
|
||||
<% elsif @flag == 6 %>
|
||||
<p>您已成功加入项目</p>
|
||||
<% end %>
|
||||
</li>
|
||||
<li>
|
||||
<% if @flag == 6 %>
|
||||
<%= link_to "知道了", project_path(@project), :class => "sy_btn_blue" %>
|
||||
<% else %>
|
||||
<a href="javascript:void(0);" class="sy_btn_blue " onclick="hideModal()">知道了</a>
|
||||
<% end %>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
var htmlvalue = "<%= escape_javascript(render :partial => 'applied_join_project', locals: {:project_id => (@project.nil? ? nil : @project.id)}) %>";
|
||||
pop_box_new(htmlvalue,460,40,50);
|
||||
pop_box_new(htmlvalue,460,190);
|
||||
|
||||
|
|
|
@ -2,4 +2,4 @@
|
|||
$("#join_in_project_applied").html('<%= escape_javascript( render :partial => 'projects/applied_status') %>');
|
||||
<% end %>
|
||||
var htmlvalue = "<%= escape_javascript(render :partial => 'applied_project/applied_project_tip') %>";
|
||||
pop_box_new(htmlvalue,380,40,50);
|
||||
pop_box_new(htmlvalue,380,166);
|
||||
|
|
|
@ -3,9 +3,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 => 'sy_cblack' %>
|
||||
<%= link_to "班级活跃度", course_member_path(course, :role => 2, :sort_type => 'act_score'), :class => 'fontGrey3' %>
|
||||
<% else %>
|
||||
班级活跃度
|
||||
<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>
|
||||
|
|
|
@ -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 => 'sy_cblack' %>
|
||||
<%= link_to "班级英雄榜", course_member_path(course, :role => 2), :class => 'fontGrey3' %>
|
||||
<% else %>
|
||||
<span>班级英雄榜</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">
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
var htmlvalue = "<%= escape_javascript(render :partial => 'join_private_course') %>";
|
||||
pop_box_new(htmlvalue,460,40,50);
|
||||
pop_box_new(htmlvalue,460,220);
|
||||
|
|
|
@ -2,5 +2,5 @@ $('#ajax-modal').html('<%= escape_javascript(render :partial => 'files/upload_su
|
|||
showModal('ajax-modal', '513px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal();' style='margin-left: 480px;'><img src='/images/bid/close.png' width='26px' height='26px' /></a>");
|
||||
$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9");
|
||||
$('#ajax-modal').parent().css("top","30%").css("left","40%").css("border","3px solid #269ac9");
|
||||
$('#ajax-modal').parent().addClass("popbox_polls");
|
|
@ -1,5 +1,5 @@
|
|||
<script type="text/javascript">
|
||||
<% if @is_in_course == 1 || @course_activity == 1 %>
|
||||
<% if @is_in_course.to_i == 1 || @course_activity == 1 %>
|
||||
$(function(){
|
||||
$("#RSide").removeAttr("id");
|
||||
$("#Container").css("width","1000px");
|
||||
|
@ -19,13 +19,17 @@
|
|||
$("#homework_editor").toggle();
|
||||
}
|
||||
function cancel_edit(){
|
||||
<% if @is_in_course == 1 %>
|
||||
<% if @is_manage.to_i == 1 %>
|
||||
window.location.href='<%=manage_or_receive_homeworks_user_path(User.current.id) %>';
|
||||
<% elsif @is_manage.to_i == 2 %>
|
||||
window.location.href='<%=my_homeworks_user_path(User.current.id) %>';
|
||||
<% elsif @is_in_course.to_i == 1 %>
|
||||
window.location.href='<%=homework_common_index_path(:course => @course.id) %>';
|
||||
<% elsif @is_in_course == 0 %>
|
||||
<% elsif @is_in_course.to_i == 0 %>
|
||||
window.location.href='<%=user_homeworks_user_path(User.current.id) %>';
|
||||
<% elsif @is_in_course == -1 && @course_activity == 0 %>
|
||||
<% elsif @is_in_course.to_i == -1 && @course_activity == 0 %>
|
||||
window.location.href='<%=user_path(User.current.id) %>';
|
||||
<% elsif @is_in_course == -1 && @course_activity == 1 %>
|
||||
<% elsif @is_in_course.to_i == -1 && @course_activity == 1 %>
|
||||
window.location.href='<%=course_path(@course.id) %>';
|
||||
<% end %>
|
||||
}
|
||||
|
@ -40,6 +44,7 @@
|
|||
<%= form_for @homework do |f| %>
|
||||
<input type="text" name="is_in_course" class="none" value="<%= @is_in_course%>"/>
|
||||
<input type="text" name="course_activity" class="none" value="<%= @course_activity%>"/>
|
||||
<input type="text" name="is_manage" class="none" value="<%= @is_manage%>"/>
|
||||
<div id="HomeWorkCon">
|
||||
<%= render :partial => 'users/user_homework_form', :locals => { :homework => @homework,:f => f,:edit_mode => true } %>
|
||||
</div>
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
<% student_num = studentCount(@course) %>
|
||||
<% course_file_num = visable_attachemnts_incourse(@course).count %>
|
||||
<p class="sy_cgrey mb10">
|
||||
<%= link_to(@course.teacher.show_name, user_path(@course.teacher), :class => 'sy_cgrey') %>
|
||||
>
|
||||
<% if @course.syllabus %>
|
||||
<%=link_to @course.syllabus.title, syllabus_path(@course.syllabus_id), :class => 'sy_cgrey' %>
|
||||
>
|
||||
|
@ -17,7 +19,9 @@
|
|||
<ul class="sy_class_setting_text">
|
||||
<li><%= link_to @course.is_public == 0 ? "设为公开" : "设为私有", {:controller => 'courses', :action => 'private_or_public', :id => @course},:remote=>true,:confirm=>"您确定要设置为"+(@course.is_public == 0 ? "公开" : "私有")+"吗", :class => "sy_class_option" %></li>
|
||||
<li><%= link_to "复制班级", copy_course_course_path(@course.id),:remote=>true, :class => "sy_class_option" %></li>
|
||||
<li><%= link_to "进入课程", syllabus_path(@course.syllabus), :class => "sy_class_option", :target => "_blank" %></li>
|
||||
<% if @course.syllabus %>
|
||||
<li><%= link_to "进入课程", syllabus_path(@course.syllabus), :class => "sy_class_option", :target => "_blank" %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
|
|
@ -10,15 +10,9 @@
|
|||
<li class="navHomepageMenu fl">
|
||||
<%= link_to "资源库", user_resource_user_path(User.current, :type => 6), :class => "c_white f16 db p10" %>
|
||||
</li>
|
||||
<% if User.current.user_extensions && User.current.user_extensions.identity == 0 && User.current.allowed_to?(:add_course, nil, :global => true)%>
|
||||
<li class="navHomepageMenu fl">
|
||||
<%= link_to "题库", user_homeworks_user_path(User.current), :class => "c_white f16 db p10"%>
|
||||
</li>
|
||||
<% else %>
|
||||
<li class="navHomepageMenu fl">
|
||||
<%= link_to "我的作业", student_homeworks_user_path(User.current), :class => "c_white f16 db p10"%>
|
||||
</li>
|
||||
<% end %>
|
||||
<li class="navHomepageMenu fl mr30">
|
||||
<%= link_to "帮助中心", "https://#{Setting.host_name}/forums/1/memos/1168", :class =>"c_white f16 db p10" %>
|
||||
</li>
|
||||
|
@ -79,9 +73,9 @@
|
|||
</div>
|
||||
|
||||
<div class="navHomepageNews" id="user_messages">
|
||||
<%= link_to "", user_message_path(User.current), :class => "homepageNewsIcon", :target =>"_Blank", :title => "您的所有消息" %>
|
||||
<% if User.current.count_new_message.to_i >0 %>
|
||||
<div ><%= link_to User.current.count_new_message , user_message_path(User.current), :class => "newsActive", :target =>"_Blank" %></div>
|
||||
<%= link_to "", user_message_path(User.current), :class => "homepageNewsIcon", :target => "_Blank", :title => "您的所有消息" %>
|
||||
<% if User.current.count_new_message.to_i > 0 %>
|
||||
<div ><%= link_to User.current.count_new_message , user_message_path(User.current), :class => "newsActive", :target => "_Blank" %></div>
|
||||
<% end %>
|
||||
<%#= link_to User.current.count_new_message, user_message_path(User.current), :class => "homepageNewsIcon" %>
|
||||
<div class="shadowbox_news undis" id="user_messages_list">
|
||||
|
|
|
@ -72,10 +72,10 @@
|
|||
<% elsif ma.course_message_type == "Course" %>
|
||||
<li><a href="<%=course_path(ma.course_message) %>" target="_blank" title="系统提示 您成功创建了班级:班级名称:<%=ma.course_message.name %>"><span class="shadowbox_news_user">系统提示 </span>您成功创建了班级:班级名称:<%=ma.course_message.name %></a></li>
|
||||
<% elsif ma.course_message_type == "JoinCourseRequest" %>
|
||||
<% content = User.find(ma.course_message_id).name+"申请成为班级\""+"#{Course.find(ma.course_id).name}"+"\"的"+"#{ma.content == '9' ? "教师" : "教辅"}" %>
|
||||
<% content = User.find(ma.course_message_id).name+"申请成为班级\""+"#{Course.find(ma.course_id).name}"+"\"的"+"#{ma.content && ma.content.include?('9') ? "教师" : "教辅"}" %>
|
||||
<li><a href="<%=user_path(User.find(ma.course_message_id), :course_id => ma.course_id) %>" target="_blank" title="系统提示 您有了新的班级成员申请:<%=content %>"><span class="shadowbox_news_user">系统提示 </span>您有了新的班级成员申请:<%=content %></a></li>
|
||||
<% elsif ma.course_message_type == "CourseRequestDealResult" %>
|
||||
<% content = ma.status == 1 ? '您申请成为班级"'+Course.find(ma.course_id).name+'"的'+(ma.content == '9' ? '老师' : '教辅')+'申请已通过' : '您申请成为班级"'+Course.find(ma.course_id).name+'"的'+(ma.content == '9' ? '老师' : '教辅')+'的申请被拒绝' %>
|
||||
<% content = ma.status == 1 ? '您申请成为班级"'+Course.find(ma.course_id).name+'"的'+(ma.content == '9' ? '老师' : '教辅')+'申请已通过' : '您申请成为班级"'+Course.find(ma.course_id).name+'"的'+(ma.content && ma.content.include?('9') ? '教师' : '教辅')+'的申请被拒绝' %>
|
||||
<li><a href="<%=course_path(Course.find(ma.course_id)) %>" target="_blank" title="系统提示 班级申请进度反馈:<%=content %>"><span class="shadowbox_news_user">系统提示 </span>班级申请进度反馈:<%=content %></a></li>
|
||||
<% elsif ma.course_message_type == "JoinCourse" and ma.status == 0 %>
|
||||
<li><a href="<%=course_member_path(ma.course) %>" target="_blank" title="<%=User.find(ma.course_message_id).show_name %> 将您加入了班级:<%=ma.course.name %>"><span class="shadowbox_news_user"><%=User.find(ma.course_message_id).show_name %> </span>将您加入了班级:<%=ma.course.name %></a></li>
|
||||
|
@ -94,6 +94,26 @@
|
|||
<span><%= applied_project_tip_header(ma) %>以“<%= applied_project_message_type(ma.role) %>”身份加入<% project = Project.find(ma.project_id) %>
|
||||
<%= link_to project.name, project_path(ma.project_id), :class => "link-blue", :target => '_blank', :title => "#{project.name}" %>
|
||||
</span>
|
||||
<% elsif ma.applied_type == "ApplyAddSchools" && ma.status == 0 %>
|
||||
<li>
|
||||
<% content = '<span class="shadowbox_news_user">'+User.where("id=?", ma.applied_user_id).first.show_name+' </span>提交了申请:添加新的单位:'+"“"+ma.name+"”" %>
|
||||
<%= link_to content.html_safe, unapplied_schools_path(:flag => 1, :applied_message_id => ma.id), :title => "#{User.where("id=?", ma.applied_user_id).first.show_name}提交了申请:添加新的单位“#{ma.name}”", :target => '_blank' %>
|
||||
</li>
|
||||
<% elsif ma.applied_type == "ApplyAddSchools" && ma.status == 1 %>
|
||||
<li>
|
||||
<% content = "<span class='shadowbox_news_user'>系统提示:</span>“#{ma.name}”的申请,已通过审核。谢谢!" %>
|
||||
<%= link_to content.html_safe, { :controller=> "my",:action => "account",:flag => 1, :applied_message_id => ma.id }, :title => "系统提示:“#{ma.name}”的申请,已通过审核。谢谢!", :target => '_blank'%>
|
||||
</li>
|
||||
<% elsif ma.applied_type == "ApplyAddSchools" && ma.status == 2 %>
|
||||
<li>
|
||||
<% content = "<span class='shadowbox_news_user'>系统提示:</span>“#{ma.applied.name}”的申请,因名称不符合规范,系统已将其更改为“#{ma.name}”。谢谢!" %>
|
||||
<%= link_to content.html_safe, { :controller=> "my",:action => "account", :flag => 1, :applied_message_id => ma.id }, :title => "系统提示:“#{ma.applied.name}”的申请,因名称不符合规范,系统已将其更改为“#{ma.name}”。谢谢!", :target => '_blank'%>
|
||||
</li>
|
||||
<% elsif ma.applied_type == "ApplyAddSchools" && ma.status == 3 %>
|
||||
<li>
|
||||
<% content = "<span class='shadowbox_news_user'>系统提示:</span>“#{ma.name}”的申请,经确认为无效的单位信息,已被删除,请重新编辑您的单位资料。谢谢!" %>
|
||||
<%= link_to content.html_safe, { :controller=> "my",:action => "account", :flag => 1, :applied_message_id => ma.id }, :title => "系统提示:“#{ma.name}”的申请,经确认为无效的单位信息,已被删除,请重新编辑您的单位资料。谢谢!", :target => '_blank'%>
|
||||
</li>
|
||||
<% end %>
|
||||
<% elsif ma.class == ForgeMessage %>
|
||||
<% if ma.forge_message_type == "AppliedProject" %>
|
||||
|
@ -126,8 +146,8 @@
|
|||
<li><a href="<%=feedback_path(ma.journals_for_message.jour_id) %>" target="_blank" title="<%=ma.journals_for_message.user.show_name %> <%= ma.journals_for_message.reply_id == 0 || ma.journals_for_message.reply_id.nil? ? "给你留言了:" : "回复了你的留言:" %><%= message_content(ma.journals_for_message.notes)%>"><span class="shadowbox_news_user"><%=ma.journals_for_message.user.show_name %> </span><%= ma.journals_for_message.reply_id == 0 || ma.journals_for_message.reply_id.nil? ? "给你留言了:" : "回复了你的留言:" %><%= message_content(ma.journals_for_message.notes)%></a></li>
|
||||
<% end %>
|
||||
<% elsif ma.class == OrgMessage %>
|
||||
<% if ma.message_type == 'ApplySubdomain' %>
|
||||
<li><a href="<%=feedback_path(ma.journals_for_message.jour_id) %>" target="_blank" title="<%=ma.organization.name %> 申请子域名:<%= (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)) ? "同意申请":"申请已批准"%>"><span class="shadowbox_news_user"><%=ma.organization.name %> </span>申请子域名:<%= (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)) ? "同意申请":"申请已批准"%></a></li>
|
||||
<% if ma.message_type == 'ApplySubdomain' && ma.organization %>
|
||||
<li><a href="<%=agree_apply_subdomain_organizations_path( :organization_id => ma.organization_id, :org_domain => ma.content, :user_id => ma.sender_id, :act_id => ma.id ) %>" target="_blank" title="<%=ma.organization.name %> 申请子域名:<%= (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)) ? "同意申请":"申请已批准"%>"><span class="shadowbox_news_user"><%=ma.organization.name %> </span>申请子域名:<%= (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)) ? "同意申请":"申请已批准"%></a></li>
|
||||
<% elsif ma.message_type == 'AgreeApplySubdomain' %>
|
||||
<li><a href="javascript:void(0)" target="_blank" title="系统提示 管理员同意了您的子域名申请:<%= ma.content%>"><span class="shadowbox_news_user">系统提示 </span>管理员同意了您的子域名申请:<%= ma.content%></a></li>
|
||||
<% end %>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<% if user.user_extensions && user.user_extensions.brief_introduction && !user.user_extensions.brief_introduction.empty? %>
|
||||
<%= user.user_extensions.brief_introduction %>
|
||||
<% else%>
|
||||
这位童鞋很懒,什么也没有留下~
|
||||
这个小伙伴很懒,什么都没留下~
|
||||
<% end %>
|
||||
</span>
|
||||
<% if User.current == user%>
|
||||
|
|
|
@ -1,99 +1,98 @@
|
|||
<% courses.each do |course|%>
|
||||
<li class="homepageLeftMenuCoursesLine pr">
|
||||
<li>
|
||||
<span class="user_icons_class"></span>
|
||||
<% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,course)) %>
|
||||
<%= link_to course.name+"("+current_time_and_term_short(course)+")", course_path(course.id,:host=>Setting.host_course), :class => "coursesLineGrey hidden #{course_endTime_timeout?(course) ? 'c_dark_grey' : ''}",
|
||||
:id => "show_course_#{course.id}", :target => '_blank', :title => (course.is_public? ? "公开班级:":"私有班级:")+course.name+"("+current_time_and_term(course)+")"%>
|
||||
<%= link_to course.name+"("+current_time_and_term_short(course)+")", course_path(course.id,:host=>Setting.host_course),
|
||||
:id => "show_course_#{course.id}", :class => 'course_list_menu hidden', :target => '_blank', :title => (course.is_public? ? "公开班级:":"私有班级:")+course.name+"("+current_time_and_term(course)+")"%>
|
||||
<% count = ShieldActivity.where("container_type='User' and container_id=#{user.id} and shield_type='Course' and shield_id=#{course.id}").count %>
|
||||
<% wechat_count = ShieldWechatMessage.where("container_type='User' and container_id=#{user.id} and shield_type='Course' and shield_id=#{course.id}").count %>
|
||||
|
||||
<ul class="<%= count > 0 ? 'shild shildP':'subNavArrow'%>">
|
||||
<li>
|
||||
<ul class="subNavMenu boxShadow">
|
||||
<div class="user_navmore_box">
|
||||
<ul class="<%#= count > 0 ? 'shild shildP':'subNavArrow'%>">
|
||||
<li class="user_navmore_icons">
|
||||
<ul class="user_navmore_txt">
|
||||
<% if is_teacher %>
|
||||
<li class="subNavRow">
|
||||
<%= link_to "作业",homework_common_index_path(:course => course.id), :class => 'fl fontGrey2 w48', :target => '_blank' %>
|
||||
<%= link_to '+',homework_common_index_path(:course => course.id,:is_new => 1), :class => 'fr fb', :title => '发布作业',:target => '_blank' %>
|
||||
<div class="cl"></div>
|
||||
<li class="clear">
|
||||
<%= link_to "作业",homework_common_index_path(:course => course.id), :class => 'user_navmore_li fl', :target => '_blank' %>
|
||||
<%= link_to '+',homework_common_index_path(:course => course.id,:is_new => 1), :class => 'user_navmore_add fl', :title => '发布作业',:target => '_blank' %>
|
||||
</li>
|
||||
<li class="subNavRow">
|
||||
<%= link_to "通知", course_news_index_path(course), :class => 'fl w48',:target => '_blank' %>
|
||||
<%= link_to "+", new_course_news_path(course,:is_new=>1), :class => 'fr fb', :title => '发布通知',:target => '_blank' %>
|
||||
<div class="cl"></div>
|
||||
<li class="clear">
|
||||
<%= link_to "通知", course_news_index_path(course), :class => 'user_navmore_li fl',:target => '_blank' %>
|
||||
<%= link_to "+", new_course_news_path(course,:is_new=>1), :class => 'user_navmore_add fl', :title => '发布通知',:target => '_blank' %>
|
||||
</li>
|
||||
<% else %>
|
||||
<li class="subNavRow">
|
||||
<%= link_to "作业",homework_common_index_path(:course => course.id), :target => '_blank' %>
|
||||
<li>
|
||||
<%= link_to "作业",homework_common_index_path(:course => course.id), :class => 'user_navmore_li', :target => '_blank' %>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<li class="subNavRow">
|
||||
<%= link_to "通知", course_news_index_path(course),:target => '_blank' %>
|
||||
<li>
|
||||
<%= link_to "通知", course_news_index_path(course), :class => 'user_navmore_li',:target => '_blank' %>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if is_teacher || (course.publish_resource == 1 && User.current.member_of_course?(course)) %>
|
||||
<li class="subNavRow">
|
||||
<%= link_to "资源",course_files_path(course), :class => 'fl w48',:target => '_blank' %>
|
||||
<%= link_to "+",upload_files_menu_path(:course_id => course.id), :class => 'fr fb',:remote => true, :title => '上传资源' %>
|
||||
<div class="cl"></div>
|
||||
<li class="clear">
|
||||
<%= link_to "资源",course_files_path(course), :class => 'user_navmore_li fl',:target => '_blank' %>
|
||||
<%= link_to "+",upload_files_menu_path(:course_id => course.id), :class => 'user_navmore_add fl',:remote => true, :title => '上传资源' %>
|
||||
</li>
|
||||
<% else %>
|
||||
<li class="subNavRow">
|
||||
<%= link_to "资源",course_files_path(course),:target => '_blank' %>
|
||||
<li>
|
||||
<%= link_to "资源",course_files_path(course), :class => 'user_navmore_li',:target => '_blank' %>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<% end %>
|
||||
<li class="subNavRow">
|
||||
<%= link_to "论坛",course_boards_path(course), :class => 'fl w48',:target => '_blank' %>
|
||||
<%= link_to "+",course_boards_path(course, :flag => true, :is_new => 1), :class => 'fr fb', :title => '发布帖子',:target => '_blank' %>
|
||||
<div class="cl"></div>
|
||||
<li class="clear">
|
||||
<%= link_to "论坛",course_boards_path(course), :class => 'user_navmore_li fl',:target => '_blank' %>
|
||||
<%= link_to "+",course_boards_path(course, :flag => true, :is_new => 1), :class => 'user_navmore_add fl', :title => '发布帖子',:target => '_blank' %>
|
||||
</li>
|
||||
<% if type=='User' && !course.syllabus.nil? %>
|
||||
<li class="subNavRow">
|
||||
<%= link_to "所属课程",syllabus_path(course.syllabus_id), :class => 'fl w48',:target => '_blank' %>
|
||||
<% if !course.syllabus.nil? %>
|
||||
<li>
|
||||
<%= link_to "所属课程",syllabus_path(course.syllabus_id), :class => 'user_navmore_li',:target => '_blank' %>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if User.current == user %>
|
||||
<li class="subNavRow">
|
||||
<li>
|
||||
<% if count == 0 %>
|
||||
<%= link_to "屏蔽动态", shield_activities_path(:user_id => user.id, :course_id => course.id), :method => 'post',:remote => true %>
|
||||
<%= link_to "屏蔽动态", shield_activities_path(:user_id => user.id, :course_id => course.id), :method => 'post', :class => 'user_navmore_li',:remote => true %>
|
||||
<% else %>
|
||||
<%= link_to "显示动态", show_acts_shield_activities_path(:user_id => user.id, :course_id => course.id),:remote => true,:method => 'delete' %>
|
||||
<%= link_to "显示动态", show_acts_shield_activities_path(:user_id => user.id, :course_id => course.id),:remote => true,:method => 'delete', :class => 'user_navmore_li' %>
|
||||
<% end %>
|
||||
</li>
|
||||
<li class="subNavRow">
|
||||
<li>
|
||||
<% if wechat_count == 0 %>
|
||||
<%= link_to "屏蔽微信消息", shield_wechat_messages_path(:user_id => user.id, :course_id => course.id), :method => 'post',:remote => true %>
|
||||
<%= link_to "屏蔽微信消息", shield_wechat_messages_path(:user_id => user.id, :course_id => course.id), :method => 'post',:remote => true, :class => 'user_navmore_li' %>
|
||||
<% else %>
|
||||
<%= link_to "接收微信消息", show_messages_shield_wechat_messages_path(:user_id => user.id, :course_id => course.id),:remote => true,:method => 'delete' %>
|
||||
<%= link_to "接收微信消息", show_messages_shield_wechat_messages_path(:user_id => user.id, :course_id => course.id),:remote => true,:method => 'delete', :class => 'user_navmore_li' %>
|
||||
<% end %>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,course)) %>
|
||||
<li class="subNavRow">
|
||||
<li>
|
||||
<%= link_to course.is_public == 0 ? "设为公开" : "设为私有", {:controller => 'courses', :action => 'private_or_public', :id => course,:user_page => true},
|
||||
:id => "set_course_public_#{course.id.to_s}",:remote=>true,:confirm=>"您确定要设置为"+(course.is_public == 0 ? "公开" : "私有")+"吗"%>
|
||||
:id => "set_course_public_#{course.id.to_s}",:remote=>true, :class => 'user_navmore_li',:confirm=>"您确定要设置为"+(course.is_public == 0 ? "公开" : "私有")+"吗"%>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
<% end %>
|
||||
|
||||
<% if all_count > (page.to_i+1) * 5%>
|
||||
<li class="homepageLeftMenuMore" id="user_show_more_course">
|
||||
<input type="hidden" value="<%= page%>" id="course_page_num">
|
||||
<a href="javascript:void(0);" class="homepageLeftMenuMoreIcon" onclick="show_more_course('<%= type=='User' ? user_courses4show_user_path(user.id,:type=>type) : user_courses4show_user_path(user.id,:type=>type,:syllabus=>@syllabus.id)%>');"></a>
|
||||
</li>
|
||||
<% if all_count > (page.to_i+1) * 10%>
|
||||
<input type="hidden" value="<%= page%>" id="course_page_num">
|
||||
<a class="user_navmorebox" href="javascript:void(0);" id="user_show_more_course" onclick="show_more_course('<%= user_courses4show_user_path(user.id,:page => page)%>');">
|
||||
<span class="user_icons_moreclass"></span>
|
||||
</a>
|
||||
<% end%>
|
||||
|
||||
<script type="text/javascript">
|
||||
var coursecount = <%= all_count %>;
|
||||
var courseshowcount = document.getElementsByClassName("coursesLineGrey").length;
|
||||
var courseshowcount = document.getElementsByClassName("course_list_menu").length;
|
||||
|
||||
if((coursecount <= courseshowcount)&&(coursecount > 5) ){
|
||||
if((coursecount <= courseshowcount)&&(coursecount > 10) ){
|
||||
$("#user_show_more_course").hide();
|
||||
$('#user_hide_course').show();
|
||||
}
|
||||
|
|
|
@ -1,71 +1,73 @@
|
|||
<% projects.each do |project|%>
|
||||
<li class="homepageLeftMenuCoursesLine pr">
|
||||
<li>
|
||||
<span class="user_icons_class"></span>
|
||||
<% count = ShieldActivity.where("container_type='User' and container_id=#{user.id} and shield_type='Project' and shield_id=#{project.id}").count %>
|
||||
<%= link_to project.name, project_path(project.id,:host=>Setting.host_name), :target => '_blank', :class => "projectsLineGrey hidden",:id => "show_project_#{project.id}", :title => (project.is_public? ? "公开项目:":"私有项目:") + project.name%>
|
||||
<ul class="<%= count > 0 ? 'shild shildP':'subNavArrow'%>">
|
||||
<li>
|
||||
<ul class="subNavMenu boxShadow">
|
||||
<li class="subNavRow">
|
||||
<%=link_to "问题跟踪", project_issues_path(project), :class => 'fl fontGrey2', :target => '_blank',:style => "width:48px;" %>
|
||||
<%=link_to "+", new_project_issue_path(project), :class => 'fr fb', :target => '_blank',:style => "width:48px;", :title => '发布问题',:style =>'width:10px;' %>
|
||||
<div class="cl"></div>
|
||||
<%= link_to project.name, project_path(project.id,:host=>Setting.host_name), :target => '_blank', :class => "course_list_menu hidden",:id => "show_project_#{project.id}", :title => (project.is_public? ? "公开项目:":"私有项目:") + project.name%>
|
||||
|
||||
<div class="user_navmore_box">
|
||||
<ul class="<%#= count > 0 ? 'shild shildP':'subNavArrow'%>">
|
||||
<li class="user_navmore_icons">
|
||||
<ul class="user_navmore_txt">
|
||||
<li class="clear">
|
||||
<%=link_to "问题跟踪", project_issues_path(project), :class => 'user_navmore_li fl', :target => '_blank' %>
|
||||
<%=link_to "+", new_project_issue_path(project), :class => 'user_navmore_add fl', :target => '_blank', :title => '发布问题' %>
|
||||
</li>
|
||||
<li class="subNavRow">
|
||||
<%=link_to "资源", project_files_path(project),:class => 'fl fontGrey2 w48' %>
|
||||
<%=link_to "+", upload_files_menu_path(:project_id => project.id),:remote => true,:class => 'fr fb',:title => '上传资源'%>
|
||||
<div class="cl"></div>
|
||||
<li class="clear">
|
||||
<%=link_to "资源", project_files_path(project),:class => 'user_navmore_li fl' %>
|
||||
<%=link_to "+", upload_files_menu_path(:project_id => project.id),:remote => true,:class => 'user_navmore_add fl',:title => '上传资源'%>
|
||||
</li>
|
||||
<li class="subNavRow">
|
||||
<%=link_to "论坛", project_boards_path(project),:class => 'fl fontGrey2 w48', :target => '_blank'%>
|
||||
<%=link_to "+", project_boards_path(project, :flag => true),:class => 'fr fb', :target => '_blank',:title => '发布帖子'%>
|
||||
<div class="cl"></div>
|
||||
<li class="clear">
|
||||
<%=link_to "论坛", project_boards_path(project),:class => 'user_navmore_li fl', :target => '_blank'%>
|
||||
<%=link_to "+", project_boards_path(project, :flag => true),:class => 'user_navmore_add fl', :target => '_blank',:title => '发布帖子'%>
|
||||
</li>
|
||||
<% if (User.current.admin? || User.current.allowed_to?({:controller => 'projects', :action => 'settings'}, project)) && rep_is_gitlab?(project) %>
|
||||
<li class="subNavRow">
|
||||
<%= link_to '版本库', url_for(:controller => 'projects', :action => 'settings', :id => project.id, :tab=>'repositories') , :target => '_blank',:class => "fl w48",:title => '版本库' %>
|
||||
<li>
|
||||
<%= link_to '版本库', url_for(:controller => 'projects', :action => 'settings', :id => project.id, :tab=>'repositories') , :target => '_blank',:class => "user_navmore_li",:title => '版本库' %>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if User.current == @user %>
|
||||
<li class="subNavRow">
|
||||
<li>
|
||||
<% if ShieldActivity.where("container_type='User' and container_id=#{user.id} and shield_type='Project' and shield_id=#{project.id}").count == 0 %>
|
||||
<%= link_to "屏蔽动态", shield_activities_path(:user_id => user.id, :project_id => project.id), :method => 'post',:remote => true %>
|
||||
<%= link_to "屏蔽动态", shield_activities_path(:user_id => user.id, :project_id => project.id), :method => 'post',:remote => true,:class => "user_navmore_li" %>
|
||||
<% else %>
|
||||
<%= link_to "显示动态", show_acts_shield_activities_path(:user_id => user.id, :project_id => project.id),:method => 'delete',:remote => true %>
|
||||
<%= link_to "显示动态", show_acts_shield_activities_path(:user_id => user.id, :project_id => project.id),:method => 'delete',:remote => true,:class => "user_navmore_li" %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<li class="subNavRow">
|
||||
<li>
|
||||
<% if ShieldWechatMessage.where("container_type='User' and container_id=#{user.id} and shield_type='Project' and shield_id=#{project.id}").count == 0 %>
|
||||
<%= link_to "屏蔽微信消息", shield_wechat_messages_path(:user_id => user.id, :project_id => project.id), :method => 'post',:remote => true %>
|
||||
<%= link_to "屏蔽微信消息", shield_wechat_messages_path(:user_id => user.id, :project_id => project.id), :method => 'post',:remote => true,:class => "user_navmore_li" %>
|
||||
<% else %>
|
||||
<%= link_to "接收微信消息", show_messages_shield_wechat_messages_path(:user_id => user.id, :project_id => project.id),:method => 'delete',:remote => true %>
|
||||
<%= link_to "接收微信消息", show_messages_shield_wechat_messages_path(:user_id => user.id, :project_id => project.id),:method => 'delete',:remote => true,:class => "user_navmore_li" %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if User.current.logged? && (User.current.admin? || is_project_manager?(User.current,project)) %>
|
||||
<li class="subNavRow">
|
||||
<li>
|
||||
<%= link_to project.is_public? ? "设为私有" : "设为公开", {:controller => 'projects', :action => 'set_public_or_private', :id => project.id,:user_page => true},
|
||||
:id => 'set_project_public_'+ project.id.to_s,:method => 'post',:remote=>true,:confirm=>"您确定要设置为"+(project.is_public? ? "私有" : "公开")+"吗"%>
|
||||
:id => 'set_project_public_'+ project.id.to_s,:method => 'post',:remote=>true,:confirm=>"您确定要设置为"+(project.is_public? ? "私有" : "公开")+"吗",:class => "user_navmore_li"%>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if projects.size == 5%>
|
||||
<li class="homepageLeftMenuMore" id="user_show_more_project">
|
||||
<input type="hidden" value="<%= page%>" id="project_page_num">
|
||||
<a href="javascript:void(0);" class="homepageLeftMenuMoreIcon" onclick="show_more_project('<%= user_projects4show_user_path(user.id)%>');"></a>
|
||||
</li>
|
||||
|
||||
<% if all_count > (page.to_i+1) * 10%>
|
||||
<input type="hidden" value="<%= page%>" id="project_page_num">
|
||||
<a class="user_navmorebox" href="javascript:void(0);" id="user_show_more_project" onclick="show_more_project('<%= user_projects4show_user_path(user.id)%>');">
|
||||
<span class="user_icons_moreclass"></span>
|
||||
</a>
|
||||
<% end%>
|
||||
|
||||
<script type="text/javascript">
|
||||
var projectcount = <%= @user.projects.visible.count %>;
|
||||
var projectshowcount = document.getElementsByClassName("projectsLineGrey").length;
|
||||
var projectshowcount = document.getElementsByClassName("course_list_menu").length;
|
||||
|
||||
if((projectcount <= projectshowcount)&&(projectcount > 5)){
|
||||
$("#user_show_more_project").hide();
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
<% if User.current.logged?%>
|
||||
<% if User.current == target%>
|
||||
<%= link_to("编辑资料", my_account_path, :class => "fl UsersEditBtn")%>
|
||||
<%= link_to("编辑个人资料", my_account_path, :class => "user_editinfo")%>
|
||||
<% else%>
|
||||
<%if(target.watched_by?(User.current))%>
|
||||
<%= link_to "取消关注",watch_path(:object_type=> 'user',:object_id=>target.id,:target_id=>target.id),:class => "UsersApBtn", :method => "delete",:remote => "true", :title => "取消关注"%>
|
||||
<%= link_to "取消关注",watch_path(:object_type=> 'user',:object_id=>target.id,:target_id=>target.id),:class => "user_editinfo", :method => "delete",:remote => "true", :title => "取消关注"%>
|
||||
<% else %>
|
||||
<%= link_to "添加关注",watch_path(:object_type=> 'user',:object_id=>target.id,:target_id=>target.id),:class => "UsersAttBtn", :method => "post",:remote => "true", :title => "添加关注"%>
|
||||
<%= link_to "添加关注",watch_path(:object_type=> 'user',:object_id=>target.id,:target_id=>target.id),:class => "user_editinfo", :method => "post",:remote => "true", :title => "添加关注"%>
|
||||
<% end %>
|
||||
<% end%>
|
||||
<% end %>
|
|
@ -131,7 +131,7 @@
|
|||
<%# 课程英雄榜 %>
|
||||
<%= render :partial => 'courses/course_heroes', :locals => {:course => @course} %>
|
||||
<div class="sy_class_leftbox mb15" >
|
||||
<h3>班级推荐</h3>
|
||||
<h3 class="fontGrey7">班级推荐</h3>
|
||||
<%= render :partial => 'courses/recommendation', :locals => {:course => @course} %>
|
||||
</div>
|
||||
</div><!--sy_class_l end-->
|
||||
|
|
|
@ -100,207 +100,135 @@
|
|||
<!--div class="homepageRightBannerImg"></div-->
|
||||
<div class="cl"></div>
|
||||
<div class="homepageContent">
|
||||
<div class="homepageLeft" id="LSide">
|
||||
<div class="homepagePortraitContainer">
|
||||
<div class="homepagePortraitImage fl" id="homepage_portrait_image">
|
||||
<%= image_tag(url_to_avatar(@user),width:"78", height: "78", :id=>'nh_user_tx') %>
|
||||
<% if User.current.logged?%>
|
||||
<% if is_current_user%>
|
||||
<div id="edit_user_file_btn" class="none">
|
||||
<div class="homepageEditProfile">
|
||||
<a href="<%= url_for(:controller => 'my', :action => 'clear_user_avatar_temp') %>" data-remote="true" class="homepageEditProfileIcon"></a>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end%>
|
||||
</div>
|
||||
<div class="fl ml10">
|
||||
<p class="homepageImageName hidden db mb5" style="margin-left:0px;margin-right:0px;">
|
||||
<%= @user.realname.blank? ? @user.login : @user.realname %>
|
||||
</p>
|
||||
<% if (@user.user_extensions && (@user.user_extensions.identity != 2) ) %>
|
||||
<span class="<%= @user.user_extensions.gender == 1 ? 'homepageImageSexWomen' : 'homepageImageSexMan' %> "></span>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
<% if @user.user_extensions && @user.user_extensions.identity %>
|
||||
<p class="mb8 c_dark f14">
|
||||
<%= get_user_roll @user %>
|
||||
</p>
|
||||
<% end%>
|
||||
<div id="watch_user_btn_div">
|
||||
<%= render :partial => 'layouts/user_watch_btn', :locals => {:target => @user} %>
|
||||
<div class="homepageLeft mt10" id="LSide">
|
||||
<div class="user_leftinfo mb10">
|
||||
<% if User.current.logged?%>
|
||||
<%=link_to image_tag(url_to_avatar(@user),width:"74", height: "74", :id=>'nh_user_tx'), my_clear_user_avatar_temp_path, :class => "user_leftinfo_img", :remote => true%>
|
||||
<% else %>
|
||||
<img src="images/user/male.jpg" width="74" height="74" />
|
||||
<% end %>
|
||||
<% if (@user.user_extensions && (@user.user_extensions.identity != 2) ) %>
|
||||
<span class="<%= @user.user_extensions.gender == 1 ? 'user_leftinfo_female' : 'user_leftinfo_male' %> "></span>
|
||||
<% end %>
|
||||
<div class="user_info_inner">
|
||||
<div class=" user_leftinfo_namebox" >
|
||||
<a href="javascript:void(0);" class="user_leftinfo_name"><%=@user.show_name %></a>
|
||||
<% if @user.user_extensions && @user.user_extensions.identity %>
|
||||
<span class="user_cirbtn_yellow" ><%= get_user_roll @user %></span>
|
||||
<% end%>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<%# 更新访问数,刷新的时候更新访问次数 %>
|
||||
<% update_visiti_count @user %>
|
||||
<%# over %>
|
||||
|
||||
<div>
|
||||
<div class="homepageSignature break_word">
|
||||
<div id="user_brief_introduction_show">
|
||||
<div>
|
||||
<div class="user_info_intro">
|
||||
<div id="user_brief_introduction_show">
|
||||
<%= 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>
|
||||
</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>
|
||||
<ul class="user_atten clear">
|
||||
<li>
|
||||
<a href="<%=user_blogs_path(:user_id => @user.id) %>">
|
||||
<strong>博客</strong><br />
|
||||
<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.id) %>">
|
||||
<strong>关注</strong><br />
|
||||
<span class="sy_cgrey"><%=User.watched_by(@user.id).count %></span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<%=user_fanslist_user_path(@user.id) %>">
|
||||
<strong>粉丝</strong><br />
|
||||
<span class="sy_cgrey"><%= @user.watcher_users.count %></span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div>
|
||||
<div class="homepageImageBlock">
|
||||
<div>
|
||||
<%= link_to(@user.blog.blog_comments.where("#{BlogComment.table_name}.parent_id is null").count,
|
||||
{:controller => 'blogs', :action => 'index', :user_id => @user.id }, :class => 'homepageImageNumber',:id => 'user_score') %>
|
||||
</div>
|
||||
<div class="homepageImageText">
|
||||
|
||||
<%= link_to('博客',
|
||||
{:controller => 'blogs', :action => 'index', :user_id => @user.id }, :class => 'homepageImageNumber',:id => 'user_score') %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="homepageVerDiv"></div>
|
||||
<div class="homepageImageBlock">
|
||||
<div id="watch_user_number_div">
|
||||
<%= link_to User.watched_by(@user.id).count.to_s, {:controller=>"users", :action=>"user_watchlist",:id=>@user.id},:class=>"homepageImageNumber" %>
|
||||
</div>
|
||||
<div class="homepageImageText">
|
||||
<%= link_to '关注', {:controller=>"users", :action=>"user_watchlist",:id=>@user.id},:class=>"homepageImageNumber" %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="homepageVerDiv"></div>
|
||||
<div class="homepageImageBlock">
|
||||
<div id="fans_user_number_div">
|
||||
<%= link_to @user.watcher_users.count.to_s, {:controller=>"users", :action=>"user_fanslist",:id=>@user.id},:class=>"homepageImageNumber", :id => "user_fans_number"%>
|
||||
</div>
|
||||
<div class="homepageImageText">
|
||||
|
||||
<%= link_to '粉丝', {:controller=>"users", :action=>"user_fanslist",:id=>@user.id},:class=>"homepageImageNumber", :id => "user_fans_number"%>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="cl"></div>
|
||||
<div id="watch_user_btn_div">
|
||||
<%= render :partial => 'layouts/user_watch_btn', :locals => {:target => @user} %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="homepageLeftMenuContainer">
|
||||
<div class="homepageLeftMenuBlock">
|
||||
<%= link_to "动态",user_activities_path(@user.id),:class => "homepageMenuText"%>
|
||||
</div>
|
||||
|
||||
<div class="user_leftnav ">
|
||||
<% hidden_courses = Setting.find_by_name("hidden_courses") %>
|
||||
<% unvisiable = hidden_courses && hidden_courses.value == "1"%>
|
||||
<% if !unvisiable %>
|
||||
<div class="homepageLeftMenuBlock">
|
||||
<%= link_to '课程',{:controller => "users", :action => "user_courselist", :id => @user.id}, :class => "homepageMenuText" %>
|
||||
|
||||
<% if is_current_user%>
|
||||
<%# if User.current.user_extensions && User.current.user_extensions.identity == 0 && User.current.allowed_to?(:add_course, nil, :global => true)%>
|
||||
<div class="courseMenu" id="courseMenu">
|
||||
<ul>
|
||||
<li class="courseMenuIcon fr" style="margin-right:10px;" id="courseMenuIcon">
|
||||
<ul class="topnav_course_menu" id="topnav_course_menu">
|
||||
<li>
|
||||
<%= link_to "新建课程", new_syllabus_path(:host=> Setting.host_course), :class => "menuGrey"%>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to "新建班级", new_course_path(:host=> Setting.host_course), :class => "menuGrey"%>
|
||||
</li>
|
||||
<!--<li><a href="javascript:void(0);" class="menuGrey">账号设置</a> </li>-->
|
||||
<li>
|
||||
<%= link_to "加入班级",join_private_courses_courses_path,:remote => true,:class => "menuGrey",:method => "post"%>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<%# else%>
|
||||
<%#=link_to "", join_private_courses_courses_path, :class => "homepageMenuSetting fr",:style => "margin-right:10px;", :remote => true, :title => "加入班级"%>
|
||||
<%# end%>
|
||||
<% end%>
|
||||
</div>
|
||||
<% end %>
|
||||
<%# if @user.courses.visible.count > 0
|
||||
course_order_ids = "(" +
|
||||
CourseActivity.find_by_sql("SELECT c.course_id, updated_at FROM
|
||||
(SELECT ca.course_id, MAX(ca.updated_at) AS updated_at FROM course_activities ca WHERE ca.course_id IN (" + @user.courses.visible.select('courses.id').map{|c| c.id}.join(',') + ")
|
||||
GROUP BY ca.course_id) AS c
|
||||
ORDER BY c.updated_at DESC limit 5").map {|c| c.course_id}.join(",") + ")"
|
||||
courses = Course.where("id in #{course_order_ids}")
|
||||
else
|
||||
courses = []
|
||||
|
||||
end
|
||||
%>
|
||||
<% courses = @user.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(5) %>
|
||||
<% all_count = @user.courses.visible.where("is_delete =?", 0).count%>
|
||||
<div class="homepageLeftMenuCourses <%= courses.empty? ? 'none' : ''%>" >
|
||||
<div class = "leftCoursesList" id="homepageLeftMenuCourses">
|
||||
<ul>
|
||||
<%= render :partial => 'layouts/user_courses', :locals => {:courses => courses,:user => @user,:all_count => all_count,:type =>'User',:page => 0} %>
|
||||
</ul>
|
||||
</div>
|
||||
<% if !courses.empty? %>
|
||||
<div class="homepageLeftMenuMore" id="user_hide_course">
|
||||
<a href="javascript:void(0);" class="homepageLeftMenuHideIcon" id="hide_show_courseicon" onclick="leftCourseslistChange();"></a>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="homepageLeftMenuBlock">
|
||||
<%= link_to '项目',{:controller => "users", :action => "user_projectlist", :id => @user.id}, :class => "homepageMenuText" %>
|
||||
<% if is_current_user %>
|
||||
<div class="courseMenu" id="projectMenu">
|
||||
<ul>
|
||||
<li class="courseMenuIcon fr" style="margin-right:10px;" id="courseMenuIcon">
|
||||
<ul class="topnav_course_menu" id="topnav_project_menu">
|
||||
<li>
|
||||
<%= link_to "新建项目", new_project_path(:host=> Setting.host_name), :class => "menuGrey"%>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to "加入项目", applied_join_project_path,:remote => true,:class => "menuGrey",:method => "post"%>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<ul class="users_accordion mb10">
|
||||
<li id="user_01" class="user_icons_course">
|
||||
<%= link_to '课程',{:controller => "users", :action => "user_courselist", :id => @user.id}, :id => "user_course_list" %>
|
||||
<% courses = @user.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) %>
|
||||
<% all_count = @user.courses.visible.where("is_delete =?", 0).count%>
|
||||
<div class="<%= courses.empty? ? 'none' : ''%>" >
|
||||
<div id="homepageLeftMenuCourses">
|
||||
<ul class="user_sub_menu" id="user_courses_li">
|
||||
<%= render :partial => 'layouts/user_courses', :locals => {:courses => courses,:user => @user,:all_count => all_count,:page => 0} %>
|
||||
</ul>
|
||||
</div>
|
||||
<% end%>
|
||||
</div>
|
||||
<%# if @user.projects.visible.count > 0
|
||||
project_order_ids = "(" +
|
||||
ForgeActivity.find_by_sql("SELECT p.project_id, p.created_at FROM
|
||||
(SELECT fa.project_id, MAX(fa.created_at) AS created_at FROM forge_activities fa WHERE fa.project_id IN (" + @user.projects.visible.select('projects.id').map{|p| p.id}.join(',') + ")
|
||||
GROUP BY fa.project_id) AS p
|
||||
ORDER BY p.created_at DESC limit 5").map {|p| p.project_id}.join(",") + ")"
|
||||
projects = Project.where("projects.id in #{project_order_ids}")
|
||||
else
|
||||
projects = []
|
||||
end
|
||||
%>
|
||||
|
||||
<% projects = @user.projects.visible.select("projects.*, (SELECT MAX(updated_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS a").order("a desc").limit(5)%>
|
||||
<div class="homepageLeftMenuCourses <%= projects.empty? ? 'none' : ''%>" >
|
||||
<div class = "leftProjecsList" id="homepageLeftMenuForge">
|
||||
<ul>
|
||||
<%= render :partial => 'layouts/user_projects', :locals => {:projects => projects,:user => @user, :page => 0} %>
|
||||
</ul>
|
||||
</div>
|
||||
<% if !projects.empty? %>
|
||||
<div class="homepageLeftMenuMore" id="user_hide_project">
|
||||
<a href="javascript:void(0);" class="homepageLeftMenuHideIcon" id="hide_show_projecticon" onclick="leftProjectslistChange();"></a>
|
||||
</div>
|
||||
<% if !courses.empty? %>
|
||||
<a class="user_navmorebox" href="javascript:void(0);" id="user_hide_course" onclick="leftCourseslistChange();">
|
||||
<span id="hide_show_courseicon" class="user_icons_closeclass"></span>
|
||||
</a>
|
||||
<% end %>
|
||||
</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.id), :target => "_blank", :style => "font-size:14px;" %>
|
||||
</li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="homepageLeftMenuBlock">
|
||||
<!--<a href="javascript:void(0);" class="homepageMenuText">留言</a>-->
|
||||
<%= link_to '留言',feedback_path(@user, :host=> Setting.host_user),:class=>'homepageMenuText'%>
|
||||
</div>
|
||||
</div>
|
||||
<div class="homepageLeftLabelContainer">
|
||||
<div class="project_Label_New">
|
||||
<span class="homepageLabelText">标签</span>
|
||||
<div class="tag_h ml10" >
|
||||
<%= render :partial => 'tags/user_tag', :locals => {:obj => @user,:object_flag => "1"}%>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
</ul>
|
||||
<% end %>
|
||||
|
||||
<ul class="users_accordion mb10">
|
||||
<li id="user_06" class="user_icons_project">
|
||||
<%= link_to '项目',{:controller => "users", :action => "user_projectlist", :id => @user.id}, :id => 'user_project_list'%>
|
||||
<% all_count = @user.projects.visible.count%>
|
||||
<% projects = @user.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' : ''%>" >
|
||||
<div id="homepageLeftMenuForge">
|
||||
<ul class="user_sub_menu" id="user_projects_li">
|
||||
<%= render :partial => 'layouts/user_projects', :locals => {:projects => projects,:user => @user, :all_count => all_count, :page => 0} %>
|
||||
</ul>
|
||||
</div>
|
||||
<% if !projects.empty? %>
|
||||
<a class="user_navmorebox" href="javascript:void(0);" id="user_hide_project" onclick="leftProjectslistChange();">
|
||||
<span id="hide_show_projecticon" class="user_icons_closeclass"></span>
|
||||
</a>
|
||||
<% end %>
|
||||
</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">-->
|
||||
<!--<a href="#user_09" >我的任务</a>-->
|
||||
<!--</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><!--sy_class_leftnav end-->
|
||||
|
||||
<div class="fontGrey5 mt10 ml20">访问计数 <%= @user.visits.to_i %> (自2016年5月)</div>
|
||||
</div>
|
||||
<div class="homepageRight">
|
||||
|
@ -367,6 +295,11 @@
|
|||
$('#user_hide_course').hide();
|
||||
$('#user_hide_project').hide();
|
||||
autoUrl("user_brief_introduction_show");
|
||||
if(<%= @is_course == 1 %>) {
|
||||
$("#user_course_list").addClass('active');
|
||||
} else if(<%= @is_project == 1 %>) {
|
||||
$("#user_project_list").addClass('active');
|
||||
}
|
||||
});
|
||||
|
||||
$("#courseMenu").mouseenter(function(){
|
||||
|
@ -382,18 +315,23 @@
|
|||
$("#topnav_project_menu").hide();
|
||||
});
|
||||
function leftCourseslistChange(){
|
||||
$('#homepageLeftMenuCourses').slideToggle();
|
||||
$('#hide_show_courseicon').toggleClass("homepageLeftMenuHideIcon");
|
||||
$('#hide_show_courseicon').toggleClass("homepageLeftMenuMoreIcon");
|
||||
var target = $('#user_courses_li>li');
|
||||
for(var i = 10; i < target.length; i++){
|
||||
target.eq(i).slideToggle();
|
||||
}
|
||||
$('#hide_show_courseicon').toggleClass("user_icons_closeclass");
|
||||
$('#hide_show_courseicon').toggleClass("user_icons_moreclass");
|
||||
|
||||
}
|
||||
function leftProjectslistChange(){
|
||||
var target = $('#user_projects_li>li');
|
||||
for(var i = 10; i < target.length; i++){
|
||||
target.eq(i).slideToggle();
|
||||
}
|
||||
$('#homepageLeftMenuForge').slideToggle();
|
||||
$('#hide_show_projecticon').toggleClass("homepageLeftMenuHideIcon");
|
||||
$('#hide_show_projecticon').toggleClass("homepageLeftMenuMoreIcon");
|
||||
|
||||
$('#hide_show_projecticon').toggleClass("user_icons_closeclass");
|
||||
$('#hide_show_projecticon').toggleClass("user_icons_moreclass");
|
||||
}
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
<%= call_hook :view_layouts_base_html_head %>
|
||||
<!-- page specific tags -->
|
||||
<%= yield :header_tags -%>
|
||||
<%= stylesheet_link_tag 'css/common','css/structure','css/public', :media => 'all'%>
|
||||
<%= stylesheet_link_tag 'css/common','css/structure','css/public','css/popup','syllabus','sy_public', :media => 'all'%>
|
||||
<!-- MathJax的配置 -->
|
||||
<script type="text/javascript"
|
||||
src="/javascripts/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
|
||||
|
|
|
@ -80,7 +80,7 @@
|
|||
<input nhname="tag" autocomplete="off" maxlength="36" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" id="province" name="province" style="display: none;" class="w210 fl" type="text" placeholder="--请搜索您所在的高校(单位)--" >
|
||||
<input nhname="tag" nh_tag_4="true" id="occupation" name="occupation" style="display: none;" class="w210" type="text" value="" placeholder=" --请选择您所属的单位--"/>
|
||||
<p class="fl ml10">
|
||||
<span id="errortip" class="icons_warning fl mt5" style="display: none;"></span>
|
||||
<!-- <span id="errortip" class="icons_warning fl mt5" style="display: none;"></span> -->
|
||||
<span id="hint" style="color: #7f7f7f;display: none">平台找到了<a id="school_num" href="javascript:void(0)" style="color: red" >0</a>个包含<a id="search_condition" href="javascript:void(0)">"国防"</a>的高校</span>
|
||||
</p>
|
||||
<!--<input nhname="tag" nh_tag_0="true" nh_tag_1="true" id="occupation_name" type="text" style="display: none;width:117px;" readonly/>-->
|
||||
|
@ -88,7 +88,7 @@
|
|||
<input nhname="tag" autocomplete="off" maxlength="36" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" id="province" name="province" style="display: none;" class="w210 fl" type="text" placeholder="--请搜索您所在的高校(单位)--" >
|
||||
<input nhname="tag" nh_tag_4="true" id="occupation" name="occupation" style="display: none;" class="w210" type="text" value="<%= @user.user_extensions.occupation %>" />
|
||||
<p class="fl ml10">
|
||||
<span id="errortip" class="icons_warning fl mt5" style="display: none;"></span>
|
||||
<!-- <span id="errortip" class="icons_warning fl mt5" style="display: none;"></span> -->
|
||||
<span id="hint" style="color: #7f7f7f;display: none">平台找到了<a id="school_num" href="javascript:void(0)" style="color: red" >0</a>个包含<a id="search_condition" href="javascript:void(0)">"国防"</a>的高校</span>
|
||||
</p>
|
||||
<!--<input nhname="tag" nh_tag_0="true" nh_tag_1="true" id="occupation_name" type="text" style="display: none;width:117px;" readonly/>-->
|
||||
|
@ -96,7 +96,7 @@
|
|||
<input nhname="tag" autocomplete="off" maxlength="36" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" id="province" name="province" style="display: none;" class="w210 fl" type="text" placeholder="--请搜索您所在的高校(单位)--" >
|
||||
<input nhname="tag" nh_tag_4="true" id="occupation" name="occupation" style="display: none;" class="w210" type="text" placeholder=" --请选择您所属的单位--" />
|
||||
<p class="fl ml10">
|
||||
<span id="errortip" class="icons_warning fl mt5" style="display: none;"></span>
|
||||
<!-- <span id="errortip" class="icons_warning fl mt5" style="display: none;"></span> -->
|
||||
<span id="hint" style="color: #7f7f7f;display: none">平台找到了<a id="school_num" href="javascript:void(0)" style="color: red" >0</a>个包含<a id="search_condition" href="javascript:void(0)">"国防"</a>的高校</span>
|
||||
</p>
|
||||
<!--<input nhname="tag" nh_tag_0="true" nh_tag_1="true" id="occupation_name" type="text" style="display: none;width:117px;" readonly/>-->
|
||||
|
@ -104,7 +104,7 @@
|
|||
<input nhname="tag" autocomplete="off" maxlength="36" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" id="province" name="province" style="display: none;" class="w210 fl" type="text" value="<%= User.current.user_extensions.school %>" />
|
||||
<input nhname="tag" nh_tag_4="true" id="occupation" name="occupation" type="text" style="display: none;" class="w210" value="<%= User.current.user_extensions.school.id %>"/>
|
||||
<p class="fl ml10">
|
||||
<span id="errortip" class="icons_warning fl mt5" style="display: none;"></span>
|
||||
<!-- <span id="errortip" class="icons_warning fl mt5" style="display: none;"></span> -->
|
||||
<span id="hint" style="color: #7f7f7f;display: none">平台找到了<a id="school_num" href="javascript:void(0)" style="color: red" >0</a>个包含<a id="search_condition" href="javascript:void(0)">"国防"</a>的高校</span>
|
||||
</p>
|
||||
<!--<input nhname="tag" nh_tag_0="true" nh_tag_1="true" id="occupation_name" type="text" style="display: none;width:117px;" value="<%#= User.current.user_extensions.school.name %>" readonly="true" style="background-color: #E2E2E2;"/>-->
|
||||
|
@ -466,7 +466,7 @@
|
|||
}else{
|
||||
$("#search_school_result_list").html('');
|
||||
str = e.target.value.length > 4 ? e.target.value.substr(0, 4)+"..." : e.target.value;
|
||||
$("#hint").html('您输入的名称尚不存在,<a style="color:#64bdd9" onclick="apply_add_school();" href="javascript:void(0);">申请添加</a>');
|
||||
$("#hint").html('如果找不到自己的单位,您可以<a style="color:#64bdd9" onclick="apply_add_school();" href="javascript:void(0);">添加单位</a>');
|
||||
$("#hint").show();
|
||||
$("#errortip").show();
|
||||
}
|
||||
|
|
|
@ -39,6 +39,14 @@
|
|||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% if allow_pull_request(@project) %>
|
||||
<div class="subNav">
|
||||
<%= link_to "Pull Requests", project_pull_requests_path(@project), :class => "f14 c_blue02" %>
|
||||
<%= link_to "+新建请求", new_project_pull_request_path(:project_id => @project.id), :class => "subnav_green" %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<%# --版本库被设置成私有、module中设置不显示、没有创建版本库 三种情况不显示-- %>
|
||||
<% if visible_repository?(@project) %>
|
||||
<div class="subNav">
|
||||
|
@ -57,6 +65,8 @@
|
|||
</div>
|
||||
<% end %>
|
||||
<!-- more -->
|
||||
|
||||
|
||||
<div class="subNav subNav_jiantou" id="expand_tools_expand"><%= l(:label_project_more) %></div>
|
||||
<ul class="navContent" id="navContent">
|
||||
<%= render 'projects/tools_expand' %>
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
<% if @message %>
|
||||
<div class="flash error"><%= @message %></div>
|
||||
<% end %>
|
||||
|
||||
<% if @fork_pr_message %>
|
||||
<div class="flash notice">您的Pull Request请求已成功发送至源项目:<%= @fork_project_name %></div>
|
||||
<% end %>
|
|
@ -0,0 +1,85 @@
|
|||
<%= form_tag(url_for(:controller => 'pull_requests', :action => 'create', :project_id => @project.id, :forked_project_id => @forked_project.try(:gpid)), :id => 'pull_request_form', :method => "post", :remote => true) do %>
|
||||
<div class="new-merge-wrap">
|
||||
<div class="merge-option-name fl mt8"><span class="c_red">*</span>标题</div><input type="text" id="pr_name" name="title" class="merge-title-input fl ml30" />
|
||||
<p id ="pull_request_title" class="fl ml100 fontGrey2 mt5 c_red" style="display: none">标题不能为空</p>
|
||||
<div class="cl mb10"></div>
|
||||
<div class="merge-option-name fl">描述</div><textarea type="text" name="description" class="merge-description-input fl ml30"></textarea>
|
||||
<!--<p class="fl ml100 f12 mt5"><a href="javascript:void(0);" class="AnnexBtn fl mr10">上传附件</a></p>-->
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="new-merge-wrap borderBottomNone">
|
||||
<div class="merge-option-name fl" style="padding:5px 0">源分支</div>
|
||||
<%= select_tag :branch, options_for_select(@source_rev), :id => "source_branch", :name => "source_branch", :value => "source_branch", :class => "ml30 fontGrey3 fb fl", :style => "padding:5px 0 5px 5px;" %>
|
||||
<div class="cl mb10"></div>
|
||||
<div class="merge-option-name fl" style="padding:5px 0">目标分支</div>
|
||||
<% if @forked_project.nil? %>
|
||||
<%= select_tag :branch, options_for_select(@source_rev), :id => "pull_request_branch", :name => "target_branch", :value => "target_branch",:class => "ml30 fontGrey3 fb fl", :style => "padding:5px 0 5px 5px;" %>
|
||||
<% else %>
|
||||
<select onchange="choice_branch(this.value, document.getElementById('pull_request_branch'), <%= @source_rev %>, <%= @forked_rev %>);" name="source_project" value="source_project" class="ml30 fontGrey3 fb fl" style = "padding:5px 0 5px 5px;">
|
||||
<option value="source_project_name"><%= @source_project_name %></option>
|
||||
<option value="forked_project_name"><%= @forked_project_name %></option>
|
||||
</select>
|
||||
<select name="target_branch" id="pull_request_branch" class = "ml30 fontGrey3 fb fl" style = "width:140px; padding:5px 0 5px 5px;">
|
||||
<% @source_rev.each do |rev| %>
|
||||
<option value="<%= rev %>"><%= rev %></option>
|
||||
<% end %>
|
||||
</select>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
<p id ="pull_request_branch_error" class="ml100 fontGrey2 mt5 c_red" style="display: none">同一个项目的源分支和目标分支不能相同</p>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="new-merge-row b_grey" style="border-top:1px solid #ddd;">
|
||||
<a href="javascript:void(0);" class="BlueCirBtn fl ml10" onclick="pull_request_commit()">提交请求</a>
|
||||
<%= link_to "返回", project_pull_requests_path(:project_id => @project.id), :class => "fr linkGrey2 mt5 mr10" %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<script>
|
||||
function regex_pr_name()
|
||||
{
|
||||
var name = $.trim($("#pr_name").val());
|
||||
if(name.length == 0)
|
||||
{
|
||||
$("#pull_request_title").show();
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#pull_request_title").hide();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
function regex_branch()
|
||||
{
|
||||
var source_branch = $.trim($("#source_branch").val());
|
||||
var target_branch = $.trim($("#pull_request_branch").val());
|
||||
if(source_branch == target_branch)
|
||||
{
|
||||
$("#pull_request_branch_error").show();
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#pull_request_branch_error").hide();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
//提交pull request
|
||||
function pull_request_commit()
|
||||
{
|
||||
if(regex_pr_name())
|
||||
{
|
||||
$("#pull_request_form").submit();
|
||||
}
|
||||
}
|
||||
|
||||
//切换项目时,替换分支
|
||||
$("#targetProject").change(function(){
|
||||
var defaultBranch = $("#targetBranch option:first-child").val();
|
||||
$("#targetBranch").val(defaultBranch);
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,30 @@
|
|||
<div id="pull_request_new_form">
|
||||
<div id="create_pull_request_error">
|
||||
<%= render :partial => "pull_requests/error_message" %>
|
||||
</div>
|
||||
|
||||
<div class="new-merge-request">
|
||||
<div class="f14 fontGrey3 fb mb10">新的合并请求</div>
|
||||
</div>
|
||||
<%= render :partial => "pull_requests/form" %>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$("#pull_request_new_form").parent().css("width","730px");
|
||||
|
||||
$("#changed-files").toggle(function(){
|
||||
$("#changed-files-detail").show();
|
||||
},function(){
|
||||
$("#changed-files-detail").hide();
|
||||
});
|
||||
|
||||
$(".merge-record li a").click(function(){
|
||||
$(".merge-record li a").removeClass("active");
|
||||
$(this).addClass("active");
|
||||
|
||||
var index = $(".merge-record li a").index(this);
|
||||
|
||||
$("#merge_record_0, #merge_record_1").hide();
|
||||
$("#merge_record_" + index).show();
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,33 @@
|
|||
<% unless @changes.blank? %>
|
||||
<% @changes.each do |cd| %>
|
||||
<div class="showing-changes-row fontGrey2" style="width:710px;">
|
||||
<a class="linkGrey3" id="changed-files">
|
||||
<img src="/images/vlicon/file.png" width="18" height="20" style="vertical-align:middle;" class="mr5" /><%= cd['new_path'] %>
|
||||
</a>
|
||||
</div>
|
||||
<div class="autoscroll">
|
||||
<table class="filecontent syntaxhl" style="width:100%;" >
|
||||
<tbody>
|
||||
<% line_num = diff_line_num(cd['diff']) %>
|
||||
<% diff_content = diff_content(cd['diff']) %>
|
||||
<% syntax_highlight_lines('new_path', Redmine::CodesetUtil.to_utf8_by_setting(diff_content)).each do |line| %>
|
||||
<tr>
|
||||
<th class="line-num" id="L<%= line_num %>" style="vertical-align: top;">
|
||||
<a href="#L<%= line_num %>" style="padding-top: 0px;"><%= line_num %></a>
|
||||
</th>
|
||||
<% if line[0,1] == "-" %>
|
||||
<td class="line-code diff_out"><pre style="white-space:pre;"><%= line.html_safe %></pre></td>
|
||||
<% elsif line[0,1] == "+" %>
|
||||
<td class="line-code diff_in"><pre style="white-space:pre;"><%= line.html_safe %></pre></td>
|
||||
<% else%>
|
||||
<td class="line-code"><pre style="white-space:pre;"><%= line.html_safe %></pre></td>
|
||||
<% end %>
|
||||
</tr>
|
||||
<% line_num += 1 %>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
<% @commits.each do |commit| %>
|
||||
<div class="new-merge-wrap">
|
||||
<div class="merge-commit-time">
|
||||
<img width="16" class="ui-datepicker-trigger mr15" style="cursor:default; margin-top:3px; margin-left:0;" /><span class="fontGrey3"><%= format_date(commit.created_at) %></span>
|
||||
<!--<p class="mt10 fontGrey2">1次提交</p>-->
|
||||
<p class="mt10 fontGrey2"><%= link_to commit.author_name, user_path(get_user_by_mail(commit.author_email)), :class => "link-blue" %>创建于<%= time_tag(commit.created_at) %>前</p>
|
||||
</div>
|
||||
<div class="merge-commit-detail">
|
||||
<span class="fontGrey3 fb"><%= commit.title %></span>
|
||||
|
||||
</div>
|
||||
<div class="merge-commit-code">
|
||||
<span class="fontGrey3">
|
||||
<%= link_to truncate(commit.short_id, :length => 20), {:controller => 'repositories', :action => 'commit_diff', :id => @project.id, :changeset => commit.id}, :target => "_blank" %>
|
||||
</span>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% end %>
|
|
@ -0,0 +1,3 @@
|
|||
<script>
|
||||
$("#RSide").before("<div class='homepageRightBanner mb10'><span class='f16 fontGrey3'>Pull Request</span></div>");
|
||||
</script>
|
|
@ -0,0 +1,15 @@
|
|||
<% if @requests.blank? %>
|
||||
<div class="no-merge-content">没有可显示的请求</div>
|
||||
<% else %>
|
||||
<% @requests.each do |request| %>
|
||||
<li>
|
||||
<% request %>
|
||||
<%=link_to request.title, project_pull_request_path(request.id, :project_id => @project.id), :class => "linkGrey3 fb fl"%>
|
||||
<!--<a href="javascript:void(0);" class="fr fontGrey2 fb"><img src="/images/comments.png" class="mr5" width="15" />0</a><span class="fr mr15 fb fontGrey2">关闭</span>-->
|
||||
<div class="cl mb5"></div>
|
||||
<span class="fontGrey2">由 <%= link_to request.author.try(:username), user_path(get_user_by_login_and(request.author.try(:username))), :class => "link-blue" %> 创建于<%= time_tag(request.created_at) %></span>
|
||||
<span class="fr fontGrey2"><%= time_tag(request.updated_at) %>更新</span>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<% end %>
|
||||
<% end %>
|
|
@ -0,0 +1,69 @@
|
|||
<div id="create_pull_request_error">
|
||||
<%= render :partial => "pull_requests/error_message" %>
|
||||
</div>
|
||||
|
||||
<div id="pull_request_show">
|
||||
<div id="mergeShow" class="f14 fontGrey2 merge-show">
|
||||
<span class="mr10 open-status"><%= @request.state == "merged" ? "已合并" : "待处理" %></span><span class="mr10">合并请求</span> 由<%= link_to @request.author.try(:username), user_path(get_user_by_login_and(@request.author.try(:username))), :class => "link-blue" %>于<%= time_tag(@request.created_at) %>提交 · 最后编辑时间<%= time_tag(@request.updated_at) %>
|
||||
<!--<a href="javascript:void(0);" class="BlueCirBtnMini fr mt5">编辑</a>-->
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="new-merge-row b_grey"><strong><%= @request.title %></strong><p class="mt10"><%= @request.description %></p></div>
|
||||
<div class="mt10 mb15">
|
||||
请求将 <span class="fontGrey3 fb"><%= @request.source_branch %></span> 合并至 <span class="fontGrey3 fb"><%= @request.target_branch %></span>
|
||||
|
||||
<% if @commits_count == 0 && @changes_count == 0 %>
|
||||
<div class="merge-commit-option mt15">
|
||||
<span class="fontGrey3 fb" style="font-size:13px;"><img src="/images/warning.png" width="16" class="mr5 mt2 fl"><%= @request.source_branch %>没有新内容可以合并至<%= @request.target_branch %></span><br />
|
||||
<p class="fontGrey2 mt5">请将新改动提交至源分支或者切换到其它目标分支</p>
|
||||
</div>
|
||||
</div>
|
||||
<% else %>
|
||||
<% if @request.state == "merged" %>
|
||||
<div class="merge-commit-option mt15">
|
||||
<span class="fontGrey3 fb" style="font-size:13px;"><%#= link_to @request.author.try(:username), user_path(get_user_by_login_and(@request.author.try(:username))), :class => "link-blue" %>于<%= time_tag(@request.created_at) %> 前合并</span><br />
|
||||
<p class="fontGrey2 mt5">改动已合并至<%= @request.target_branch %></p>
|
||||
</div>
|
||||
<% else %>
|
||||
<% if is_project_manager?(User.current.id, @project.id) %>
|
||||
<div class="merge-commit-option mt15">
|
||||
<%= link_to "接受请求", accept_pull_request_project_pull_request_path(@request.id, :project_id => @project.id), :class => "BlueCirBtn", :remote => true %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
<ul class="merge-record" style="border-top:1px solid #ddd;">
|
||||
<li><%= link_to "提交<span class='project-number-dot'>#{@commits_count}</span>".html_safe, pull_request_commits_project_pull_request_path(@request.id, :project_id => @project.id, :type => 1), :remote => true, :class => "active" %></li>
|
||||
<li><%= link_to "改动<span class='project-number-dot'>#{@changes_count}</span>".html_safe, pull_request_changes_project_pull_request_path(@request.id, :project_id => @project.id, :type => 2), :remote => true %></li>
|
||||
</ul>
|
||||
<div class="new-merge-row b_grey fontGrey2"><span class="ml10"> 根据最近提交时间排列</span></div>
|
||||
<div id="merge_record_0">
|
||||
<%= render :partial => "pull_requests/pull_request_commits" %>
|
||||
</div>
|
||||
<div id="merge_record_1" class="undis">
|
||||
<%= render :partial => "pull_requests/pull_request_changes" %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
$("#pull_request_show").parent().css("width","730px");
|
||||
|
||||
$("#changed-files").toggle(function(){
|
||||
$("#changed-files-detail").show();
|
||||
},function(){
|
||||
$("#changed-files-detail").hide();
|
||||
});
|
||||
|
||||
$(".merge-record li a").click(function(){
|
||||
$(".merge-record li a").removeClass("active");
|
||||
$(this).addClass("active");
|
||||
|
||||
var index = $(".merge-record li a").index(this);
|
||||
|
||||
$("#merge_record_0, #merge_record_1").hide();
|
||||
$("#merge_record_" + index).show();
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,2 @@
|
|||
$("#create_pull_request_error").html('<%= escape_javascript(render :partial => "pull_requests/error_message") %>');
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
<%= render :partial => "pull_requests/pull_request_container" %>
|
||||
<%= render :partial => "pull_requests/new" %>
|
||||
|
|
@ -0,0 +1 @@
|
|||
$("#create_pull_request_error").html('<%= escape_javascript(render :partial => "pull_requests/error_message") %>');
|
|
@ -0,0 +1,22 @@
|
|||
<%= render :partial => "pull_requests/pull_request_container" %>
|
||||
<ul id="mergeBanner" class="project-merge-banner">
|
||||
<li class="active"><%= link_to "待处理<span class='project-number-dot'>#{@requests_opened_count}</span>".html_safe, project_pull_requests_path(:type => "1"), :remote => true %></li>
|
||||
<li><%= link_to "已处理<span class='project-number-dot'>#{@requests_merged_count}</span>".html_safe, project_pull_requests_path(:type => "2"), :remote => true %></li>
|
||||
|
||||
<%= link_to "创建Pull Request", new_project_pull_request_path, :class => "BlueCirBtn fr ml10 mt10", :style => "width:110px;" %>
|
||||
<div class="cl"></div>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
|
||||
<ul class="project-merge-content" id="pull_requests_list">
|
||||
<%= render "pull_requests/pull_requests_list" %>
|
||||
</ul>
|
||||
|
||||
<script>
|
||||
$("#mergeBanner").parent().css("width","730px");
|
||||
|
||||
$(".project-merge-banner li").click(function(){
|
||||
$(".project-merge-banner li").removeClass("active");
|
||||
$(this).addClass("active");
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1 @@
|
|||
$("#pull_requests_list").html('<%= escape_javascript( render :partial => "pull_requests/pull_requests_list", :locals => {:type => @type} ) %>');
|
|
@ -0,0 +1,3 @@
|
|||
<%= render :partial => "pull_requests/pull_request_container" %>
|
||||
<%= render :partial => "pull_requests/new" %>
|
||||
|
|
@ -0,0 +1 @@
|
|||
$("#merge_record_1").html('<%= escape_javascript( render :partial => "pull_requests/pull_request_changes", :locals => {:type => @type} ) %>');
|
|
@ -0,0 +1 @@
|
|||
$("#merge_record_0").html('<%= escape_javascript( render :partial => "pull_requests/pull_request_commits", :locals => {:type => @type} ) %>');
|
|
@ -0,0 +1,2 @@
|
|||
<%= render :partial => "pull_requests/pull_request_container" %>
|
||||
<%= render :partial => "pull_requests/show" %>
|
|
@ -0,0 +1,3 @@
|
|||
<%# 详情页面和新建页面都会跳入,所以用两种局部刷新 %>
|
||||
$("#pull_request_new_form").html('<%= escape_javascript(render :partial => "pull_requests/show") %>');
|
||||
$("#pull_request_show").html('<%= escape_javascript(render :partial => "pull_requests/show") %>');
|
|
@ -1,7 +1,7 @@
|
|||
<div class="commit-row-info">
|
||||
<% if !user_commit_rep(changeset.author_email).nil? %>
|
||||
<a class="commit-author-link has_tooltip"> <span class="commit-author-name">
|
||||
<%= image_tag(url_to_avatar(user_commit_rep(changeset.author_email)), :width => "20", :height => "20", :class => "fl portraitRadius mt2 ml4 mr5") %>
|
||||
<%= image_tag(url_to_avatar(user_commit_rep(changeset.author_email)), :width => "20", :height => "20", :class => "fl portraitRadius mt2 ml4 mr5") %>
|
||||
<%= link_to user_commit_rep(changeset.author_email), user_path(user_commit_rep(changeset.author_email)), :length => 30 %></span></a>提交于
|
||||
<div class="committed_ago">
|
||||
<time class="time_ago js-timeago" title="<%= changeset.created_at %>"><%= time_tag(changeset.created_at) %>前 </time>
|
||||
|
|
|
@ -1,12 +1,17 @@
|
|||
<div id="popbox02">
|
||||
<div class="ni_con">
|
||||
<p style="display: block;font-size: 14px;margin-left: 30px;margin-top: 20px;">
|
||||
题目已发送到目标课程的作业列表,但需要您设置发布和截止时间,以激活相应作业,谢谢!
|
||||
</p>
|
||||
<div class="ni_btn">
|
||||
<a href="javascript:void(0)" class="tijiao c_white ml45" onclick="hideModal();">
|
||||
确 定
|
||||
</a>
|
||||
</div>
|
||||
<div id="sy_popup_box" style="width:380px;">
|
||||
<div class="sy_popup_top sy_popup_top_tishi">
|
||||
<h3 class="fl">提示</h3>
|
||||
<a href="javascript:void(0);" class="sy_icons_close02 fr" onclick="hideModal()"></a>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="sy_popup_con02" >
|
||||
<ul class="sy_popup_tishi">
|
||||
<li>
|
||||
题目已发送到目标课程的作业列表,但需要您设置发布和截止时间,以激活相应作业,谢谢!
|
||||
</li>
|
||||
<li>
|
||||
<a href="javascript:void(0);" class="sy_btn_blue mt10" onclick="hideModal()">知道了</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
|
@ -1,52 +1,42 @@
|
|||
<div class="subjectDetail fl mt10">
|
||||
<div class="subjectInfo">题目信息</div>
|
||||
<div class="subject-content-wrapper">
|
||||
<% if homework.nil? %>
|
||||
<span id="homework_notice_span"><span class="center db">本题库遵循创作共用许可证</span><br>
|
||||
|
||||
教师给学生出题本质上是一种创作行为,题目的作者通常为此付出大量时间和精力。好的题目不仅能加深学生对知识点的理解,还能激发学生兴趣,提升学习效率。为此,本网站的题库许可证基于创作共用许可证( Creative Commons License )建立,其核心条款包括:<br/><br/>
|
||||
|
||||
1. 署名:必须提到原作者。<br/><br/>
|
||||
|
||||
2. 非商业用途:不得用于盈利性目的。<br/><br/>
|
||||
|
||||
3. 相同方式共享:允许修改原作品,但必须使用相同的许可证发布。<br/><br/>
|
||||
|
||||
对此许可证的支持或反对,请在网站中留言,我们不断完善,谢谢!
|
||||
</span>
|
||||
<!-- <%# elsif homework.nil? && status == 1 %>
|
||||
<span class="c_red">您选中的作业目前为私有作业,您的分享请求已发送至老师,请耐心等待老师的同意。</span>
|
||||
<%# elsif homework.nil? && status == 2 %>
|
||||
<span class="c_red">您选中的作业目前为私有作业,请点击“请求分享”按钮向题目的作者发送分享请求吧!<br/>
|
||||
祝您成功:)
|
||||
</span>
|
||||
<%# elsif homework.nil? && status == 3 %>
|
||||
<span class="c_red">您选中的作业目前为私有作业,您的分享请求已被老师拒绝,暂时不可查看作业详情。</span>-->
|
||||
<% else %>
|
||||
<div class="subjectIntro mb15">标题:<%=homework.name %><br />
|
||||
来源:<%=homework.course.name %><br />
|
||||
<% if homework.homework_type == 2 && homework.homework_detail_programing %>
|
||||
编程语言:<%=homework.language_name %><br/>
|
||||
<% end %>
|
||||
贡献者:<%=homework.user.show_name %>
|
||||
<% if homework.user.user_extensions.occupation && homework.user.user_extensions.occupation!="" %>
|
||||
,<%=homework.user.user_extensions.occupation%>
|
||||
<% end %>
|
||||
<br />
|
||||
描述如下:
|
||||
</div>
|
||||
<div class="subjectContent" id="homework_description">
|
||||
<%=homework.description.html_safe %>
|
||||
</div>
|
||||
<% if homework.homework_type == 2 %>
|
||||
<div class="subjectContent mt10">
|
||||
测试集:<%=homework.homework_tests.count %>组
|
||||
</div>
|
||||
<% elsif homework.homework_type ==3 && homework.homework_detail_group %>
|
||||
<div class="subjectContent mt10">
|
||||
分组人数:<%=homework.homework_detail_group.min_num %> - <%=homework.homework_detail_group.max_num %>人
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<div class="hw_popup_box" style="padding-bottom:30px;">
|
||||
<div class="hw_popup_top clear">
|
||||
<a href="javascript:void(0);" class="hw_icons_close fr" style="outline: none;" onclick="hideModal()"></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hw_popup_con">
|
||||
<div class="clear">
|
||||
<h3 class="sy_classlist_title fl"><%=@homework.name %></h3>
|
||||
<span class="hw_icon_open fl mt3"></span>
|
||||
</div>
|
||||
<span class=" mr15">作者:<%=link_to @homework.user.show_name, user_path(@homework.user_id), :class => 'hw_cgrey', :target => '_blank'%></span>
|
||||
<div class="hw_popup_txt">
|
||||
<p><%=@homework.description.html_safe %></p>
|
||||
<% if @homework.homework_type == 2 %>
|
||||
<p class="subjectContent mt10">
|
||||
测试集:<%=@homework.homework_tests.count %>组
|
||||
</p>
|
||||
<% if @homework.user == User.current && @homework.homework_tests.count > 0 %>
|
||||
<table class="hw_popup_testtable" cellpadding="0" cellspacing="0">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="test_td_min"> </td>
|
||||
<td class="test_td_title">测试集输入</td>
|
||||
<td class="test_td_title">测试集输出</td>
|
||||
</tr>
|
||||
<% @homework.homework_tests.each_with_index do |test, i| %>
|
||||
<tr>
|
||||
<td class="test_td_min"><%=i+1 %></td>
|
||||
<td><%=test.input %></td>
|
||||
<td ><%=test.output %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<% end %>
|
||||
<% elsif @homework.homework_type ==3 && @homework.homework_detail_group %>
|
||||
<p class="subjectContent mt10">
|
||||
分组人数:<%=@homework.homework_detail_group.min_num %> - <%=@homework.homework_detail_group.max_num %>人
|
||||
</p>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,39 +1,58 @@
|
|||
<ul class="subject-list-banner">
|
||||
<li class="subject-list-name fl hidden"><span style="padding-left:15px;">作业名称</span></li>
|
||||
<li class="subject-list-from fl">
|
||||
<%= link_to "来源",user_search_homeworks_user_path(@user,:name=>search,:type => type,:is_import=>is_import,:property=>property,:order => "course_name", :sort => @r_sort),:class => "fl ml55",:remote => true%>
|
||||
<% if @order == "course_name"%>
|
||||
<%= link_to "", user_search_homeworks_user_path(@user,:name=>search,:type => type,:is_import=>is_import,:property=>property,:order => "course_name", :sort => @r_sort),:class => "#{@r_sort == 'desc' ? 'st_up' : 'st_down'} mt12 fl" ,:remote => true%>
|
||||
<% end%>
|
||||
</li>
|
||||
<li class="subject-list-type fl">
|
||||
<%= link_to "类别",user_search_homeworks_user_path(@user,:name=>search,:type => type,:is_import=>is_import,:property=>property,:order => "homework_type", :sort => @r_sort),:class => "fl ml10",:remote => true%>
|
||||
<% if @order == "homework_type"%>
|
||||
<%= link_to "", user_search_homeworks_user_path(@user,:name=>search,:type => type,:is_import=>is_import,:property=>property,:order => "homework_type", :sort => @r_sort),:class => "#{@r_sort == 'desc' ? 'st_up' : 'st_down'} mt12 fl" ,:remote => true%>
|
||||
<% end%>
|
||||
</li>
|
||||
<li class="subject-list-publisher fl">
|
||||
<%= link_to "贡献者",user_search_homeworks_user_path(@user,:name=>search,:type => type,:is_import=>is_import,:property=>property,:order => "user_name", :sort => @r_sort),:class => "fl ml20",:remote => true%>
|
||||
<% if @order == "user_name"%>
|
||||
<%= link_to "", user_search_homeworks_user_path(@user,:name=>search,:type => type,:is_import=>is_import,:property=>property,:order => "user_name", :sort => @r_sort),:class => "#{@r_sort == 'desc' ? 'st_up' : 'st_down'} mt12 fl" ,:remote => true%>
|
||||
<% end%>
|
||||
</li>
|
||||
<li class="subject-list-count fl">
|
||||
<%= link_to "引用数",user_search_homeworks_user_path(@user,:name=>search,:type => type,:is_import=>is_import,:property=>property,:order => "quotes", :sort => @r_sort),:class => "fl ml5",:remote => true%>
|
||||
<% if @order == "quotes"%>
|
||||
<%= link_to "", user_search_homeworks_user_path(@user,:name=>search,:type => type,:is_import=>is_import,:property=>property,:order => "quotes", :sort => @r_sort),:class => "#{@r_sort == 'desc' ? 'st_up' : 'st_down'} mt12 fl" ,:remote => true%>
|
||||
<% end%>
|
||||
</li>
|
||||
<li class="fl subject-list-date">
|
||||
<%= link_to "发布时间",user_search_homeworks_user_path(@user,:name=>search,:type => type,:is_import=>is_import,:property=>property,:order => "publish_time", :sort => @r_sort),:class => "fl",:remote => true%>
|
||||
<% if @order == "publish_time"%>
|
||||
<%= link_to "", user_search_homeworks_user_path(@user,:name=>search,:type => type,:is_import=>is_import,:property=>property,:order => "publish_time", :sort => @r_sort),:class => "#{@r_sort == 'desc' ? 'st_up' : 'st_down'} mt12 fl" ,:remote => true%>
|
||||
<% end%>
|
||||
</li>
|
||||
<li class="fl subject-list-option">
|
||||
操作
|
||||
</li>
|
||||
</ul>
|
||||
<div id="homework_repository">
|
||||
<%=render :partial => 'homework_repository', :locals => {:homeworks => homeworks} %>
|
||||
</div>
|
||||
<% if homeworks.empty? %>
|
||||
<div class="icons_tishi"><img src="/images/sy/icons_tan.png" width="110" height="110" alt="" ></div>
|
||||
<p class="sy_tab_con_p">暂无可显示的内容~</p>
|
||||
<% else %>
|
||||
<% homeworks.each do |homework| %>
|
||||
<ul class="sy_classlist">
|
||||
<span class="hw_icons_cir fl mt5 mr5"></span>
|
||||
<div class="fl ">
|
||||
<h3 class="sy_classlist_title fl">
|
||||
<% if type == "1" %>
|
||||
<%=link_to homework.name, student_work_index_path(:homework => homework), :class => 'hw_cgrey', :target => "_blank" %>
|
||||
<% else %>
|
||||
<%=homework.name %>
|
||||
<% end %>
|
||||
</h3>
|
||||
<span class="<%=homework.course.is_public? ? 'hw_icon_open' : 'hw_icon_private'%> fl mt3"></span>
|
||||
<div class="cl"></div>
|
||||
<p class="sy_cgrey">
|
||||
<span class="fl">
|
||||
<span class="fl">来源:</span>
|
||||
<%=link_to homework.course.name.to_s + "(#{current_time_and_term_short(homework.course)})", course_path(homework.course), :class => 'hw_cgrey hw_list_classname fl mr15', :target => '_blank' %>
|
||||
</span>
|
||||
<% if type == "2" %>
|
||||
<span class="mr15 fl">
|
||||
<span class="fl">贡献者:</span>
|
||||
<%=link_to homework.user.show_name, user_path(homework.user_id), :class => 'hw_cgrey hw_list_teachername fl', :target => '_blank'%>
|
||||
</span>
|
||||
<% end %>
|
||||
<span class="mr15 fl">类别:
|
||||
<% case homework.homework_type %>
|
||||
<% when 1 %>
|
||||
普通
|
||||
<% when 2 %>
|
||||
编程
|
||||
<% when 3 %>
|
||||
分组
|
||||
<% end %>
|
||||
</span>
|
||||
<span class="fl mr15">引用数:<span id="subject_count_homework_<%=homework.id %>"><%= homework.quotes %></span></span>
|
||||
<% if homework.publish_time.nil? %>
|
||||
<span class="fl mr15">发布时间: - -</span>
|
||||
<% else %>
|
||||
<span class="fl mr15">发布时间:<%= format_date(homework.publish_time) %></span>
|
||||
<% end %>
|
||||
</p>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% student_ids = homework.course.student.empty? ? [] : homework.course.student.map{|student| student.student_id}.join(',') %>
|
||||
<% if student_ids.include?(User.current.id.to_s) %>
|
||||
<a href="javascript:void(0);" class="hw_btn_grey fr mt5" title="您选中的题是“我收到的作业”,不能发送">发送</a>
|
||||
<% else %>
|
||||
<a href="javascript:void(0);" class="hw_btn_green fr mt5" onclick="choose_course('<%=User.current.id%>', '<%=homework.id %>');" data-remote="true">发送</a>
|
||||
<% end %>
|
||||
<a href="javascript:void(0);" class="hw_btn_green fr mt5 mr5" onclick="show_homework_detail('<%=show_homework_detail_user_path(@user,:homework=>homework.id,:is_import => 0) %>')" data-remote="true">预览</a>
|
||||
<div class="cl"></div>
|
||||
</ul>
|
||||
<% end %>
|
||||
<% end %>
|
|
@ -1,4 +1,12 @@
|
|||
<input type="text" name="search" placeholder="输入作业、老师姓名的关键词进行搜索" class="subject-pop-search fr" />
|
||||
<div id="homework_repository_sort">
|
||||
<%= render :partial => 'users/homework_repository_sort', :locals => {:type => type,:is_import => is_import,:property => property,:order => @order,:search => search} %>
|
||||
</div>
|
||||
|
||||
<div class="hw_search_box fr mr10">
|
||||
<input class="hw_search-input" name="search" value='<%=search %>' placeholder="输入作业、老师姓名的关键词进行搜索" type="text" >
|
||||
<span class="hw_btn_search"></span>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<script type="text/javascript">
|
||||
var lastSearchCondition = '';
|
||||
var count = 0;
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
<span class="sy_cgrey ">排序:</span>
|
||||
<%= link_to "发布时间",user_search_homeworks_user_path(@user,:name=>search,:type => type,:is_import=>is_import,:property=>property,:order => "publish_time", :sort => @r_sort),:class => "sy_cgrey fl",:remote => true%>
|
||||
<% if order == "publish_time" %>
|
||||
<%= link_to "", user_search_homeworks_user_path(@user,:name=>search,:type => type,:is_import=>is_import,:property=>property,:order => "publish_time", :sort => @r_sort), :class => "#{@r_sort == 'asc' ? 'sortupbtn' : 'sortdownbtn'} mt15 fl", :remote => true %>
|
||||
<% else %>
|
||||
<%= link_to "", user_search_homeworks_user_path(@user,:name=>search,:type => type,:is_import=>is_import,:property=>property,:order => "publish_time", :sort => @r_sort), :class => "sortdownbtn sort_no mt15 fl", :remote => true %>
|
||||
<% end %>
|
||||
<%= link_to "引用数",user_search_homeworks_user_path(@user,:name=>search,:type => type,:is_import=>is_import,:property=>property,:order => "quotes", :sort => @r_sort),:class => "sy_cgrey fl",:remote => true%>
|
||||
<% if order == "quotes" %>
|
||||
<%= link_to "", user_search_homeworks_user_path(@user,:name=>search,:type => type,:is_import=>is_import,:property=>property,:order => "quotes", :sort => @r_sort), :class => "#{@r_sort == 'asc' ? 'sortupbtn' : 'sortdownbtn'} mt15 fl", :remote => true %>
|
||||
<% else %>
|
||||
<%= link_to "", user_search_homeworks_user_path(@user,:name=>search,:type => type,:is_import=>is_import,:property=>property,:order => "quotes", :sort => @r_sort), :class => "sortdownbtn sort_no mt15 fl", :remote => true %>
|
||||
<% end %>
|
|
@ -0,0 +1,45 @@
|
|||
<div class="sy_classbox" >
|
||||
<% if homeworks.empty? %>
|
||||
<div class="icons_tishi"><img src="/images/sy/icons_tan.png" width="110" height="110" alt="" ></div>
|
||||
<p class="sy_tab_con_p">暂无可显示的内容~</p>
|
||||
<% else %>
|
||||
<% homeworks.each do |homework| %>
|
||||
<ul class="sy_classlist">
|
||||
<span class="hw_icons_cir fl mt5 mr5"></span>
|
||||
<div class="fl ">
|
||||
<h3 class="sy_classlist_title fl">
|
||||
<%= link_to homework.name, student_work_index_path(:homework => homework.id), :class => 'sy_cblack', :target => '_blank' %>
|
||||
</h3>
|
||||
<div class="cl"></div>
|
||||
<p class="sy_cgrey clear">
|
||||
<span class="fl">来源:</span>
|
||||
<%= link_to homework.course.name, course_path(homework.course), :target => '_blank', :class => 'hw_cgrey hw_classname fl mr15' %>
|
||||
<span class="mr15 fl">类别:<%=homework.homework_type_ch %></span>
|
||||
<span class="fl">作品:</span>
|
||||
<span class="sy_corange hw_w20 fl "><%=homework.student_works.has_committed.count %></span>
|
||||
<span class="fl">/</span>
|
||||
<span class="sy_cgrey hw_w20 fl mr15"><%= homework.homework_type == 3 ? '--' : homework.course.student.count %></span>
|
||||
<span class="fl">待评阅:</span>
|
||||
<span class="sy_corange hw_w20 fl"><%= homework.student_works.has_committed.where("teacher_score is null and teaching_asistant_score is null").count %></span>
|
||||
<span class="fl">/</span>
|
||||
<span class="sy_cgrey hw_w20 fl mr15"><%=homework.student_works.has_committed.count %></span>
|
||||
<span class="mr15 fl">发布时间:
|
||||
<% if homework.publish_time %>
|
||||
<%= format_date(homework.publish_time) %>
|
||||
<% else %>
|
||||
<span> -- </span>
|
||||
<% end %>
|
||||
</span>
|
||||
<span class="mr15 fl"><%=(cur_homework_end_time homework).html_safe %></span>
|
||||
</p>
|
||||
</div>
|
||||
<% if homework.student_works.has_committed.count == 0 %>
|
||||
<%= link_to '编 辑'.html_safe, edit_homework_common_path(homework, :is_manage => is_manage), :class => 'hw_btn_green fr mt5', :target => '_blank' %>
|
||||
<% else %>
|
||||
<%= link_to '评 分'.html_safe, student_work_index_path(:homework => homework.id), :class => 'hw_btn_green fr mt5', :target => '_blank' %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</ul>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
|
@ -0,0 +1,11 @@
|
|||
<div class="hw_tab_top clear">
|
||||
<span class="sy_cgrey fl"><%= @manage_pre ? '我管理的作业:' : '我收到的的作业:' %></span>
|
||||
<%= link_to '查看更多', @manage_pre ? manage_or_receive_homeworks_user_path(@user) : manage_or_receive_homeworks_user_path(@user, :type =>2), :class => 'sy_cgrey fr mr15' %>
|
||||
</div>
|
||||
<%= render :partial => "#{@manage_pre ? 'manage_homework_list' : 'receive_homework_list'}", :locals => {:homeworks => @manage_pre ? @manage_homeworks : @receive_homeworks, :is_manage => 2} %>
|
||||
|
||||
<div class="hw_tab_top clear">
|
||||
<span class="sy_cgrey fl"><%= @manage_pre ? '我收到的的作业:' : '我管理的作业:' %></span>
|
||||
<%= link_to '查看更多', @manage_pre ? manage_or_receive_homeworks_user_path(@user, :type =>2) : manage_or_receive_homeworks_user_path(@user), :class => 'sy_cgrey fr mr15' %>
|
||||
</div>
|
||||
<%= render :partial => "#{@manage_pre ? 'receive_homework_list' : 'manage_homework_list'}", :locals => {:homeworks => @manage_pre ? @receive_homeworks : @manage_homeworks, :is_manage => 2} %>
|
|
@ -0,0 +1,22 @@
|
|||
<span class="sy_cgrey ">排序:</span>
|
||||
<% if type == 1 %>
|
||||
<%= link_to "发布时间",search_m_r_homeworks_user_path(@user,:name=>search,:type => type,:property=>property,:order => "publish_time", :sort => @r_sort),:class => "sy_cgrey fl",:remote => true%>
|
||||
<% if order == "publish_time" %>
|
||||
<%= link_to "", search_m_r_homeworks_user_path(@user,:name=>search,:type => type,:property=>property,:order => "publish_time", :sort => @r_sort), :class => "#{@r_sort == 'asc' ? 'sortupbtn' : 'sortdownbtn'} mt15 fl", :remote => true %>
|
||||
<% else %>
|
||||
<%= link_to "", search_m_r_homeworks_user_path(@user,:name=>search,:type => type,:property=>property,:order => "publish_time", :sort => @r_sort), :class => "sortdownbtn sort_no mt15 fl", :remote => true %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<%= link_to "状态", search_m_r_homeworks_user_path(@user,:name=>search,:type => type,:property=>property,:order => "status", :sort => @r_sort),:class => "sy_cgrey fl",:remote => true%>
|
||||
<% if order == "status" %>
|
||||
<%= link_to "", search_m_r_homeworks_user_path(@user,:name=>search,:type => type,:property=>property,:order => "status", :sort => @r_sort), :class => "#{@r_sort == 'asc' ? 'sortupbtn' : 'sortdownbtn'} mt15 fl", :remote => true %>
|
||||
<% else %>
|
||||
<%= link_to "", search_m_r_homeworks_user_path(@user,:name=>search,:type => type,:property=>property,:order => "status", :sort => @r_sort), :class => "sortdownbtn sort_no mt15 fl", :remote => true %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<%= link_to "截止时间",search_m_r_homeworks_user_path(@user,:name=>search,:type => type,:property=>property,:order => "end_time", :sort => @r_sort),:class => "sy_cgrey fl",:remote => true%>
|
||||
<% if order == "end_time" %>
|
||||
<%= link_to "", search_m_r_homeworks_user_path(@user,:name=>search,:type => type,:property=>property,:order => "end_time", :sort => @r_sort), :class => "#{@r_sort == 'asc' ? 'sortupbtn' : 'sortdownbtn'} mt15 fl", :remote => true %>
|
||||
<% else %>
|
||||
<%= link_to "", search_m_r_homeworks_user_path(@user,:name=>search,:type => type,:property=>property,:order => "end_time", :sort => @r_sort), :class => "sortdownbtn sort_no mt15 fl", :remote => true %>
|
||||
<% end %>
|
|
@ -0,0 +1,36 @@
|
|||
<div id="my_homework_sort">
|
||||
<%= render :partial => 'users/my_homework_sort', :locals => {:type => type,:property => property,:order => @order,:search => search} %>
|
||||
</div>
|
||||
|
||||
<div class="hw_search_box fr mr10">
|
||||
<input class="hw_search-input" name="search" value='<%=search %>' placeholder="输入作业关键词进行搜索" type="text" >
|
||||
<span class="hw_btn_search"></span>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<script type="text/javascript">
|
||||
var lastSearchCondition = '';
|
||||
var count = 0;
|
||||
function search_hws(e){
|
||||
if($(e.target).val().trim() == lastSearchCondition && lastSearchCondition != '')
|
||||
{
|
||||
return;
|
||||
}
|
||||
lastSearchCondition = $(e.target).val().trim();
|
||||
$.ajax({
|
||||
url: '<%= url_for(:controller => 'users', :action => 'search_m_r_homeworks') %>'+'?name='+ e.target.value+'&type=<%=type %>&property=<%=property %>',
|
||||
type:'get'
|
||||
});
|
||||
}
|
||||
|
||||
function throttle(method,context,e){
|
||||
clearTimeout(method.tId);
|
||||
method.tId=setTimeout(function(){
|
||||
method.call(context,e);
|
||||
},500);
|
||||
}
|
||||
|
||||
//查询项目
|
||||
$("input[name='search']").on('input', function (e) {
|
||||
throttle(search_hws,window,e);
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,36 @@
|
|||
<div class="sy_classbox">
|
||||
<% if homeworks.empty? %>
|
||||
<div class="icons_tishi"><img src="/images/sy/icons_tan.png" width="110" height="110" alt="" ></div>
|
||||
<p class="sy_tab_con_p">暂无可显示的内容~</p>
|
||||
<% else %>
|
||||
<% homeworks.each do |homework| %>
|
||||
<ul class="sy_classlist">
|
||||
<span class="hw_icons_cir fl mt5 mr5"></span>
|
||||
<div class="fl ">
|
||||
<h3 class="sy_classlist_title fl">
|
||||
<%= link_to homework.name, student_work_index_path(:homework => homework.id), :class => 'sy_cblack', :target => '_blank' %>
|
||||
</h3>
|
||||
<div class="cl"></div>
|
||||
<p class="sy_cgrey clear">
|
||||
<span class=" fl">来源:</span>
|
||||
<%= link_to homework.course.name, course_path(homework.course), :target => '_blank', :class => 'hw_cgrey hw_classname fl mr15' %>
|
||||
<span class="mr15 fl">类别:<%=homework.homework_type_ch %></span>
|
||||
<% my_work = cur_user_works_for_homework(homework) %>
|
||||
<span class="fl">状态:</span><span class="<%= my_work ? '' : 'hw_cir_nomal hw_cir_lorange' %> fl mr15"><%= my_work ? '已提交' : '未提交' %></span>
|
||||
<span class="fl">作品:</span><span class="sy_corange hw_w20 fl mr15"><%=homework.student_works.has_committed.count %></span>
|
||||
<span class="fl">成绩:</span>
|
||||
<% if my_work && !my_work.work_score.nil? %>
|
||||
<span class="sy_corange hw_w40 fl mr15"><%= format("%.1f",my_work.work_score.to_f) %></span>
|
||||
<% else %>
|
||||
<span class="sy_cgrey hw_w40 fl mr15">--</span>
|
||||
<% end %>
|
||||
<span class="mr15 fl">发布时间:<%= format_date homework.publish_time %></span>
|
||||
<span class="mr15 fl"><%=cur_homework_end_time homework %></span>
|
||||
</p>
|
||||
</div>
|
||||
<%= student_for_homework_common homework %>
|
||||
<div class="cl"></div>
|
||||
</ul>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
|
@ -1,18 +1,49 @@
|
|||
<div class="boxContainer" style="height: auto;">
|
||||
<div>
|
||||
<div class="sendText fl mr10" style="width: auto">发送到</div>
|
||||
<div class="hw_sendpopup_box">
|
||||
<div class="hw_sendpopup_top">
|
||||
<h3 class="fl">发送</h3>
|
||||
<a href="javascript:void(0);" class="hw_sendpopup_close fr" onclick="hideModal()"></a>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<!--<div class="resourcePopupClose"> <a href="javascript:void(0);" class="resourceClose" onclick="closeModal();"></a></div>-->
|
||||
<div class="fl">
|
||||
<!--<input type="text" name="search" placeholder="输入班级ID或者名称搜索" class="subjectSearch fr" />-->
|
||||
<input type="text" id="search_course_input" value="<%= @search %>" name="search" placeholder="输入班级ID或者名称搜索" class="mt10 mb10 course-search" />
|
||||
</div>
|
||||
<div id="send_homework_to_course_form">
|
||||
<%= render :partial => "users/send_homework_to_course_form", :locals => {:user => user, :courses => courses, :send_id => send_id} %>
|
||||
<div class="hw_sendpopup_con">
|
||||
<div class="hw_sendpopup_tishi">
|
||||
<p>选择的题目将被发送到班级作业</p>
|
||||
</div>
|
||||
<div class="hw_sendpopup_con_innner">
|
||||
<div class="hw_search_box mb10" >
|
||||
<input class="hw_sendpopup_search_input" id="search_course_input" value="<%= @search %>" name="search" placeholder="输入班级名称进行搜索" type="text" >
|
||||
<span class="hw_btn_search" style="margin-top: -10px;"></span>
|
||||
</div>
|
||||
<div id="send_homework_to_course_form">
|
||||
<%= render :partial => "users/send_homework_to_course_form", :locals => {:user => user, :courses => courses, :send_id => send_id} %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
//全选与取消全选
|
||||
//复选框事件
|
||||
//全选、取消全选的事件
|
||||
function selectAll() {
|
||||
if ($("#SelectAll").is(":checked")) {
|
||||
$(":checkbox").attr("checked", true);
|
||||
} else {
|
||||
$(":checkbox").attr("checked", false);
|
||||
}
|
||||
}
|
||||
//子复选框的事件
|
||||
function setSelectAll() {
|
||||
//当没有选中某个子复选框时,SelectAll取消选中
|
||||
if (!$("#subcheck").checked) {
|
||||
$("#SelectAll").attr("checked", false);
|
||||
}
|
||||
var chsub = $("input[type='checkbox'][id='subcheck']").length; //获取subcheck的个数
|
||||
var checkedsub = $("input[type='checkbox'][id='subcheck']:checked").length; //获取选中的subcheck的个数
|
||||
if (checkedsub == chsub) {
|
||||
$("#SelectAll").attr("checked", true);
|
||||
}
|
||||
}
|
||||
|
||||
function send_submit() {
|
||||
var checkboxs = $("input[name='course_ids[]']:checked");
|
||||
if(checkboxs.length == 0) {
|
||||
|
@ -32,7 +63,7 @@
|
|||
}
|
||||
lastSearchCondition = $(e.target).val().trim();
|
||||
$.ajax({
|
||||
url: '<%= url_for(:controller => 'users', :action => 'choose_user_course') %>'+'?search='+ e.target.value+'&send_id=<%=send_id %>',
|
||||
url: '<%= url_for(:controller => 'users', :action => 'choose_user_course') %>'+'?search='+ e.target.value+'&homework=<%=send_id %>',
|
||||
type:'get',
|
||||
data: {is_observe:true},
|
||||
success: function(data){ },
|
||||
|
|
|
@ -1,27 +1,25 @@
|
|||
<%= form_tag send_homework_to_course_user_path(user), :remote => true, :id => 'choose_course_list_form' %>
|
||||
<div>
|
||||
<%= hidden_field_tag(:send_id, send_id) %>
|
||||
<div class="courseReferContainer">
|
||||
<ul class="hw_sendpopup_searchli">
|
||||
<% if !courses.empty? %>
|
||||
<% courses.each do |course| %>
|
||||
<ul class="courseSend">
|
||||
<li class="" style="display:inline-block">
|
||||
<input name="course_ids[]" type="checkbox" value="<%= course.id %>" class="courseSendCheckbox"/>
|
||||
</li>
|
||||
<li class="sendCourseName"><%= truncate(course.name, :lendght => 25) + '['+current_time_and_term(course) + ']' %></li>
|
||||
</ul>
|
||||
<li>
|
||||
<input type="checkbox" name="course_ids[]" id="subcheck" onclick="setSelectAll();" value="<%= course.id %>" />
|
||||
<label><%=course.name + '('+current_time_and_term_short(course) + ')'%></label>
|
||||
</li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</ul>
|
||||
<div>
|
||||
<p><input type="checkbox" name="check_all" id="SelectAll" onclick="selectAll();"/><label>全选</label></p>
|
||||
<p class="clear mt5">
|
||||
<label> </label>
|
||||
<a href="javascript:void(0);" onfocus='this.blur();' onclick="send_submit();" class="sy_btn_blue fl">发 送</a>
|
||||
<a href="javascript:void(0);" onclick="hideModal();" class="sy_btn_grey fl ml10">取 消</a>
|
||||
</p>
|
||||
</div>
|
||||
<span id="choose_courses_notice" class="c_red"></span>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<span id="choose_courses_notice" class="c_red"></span>
|
||||
<div>
|
||||
<div class="courseSendSubmit">
|
||||
<a href="javascript:void(0);" onfocus='this.blur();' onclick="send_submit();" class="sendSourceText">确定</a>
|
||||
</div>
|
||||
<div class="courseSendCancel">
|
||||
<a href="javascript:void(0);" class="sendSourceText" onclick="hideModal();">取消</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<span id="choose_courses_notice" class="c_red"></span>
|
|
@ -25,8 +25,9 @@
|
|||
<%= render :partial => 'users/show_user_homework_form', :locals => {:homeworks => @homeworks}%>
|
||||
</div>
|
||||
<% end %>
|
||||
<div><span id="choose_courses_notice" class="c_red"></span></div>
|
||||
<div class="courseSendSubmit mr15">
|
||||
<a href="javascript:void(0);" class="sendSourceText" onclick="$('#select_homework_form').submit();hideModal()">选用</a>
|
||||
<a href="javascript:void(0);" class="sendSourceText" onclick="choose_homework_submit();">选用</a>
|
||||
</div>
|
||||
<div class="courseSendCancel">
|
||||
<a href="javascript:void(0);" class="sendSourceText" onclick="hideModal()">取消</a>
|
||||
|
@ -44,6 +45,26 @@
|
|||
<div class="cl"></div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
function choose_homework_submit() {
|
||||
var checkboxs = $("input[name='checkMenu']:checked");
|
||||
if(checkboxs.length == 0) {
|
||||
$("#choose_courses_notice").html("请先选择作业");
|
||||
} else{
|
||||
$.post(
|
||||
'<%=check_homework_users_path() %>',
|
||||
{homework: checkboxs.val()},
|
||||
function(data){
|
||||
if(data.status == 1) {
|
||||
$("#choose_courses_notice").html("您选中的题是“我收到的作业”,不能选用");
|
||||
} else if(data.status == 0) {
|
||||
$("#choose_courses_notice").html("");
|
||||
$('#select_homework_form').submit();
|
||||
hideModal();
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
$("#public_homeworks_choose").click(function(){
|
||||
$(this).addClass("resource-tab-active");
|
||||
$("#user_homeworks_choose").removeClass("resource-tab-active");
|
||||
|
|
|
@ -1,51 +1,24 @@
|
|||
<% if ma.class == AppliedMessage %>
|
||||
<!--申请加入项目-->
|
||||
<% if ma.applied_type == "ApplyAddSchools" %>
|
||||
<% if ma.status == 1 || ma.status == 2 || ma.status == 3 || ma.status == 0 %>
|
||||
<ul class="homepageNewsList fl">
|
||||
<li class="homepageNewsPortrait fl">
|
||||
<a href="javascript:void(0);">
|
||||
<% if ma.status == 1 || ma.status == 2 || ma.status == 3 %>
|
||||
<%= image_tag("/images/trustie_logo1.png", width: "30px", height: "30px", class: "mt3") %>
|
||||
<% elsif ma.status == 0 %>
|
||||
<%= link_to image_tag(url_to_avatar(ma.user), :width => "30", :height => "30"), user_path(ma.user), :target => '_blank' %>
|
||||
<% if ma.status == 0 %>
|
||||
<%= link_to image_tag(url_to_avatar(ma.user), :width => "30", :height => "30"), user_path(ma.user), :target => '_blank' %>
|
||||
<% else %>
|
||||
<%= image_tag("/images/trustie_logo1.png", width: "30px", height: "30px", class: "mt3") %>
|
||||
<% end %>
|
||||
</a>
|
||||
</li>
|
||||
<li class="homepageNewsPubType fl">
|
||||
<% if ma.status == 1 %>
|
||||
<span class="newsBlue homepageNewsPublisher">系统提示</span>
|
||||
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">您添加新的高校(单位):</span>
|
||||
<li class="homepageNewsContent fl">
|
||||
<a class ="#{ma.viewed == 0 ? 'newsBlack' : 'newsGrey'}" target = '_blank' title="<%= ma.name %>的申请,已通过">“<%= ma.name %>”的申请,已通过</a>
|
||||
</li>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
<% elsif ma.status == 2 %>
|
||||
<span class="newsBlue homepageNewsPublisher">系统提示</span>
|
||||
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">您添加新的高校(单位):</span>
|
||||
<li class="homepageNewsContent fl">
|
||||
<a class ="#{ma.viewed == 0 ? 'newsBlack' : 'newsGrey'}" target = '_blank' title="“<%= ma.applied.name %>”的申请,因名称不合法,系统已将其更改为“<%= ma.name %>”">“<%= ma.applied.name %>”的申请,因名称不合法,系统已将其更改为“<%= ma.name %>”</a>
|
||||
</li>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
<% elsif ma.status == 3 %>
|
||||
<span class="newsBlue homepageNewsPublisher">系统提示</span>
|
||||
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">您添加新的高校(单位):</span>
|
||||
<li class="homepageNewsContent fl">
|
||||
<%= link_to "“"+ma.name+"”" + "的申请,因名称不合法,已被拒绝,请重新编辑您的基本资料", { :controller=> "my",:action => "account" }, :title => "“#{ma.name}”的申请,因名称不合法,已被拒绝,请重新编辑您的基本资料", :target => '_blank'%>
|
||||
</li>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
<% elsif ma.status == 0 %>
|
||||
<%=link_to User.where("id=?", ma.applied_user_id).first.show_name, user_path(ma.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
|
||||
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>"> 申请了单位:</span>
|
||||
<li class="homepageNewsContent fl">
|
||||
<a class ="#{ma.viewed == 0 ? 'newsBlack' : 'newsGrey'}" target = '_blank'>
|
||||
<%= link_to User.where("id=?", ma.applied_user_id).first.show_name + "提交了申请:添加新的单位“#{ma.name}”", unapplied_schools_path(), :title => "#{User.where("id=?", ma.applied_user_id).first.show_name}提交了申请:添加新的单位“#{ma.name}”" %></a>
|
||||
</li>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
<% end %>
|
||||
<%= render :partial => "users/user_message_applied_schools", :locals =>{:ma => ma} %>
|
||||
<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>
|
||||
</ul>
|
||||
<% end %>
|
||||
<% elsif ma && ma.applied_type == "AppliedProject" %>
|
||||
<ul class="homepageNewsList fl" id="applied_project_<%= ma.id %>">
|
||||
<%= render :partial => "users/applied_project_content", :locals =>{:ma => ma} %>
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
<% if ma.status == 1 %>
|
||||
<a class ="#{ma.viewed == 0 ? 'newsBlack' : 'newsGrey'}" target = '_blank' title="<%= ma.name %>的申请,已通过审核。谢谢!">
|
||||
“<%= ma.name %>”的申请,已通过审核。谢谢!
|
||||
</a>
|
||||
<% elsif ma.status == 2 %>
|
||||
<a class ="#{ma.viewed == 0 ? 'newsBlack' : 'newsGrey'}" target = '_blank' title="“<%= ma.applied.name %>”的申请,因名称不符合规范,系统已将其更改为“<%= ma.name %>”。谢谢!">
|
||||
“<%= ma.applied.name %>”的申请,因名称不符合规范,系统已将其更改为“<%= ma.name %>”。谢谢!
|
||||
</a>
|
||||
<% elsif ma.status == 3 %>
|
||||
<%= link_to "“"+ma.name+"”" + "的申请,经确认为无效的单位信息,已被删除,请重新编辑您的单位资料。谢谢!", { :controller=> "my",:action => "account" }, :title => "“#{ma.name}”的申请,经确认为无效的单位信息,已被删除,请重新编辑您的单位资料。谢谢!", :target => '_blank'%>
|
||||
<% elsif ma.status == 0 %>
|
||||
<a class ="#{ma.viewed == 0 ? 'newsBlack' : 'newsGrey'}" target = '_blank'>
|
||||
<%= link_to User.where("id=?", ma.applied_user_id).first.show_name + "提交了申请:添加新的单位“#{ma.name}”", unapplied_schools_path(), :title => "#{User.where("id=?", ma.applied_user_id).first.show_name}提交了申请:添加新的单位“#{ma.name}”" %>
|
||||
</a>
|
||||
<% end %>
|
|
@ -0,0 +1,7 @@
|
|||
|
||||
<% if ma.status != 0 %>
|
||||
<span class="newsBlue homepageNewsPublisher">系统提示</span>
|
||||
<% else %>
|
||||
<%=link_to User.where("id=?", ma.applied_user_id).first.show_name, user_path(ma.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
|
||||
<% end %>
|
||||
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>"><%= applied_school_tip(ma) %></span>
|
|
@ -601,7 +601,7 @@
|
|||
</p>
|
||||
<p>申请班级:<%= Course.find(ma.course_id).name%></p>
|
||||
<div class="fl">班级描述:</div>
|
||||
<div class="ml60"><%= Course.find(ma.course_id).description.html_safe %></div>
|
||||
<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>
|
||||
|
|
|
@ -1,20 +1,15 @@
|
|||
<% if @status == 1 || @status == 2 || @status == 3 %>
|
||||
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/send_notice', :locals => {:status => @status}) %>');
|
||||
showModal('ajax-modal', '500px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||
"<a href='javascript:' onclick='hideModal();'><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");
|
||||
<% else %>
|
||||
<%# if @status == 1 || @status == 2 || @status == 3 %>
|
||||
// $("#ajax-modal").html('<%#= escape_javascript( render :partial => 'users/send_notice', :locals => {:status => @status}) %>');
|
||||
// showModal('ajax-modal', '500px');
|
||||
// $('#ajax-modal').siblings().remove();
|
||||
// $('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||
// "<a href='javascript:' onclick='hideModal();'><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");
|
||||
<%# else %>
|
||||
<% if params[:is_observe].nil? %>
|
||||
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/send_homework_to_course', :locals => {:courses => @course, :user => @user, :send_id => @send_id}) %>');
|
||||
showModal('ajax-modal', '452px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal();' style='margin-left: 435px;' class='resourceClose'></a>");
|
||||
$('#ajax-modal').parent().css("top","50%").css("left","50%");
|
||||
$('#ajax-modal').parent().addClass("popbox").addClass("resourceUploadPopup");
|
||||
$('#ajax-modal').css("padding-left","16px").css("padding-bottom","16px");
|
||||
var htmlvalue = "<%= escape_javascript(render :partial => 'users/send_homework_to_course', :locals => {:courses => @course, :user => @user, :send_id => @send_id}) %>";
|
||||
pop_box_new(htmlvalue,460,435);
|
||||
<% else %>
|
||||
$("#send_homework_to_course_form").html("<%= escape_javascript(render :partial => 'users/send_homework_to_course_form', :locals => {:courses => @course, :user => @user, :send_id => @send_id}) %>");
|
||||
<% end %>
|
||||
<% end %>
|
||||
<%# end %>
|
|
@ -0,0 +1,53 @@
|
|||
<script type="text/javascript" language="javascript">
|
||||
function HoverLi(url){
|
||||
window.location.href = url;
|
||||
}
|
||||
</script>
|
||||
<div class="hw_content" >
|
||||
<ul id="hw_tab_nav">
|
||||
<li id="hw_tab_nav_1" onclick="HoverLi('<%= my_homeworks_user_path(@user) %>');">
|
||||
<a href="javascript:void(0);" class="hw_tab_type">我的作业</a>
|
||||
</li>
|
||||
<li id="hw_tab_nav_2" class="<%=@type == 1 ? 'hw_tab_hover' : '' %>" onclick="HoverLi('<%= manage_or_receive_homeworks_user_path(@user) %>');">
|
||||
<a href="javascript:void(0);" class="hw_tab_type">我管理的作业</a>
|
||||
</li>
|
||||
<li id="hw_tab_nav_3" class="<%=@type == 2 ? 'hw_tab_hover' : '' %>" onclick="HoverLi('<%= manage_or_receive_homeworks_user_path(@user, :type =>2) %>');">
|
||||
<a href="javascript:void(0);" class="hw_tab_type" >我收到的作业</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="hw_more_box" >
|
||||
<ul>
|
||||
<li class="hw_more_icons">
|
||||
<ul class="hw_more_txt">
|
||||
<li> <a href="<%= manage_or_receive_homeworks_user_path(@user, :type => @type, :property => 0) %>" id="homework_type_all" class="hw_more_li" data-method="get" data-remote="true">全部作业</a> </li>
|
||||
<li> <a href="<%= manage_or_receive_homeworks_user_path(@user, :type => @type, :property => 1) %>" id="homework_type_nor" class="hw_more_li" data-method="get" data-remote="true">普通作业</a> </li>
|
||||
<li> <a href="<%= manage_or_receive_homeworks_user_path(@user, :type => @type, :property => 2) %>" id="homework_type_pro" class="hw_more_li" data-method="get" data-remote="true">编程作业</a> </li>
|
||||
<li> <a href="<%= manage_or_receive_homeworks_user_path(@user, :type => @type, :property => 3) %>" id="homework_type_gro" class="hw_more_li" data-method="get" data-remote="true">分组作业</a> </li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div id="hw_tab_con_2">
|
||||
<div class="sy_category" id="homework_search_input">
|
||||
<%=render :partial=>'my_homeworks_search', :locals=>{:type => @type,:property => nil,:order => @order, :search => ''} %>
|
||||
</div>
|
||||
|
||||
<div class="sy_classbox" style="min-height:800px;" id="my_homework_list">
|
||||
<% if @type == 1 %>
|
||||
<%= render :partial => "manage_homework_list", :locals => {:homeworks => @homeworks, :is_manage => 1} %>
|
||||
<% else %>
|
||||
<%= render :partial => "receive_homework_list", :locals => {:homeworks => @homeworks} %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div style="text-align:center;">
|
||||
<div class="pages" style="width:auto; display:inline-block;">
|
||||
<ul id="homework_list_ref_pages">
|
||||
<%= pagination_links_full @hw_pages, @hw_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true%>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -0,0 +1,11 @@
|
|||
<% if @type == 1 %>
|
||||
$("#my_homework_list").html('<%= escape_javascript(render :partial => "manage_homework_list", :locals => {:homeworks => @homeworks, :is_manage => 1})%>');
|
||||
<% else %>
|
||||
$("#my_homework_list").html('<%= escape_javascript(render :partial => "receive_homework_list", :locals => {:homeworks => @homeworks})%>');
|
||||
<% end %>
|
||||
$("#homework_list_ref_pages").html('<%= pagination_links_full @hw_pages, @hw_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true %>');
|
||||
$("#my_homework_sort").html('<%= escape_javascript( render :partial => 'users/my_homework_sort', :locals => {:type => @type,:property => @property,:order => @order,:search => @search})%>');
|
||||
$("#homework_type_all").attr('href','<%= manage_or_receive_homeworks_user_path(@user, :type => @type, :property => 0) %>');
|
||||
$("#homework_type_nor").attr('href','<%= manage_or_receive_homeworks_user_path(@user, :type => @type, :property => 1) %>');
|
||||
$("#homework_type_pro").attr('href','<%= manage_or_receive_homeworks_user_path(@user, :type => @type, :property => 2) %>');
|
||||
$("#homework_type_gro").attr('href','<%= manage_or_receive_homeworks_user_path(@user, :type => @type, :property => 3) %>');
|
|
@ -0,0 +1,28 @@
|
|||
<script type="text/javascript" language="javascript">
|
||||
//课程大纲tab
|
||||
//function g(o){return document.getElementById(o);}
|
||||
function HoverLi(url){
|
||||
// for(var i=1;i<=3;i++){
|
||||
// g('hw_tab_nav_'+i).className='hw_tab_nomal';
|
||||
// }
|
||||
// g('hw_tab_nav_'+n).className='hw_tab_hover';
|
||||
window.location.href = url;
|
||||
}
|
||||
</script>
|
||||
<div class="hw_content" >
|
||||
<ul id="hw_tab_nav">
|
||||
<li id="hw_tab_nav_1" class="hw_tab_hover" onclick="HoverLi('<%= my_homeworks_user_path(@user) %>');">
|
||||
<a href="javascript:void(0);" class="hw_tab_type">我的作业</a>
|
||||
</li>
|
||||
<li id="hw_tab_nav_2" onclick="HoverLi('<%= manage_or_receive_homeworks_user_path(@user) %>');">
|
||||
<a href="javascript:void(0);" class="hw_tab_type">我管理的作业</a>
|
||||
</li>
|
||||
<li id="hw_tab_nav_3" onclick="HoverLi('<%= manage_or_receive_homeworks_user_path(@user, :type =>2) %>');">
|
||||
<a href="javascript:void(0);" class="hw_tab_type" >我收到的作业</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div id="hw_tab_con_1">
|
||||
<%=render :partial => 'my_homework_list' %>
|
||||
</div> <!-- hw_tab_con_1 end-->
|
||||
</div><!--sy_content end-->
|
|
@ -0,0 +1 @@
|
|||
$("#hw_tab_con_1").html("<%= escape_javascript(render :partial => 'users/my_homework_list') %>");
|
|
@ -0,0 +1,7 @@
|
|||
<% if @type == 1 %>
|
||||
$("#my_homework_list").html('<%= escape_javascript(render :partial => "manage_homework_list", :locals => {:homeworks => @homeworks, :is_manage => 1})%>');
|
||||
<% else %>
|
||||
$("#my_homework_list").html('<%= escape_javascript(render :partial => "receive_homework_list", :locals => {:homeworks => @homeworks})%>');
|
||||
<% end %>
|
||||
$("#homework_list_ref_pages").html('<%= pagination_links_full @hw_pages, @hw_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true %>');
|
||||
$("#my_homework_sort").html('<%= escape_javascript( render :partial => 'users/my_homework_sort', :locals => {:type => @type,:property => @property,:order => @order,:search => @search})%>');
|
|
@ -1,9 +1,4 @@
|
|||
$("#subject_count_homework_<%=@homework.id %>").html(<%= @homework.quotes %>);
|
||||
$("#ajax-modal").html("<%=escape_javascript(render :partial => 'homework_post_notice') %>");
|
||||
showModal('ajax-modal', '500px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||
"<a href='javascript:' onclick='hideModal();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().css("top","50%").css("left","50%");
|
||||
$('#ajax-modal').parent().addClass("popbox").addClass("resourceUploadPopup");
|
||||
$('#ajax-modal').css("padding-left","16px").css("padding-bottom","16px");
|
||||
hideModal();
|
||||
var htmlvalue = "<%= escape_javascript(render :partial => 'homework_post_notice') %>";
|
||||
pop_box_new(htmlvalue,380,182);
|
|
@ -1,5 +1,7 @@
|
|||
<% if @is_import.to_i == 1 %>
|
||||
$("#homework_detail_information").html("<%=escape_javascript(render :partial => 'users/homework_detail_information', :locals => {:homework=>@homework}) %>");
|
||||
$("#choose_courses_notice").html("");
|
||||
<% else %>
|
||||
$("#homework_repository_detail").html("<%=escape_javascript(render :partial => 'users/homework_repository_detail', :locals => {:homework=>@homework}) %>");
|
||||
var htmlvalue = "<%= escape_javascript(render :partial => 'users/homework_repository_detail') %>";
|
||||
pop_box_new(htmlvalue,820,800);
|
||||
<% end %>
|
|
@ -1 +1 @@
|
|||
$("#user_show_more_course").replaceWith("<%= escape_javascript( render :partial => 'layouts/user_courses',:locals => {:courses => @courses,:user => @user,:type=>@type,:page => @page, :all_count => @all_count} )%>");
|
||||
$("#user_show_more_course").replaceWith("<%= escape_javascript( render :partial => 'layouts/user_courses',:locals => {:courses => @courses,:user => @user,:page => @page, :all_count => @all_count} )%>");
|
||||
|
|
|
@ -3,11 +3,11 @@ $("#homework_list_form_show").html('<%= escape_javascript(render :partial => 'us
|
|||
$("#homewrok_ref_pages").html('<%= pagination_links_full @hw_pages, @hw_count, :per_page_links => false, :remote => @is_remote, :flag => true %>');
|
||||
$("#homework_detail_information").html("<%=escape_javascript(render :partial => 'users/homework_detail_information', :locals => {:homework=>nil}) %>");
|
||||
$("#homework_search_input").html("<%=escape_javascript(render :partial=>'homework_search_input', :locals=>{:type=>@type,:is_import=>@is_import}) %>");
|
||||
$("#choose_courses_notice").html("");
|
||||
<% else %>
|
||||
$("#homework_repository_list").html('<%= escape_javascript(render :partial => 'users/homework_repository_list', :locals => {:homeworks => @homeworks,:sort => @order,:b_sort => @b_sort,:type=>@type,:is_import => @is_import,:property => @property,:search=>''})%>');
|
||||
$("#homework_pository_ref_pages").html('<%= pagination_links_full @hw_pages, @hw_count, :per_page_links => false, :remote => @is_remote, :flag => true %>');
|
||||
$("#homework_repository_detail").html("<%=escape_javascript(render :partial => 'users/homework_repository_detail', :locals => {:homework=>nil}) %>");
|
||||
$("#homework_search_input").html("<%=escape_javascript(render :partial=>'homework_repository_search', :locals=>{:type=>@type,:is_import=>@is_import,:property=>@property}) %>");
|
||||
$("#homework_pository_ref_pages").html('<%= pagination_links_full @hw_pages, @hw_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true %>');
|
||||
$("#homework_search_input").html('<%= escape_javascript(render :partial => 'users/homework_repository_search', :locals => {:type => @type,:is_import => @is_import,:property => @property,:order => @order, :b_sort => @b_sort, :search => ''})%>');
|
||||
$("#homework_type_all").attr('href','<%= user_homework_type_user_path(@user,:type => @type,:is_import => 0,:property => 0) %>');
|
||||
$("#homework_type_nor").attr('href','<%= user_homework_type_user_path(@user,:type => @type,:is_import => 0,:property => 1) %>');
|
||||
$("#homework_type_pro").attr('href','<%= user_homework_type_user_path(@user,:type => @type,:is_import => 0,:property => 2) %>');
|
||||
|
|
|
@ -1,89 +1,68 @@
|
|||
<%= stylesheet_link_tag 'css/common','css/structure','css/public','css/org','repository' %>
|
||||
<%= stylesheet_link_tag 'css/org','repository' %>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$(".resource-switch").click(function(){
|
||||
$(".resource-switch").children().removeClass("resource-tab-active");
|
||||
$(this).children().addClass("resource-tab-active");
|
||||
});
|
||||
$("input[name='checkMenu']").click(function(){
|
||||
if($("input[name='checkMenu']:checked").length >= 1){
|
||||
$(".resourcesSelectSendButton").removeClass("inactive-border");
|
||||
$(".resourcesSelectSendButton").mouseover(function(){
|
||||
$(this).css("backgroundColor","#297fb8");
|
||||
});
|
||||
$(".resourcesSelectSendButton").mouseout(function(){
|
||||
$(this).css("backgroundColor","#fff");
|
||||
});
|
||||
$(".sendButtonBlue").removeClass("inactive-text");
|
||||
}
|
||||
});
|
||||
});
|
||||
function choose_course(user_id) {
|
||||
var check = $('input[name="checkMenu"]:checked');
|
||||
if(check.length == 0) {
|
||||
$("#choose_homework_notice").text("请先选择一个作业");
|
||||
} else {
|
||||
var hw_id = $('input[name="checkMenu"]:checked').val();
|
||||
$("#choose_homework_notice").text("");
|
||||
$.ajax({
|
||||
type: 'get',
|
||||
url: '/users/' + user_id + '/choose_user_course?homework='+hw_id,
|
||||
data:{send_id:$('input[name="checkMenu"]:checked').val()}
|
||||
});
|
||||
function g(o){return document.getElementById(o);}
|
||||
function HoverLi(n, url){
|
||||
for(var i=1;i<=2;i++){
|
||||
g('hw_tab_nav_'+i).className='hw_tab_nomal';
|
||||
}
|
||||
g('hw_tab_nav_'+n).className='hw_tab_hover';
|
||||
$.get(url, {}, function(data){});
|
||||
}
|
||||
function show_homework_detail(url){
|
||||
$.get(
|
||||
url,
|
||||
{},
|
||||
function (data) {
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
function choose_course(user_id, hw_id) {
|
||||
$.ajax({
|
||||
type: 'get',
|
||||
url: '/users/' + user_id + '/choose_user_course?homework='+hw_id
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="homepageContentContainer">
|
||||
<div class="homepageContent">
|
||||
<div class="resource-wrapper mb10">
|
||||
<ul class="resource-banner">
|
||||
<li class="fl resource-switch">
|
||||
<a href="<%= user_homework_type_user_path(@user,:is_import => 0) %>" id="public_homeworks_choose" class="resource-tab resource-tab-active" data-remote="true">我的题库</a>
|
||||
</li>
|
||||
<li class="fl resource-switch">
|
||||
<a href="<%= user_homework_type_user_path(@user,:type=>'2',:is_import => 0) %>" id="user_homeworks_choose" class="resource-tab" style="text-align: center;" data-remote="true">题库</a>
|
||||
</li>
|
||||
<li class="fl resource-switch">
|
||||
<a href="<%= user_homework_type_user_path(@user,:type=>'3',:is_import => 0) %>" id="apply_homeworks_choose" class="resource-tab" data-remote="true">申请题库</a>
|
||||
</li>
|
||||
<li class="fl w680 border-bottom h34"> </li>
|
||||
<li class="fr resource-banner-li border-bottom h34">
|
||||
<ul class="resourcesSelect">
|
||||
<li class="resourcesSelected"><a href="javascript:void(0);" class="resourcesIcon"></a>
|
||||
<ul class="resourcesType">
|
||||
<li> <a href="<%= user_homework_type_user_path(@user,:type => @type,:is_import => 0) %>" id="homework_type_all" class="resourcesTypeAll resourcesGrey" data-method="get" data-remote="true">全部</a> </li>
|
||||
<li> <a href="<%= user_homework_type_user_path(@user,:type => @type,:is_import => 0,:property => 1) %>" id="homework_type_nor" class="homepagePostTypeAssignment postTypeGrey" data-method="get" data-remote="true">普通作业</a> </li>
|
||||
<li> <a href="<%= user_homework_type_user_path(@user,:type => @type,:is_import => 0,:property => 2) %>" id="homework_type_pro" class="program-btn postTypeGrey" data-method="get" data-remote="true" style="white-space:nowrap;">编程作业</a> </li>
|
||||
<li> <a href="<%= user_homework_type_user_path(@user,:type => @type,:is_import => 0,:property => 3) %>" id="homework_type_gro" class="group-btn resourcesGrey" data-method="get" data-remote="true">分组作业</a> </li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
<div class="hw_content mb10">
|
||||
<ul id="hw_tab_nav">
|
||||
<li id="hw_tab_nav_1" class="hw_tab_hover" onclick="HoverLi(1, '<%= user_homework_type_user_path(@user,:is_import => 0) %>');">
|
||||
<a href="javascript:void(0)" id="public_homeworks_choose" class="hw_tab_type" style="text-align: center;">我的题库</a>
|
||||
</li>
|
||||
<li id="hw_tab_nav_2" onclick="HoverLi(2, '<%= user_homework_type_user_path(@user,:type=>'2',:is_import => 0) %>');">
|
||||
<a href="javascript:void(0)" id="user_homeworks_choose" class="hw_tab_type" style="text-align: center;">公共题库</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="hw_more_box" >
|
||||
<ul>
|
||||
<li class="hw_more_icons">
|
||||
<ul class="hw_more_txt">
|
||||
<li> <a href="<%= user_homework_type_user_path(@user,:type => @type,:is_import => 0) %>" id="homework_type_all" class="hw_more_li" data-method="get" data-remote="true">全部作业</a> </li>
|
||||
<li> <a href="<%= user_homework_type_user_path(@user,:type => @type,:is_import => 0,:property => 1) %>" id="homework_type_nor" class="hw_more_li" data-method="get" data-remote="true">普通作业</a> </li>
|
||||
<li> <a href="<%= user_homework_type_user_path(@user,:type => @type,:is_import => 0,:property => 2) %>" id="homework_type_pro" class="hw_more_li" data-method="get" data-remote="true" style="white-space:nowrap;">编程作业</a> </li>
|
||||
<li> <a href="<%= user_homework_type_user_path(@user,:type => @type,:is_import => 0,:property => 3) %>" id="homework_type_gro" class="hw_more_li" data-method="get" data-remote="true">分组作业</a> </li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div id="hw_tab_con_1">
|
||||
<div class="sy_category" id="homework_search_input">
|
||||
<%=render :partial=>'homework_repository_search', :locals=>{:type => '1',:is_import => 0,:property => nil,:order => @order, :search => ''} %>
|
||||
</div>
|
||||
|
||||
<div class="sy_classbox" style="min-height:800px;" id="homework_repository_list">
|
||||
<%=render :partial => 'homework_repository_list', :locals => {:homeworks => @homeworks,:type=>'1',:is_import => 0,:property => @property,:search=>''} %>
|
||||
</div>
|
||||
|
||||
<div style="text-align:center;">
|
||||
<div class="pages" style="width:auto; display:inline-block;">
|
||||
<ul id="homework_pository_ref_pages">
|
||||
<%= pagination_links_full @hw_pages, @hw_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true%>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
<div id="homework_search_input" class="mt10 fl">
|
||||
<%=render :partial=>'homework_repository_search', :locals=>{:type => @type,:is_import => 0,:property => nil} %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div class="w683 fl mr10 mt10" id="homework_repository_list">
|
||||
<%=render :partial => 'homework_repository_list', :locals => {:homeworks => @homeworks,:type=>@type,:is_import => 0,:property => @property,:search=>''} %>
|
||||
</div>
|
||||
<div id="homework_repository_detail">
|
||||
<%=render :partial => 'homework_repository_detail', :locals => {:homework => nil} %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div>
|
||||
<ul class="wlist mt10" id="homework_pository_ref_pages" style="margin-top: 5px;margin-right: 295px">
|
||||
<%= pagination_links_full @hw_pages, @hw_count, :per_page_links => false, :remote => @is_remote, :flag => true%>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="fl resourcesSelectSendButton mr15 inactive-border mt10">
|
||||
<a href="javascript:void(0)" onclick="choose_course('<%=User.current.id %>');" class="sendButtonBlue db inactive-text" data-remote="true">发送至</a>
|
||||
</div>
|
||||
<span class="c_red fl mt15" id="choose_homework_notice"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -1,4 +1,3 @@
|
|||
/*$("#homework_repository").html('<%#= escape_javascript(render :partial => 'users/homework_repository', :locals => {:homeworks => @homeworks})%>');*/
|
||||
$("#homework_repository_list").html('<%= escape_javascript(render :partial => 'users/homework_repository_list', :locals => {:homeworks => @homeworks,:sort => @order,:b_sort => @b_sort,:type=>@type,:is_import => 0,:property => @property,:search=>''})%>');
|
||||
$("#homework_pository_ref_pages").html('<%= pagination_links_full @hw_pages, @hw_count, :per_page_links => false, :remote => @is_remote, :flag => true %>');
|
||||
$("#homework_repository_detail").html("<%=escape_javascript(render :partial => 'users/homework_repository_detail', :locals => {:homework=>nil}) %>");
|
||||
$("#homework_pository_ref_pages").html('<%= pagination_links_full @hw_pages, @hw_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true %>');
|
|
@ -1 +1 @@
|
|||
$("#user_show_more_project").replaceWith("<%= escape_javascript( render :partial => 'layouts/user_projects',:locals => {:projects => @projects,:user => @user, :page => @page} )%>");
|
||||
$("#user_show_more_project").replaceWith("<%= escape_javascript( render :partial => 'layouts/user_projects',:locals => {:projects => @projects,:user => @user, :page => @page, :all_count => @all_count} )%>");
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue