Merge branch 'develop' into weixin_guange

This commit is contained in:
yuanke 2016-09-01 14:13:28 +08:00
commit 6809af469b
119 changed files with 1229 additions and 912 deletions

View File

@ -83,15 +83,15 @@ module Mobile
if ac.container_type == "Course" if ac.container_type == "Course"
case ac.act_type case ac.act_type
when "HomeworkCommon" when "HomeworkCommon"
"课程作业" "班级作业"
when "News" when "News"
"课程通知" "班级通知"
when "Message" when "Message"
"课程问答" "班级讨论"
when "Poll" when "Poll"
"课程问卷" "班级问卷"
when "Course" when "Course"
"课程" "班级"
end end
elsif ac.container_type == "Project" elsif ac.container_type == "Project"
case ac.act_type case ac.act_type

View File

@ -30,6 +30,8 @@ class AccountController < ApplicationController
user = UserExtensions.where(:user_id => User.current.id).first user = UserExtensions.where(:user_id => User.current.id).first
if user.gender.nil? || user.school_id.nil? || User.current.lastname.nil? if user.gender.nil? || user.school_id.nil? || User.current.lastname.nil?
redirect_to my_account_path(:tip => 1) redirect_to my_account_path(:tip => 1)
elsif user.identity == 3 && user.school_id.nil?
redirect_to my_account_path(:tip => 1)
else else
redirect_to user_path(User.current) redirect_to user_path(User.current)
end end
@ -357,6 +359,8 @@ class AccountController < ApplicationController
user = UserExtensions.where(:user_id => User.current.id).first user = UserExtensions.where(:user_id => User.current.id).first
if user.gender.nil? || user.school_id.nil? || User.current.lastname.nil? if user.gender.nil? || user.school_id.nil? || User.current.lastname.nil?
redirect_to my_account_path(:tip => 1) redirect_to my_account_path(:tip => 1)
elsif user.identity == 3 && user.school_id.nil?
redirect_to my_account_path(:tip => 1)
else else
redirect_back_or_default User.current redirect_back_or_default User.current
#redirect_to my_account_url #redirect_to my_account_url

View File

@ -202,6 +202,11 @@ class AttachmentsController < ApplicationController
end end
@attachment.save @attachment.save
@newfiledense = filedense @newfiledense = filedense
end
if @project
elsif @course
end end
respond_to do |format| respond_to do |format|
format.js format.js

View File

@ -12,11 +12,13 @@ class AvatarController < ApplicationController
@source_id = params[:source_id] @source_id = params[:source_id]
@temp_file = params[:avatar][:image] @temp_file = params[:avatar][:image]
@image_file = @temp_file.original_filename @image_file = @temp_file.original_filename
@is_direct = params[:is_direct]
else else
unless request.raw_post.nil? unless request.raw_post.nil?
@source_type = params[:source_type] @source_type = params[:source_type]
@source_id = params[:source_id] @source_id = params[:source_id]
@temp_file = request.raw_post @temp_file = request.raw_post
@is_direct = params[:is_direct]
if @temp_file.size > 0 if @temp_file.size > 0
if @temp_file.respond_to?(:original_filename) if @temp_file.respond_to?(:original_filename)
@image_file = @temp_file.original_filename @image_file = @temp_file.original_filename
@ -38,7 +40,7 @@ class AvatarController < ApplicationController
@urlfile='/' << File.join("images","avatars",avatar_directory(@source_type),avatar_filename(@source_id,@image_file)) @urlfile='/' << File.join("images","avatars",avatar_directory(@source_type),avatar_filename(@source_id,@image_file))
# 用户头像上传时进行特别处理 # 用户头像上传时进行特别处理
if @source_type == 'User' if @is_direct == '1' && (@source_type == 'User' || @source_type == 'Course' || @source_type == 'Project')
diskfile += "temp" diskfile += "temp"
@urlfile += "temp" @urlfile += "temp"
end end
@ -105,7 +107,7 @@ class AvatarController < ApplicationController
path = File.dirname(diskfile) path = File.dirname(diskfile)
if File.directory?(path) && File.exist?(diskfile) if File.directory?(path) && File.exist?(diskfile)
# 用户头像进行特别处理 # 用户头像进行特别处理
if @source_type == 'User' if @source_type == 'User' || @source_type == 'Course' || @source_type == 'Project'
diskfile1 = diskfile + 'temp' diskfile1 = diskfile + 'temp'
File.open(diskfile1, "wb") do |f| File.open(diskfile1, "wb") do |f|
buffer = "DELETE" buffer = "DELETE"

View File

@ -325,6 +325,7 @@ class FilesController < ApplicationController
@containers = [ Project.includes(:attachments).reorder(sort).find(@project.id)] @containers = [ Project.includes(:attachments).reorder(sort).find(@project.id)]
show_attachments @containers show_attachments @containers
# get_attachment_for_tip(@all_attachments)
@tag_list = attachment_tag_list @all_attachments @tag_list = attachment_tag_list @all_attachments
@ -377,6 +378,7 @@ class FilesController < ApplicationController
@containers = [ Course.includes(:attachments).reorder(sort).find(@course.id)] @containers = [ Course.includes(:attachments).reorder(sort).find(@course.id)]
show_attachments @containers show_attachments @containers
# get_attachment_for_tip(@all_attachments)
@tag_list = attachment_tag_list @all_attachments @tag_list = attachment_tag_list @all_attachments
@ -440,6 +442,39 @@ class FilesController < ApplicationController
end end
# 获取提示中私有、公开总数信息
def get_attachment_for_tip all_attachment
@tip_all_public_attachments = all_attachment.select{|attach| attach.is_public == 1}.count
if params[:project_id]
if User.current.member_of?(@project) || User.current.admin?
@tip_all_attachments = all_attachment.count
@tip_all_private_attachments = all_attachment.select{|attach| attach.is_public == 0}.count
else
if params[:tag_name]
@tip_all_attachments = all_attachment.count
@tip_all_private_attachments = 0
else
@tip_all_attachments = Attachment.where(:container_id => params[:project_id], :container_type => "Project").count
@tip_all_private_attachments = Attachment.where(:container_id => params[:project_id], :container_type => "Project", :is_public => 0).count
end
end
elsif params[:course_id]
if User.current.member_of_course?(@course) || User.current.admin?
@tip_all_attachments = all_attachment.count
@tip_all_private_attachments = all_attachment.select{|attach| attach.is_public == 0}.count
else
if params[:tag_name]
@tip_all_attachments = all_attachment.count
@tip_all_private_attachments = 0
else
@tip_all_attachments = Attachment.where(:container_id => params[:course_id], :container_type => "Course").count
@tip_all_private_attachments = Attachment.where(:container_id => params[:course_id], :container_type => "Course", :is_public => 0).count
end
end
end
end
def quote_resource_show def quote_resource_show
@file = Attachment.find(params[:id]) @file = Attachment.find(params[:id])
@can_quote = attachment_candown @file @can_quote = attachment_candown @file
@ -883,6 +918,7 @@ class FilesController < ApplicationController
end end
@all_attachments = @result @all_attachments = @result
get_attachment_for_tip(@all_attachments)
@limit = 10 @limit = 10
@feedback_count = @all_attachments.count @feedback_count = @all_attachments.count
@feedback_pages = Paginator.new @feedback_count, @limit, params['page'] @feedback_pages = Paginator.new @feedback_count, @limit, params['page']

View File

@ -94,8 +94,10 @@ class HomeworkCommonController < ApplicationController
end end
end end
status = false
if @homework.publish_time <= Date.today && homework_detail_manual.comment_status == 0 if @homework.publish_time <= Date.today && homework_detail_manual.comment_status == 0
homework_detail_manual.comment_status = 1 homework_detail_manual.comment_status = 1
status = true
end end
eval_start = homework_detail_manual.evaluation_start eval_start = homework_detail_manual.evaluation_start
if eval_start.nil? || (eval_start <= @homework.end_time && homework_detail_manual.comment_status <= 1) if eval_start.nil? || (eval_start <= @homework.end_time && homework_detail_manual.comment_status <= 1)
@ -145,6 +147,10 @@ class HomeworkCommonController < ApplicationController
@homework_detail_programing.save if @homework_detail_programing @homework_detail_programing.save if @homework_detail_programing
@homework_detail_group.save if @homework_detail_group @homework_detail_group.save if @homework_detail_group
if @homework.homework_type != 3 && homework_detail_manual.comment_status == 1 && status
create_works_list @homework
end
if params[:is_manage] == "1" if params[:is_manage] == "1"
redirect_to manage_or_receive_homeworks_user_path(User.current.id) redirect_to manage_or_receive_homeworks_user_path(User.current.id)
elsif params[:is_manage] == "2" elsif params[:is_manage] == "2"

View File

@ -521,10 +521,10 @@ class IssuesController < ApplicationController
def delete_journal def delete_journal
@issue = Issue.find(params[:id]) @issue = Issue.find(params[:id])
begin begin
forge_acts = ForgeMessage.where(:forge_message_type => "Journal", :forge_message_id => params[:journal_id]).first forge_acts = ForgeMessage.where(:forge_message_type => "Journal", :forge_message_id => params[:journal_id])
forge_acts.destroy unless forge_acts.nil? forge_acts.destroy_all unless forge_acts.empty?
at_message = AtMessage.where(:at_message_type => "Journal", :at_message_id => params[:journal_id]).first at_message = AtMessage.where(:at_message_type => "Journal", :at_message_id => params[:journal_id])
at_message.destroy unless at_message.nil? at_message.destroy_all unless at_message.empty?
Journal.delete(params[:journal_id]) Journal.delete(params[:journal_id])
rescue Exception => e rescue Exception => e
puts e puts e

View File

@ -229,7 +229,7 @@ class MembersController < ApplicationController
user_ids.each do |user_id| user_ids.each do |user_id|
member = Member.new(:role_ids => params[:membership][:role_ids], :user_id => user_id) member = Member.new(:role_ids => params[:membership][:role_ids], :user_id => user_id)
role_ids = attrs.delete(:role_ids) role_ids = params[:membership][:role_ids]
#role = Role.find(params[:membership][:role_ids]) #role = Role.find(params[:membership][:role_ids])
# 这里的判断只能通过角色名,可以弄成常量 # 这里的判断只能通过角色名,可以弄成常量
if role_ids && role_ids.include?("10") if role_ids && role_ids.include?("10")

View File

@ -90,14 +90,34 @@ class MyController < ApplicationController
end end
def clear_user_avatar_temp def clear_user_avatar_temp
@user = User.current if params[:course]
diskfile = disk_filename('User', @user.id) @course = Course.find params[:course]
diskfile = disk_filename('Course', @course.id)
elsif params[:project]
@project = Project.find params[:project]
diskfile = disk_filename('Project', @project.id)
else
@user = User.current
diskfile = disk_filename('User', @user.id)
end
diskfile1 = diskfile + 'temp' diskfile1 = diskfile + 'temp'
File.delete(diskfile1) if File.exist?(diskfile1) File.delete(diskfile1) if File.exist?(diskfile1)
end end
def save_user_avatar def save_user_avatar
@user = User.current if params[:source_id] && params[:source_type]
diskfile = disk_filename('User', @user.id) case params[:source_type]
when 'User'
@user = User.current
diskfile = disk_filename('User', @user.id)
when 'Course'
@course = Course.find params[:source_id]
diskfile = disk_filename('Course', @course.id)
when 'Project'
@project = Project.find params[:source_id]
diskfile = disk_filename('Project', @project.id)
end
end
diskfile1 = diskfile + 'temp' diskfile1 = diskfile + 'temp'
begin begin
FileUtils.mv diskfile1, diskfile, force: true if File.exist? diskfile1 FileUtils.mv diskfile1, diskfile, force: true if File.exist? diskfile1
@ -145,8 +165,10 @@ class MyController < ApplicationController
@user.pref[:no_self_notified] = (params[:no_self_notified] == '1') @user.pref[:no_self_notified] = (params[:no_self_notified] == '1')
#@user.login = params[:login] #@user.login = params[:login]
unless @user.user_extensions.nil? unless @user.user_extensions.nil?
if @user.user_extensions.identity == 2 # 如果用户是从业者将单位名称保存至学校id字段
if @user.user_extensions.identity == 3
# @user.firstname = params[:enterprise_name] # @user.firstname = params[:enterprise_name]
@user.user_extensions.school_id = params[:occupation]
end end
end end
@ -157,7 +179,6 @@ class MyController < ApplicationController
# @se.occupation = params[:occupation] # @se.occupation = params[:occupation]
# end # end
@se.school_id = params[:occupation] @se.school_id = params[:occupation]
@se.gender = params[:sex] @se.gender = params[:sex]
@se.location = params[:province] if params[:province] @se.location = params[:province] if params[:province]
@se.location_city = params[:city] if params[:city] @se.location_city = params[:city] if params[:city]
@ -180,6 +201,7 @@ class MyController < ApplicationController
@user.login = lg @user.login = lg
end end
end end
# 不管前面是否有异常,如果文件已存在就删除
ensure ensure
File.delete(diskfile1) if File.exist?(diskfile1) File.delete(diskfile1) if File.exist?(diskfile1)
end end

View File

@ -1,8 +1,10 @@
class PullRequestsController < ApplicationController class PullRequestsController < ApplicationController
before_filter :authorize_logged
before_filter :find_project_and_repository before_filter :find_project_and_repository
before_filter :connect_gitlab, :only => [:index, :show, :create, :accept_pull_request, :pull_request_commits, :pull_request_changes, :new, before_filter :connect_gitlab, :only => [:index, :show, :create, :accept_pull_request, :pull_request_commits, :pull_request_changes, :new,
:update_pull_request, :pull_request_comments, :create_pull_request_comment] :update_pull_request, :pull_request_comments, :create_pull_request_comment]
layout "base_projects" layout "base_projects"
include PullRequestsHelper include PullRequestsHelper
include ApplicationHelper include ApplicationHelper
@ -235,6 +237,13 @@ class PullRequestsController < ApplicationController
end end
private private
def authorize_logged
if !User.current.logged?
redirect_to signin_path
return
end
end
def connect_gitlab def connect_gitlab
@g = Gitlab.client @g = Gitlab.client
end end

View File

@ -241,6 +241,21 @@ class QualityAnalysisController < ApplicationController
complexity_date = open(@sonar_address + "/api/resources/index?resource=#{@resource_id}&depth=0&metrics=#{filter}").read complexity_date = open(@sonar_address + "/api/resources/index?resource=#{@resource_id}&depth=0&metrics=#{filter}").read
@complexity =JSON.parse(complexity_date).first @complexity =JSON.parse(complexity_date).first
# 获取排名结果
@g = Gitlab.client
@author_infos = @g.rep_user_stats(@project.gpid, :rev => @branch)
@user_quality_infos = []
@author_infos.each do |author_info|
email = author_info.email
changes = author_info.changes.to_i
unresolved_issues = open(@sonar_address + "/api/issues/search?projectKeys=#{@resource_id}&authors=#{email}&resolved=false").read
unresolved_issue_count = JSON.parse(unresolved_issues)["total"].to_i
all_issues = open(@sonar_address + "/api/issues/search?projectKeys=#{@resource_id}&authors=#{email}").read
all_issue_count = JSON.parse(all_issues)["total"].to_i
ratio = (changes == 0 ? 0 : format("%0.4f",unresolved_issue_count.to_f/changes.to_f))
@user_quality_infos << {:email => email, :changes => changes, :unresolved_issue_count => unresolved_issue_count, :ratio => ratio, :all_issue_count => all_issue_count}
end
# 按名称转换成hash键值对 # 按名称转换成hash键值对
@ha = {} @ha = {}
@complexity["msr"].each do |com| @complexity["msr"].each do |com|

View File

@ -734,24 +734,33 @@ class StudentWorkController < ApplicationController
end end
def destroy def destroy
if @work.destroy if @homework.homework_type == 3
if @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 if @work.destroy
pros = @work.student_work_projects.where("is_leader = 0") if @homework.homework_detail_group.base_on_project == 1
pros.each do |pro| pros = @work.student_work_projects.where("is_leader = 0")
pro.destroy pros.each do |pro|
end pro.destroy
project = @work.student_work_projects.where("is_leader = 1").first end
project.update_attributes(:student_work_id => nil) project = @work.student_work_projects.where("is_leader = 1").first
elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 0 project.update_attributes(:student_work_id => nil)
@work.student_work_projects.each do |pro2| elsif @homework.homework_detail_group.base_on_project == 0
pro2.destroy @work.student_work_projects.each do |pro2|
pro2.destroy
end
end end
end end
respond_to do |format| else
format.html { @work.attachments.destroy_all
redirect_to student_work_index_url(:homework => @homework.id) @work.student_works_scores.destroy_all
} @work.course_messages.destroy_all
end @work.student_work_tests.destroy_all
@work.update_attributes(:work_status => 0, :name => "#{@homework.name}的作品提交", :description => nil, :late_penalty => 0, :commit_time => nil,:final_score => nil,:teacher_score => nil,:student_score => nil,:teaching_asistant_score => nil,:system_score => 0,:work_score => nil)
@work.update_column("work_score",nil)
end
respond_to do |format|
format.html {
redirect_to student_work_index_url(:homework => @homework.id)
}
end end
end end
@ -793,6 +802,8 @@ class StudentWorkController < ApplicationController
end end
elsif @homework.homework_type == 1 elsif @homework.homework_type == 1
@work.update_attributes(:work_status => 0, :name => "#{@homework.name}的作品提交", :description => nil, :late_penalty => 0, :commit_time => nil) @work.update_attributes(:work_status => 0, :name => "#{@homework.name}的作品提交", :description => nil, :late_penalty => 0, :commit_time => nil)
@work.attachments.destroy_all
@work.course_messages.destroy_all
end end
@student_work = StudentWork.new @student_work = StudentWork.new
respond_to do |format| respond_to do |format|

View File

@ -42,7 +42,7 @@ class UsersController < ApplicationController
:activity_new_score_index, :influence_new_score_index, :score_new_index,:user_projects_index,:user_resource, :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_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,
:sort_project_list,:my_homeworks,:manage_or_receive_homeworks,:search_m_r_homeworks] :sort_project_list,:my_homeworks,:manage_or_receive_homeworks,:search_m_r_homeworks, :cancel_or_collect,:expand_courses]
before_filter :auth_user_extension, only: :show before_filter :auth_user_extension, only: :show
#before_filter :rest_user_score, only: :show #before_filter :rest_user_score, only: :show
#before_filter :select_entry, only: :user_projects #before_filter :select_entry, only: :user_projects
@ -1115,23 +1115,8 @@ class UsersController < ApplicationController
homework_detail_programing.save if homework_detail_programing homework_detail_programing.save if homework_detail_programing
homework_detail_group.save if homework_detail_group homework_detail_group.save if homework_detail_group
if homework.homework_type != 3 if homework.homework_type != 3 && homework_detail_manual.comment_status == 1
students = homework.course.student create_works_list homework
if !homework.course.nil? && !students.empty?
name = homework.name
name_str = name + "的作品提交"
str = ""
students.each do |student|
if str != ""
str += ","
end
str += "('#{name_str}',#{homework.id},#{student.student_id}, '#{format_time(Time.now)}', '#{format_time(Time.now)}')"
end
#('#{name}的作品提交',#{homework.id},#{student.student_id}, '#{format_time(Time.now)}', '#{format_time(Time.now)}')
sql = "insert into student_works (name, homework_common_id,user_id, created_at, updated_at) values" + str
#StudentWork.create(:name => "#{name}的作品提交", :homework_common_id => homework.id, :user_id => student.student_id)
ActiveRecord::Base.connection.execute sql
end
end end
if params[:quotes] && !params[:quotes].blank? if params[:quotes] && !params[:quotes].blank?
@ -1474,15 +1459,15 @@ class UsersController < ApplicationController
#显示更多用户课程 #显示更多用户课程
def user_courses4show def user_courses4show
@page = params[:page].to_i + 1 @page = params[:page].to_i + 1
@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) @courses = @user.favorite_courses.visible.where("is_delete =?", 0).select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS a").order("a desc").limit(10).offset(@page * 10)
@all_count = @user.courses.visible.where("is_delete =?", 0).count @all_count = @user.favorite_courses.visible.where("is_delete =?", 0).count
end end
#显示更多用户项目 #显示更多用户项目
def user_projects4show def user_projects4show
@page = params[:page].to_i + 1 @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(10).offset(@page * 10) @projects = @user.favorite_projects.visible.select("projects.*,(SELECT MAX(updated_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS a").order("a desc").limit(10).offset(@page * 10)
@all_count = @user.projects.visible.count @all_count = @user.favorite_projects.visible.count
end end
def user_course_activities def user_course_activities
@ -2167,6 +2152,7 @@ class UsersController < ApplicationController
#这里仅仅是传递需要发送的资源id #这里仅仅是传递需要发送的资源id
@send_id = params[:send_id] @send_id = params[:send_id]
@send_ids = params[:checkbox1] || params[:send_ids] @send_ids = params[:checkbox1] || params[:send_ids]
@hidden_unproject = hidden_unproject_infos
respond_to do |format| respond_to do |format|
format.js format.js
end end
@ -2186,6 +2172,7 @@ class UsersController < ApplicationController
#这里仅仅是传递需要发送的资源id #这里仅仅是传递需要发送的资源id
@send_id = params[:send_id] @send_id = params[:send_id]
@send_ids = params[:checkbox1] || params[:send_ids] #搜索的时候 和 直接 用表格提交的时候的send_ids @send_ids = params[:checkbox1] || params[:send_ids] #搜索的时候 和 直接 用表格提交的时候的send_ids
@hidden_unproject = hidden_unproject_infos
respond_to do |format| respond_to do |format|
format.js format.js
end end
@ -3349,6 +3336,7 @@ class UsersController < ApplicationController
#这里仅仅是传递需要发送的资源id #这里仅仅是传递需要发送的资源id
@send_id = params[:send_id] @send_id = params[:send_id]
@send_ids = params[:checkbox1] || params[:send_ids] @send_ids = params[:checkbox1] || params[:send_ids]
@hidden_unproject = hidden_unproject_infos
respond_to do |format| respond_to do |format|
format.js format.js
end end
@ -3439,6 +3427,28 @@ class UsersController < ApplicationController
end end
end end
#收藏班级/项目
def cancel_or_collect
if params[:project]
@project = Project.find params[:project]
member = Member.where("user_id = #{@user.id} and project_id = #{@project.id}")
elsif params[:course]
@course = Course.find params[:course]
member = Member.where("user_id = #{@user.id} and course_id = #{@course.id}")
end
unless member.empty?
member.first.update_attribute(:is_collect, member.first.is_collect == 0 ? 1 : 0)
end
if @project
@projects = @user.favorite_projects.visible.select("projects.*, (SELECT MAX(updated_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS a").order("a desc").limit(10)
elsif @course
@courses = @user.favorite_courses.visible.where("is_delete =?", 0).select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS a").order("a desc").limit(10)
end
respond_to do |format|
format.js
end
end
def user_projectlist def user_projectlist
@order, @c_sort, @type, @list_type = 1, 2, 1, 1 @order, @c_sort, @type, @list_type = 1, 2, 1, 1
#limit = 5 #limit = 5

View File

@ -37,6 +37,13 @@ module ApplicationHelper
# super # super
# end # end
# 隐藏项目以外的信息
# return: true 显示false 不显示
def hidden_unproject_infos
hidden_info = Setting.find_by_name("hidden_non_project")
(hidden_info && hidden_info.value == "1") ? true : false
end
# 通过系统外部邮箱查找用户,如果用户不存在则用邮箱替换 # 通过系统外部邮箱查找用户,如果用户不存在则用邮箱替换
def get_user_by_mail mail def get_user_by_mail mail
user = User.find_by_mail(mail) user = User.find_by_mail(mail)
@ -820,16 +827,17 @@ module ApplicationHelper
return @result return @result
end end
def show_attachment_tip container_id, container_type
atts = Attachment.where(:container_id => container_id, :container_type => container_type, :is_public => 0)
atts.count > 0 ? true :false
end
# 必须是项目成,项目必须提交过代码 # 必须是项目成,项目必须提交过代码
def allow_pull_request project def allow_pull_request project
return false if project.gpid.nil? return false if project.gpid.nil?
g = Gitlab.client g = Gitlab.client
count = g.user_static(project.gpid, :rev => "master").count count = g.user_static(project.gpid, :rev => "master").count
if User.current.member_of?(project) && count > 0 count
true
else
false
end
end end
# 判断版本库是否初始为gitlab # 判断版本库是否初始为gitlab
@ -2519,7 +2527,7 @@ module ApplicationHelper
def footer_logo(ul_class=nil, li_class=nil) def footer_logo(ul_class=nil, li_class=nil)
logos = [] logos = []
logos.push(link_to image_tag('/images/footer_logo/nudt.png',:alt=>"nudt"),"http://www.nudt.edu.cn/special.asp?classid=12" ) logos.push(link_to image_tag('/images/footer_logo/nudt.png',:alt=>"nudt"),"http://www.nudt.edu.cn/special.asp?classid=12" )
logos.push(link_to image_tag('/images/footer_logo/peking_eecs.png', :alt=>"peking_eecs"), "http://eecs.pku.edu.cn" ) logos.push(link_to image_tag('/images/footer_logo/peking_eecs.png', :alt=>"peking_eecs"), "http://www.sei.pku.edu.cn/" )
logos.push(link_to image_tag('/images/footer_logo/buaa_scse.png', :alt=>"buaa_scse"), "http://scse.buaa.edu.cn/" ) logos.push(link_to image_tag('/images/footer_logo/buaa_scse.png', :alt=>"buaa_scse"), "http://scse.buaa.edu.cn/" )
logos.push(link_to image_tag('/images/footer_logo/iscas.png', :alt=>"iscas"), "http://www.iscas.ac.cn" ) logos.push(link_to image_tag('/images/footer_logo/iscas.png', :alt=>"iscas"), "http://www.iscas.ac.cn" )
logos.push(link_to image_tag('/images/footer_logo/inforbus.png', :alt=>"inforbus"), "http://www.inforbus.com" ) logos.push(link_to image_tag('/images/footer_logo/inforbus.png', :alt=>"inforbus"), "http://www.inforbus.com" )
@ -3447,8 +3455,26 @@ def course_syllabus_option user = User.current
type type
end end
def create_works_list homework
students = homework.course.student
if !homework.course.nil? && !students.empty?
name = homework.name
name_str = name + "的作品提交"
str = ""
students.each do |student|
if str != ""
str += ","
end
str += "('#{name_str}',#{homework.id},#{student.student_id}, '#{format_time(Time.now)}', '#{format_time(Time.now)}')"
end
sql = "insert into student_works (name, homework_common_id,user_id, created_at, updated_at) values" + str
ActiveRecord::Base.connection.execute sql
end
end
# 获取项目动态更新时间 # 获取项目动态更新时间
def get_forge_act_message(act, type) def get_forge_act_message(act, type)
forge_act = ForgeActivity.where(:forge_act_id => act.id, :forge_act_type => type).first forge_act = ForgeActivity.where(:forge_act_id => act.id, :forge_act_type => type).first
format_time(forge_act.nil? ? act.created_on : forge_act.try(:updated_at)) format_time(forge_act.nil? ? act.created_on : forge_act.try(:updated_at))
end end

View File

@ -7,7 +7,7 @@ module OrgMemberHelper
scope = [] scope = []
end end
principals = paginateHelper scope,10 principals = paginateHelper scope,10
s = content_tag('ul', project_member_check_box_tags_ex('membership[user_ids][]', principals), :class => 'mb5', :id => 'principals') s = content_tag('ul', project_member_check_box_tags_ex('membership[user_ids][]', principals), :id => 'principals')
links = pagination_links_full(@obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true){|text, parameters, options| links = pagination_links_full(@obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true){|text, parameters, options|
link_to text, host_with_protocol + "/org_member/org_member_autocomplete?" + parameters.merge(:q => params[:q],:flag => true,:org=> org, :format => 'js').to_query, :remote => true link_to text, host_with_protocol + "/org_member/org_member_autocomplete?" + parameters.merge(:q => params[:q],:flag => true,:org=> org, :format => 'js').to_query, :remote => true
} }

View File

@ -52,6 +52,9 @@ class Member < ActiveRecord::Base
ids += member_roles.select {|mr| !mr.inherited_from.nil?}.collect(&:role_id) ids += member_roles.select {|mr| !mr.inherited_from.nil?}.collect(&:role_id)
new_role_ids = ids - role_ids new_role_ids = ids - role_ids
if (new_role_ids.include?(7) || new_role_ids.include?(9)) && role_ids.include?(10)
member_roles.where("role_id = 10").first.update_column('is_current', 0)
end
# Add new roles # Add new roles
if new_role_ids.include?(7) && new_role_ids.include?(10) if new_role_ids.include?(7) && new_role_ids.include?(10)
member_roles << MemberRole.new(:role_id => 7) member_roles << MemberRole.new(:role_id => 7)

View File

@ -131,6 +131,22 @@ class Principal < ActiveRecord::Base
columns.uniq.map {|field| "#{table}.#{field}"} columns.uniq.map {|field| "#{table}.#{field}"}
end end
#收藏的课程
def favorite_courses
members = Member.where("user_id = #{self.id} and course_id != -1 and is_collect = 1")
course_ids = members.empty? ? "(-1)" : "(" + members.map{|member| member.course_id}.join(",") + ")"
courses = Course.where("id in #{course_ids}")
return courses
end
#收藏的项目
def favorite_projects
members = Member.where("user_id = #{self.id} and project_id != -1 and project_id != 0 and is_collect = 1")
project_ids = members.empty? ? "(-1)" : "(" + members.map{|member| member.project_id}.join(",") + ")"
projects = Project.where("id in #{project_ids}")
return projects
end
protected protected
# Make sure we don't try to insert NULL values (see #4632) # Make sure we don't try to insert NULL values (see #4632)

View File

@ -1,6 +1,6 @@
#学生提交作品表 #学生提交作品表
class StudentWork < ActiveRecord::Base 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, :work_status, :commit_time attr_accessible :name, :description, :homework_common_id, :user_id, :final_score, :teacher_score, :student_score, :teaching_asistant_score, :system_score, :work_score, :project_id, :is_test, :simi_id, :simi_value, :work_status, :commit_time
belongs_to :homework_common belongs_to :homework_common
belongs_to :user belongs_to :user

View File

@ -34,7 +34,7 @@ class Tracker < ActiveRecord::Base
end end
has_and_belongs_to_many :projects has_and_belongs_to_many :projects
has_and_belongs_to_many :courses # has_and_belongs_to_many :courses
has_and_belongs_to_many :custom_fields, :class_name => 'IssueCustomField', :join_table => "#{table_name_prefix}custom_fields_trackers#{table_name_suffix}", :association_foreign_key => 'custom_field_id' has_and_belongs_to_many :custom_fields, :class_name => 'IssueCustomField', :join_table => "#{table_name_prefix}custom_fields_trackers#{table_name_suffix}", :association_foreign_key => 'custom_field_id'
acts_as_list acts_as_list

View File

@ -1162,18 +1162,20 @@ class User < Principal
#为新注册用户发送留言 #为新注册用户发送留言
def add_new_jour def add_new_jour
if Message.where("id=19504").any? and Message.where("id=19291").any? and Message.where("id=19292").any? if Setting.find_by_name("hidden_non_project") && Setting.find_by_name("hidden_non_project").value != "0"
lead_message1 = Message.find(19292) if Message.where("id=19504").any? and Message.where("id=19291").any? and Message.where("id=19292").any?
notes1 = lead_message1.content lead_message1 = Message.find(19292)
lead_message2 = Message.find(19291) notes1 = lead_message1.content
notes2 = lead_message2.content lead_message2 = Message.find(19291)
lead_message3 = Message.find(19504) notes2 = lead_message2.content
notes3 = lead_message3.content lead_message3 = Message.find(19504)
#user_id 默认为课程使者创建 notes3 = lead_message3.content
self.journals_for_messages << JournalsForMessage.new(:user_id => 1, :notes => notes1, :reply_id => 0, :status => true, :is_readed => false, :private => 0) #user_id 默认为课程使者创建
self.journals_for_messages << JournalsForMessage.new(:user_id => 1, :notes => notes2, :reply_id => 0, :status => true, :is_readed => false, :private => 0) self.journals_for_messages << JournalsForMessage.new(:user_id => 1, :notes => notes1, :reply_id => 0, :status => true, :is_readed => false, :private => 0)
self.journals_for_messages << JournalsForMessage.new(:user_id => 1, :notes => notes3, :reply_id => 0, :status => true, :is_readed => false, :private => 0) self.journals_for_messages << JournalsForMessage.new(:user_id => 1, :notes => notes2, :reply_id => 0, :status => true, :is_readed => false, :private => 0)
end self.journals_for_messages << JournalsForMessage.new(:user_id => 1, :notes => notes3, :reply_id => 0, :status => true, :is_readed => false, :private => 0)
end
end
end end
# 更新邮箱的同事更新invite_lists表中的邮箱信息 # 更新邮箱的同事更新invite_lists表中的邮箱信息

View File

@ -17,7 +17,8 @@
:upload_path => upload_avatar_path(:format => 'js'), :upload_path => upload_avatar_path(:format => 'js'),
:description_placeholder => nil ,# l(:label_optional_description) :description_placeholder => nil ,# l(:label_optional_description)
:source_type => source.class.to_s, :source_type => source.class.to_s,
:source_id => source.id.to_s :source_id => source.id.to_s,
:is_direct => 0
} %> } %>
<!--</span>--> <!--</span>-->
<% content_for :header_tags do %> <% content_for :header_tags do %>

View File

@ -1,4 +1,4 @@
<% if @source_type=='User' %> <% if @is_direct == '1' && (@source_type=='User'|| @source_type == 'Course' || @source_type == 'Project') %>
var imgSpan = $("img[nhname='avatar_image']"); var imgSpan = $("img[nhname='avatar_image']");
imgSpan.attr({"src":'<%= "#{@urlfile.to_s}?#{Time.now.to_i}" %>'}); imgSpan.attr({"src":'<%= "#{@urlfile.to_s}?#{Time.now.to_i}" %>'});
<% else %> <% else %>

View File

@ -22,7 +22,7 @@
<div class="homepageRight mt0 ml10"> <div class="homepageRight mt0 ml10">
<div class="homepageRightBanner"> <div class="homepageRightBanner">
<div class="NewsBannerName"> <div class="NewsBannerName">
班级问答 班级讨论
</div> </div>
</div> </div>
<div nhname="topic_form"> <div nhname="topic_form">

View File

@ -2,7 +2,7 @@
<% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course)) %> <% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course)) %>
<% if show_nav?(@course.boards.first ? @course.boards.first.topics.count : 0) %> <% if show_nav?(@course.boards.first ? @course.boards.first.topics.count : 0) %>
<li> <li>
<a href="<%=course_boards_path(@course) %>">问答区</a> <a href="<%=course_boards_path(@course) %>">讨论区</a>
<%= link_to( "",course_boards_path(@course, :flag => true, :is_new => 1), :class => 'sy_class_add', :title =>"#{l(:label_message_new)}") %> <%= link_to( "",course_boards_path(@course, :flag => true, :is_new => 1), :class => 'sy_class_add', :title =>"#{l(:label_message_new)}") %>
</li> </li>
<% end %> <% end %>

View File

@ -17,7 +17,7 @@
<div class="cl"></div> <div class="cl"></div>
<li class="ml45"> <li class="ml45">
<label><span class="c_red">*</span>&nbsp;<%= l(:label_tags_course_name)%>&nbsp;&nbsp;</label> <label><span class="c_red">*</span>&nbsp;<%= l(:label_tags_course_name)%>&nbsp;&nbsp;</label>
<input type="text" name="course[name]" id="new_course_name" class="courses_input" maxlength="100" placeholder="例如计算机系A班" onkeyup="regex_course_name('new');"> <input type="text" name="course[name]" id="new_course_name" class="courses_input" maxlength="100" placeholder="例如:软件工程计算机系A班" onkeyup="regex_course_name('new');">
<span class="c_red" id="new_course_name_notice" style="display: none;">班级名称不能为空且至少有两个字符</span> <span class="c_red" id="new_course_name_notice" style="display: none;">班级名称不能为空且至少有两个字符</span>
</li> </li>
<div class="cl"></div> <div class="cl"></div>

View File

@ -7,6 +7,9 @@
$("#course_is_public").attr("checked",true); $("#course_is_public").attr("checked",true);
<% end %> <% end %>
} }
if(document.getElementById("course_list")) {
window.location.href = "<%=course_files_path(@course) %>";
}
<% else %> <% else %>
<% if @course.is_public? %> <% if @course.is_public? %>
$("#show_course_<%= @course.id %>").attr("title","公开班级:<%= @course.name %><%= @course.time.to_s+ @course.term %>"); $("#show_course_<%= @course.id %>").attr("title","公开班级:<%= @course.name %><%= @course.time.to_s+ @course.term %>");

View File

@ -27,9 +27,8 @@
<div class="hwork_dis" id="tbc_01" style="padding-top: 10px;"> <div class="hwork_dis" id="tbc_01" style="padding-top: 10px;">
<ul> <ul>
<%= labelled_form_for @course do |f| %> <%= labelled_form_for @course do |f| %>
<li class="ml45 mb10"> <li class="ml45 mb10" id="course_avatar_form">
<%= render :partial => "avatar/new_avatar_form", :locals => {source: @course} %> <%= render :partial => "avatar/new_avatar_form", :locals => {source: @course} %>
<div class="cl"></div>
</li> </li>
<li class="ml45 mb10"> <li class="ml45 mb10">
<label><span class="c_red">*</span>&nbsp;<%= l(:label_tags_syllabus_name)%>&nbsp;&nbsp;</label> <label><span class="c_red">*</span>&nbsp;<%= l(:label_tags_syllabus_name)%>&nbsp;&nbsp;</label>

View File

@ -94,7 +94,7 @@
</p> </p>
</div> </div>
<% end %> <% end %>
<div class="resources mt10" style="padding-bottom:5px;"> <div class="resources mt10 pr" style="padding-bottom:5px;">
<div class="reTop mb5"> <div class="reTop mb5">
<%= form_tag( search_course_files_path(@course), method: 'get',:class => "re_search",:remote=>true) do %> <%= form_tag( search_course_files_path(@course), method: 'get',:class => "re_search",:remote=>true) do %>
<%= text_field_tag 'name', params[:name], name: "name", :class => 'researchBox fl',:style=>"padding: 0px"%> <%= text_field_tag 'name', params[:name], name: "name", :class => 'researchBox fl',:style=>"padding: 0px"%>
@ -115,13 +115,22 @@
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<div class="re_con_top"> <div class="re_con_top">
<p class="f_l fontBlue f_b f_14">共有&nbsp;<span id="attachment_count"><%= @all_attachments.count%></span>&nbsp;个资源</p> <!--<p class="f_l fontBlue f_b f_14" id="tip_attachment_count">-->
<p class="f_r" style="color: #808080" id="course_filter_order"> <!--<%#= render :partial => "files/tip_attachment_count" %>-->
<%= render :partial => 'course_file_filter_order', :locals => {:remote => @is_remote, :sort => @sort, :order => @order} %> <!--</p>-->
</p> <p class="f_l fontBlue f_b f_14">共有&nbsp;<span id="attachment_count"><%= @all_attachments.count%></span>&nbsp;个资源</p>
<p class="f_r" style="color: #808080" id="course_filter_order">
<%= render :partial => 'course_file_filter_order', :locals => {:remote => @is_remote, :sort => @sort, :order => @order} %>
</p>
</div> </div>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<!--<div class="resource_tip_box fontGrey2">-->
<!--<em></em>-->
<!--<span></span>-->
<!--<p class="mb5">私有资源:<br/>仅对本班级成员可见</p>-->
<!--<p>公共资源:<br/>对所有用户可见</p>-->
<!--</div>-->
</div> </div>
<div id="course_list"> <div id="course_list">
<%= render :partial => 'course_list',:locals => {course: @course,all_attachments: @all_attachments,sort:@sort,order:@order,curse_attachments:@obj_attachments} %> <%= render :partial => 'course_list',:locals => {course: @course,all_attachments: @all_attachments,sort:@sort,order:@order,curse_attachments:@obj_attachments} %>

View File

@ -63,7 +63,11 @@
<li class="homepagePostSettingIcon"> <li class="homepagePostSettingIcon">
<% if (delete_allowed || User.current.id == file.author_id) && file.container_id == org_subfield.id && file.container_type == "OrgSubfield" %> <% if (delete_allowed || User.current.id == file.author_id) && file.container_id == org_subfield.id && file.container_type == "OrgSubfield" %>
<ul class="homepagePostSettiongText"> <ul class="homepagePostSettiongText">
<li><%= link_to("发&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;送".html_safe, 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send('#{file.id}','#{User.current.id}','file')") %></li> <% if hidden_unproject_infos %>
<li><%= link_to("发&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;送".html_safe, 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send('#{file.id}','#{User.current.id}','file')") %></li>
<% else %>
<li><%= link_to("发&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;送".html_safe, 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send_hidden('#{file.id}','#{User.current.id}','file')") %></li>
<% end %>
<li><%= link_to '更新版本',attachments_versions_path(file),:class => "postOptionLink",:remote=>true %></li> <li><%= link_to '更新版本',attachments_versions_path(file),:class => "postOptionLink",:remote=>true %></li>
<% if file.container.try(:organization).try(:is_public?) %> <% if file.container.try(:organization).try(:is_public?) %>
<li> <li>

View File

@ -65,7 +65,7 @@
</p> </p>
</div> </div>
<% end %> <% end %>
<div class="resources mt10" style="padding-bottom:5px;"> <div class="resources mt10 pr" style="padding-bottom:5px;">
<div class="reTop mb5"> <div class="reTop mb5">
<%= form_tag( search_project_project_files_path(@project), method: 'get',:class => "re_search",:remote=>true) do %> <%= form_tag( search_project_project_files_path(@project), method: 'get',:class => "re_search",:remote=>true) do %>
<%= text_field_tag 'name', params[:name], name: "name", :class => 're_schbox',:style=>"padding: 0px"%> <%= text_field_tag 'name', params[:name], name: "name", :class => 're_schbox',:style=>"padding: 0px"%>
@ -85,6 +85,9 @@
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<div class="re_con_top"> <div class="re_con_top">
<!--<p class="f_l fontBlue f_b f_14" id="tip_attachment_count">-->
<!--<%#= render :partial => "files/tip_attachment_count" %>-->
<!--</p>-->
<p class="f_l fontBlue f_b f_14">共有&nbsp;<span id="attachment_count"><%= @all_attachments.count%></span>&nbsp;个资源</p> <p class="f_l fontBlue f_b f_14">共有&nbsp;<span id="attachment_count"><%= @all_attachments.count%></span>&nbsp;个资源</p>
<p class="f_r" style="color: #808080"> <p class="f_r" style="color: #808080">
<% if @order == "asc" %> <% if @order == "asc" %>
@ -100,6 +103,14 @@
</div> </div>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<%# if !User.current.member_of?(@project) && show_attachment_tip(@project.id, "Project") %>
<!--<div class="resource_tip_box fontGrey2">-->
<!--<em></em>-->
<!--<span></span>-->
<!--<p class="mb5">私有资源:<br/>仅对本项目成员可见</p>-->
<!--<p>公共资源:<br/>对所有用户可见</p>-->
<!--</div>-->
<%# end %>
</div> </div>
<div id="course_list"> <div id="course_list">
<%= render :partial => 'project_list',:locals => {project: @project, all_attachments: @all_attachments, sort:@sort, order:@order, project_attachments:@obj_attachments} %> <%= render :partial => 'project_list',:locals => {project: @project, all_attachments: @all_attachments, sort:@sort, order:@order, project_attachments:@obj_attachments} %>

View File

@ -0,0 +1,15 @@
共有&nbsp;<span id="attachment_count"><%= @tip_all_attachments %></span>&nbsp;个资源
<span id="attachment_count_public" class="fontGrey2 ml10" style="font-weight: normal;">公共资源:<%= @tip_all_public_attachments %>个</span>
<% if @project %>
<% if !User.current.member_of?(@project) && params[:tag_name] %>
<span id="attachment_count_private" class="fontGrey2 ml10" style="font-weight: normal;">私有资源0个</span>
<% else %>
<span id="attachment_count_private" class="fontGrey2 ml10" style="font-weight: normal;">私有资源:<%= @tip_all_private_attachments %>个</span>
<% end %>
<% elsif @course %>
<% if !User.current.member_of_course?(@course) && params[:tag_name] %>
<span id="attachment_count_private" class="fontGrey2 ml10" style="font-weight: normal;">私有资源0个</span>
<% else %>
<span id="attachment_count_private" class="fontGrey2 ml10" style="font-weight: normal;">私有资源:<%= @tip_all_private_attachments %>个</span>
<% end %>
<% end %>

View File

@ -4,7 +4,11 @@
<% if User.current.admin? || ((is_project_manager?(User.current, project) || file.author_id == User.current.id) && project_contains_attachment?(project, file)) %> <% if User.current.admin? || ((is_project_manager?(User.current, project) || file.author_id == User.current.id) && project_contains_attachment?(project, file)) %>
<% if User.current.admin? || ((delete_allowed || User.current.id == file.author_id) && file.container_id == project.id && file.container_type == "Project") %> <% if User.current.admin? || ((delete_allowed || User.current.id == file.author_id) && file.container_id == project.id && file.container_type == "Project") %>
<ul class="homepagePostSettiongText"> <ul class="homepagePostSettiongText">
<li><%= link_to("发&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;送".html_safe, 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send('#{file.id}','#{User.current.id}','file')") %></li> <% if hidden_unproject_infos %>
<li><%= link_to("发&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;送".html_safe, 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send('#{file.id}','#{User.current.id}','file')") %></li>
<% else %>
<li><%= link_to("发&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;送".html_safe, 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send_hidden('#{file.id}','#{User.current.id}','file')") %></li>
<% end %>
<li><%= link_to '更新版本',attachments_versions_path(file),:class => "postOptionLink",:remote=>true %></li> <li><%= link_to '更新版本',attachments_versions_path(file),:class => "postOptionLink",:remote=>true %></li>
<% if project.is_public? %> <% if project.is_public? %>
<li> <li>
@ -20,7 +24,11 @@
<% end %> <% end %>
<% else %> <% else %>
<ul class="resourceSendO"> <ul class="resourceSendO">
<li><%= link_to("发&nbsp;&nbsp;送".html_safe, 'javascript:void(0)',:class => "postOptionLink2",:onclick=>"show_send('#{file.id}','#{User.current.id}','file')") %></li> <% if hidden_unproject_infos %>
<li><%= link_to("发&nbsp;&nbsp;送".html_safe, 'javascript:void(0)',:class => "postOptionLink2",:onclick=>"show_send('#{file.id}','#{User.current.id}','file')") %></li>
<% else %>
<li><%= link_to("发&nbsp;&nbsp;送".html_safe, 'javascript:void(0)',:class => "postOptionLink2",:onclick=>"show_send_hidden('#{file.id}','#{User.current.id}','file')") %></li>
<% end %>
</ul> </ul>
<% end %> <% end %>
<% end %> <% end %>

View File

@ -3,5 +3,6 @@
$("#pages").html('<%= pagination_links_full @feedback_pages, @feedback_count, :per_page_links => false, :remote => true, :flag => true %>'); $("#pages").html('<%= pagination_links_full @feedback_pages, @feedback_count, :per_page_links => false, :remote => true, :flag => true %>');
<% else %> <% else %>
$("#resource_list").html("<%= escape_javascript( render :partial => 'files/project_file',:locals => {project:@project, all_attachments:@all_attachments, sort:@sort, order:@order, project_attachments:@obj_attachments}) %>"); $("#resource_list").html("<%= escape_javascript( render :partial => 'files/project_file',:locals => {project:@project, all_attachments:@all_attachments, sort:@sort, order:@order, project_attachments:@obj_attachments}) %>");
// $("#tip_attachment_count").html("<%#= escape_javascript( render :partial => 'files/tip_attachment_count') %>");
$("#pages").html('<%= pagination_links_full @feedback_pages, @feedback_count, :per_page_links => false, :remote => true, :flag => true %>'); $("#pages").html('<%= pagination_links_full @feedback_pages, @feedback_count, :per_page_links => false, :remote => true, :flag => true %>');
<% end %> <% end %>

View File

@ -0,0 +1,5 @@
<% count = @issue.journals.count %>
回复<sapn class="mr15"><%= count>0 ? "#{count}" : "" %></sapn><span style="color: #cecece;">▪</span>
<span id="praise_count_<%=@issue.id %>">
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>@issue, :user_activity_id=>@issue.id,:type=>"activity"}%>
</span>

View File

@ -17,5 +17,5 @@ issue_desc_editor = KindEditor.create('#issue_description',
"uploadJson":"/kindeditor/upload", "uploadJson":"/kindeditor/upload",
"fileManagerJson":"/kindeditor/filemanager"}); "fileManagerJson":"/kindeditor/filemanager"});
// $("#issue_test_<%#= @issue.id %>").html("<%#= escape_javascript(render :partial => 'issues/edit', :locals => {:issue => Issue.find( @issue_id)}) %>"); // $("#issue_test_<%#= @issue.id %>").html("<%#= escape_javascript(render :partial => 'issues/edit', :locals => {:issue => Issue.find( @issue_id)}) %>");
$(".homepagePostReplyBannerCount").html('回复(<%= @issue.journals.count %>'); $(".homepagePostReplyBannerCount").html('<%= escape_javascript(render :partial => 'issues/issue_reply_banner') %>');
sd_create_editor_from_data(<%= @issue.id%>, null, "100%","<%= @issue.class.name %>"); sd_create_editor_from_data(<%= @issue.id%>, null, "100%","<%= @issue.class.name %>");

View File

@ -36,7 +36,9 @@
<div class="homepagePostReply"> <div class="homepagePostReply">
<div class="topBorder" style="display: <%= @issue.journals.count>0 ? 'none': '' %>"></div> <div class="topBorder" style="display: <%= @issue.journals.count>0 ? 'none': '' %>"></div>
<div class="homepagePostReplyBanner" > <div class="homepagePostReplyBanner" >
<div class="homepagePostReplyBannerCount" >回复(<%= @issue.journals.count %></div> <div class="homepagePostReplyBannerCount">
<%=render :partial => 'issue_reply_banner' %>
</div>
<div class="homepagePostReplyBannerTime"></div> <div class="homepagePostReplyBannerTime"></div>
</div> </div>
<div class="" id="reply_div_<%= @issue.id %>" > <div class="" id="reply_div_<%= @issue.id %>" >

View File

@ -26,7 +26,7 @@
<%= link_to image_tag('/images/footer_logo/nudt.png',:size=>'100x30',:alt=>l(:label_co_organizer_NUDT)),"http://www.nudt.edu.cn/special.asp?classid=12", :target => "_blank" %> <%= link_to image_tag('/images/footer_logo/nudt.png',:size=>'100x30',:alt=>l(:label_co_organizer_NUDT)),"http://www.nudt.edu.cn/special.asp?classid=12", :target => "_blank" %>
</span> </span>
<span class="footer_logo_link"> <span class="footer_logo_link">
<%= link_to image_tag('/images/footer_logo/peking_eecs.png',:size=>'100x30',:alt=>l(:label_co_organizer_EECS)), "http://eecs.pku.edu.cn", :target => "_blank" %> <%= link_to image_tag('/images/footer_logo/peking_eecs.png',:size=>'100x30',:alt=>l(:label_co_organizer_EECS)), "http://www.sei.pku.edu.cn/", :target => "_blank" %>
</span> </span>
<span class="footer_logo_link"> <span class="footer_logo_link">
<%= link_to image_tag('/images/footer_logo/buaa_scse.png',:size=>'100x30',:alt=>l(:label_co_organizer_BHU)), "http://scse.buaa.edu.cn/", :target => "_blank" %> <%= link_to image_tag('/images/footer_logo/buaa_scse.png',:size=>'100x30',:alt=>l(:label_co_organizer_BHU)), "http://scse.buaa.edu.cn/", :target => "_blank" %>

View File

@ -24,7 +24,7 @@
<a href="http://www.nudt.edu.cn/ArticleShow.asp?ID=41" class="mr45 f_grey" target="_blank"><%= l(:label_sponsor)%></a> <a href="http://www.nudt.edu.cn/ArticleShow.asp?ID=41" class="mr45 f_grey" target="_blank"><%= l(:label_sponsor)%></a>
</li> </li>
<li class="fl mr10"> <li class="fl mr10">
<strong><%= l(:label_partners)%></strong><a href="http://eecs.pku.edu.cn" class="ml10 f_grey" target="_blank"><%= l(:label_co_organizer_EECS)%></a> <strong><%= l(:label_partners)%></strong><a href="http://www.sei.pku.edu.cn/" class="ml10 f_grey" target="_blank"><%= l(:label_co_organizer_EECS)%></a>
</li> </li>
<li class="fl"> <li class="fl">
<a href="http://scse.buaa.edu.cn/" class="mr10 f_grey" target="_blank"><%= l(:label_co_organizer_BHU)%></a> <a href="http://scse.buaa.edu.cn/" class="mr10 f_grey" target="_blank"><%= l(:label_co_organizer_BHU)%></a>

View File

@ -2,7 +2,7 @@
<% teacher_num = TeacherAndAssistantCount(@course) %> <% teacher_num = TeacherAndAssistantCount(@course) %>
<% student_num = studentCount(@course) %> <% student_num = studentCount(@course) %>
<% course_file_num = visable_attachemnts_incourse(@course).count %> <% course_file_num = visable_attachemnts_incourse(@course).count %>
<p class="sy_cgrey mb10"> <p class="sy_cgrey mb10 mr20">
<%= link_to(@course.teacher.show_name, user_path(@course.teacher), :class => 'sy_cgrey') %> <%= link_to(@course.teacher.show_name, user_path(@course.teacher), :class => 'sy_cgrey') %>
&nbsp;&gt;&nbsp; &nbsp;&gt;&nbsp;
<% if @course.syllabus %> <% if @course.syllabus %>
@ -30,7 +30,16 @@
<div class="cl"></div> <div class="cl"></div>
<div class="sy_class_logo fl"> <div class="sy_class_logo fl">
<%= image_tag(url_to_avatar(@course), :width => "110", :height => "110", :alt => "班级logo") %> <div class="pr" style="width: 96px; height:96px;">
<% if User.current.logged? && (User.current == @course.teacher || User.current.admin?)%>
<%=link_to image_tag(url_to_avatar(@course),width:"96", height: "96", :id=>'nh_source_tx'), my_clear_user_avatar_temp_path(:course => @course.id), :remote => true%>
<div class="homepageEditProfile undis">
<%=link_to '', my_clear_user_avatar_temp_path(:course => @course.id), :class => 'homepageEditProfileIcon', :title => '点击编辑头像', :remote => true %>
</div>
<% else %>
<%= image_tag(url_to_avatar(@course), :width => "96", :height => "96", :alt => "班级logo") %>
<% end %>
</div>
</div> </div>
<div class="sy_class_id fl"> <div class="sy_class_id fl">
<p>邀 请 码<br /> <p>邀 请 码<br />
@ -54,7 +63,7 @@
</p> </p>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<p class="sy_cgrey mb10"> <p class="sy_cgrey mb5">
<span class=" mr15">主讲老师:<%= link_to(@course.teacher.show_name, user_path(@course.teacher), :class => 'sy_cblue') %></span> <span class=" mr15">主讲老师:<%= link_to(@course.teacher.show_name, user_path(@course.teacher), :class => 'sy_cblue') %></span>
<span class=" mr15">学时:<span class="sy_cblack"><%= @course.class_period %>学时</span></span> <span class=" mr15">学时:<span class="sy_cblack"><%= @course.class_period %>学时</span></span>
<span class=" mr15">学期:<span class="sy_cblack"><%= current_time_and_term @course %></span></span> <span class=" mr15">学期:<span class="sy_cblack"><%= current_time_and_term @course %></span></span>

View File

@ -4,7 +4,9 @@
<li class="fl"><a href="<%= about_us_path %>" class="f_grey mw20" target="_blank"><%= l(:label_about_us)%></a>|</li> <li class="fl"><a href="<%= about_us_path %>" class="f_grey mw20" target="_blank"><%= l(:label_about_us)%></a>|</li>
<li class="fl"><a href="<%= agreement_path %>" class="f_grey mw20" target="_blank">服务协议</a>|</li> <li class="fl"><a href="<%= agreement_path %>" class="f_grey mw20" target="_blank">服务协议</a>|</li>
<li class="fl" style="display: none"><span class="f_grey mw20" title="暂未开放"><%= l(:label_recruitment_information)%></span>|</li> <li class="fl" style="display: none"><span class="f_grey mw20" title="暂未开放"><%= l(:label_recruitment_information)%></span>|</li>
<li class="fl"><%= link_to l(:label_surpport_group), "#{Setting.protocol}://#{Setting.host_name}/forums/1/memos/1168", :class => "f_grey mw20", :target=>"_blank" %>|</li> <% if hidden_unproject_infos %>
<li class="fl"><%= link_to l(:label_surpport_group), "#{Setting.protocol}://#{Setting.host_name}/forums/1/memos/1168", :class => "f_grey mw20", :target=>"_blank" %>|</li>
<% end %>
<li class="fl"><a href="<%= forums_path(:reorder_complex=>'desc')%>" class="f_grey mw20" target="_blank" ><%= l(:label_forums)%></a></li> <li class="fl"><a href="<%= forums_path(:reorder_complex=>'desc')%>" class="f_grey mw20" target="_blank" ><%= l(:label_forums)%></a></li>
</ul> </ul>
@ -22,7 +24,7 @@
<strong><%= l(:label_partners)%></strong> <strong><%= l(:label_partners)%></strong>
</li> </li>
<li class="fl mr20"> <li class="fl mr20">
<a href="http://eecs.pku.edu.cn" class="f_grey" target="_blank"><%#= l(:label_co_organizer_EECS)%><img src="/images/footer_logo/PekingUniversity.png" width="121" height="40" style="display: inline-block;" alt="北京大学" /></a> <a href="http://www.sei.pku.edu.cn/" class="f_grey" target="_blank"><%#= l(:label_co_organizer_EECS)%><img src="/images/footer_logo/PekingUniversity.png" width="121" height="40" style="display: inline-block;" alt="北京大学" /></a>
</li> </li>
<li class="fl mr20"> <li class="fl mr20">
<a href="http://scse.buaa.edu.cn/" class="f_grey" target="_blank"><%#= l(:label_co_organizer_BHU)%><img src="/images/footer_logo/BeiHang_university.png" width="173" height="40" style="display: inline-block;" alt="北京航空航天大学" /></a> <a href="http://scse.buaa.edu.cn/" class="f_grey" target="_blank"><%#= l(:label_co_organizer_BHU)%><img src="/images/footer_logo/BeiHang_university.png" width="173" height="40" style="display: inline-block;" alt="北京航空航天大学" /></a>

View File

@ -4,7 +4,9 @@
<li class="fl"><a href="javascript:void(0);" disabled="true" class="f_grey mw20" target="_blank"><%= l(:label_about_us)%></a>|</li> <li class="fl"><a href="javascript:void(0);" disabled="true" class="f_grey mw20" target="_blank"><%= l(:label_about_us)%></a>|</li>
<li class="fl"><a href="javascript:void(0);" disabled="true" class="f_grey mw20" target="_blank">服务协议</a>|</li> <li class="fl"><a href="javascript:void(0);" disabled="true" class="f_grey mw20" target="_blank">服务协议</a>|</li>
<li class="fl" style="display: none"><span class="f_grey mw20" title="暂未开放"><%= l(:label_recruitment_information)%></span>|</li> <li class="fl" style="display: none"><span class="f_grey mw20" title="暂未开放"><%= l(:label_recruitment_information)%></span>|</li>
<li class="fl"><%= link_to l(:label_surpport_group), "javascript:void(0);", :class => "f_grey mw20", :target=>"_blank" %>|</li> <% if hidden_unproject_infos %>
<li class="fl"><%= link_to l(:label_surpport_group), "javascript:void(0);", :class => "f_grey mw20", :target=>"_blank" %>|</li>
<% end %>
<li class="fl"><a href="javascript:void(0);" disabled="true" class="f_grey mw20" target="_blank"><%= l(:label_forums)%></a></li> <li class="fl"><a href="javascript:void(0);" disabled="true" class="f_grey mw20" target="_blank"><%= l(:label_forums)%></a></li>
</ul> </ul>
@ -22,7 +24,7 @@
<strong><%= l(:label_partners)%></strong> <strong><%= l(:label_partners)%></strong>
</li> </li>
<li class="fl mr20"> <li class="fl mr20">
<a href="http://eecs.pku.edu.cn" class="f_grey" target="_blank"><%#= l(:label_co_organizer_EECS)%><img src="/images/footer_logo/PekingUniversity.png" width="121" height="40" style="display: inline-block;" alt="北京大学" /></a> <a href="http://www.sei.pku.edu.cn/" class="f_grey" target="_blank"><%#= l(:label_co_organizer_EECS)%><img src="/images/footer_logo/PekingUniversity.png" width="121" height="40" style="display: inline-block;" alt="北京大学" /></a>
</li> </li>
<li class="fl mr20"> <li class="fl mr20">
<a href="http://scse.buaa.edu.cn/" class="f_grey" target="_blank"><%#= l(:label_co_organizer_BHU)%><img src="/images/footer_logo/BeiHang_university.png" width="173" height="40" style="display: inline-block;" alt="北京航空航天大学" /></a> <a href="http://scse.buaa.edu.cn/" class="f_grey" target="_blank"><%#= l(:label_co_organizer_BHU)%><img src="/images/footer_logo/BeiHang_university.png" width="173" height="40" style="display: inline-block;" alt="北京航空航天大学" /></a>

View File

@ -0,0 +1,40 @@
<%= javascript_include_tag "feedback" %>
<div class="scrollsidebar" id="scrollsidebar">
<div class="side_content">
<div class="side_list">
<div class="side_title">
<a title="<%= l(:button_hide) %>" class="close_btn">
<span>
</span>
</a>
</div>
<div class="side_center">
<div class="custom_service">
<% get_memo %>
<%= form_for(@new_memo, :url => create_feedback_forum_path(@public_forum)) do |f| %>
<%= f.text_area :subject, :id=>"subject", :class => "opnionText", :placeholder => l(:label_feedback_tips) %>
<%= f.hidden_field :content,:id => 'hidden', :required => true , :value => l(:label_feedback_value) %>
<label class="c_grey">您还能输入<span id="textCount" class="c_orange">50</span>个字符</label>
<a href="javascript:void(0);" class="opnionButton" style=" color:#fff;height:21px" id="" onclick="">
<%= l(:label_submit)%>
</a>
<% end %>
</div>
<div class="mt5" style="color: #269ac9;cursor: default">
<!--<a target="hiddentab" href="http://wpa.qq.com/msgrd?v=1&uin=1554253403&site=qq&menu=yes" style="color: #269ac9;">-->
<%#= l(:label_technical_support) %>
<!--白&nbsp;&nbsp;&nbsp;羽</a> http://shang.qq.com/wpa/qunwpa?idkey=4fe2d63a4527cddce038f04f0b1d728a62082074fb4a74870a5444ee1a6910ad-->
<!--<p style="text-align: center"> 请加入师姐师兄答疑群</p> <p style="text-align: center"></p>-->
<!--<a href="mqqapi://card/show_pslcard?src_type=internal&version=1&uin=173184401&card_type=group&source=qrcode">QQ群号173184401</a>-->
<a target="_blank" href="http://shang.qq.com/wpa/qunwpa?idkey=fb938b1f6f991fc100f3d32b6ef38b7888dd4097c71d0eb8b239eaa8749a6afd"><img border="0" src="http://pub.idqqimg.com/wpa/images/group.png" alt="Trustie师姐师兄答疑群" title="Trustie师姐师兄答疑群"></a>
</div>
</div>
<div class="side_bottom"></div>
</div>
</div>
<div class="show_btn">
<span><%= l(:label_submit)%></span>
<a href="javascript:void(0)" class="closeSidebar"></a>
</div>
</div>

View File

@ -0,0 +1,17 @@
<% all_count = @user.favorite_courses.visible.where("is_delete =?", 0).count%>
<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>
<% 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 %>
<script>
$(function() {
$('#user_hide_course').hide();
})
</script>

View File

@ -0,0 +1,17 @@
<% all_count = @user.favorite_projects.visible.count%>
<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 %>
<script>
$(function() {
$('#user_hide_project').hide();
})
</script>

View File

@ -10,12 +10,14 @@
<li class="navHomepageMenu fl"> <li class="navHomepageMenu fl">
<%= link_to "资源库", user_resource_user_path(User.current, :type => 6), :class => "c_white f16 db p10" %> <%= link_to "资源库", user_resource_user_path(User.current, :type => 6), :class => "c_white f16 db p10" %>
</li> </li>
<li class="navHomepageMenu fl"> <% if hidden_unproject_infos %>
<li class="navHomepageMenu fl">
<%= link_to "题库", user_homeworks_user_path(User.current), :class => "c_white f16 db p10"%> <%= link_to "题库", user_homeworks_user_path(User.current), :class => "c_white f16 db p10"%>
</li> </li>
<li class="navHomepageMenu fl mr30"> <li class="navHomepageMenu fl mr30">
<%= link_to "帮助中心", "https://#{Setting.host_name}/forums/1/memos/1168", :class =>"c_white f16 db p10" %> <%= link_to "帮助中心", "https://#{Setting.host_name}/forums/1/memos/1168", :class =>"c_white f16 db p10" %>
</li> </li>
<% end %>
</ul> </ul>
</div> </div>
<script> <script>

View File

@ -10,12 +10,14 @@
<li class="navHomepageMenu fl"> <li class="navHomepageMenu fl">
<a href ="javascript:void(0);" disabled="true" class="c_white f16 db p10">资源库</a> <a href ="javascript:void(0);" disabled="true" class="c_white f16 db p10">资源库</a>
</li> </li>
<li class="navHomepageMenu fl"> <% if hidden_unproject_infos %>
<a href ="javascript:void(0);" disabled="true" class="c_white f16 db p10">题库</a> <li class="navHomepageMenu fl">
</li> <a href ="javascript:void(0);" disabled="true" class="c_white f16 db p10">题库</a>
<li class="navHomepageMenu fl mr30"> </li>
<a href ="javascript:void(0);" disabled="true" class="c_white f16 db p10">帮助中心</a> <li class="navHomepageMenu fl mr30">
</li> <a href ="javascript:void(0);" disabled="true" class="c_white f16 db p10">帮助中心</a>
</li>
<% end %>
</ul> </ul>
</div> </div>
<div class="fl" id="navHomepageSearch"> <div class="fl" id="navHomepageSearch">

View File

@ -13,7 +13,7 @@
<%= link_to image_tag('/images/footer_logo/nudt.png',:style => "width:90px;height:30px;",:alt=>l(:label_co_organizer_NUDT)),"http://www.nudt.edu.cn/special.asp?classid=12", :target => "_blank"%> <%= link_to image_tag('/images/footer_logo/nudt.png',:style => "width:90px;height:30px;",:alt=>l(:label_co_organizer_NUDT)),"http://www.nudt.edu.cn/special.asp?classid=12", :target => "_blank"%>
</li> </li>
<li class="fl mr20"> <li class="fl mr20">
<%= link_to image_tag('/images/footer_logo/peking_eecs.png',:style => "width:90px;height:30px;",:alt=>l(:label_co_organizer_EECS)), "http://eecs.pku.edu.cn", :target => "_blank"%> <%= link_to image_tag('/images/footer_logo/peking_eecs.png',:style => "width:90px;height:30px;",:alt=>l(:label_co_organizer_EECS)), "http://www.sei.pku.edu.cn/", :target => "_blank"%>
</li> </li>
<li class="fl mr20"> <li class="fl mr20">
<%= link_to image_tag('/images/footer_logo/buaa_scse.png',:style => "width:90px;height:30px;",:alt=>l(:label_co_organizer_BHU)), "http://scse.buaa.edu.cn/", :target => "_blank"%> <%= link_to image_tag('/images/footer_logo/buaa_scse.png',:style => "width:90px;height:30px;",:alt=>l(:label_co_organizer_BHU)), "http://scse.buaa.edu.cn/", :target => "_blank"%>

View File

@ -0,0 +1,44 @@
<div>
<div><a href="javascript:hideModal();" class="box_close"></a></div>
<div class="cl"></div>
<div class="pro_new">
<h3 class="box_h3 mb10">头像设置</h3>
<div class="uppicBox">
<input type="button" class="uppic_btn" onclick="$('#upload_avatar').click();" value="浏览.."/>
<%= file_field_tag 'avatar[image]',
:id => "upload_avatar",
:style => 'display:none;',#added by young
:size => "1",
:multiple => false,
:onchange => 'addInputAvatar(this);',
:data => {
:max_file_size => Setting.attachment_max_size.to_i.kilobytes,
:max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)),
:max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i,
:file_type => Redmine::Configuration['pic_types'].to_s,
:type_support_message => l(:error_pic_type),
:upload_path => upload_avatar_path(:format => 'js'),
:description_placeholder => nil ,# l(:label_optional_description)
:source_type => source.class.to_s,
:source_id => source.id.to_s,
:is_direct => 1
} %>
<!--<br/>-->
<!--<span>只支持jpg,png,gif,大小不超过5M</span>-->
</div>
<div class="showpicBox">
<p>预览</p>
<%= image_tag(url_to_avatar(source), :style=>"width:96px;height:96px;",:class=>"mb5 mt10",:nhname=>'avatar_image') %>
<br/>
<span >96px*96px</span> <br />
<div class="mb20"></div>
<%= image_tag(url_to_avatar(source), :style=>"width:48px;height:48px;",:class=>"mb5",:nhname=>'avatar_image') %>
<br />
<span>48px*48px</span> <br />
</div>
<div class="cl mb10"></div>
<a href="javascript:hideModal();" class=" fr grey_btn mr15 f14"> 取&nbsp;&nbsp;消</a>
<a href="<%= url_for(:controller => 'my', :action => 'save_user_avatar', :source_id => source.id, :source_type => source.class.to_s) %>" data-remote="true" class="blue_btn fr mr10 f14">确&nbsp;&nbsp;定</a>
</div><!--talknew end-->
<div class="cl"></div>
</div><!--floatbox end-->

View File

@ -52,6 +52,10 @@
</li> </li>
<% end %> <% end %>
<% if User.current == user %> <% if User.current == user %>
<li>
<%= link_to "取消收藏", cancel_or_collect_user_path(user, :course => course.id), :class => 'user_navmore_li',:target => '_blank', :remote => true %>
<div class="cl"></div>
</li>
<li> <li>
<% if count == 0 %> <% if count == 0 %>
<%= link_to "屏蔽动态", shield_activities_path(:user_id => user.id, :course_id => course.id), :method => 'post', :class => 'user_navmore_li',:remote => true %> <%= link_to "屏蔽动态", shield_activities_path(:user_id => user.id, :course_id => course.id), :method => 'post', :class => 'user_navmore_li',:remote => true %>

View File

@ -27,6 +27,10 @@
</li> </li>
<% end %> <% end %>
<% if User.current == @user %> <% if User.current == @user %>
<li>
<%= link_to "取消收藏", cancel_or_collect_user_path(user, :project => project.id), :class => 'user_navmore_li',:target => '_blank', :remote => true %>
<div class="cl"></div>
</li>
<li> <li>
<% if ShieldActivity.where("container_type='User' and container_id=#{user.id} and shield_type='Project' and shield_id=#{project.id}").count == 0 %> <% 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,:class => "user_navmore_li" %> <%= link_to "屏蔽动态", shield_activities_path(:user_id => user.id, :project_id => project.id), :method => 'post',:remote => true,:class => "user_navmore_li" %>

View File

@ -1,5 +1,6 @@
<%# course_model %> <%# course_model %>
<% course_file_num = visable_attachemnts_incourse(@course).count%> <% course_file_num = visable_attachemnts_incourse(@course).count%>
<%# course_file_num = Attachment.where(:container_type => "Course", :container_id => @course.id).count %>
<% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course)) %> <% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course)) %>
<% homework_num = visable_course_homework @course %> <% homework_num = visable_course_homework @course %>
@ -18,7 +19,7 @@
<%= heads_for_theme %> <%= heads_for_theme %>
<%= call_hook :view_layouts_base_html_head %> <%= call_hook :view_layouts_base_html_head %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common','css/public', 'css/structure','prettify', 'css/courses','css/popup','sy_public','syllabus'%> <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common','css/public', 'css/structure','prettify', 'css/courses','css/popup','sy_public','syllabus'%>
<%= javascript_include_tag "course","header","attachments",'prettify' %> <%= javascript_include_tag "course","avatars","header","attachments",'prettify' %>
<!-- page specific tags --> <!-- page specific tags -->
<%= yield :header_tags -%> <%= yield :header_tags -%>
<!-- MathJax的配置 --> <!-- MathJax的配置 -->
@ -65,7 +66,7 @@
<% unless show_nav?(@course.boards.first ? @course.boards.first.topics.count : 0) %> <% unless show_nav?(@course.boards.first ? @course.boards.first.topics.count : 0) %>
<li id="sy_02" class="sy_icons_boards"> <li id="sy_02" class="sy_icons_boards">
<% count = @course.boards.first ? (@course.boards.first.topics.count + Message.where("board_id =? and parent_id is not ?", @course.boards.first.id, nil).count) : 0 %> <% count = @course.boards.first ? (@course.boards.first.topics.count + Message.where("board_id =? and parent_id is not ?", @course.boards.first.id, nil).count) : 0 %>
<a href="<%=course_boards_path(@course) %>">问答区<span><%=count %></span></a> <a href="<%=course_boards_path(@course) %>">讨论区<span><%=count %></span></a>
<%= link_to( "",course_boards_path(@course, :flag => true, :is_new => 1), :class => 'sy_class_add', :title =>"#{l(:label_message_new)}") %> <%= link_to( "",course_boards_path(@course, :flag => true, :is_new => 1), :class => 'sy_class_add', :title =>"#{l(:label_message_new)}") %>
</li> </li>
<% end %> <% end %>
@ -130,10 +131,13 @@
<%= render :partial => 'courses/course_activity_users', :locals => {:course => @course} %> <%= render :partial => 'courses/course_activity_users', :locals => {:course => @course} %>
<%# 课程英雄榜 %> <%# 课程英雄榜 %>
<%= render :partial => 'courses/course_heroes', :locals => {:course => @course} %> <%= render :partial => 'courses/course_heroes', :locals => {:course => @course} %>
<div class="sy_class_leftbox mb15" > <div class="sy_class_leftbox" >
<h3 class="fontGrey7">班级推荐</h3> <h3 class="fontGrey7">班级推荐</h3>
<%= render :partial => 'courses/recommendation', :locals => {:course => @course} %> <%= render :partial => 'courses/recommendation', :locals => {:course => @course} %>
</div> </div>
<%# 更新访问数,刷新的时候更新访问次数 %>
<% update_visiti_count @course %>
<div class="fontGrey5 mt10 ml20">访问计数 <%= @course.visits.to_i %> 自2016年5月</div>
</div><!--sy_class_l end--> </div><!--sy_class_l end-->
<div class="fl"> <div class="fl">
<%= yield %> <%= yield %>
@ -151,6 +155,9 @@
<span><%= l(:label_loading) %></span> <span><%= l(:label_loading) %></span>
</div> </div>
<div id="ajax-modal" style="display:none;"></div> <div id="ajax-modal" style="display:none;"></div>
<div id="nh_tx_dialog_html" class="white_content" style="display:none;">
<%=render :partial => 'layouts/upload_avatar', :locals => {:source => @course} %>
</div>
<%= call_hook :view_layouts_base_body_bottom %> <%= call_hook :view_layouts_base_body_bottom %>
</body> </body>
<script> <script>

View File

@ -13,7 +13,7 @@
<%= javascript_heads %> <%= javascript_heads %>
<%= heads_for_theme %> <%= heads_for_theme %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common','css/structure','scm','css/public', 'css/project','css/popup','prettify','repository' %> <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common','css/structure','scm','css/public', 'css/project','css/popup','prettify','repository' %>
<%= javascript_include_tag 'cookie','project', 'header','prettify','select_list_move','attachments' %> <%= javascript_include_tag 'cookie','project',"avatars", 'header','prettify','select_list_move','attachments' %>
<%= call_hook :view_layouts_base_html_head %> <%= call_hook :view_layouts_base_html_head %>
<!-- page specific tags --> <!-- page specific tags -->
@ -50,7 +50,16 @@
<div id="LSide" class="fl"> <div id="LSide" class="fl">
<div class="project_info"> <div class="project_info">
<div class="pr_info_logo fl mr10 mb5"> <div class="pr_info_logo fl mr10 mb5">
<%= image_tag(url_to_avatar(@project), :width => "60", :height => "60") %> <div class="pr" style="width: 64px; height:64px;">
<% if User.current.logged? && (User.current.allowed_to?({:controller => 'projects', :action => 'settings'}, @project) || User.current.admin?)%>
<%=link_to image_tag(url_to_avatar(@project),width:"60", height: "60", :id=>'nh_source_tx'), my_clear_user_avatar_temp_path(:project => @project.id), :remote => true%>
<div class="homepageEditProfile undis">
<%=link_to '', my_clear_user_avatar_temp_path(:project => @project.id), :remote => true, :class => 'homepageEditProfileIcon', :title => '点击编辑Logo' %>
</div>
<% else %>
<%= image_tag(url_to_avatar(@project), :width => "60", :height => "60", :alt => "项目logo") %>
<% end %>
</div>
</div> </div>
<div class="pr_info_id fl mb5 f14"> <div class="pr_info_id fl mb5 f14">
<%= l(:label_project_ivite_code)%> <%= l(:label_project_ivite_code)%>
@ -242,13 +251,17 @@
}); });
</script> </script>
</div> </div>
<% if hidden_unproject_infos %>
<%= render :partial => 'layouts/new_feedback' %>
<% end %>
<div id="fade" class="black_overlay">123</div>
<%= render :partial => 'layouts/new_feedback' %>
<div id="ajax-indicator" style="display:none;"> <div id="ajax-indicator" style="display:none;">
<span><%= l(:label_loading) %></span> <span><%= l(:label_loading) %></span>
</div> </div>
<div id="ajax-modal" style="display:none;"></div> <div id="ajax-modal" style="display:none;"></div>
<div id="nh_tx_dialog_html" class="white_content" style="display:none;">
<%=render :partial => 'layouts/upload_avatar', :locals => {:source => @project} %>
</div>
<%= call_hook :view_layouts_base_body_bottom %> <%= call_hook :view_layouts_base_body_bottom %>
</body> </body>
</html> </html>

View File

@ -298,6 +298,7 @@
<div class="cl"></div> <div class="cl"></div>
</div><!--Container end--> </div><!--Container end-->
<%= render :partial => 'layouts/new_feedback' %> <%= render :partial => 'layouts/new_feedback' %>
<div id="ajax-modal" style="display:none;"></div> <div id="ajax-modal" style="display:none;"></div>

View File

@ -59,7 +59,9 @@
<div class="cl"></div> <div class="cl"></div>
<%= render :partial => 'layouts/footer' %> <%= render :partial => 'layouts/footer' %>
<div class="cl"></div> <div class="cl"></div>
<%= render :partial => 'layouts/new_feedback' %> <% if hidden_unproject_infos %>
<%= render :partial => 'layouts/new_feedback' %>
<% end %>
<div id="ajax-indicator" style="display:none;"> <div id="ajax-indicator" style="display:none;">
<span><%= l(:label_loading) %></span> <span><%= l(:label_loading) %></span>
</div> </div>

View File

@ -103,12 +103,17 @@
<div class="homepageLeft mt10" id="LSide"> <div class="homepageLeft mt10" id="LSide">
<div class="user_leftinfo mb10"> <div class="user_leftinfo mb10">
<% if User.current.logged? && User.current == @user%> <% if User.current.logged? && User.current == @user%>
<%=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%> <div class="pr" style="width: 80px; margin:0 auto;">
<% elsif User.current.logged? %> <%=link_to image_tag(url_to_avatar(@user),width:"74", height: "74", :id=>'nh_source_tx'), my_clear_user_avatar_temp_path, :class => "user_leftinfo_img", :remote => true%>
<a href="javascript:void(0)" style="cursor: default;" class="user_leftinfo_img"><%=image_tag(url_to_avatar(@user),width:"74", height: "74", :id=>'nh_user_tx') %></a> <div class="homepageEditProfile undis">
<%=link_to '', my_clear_user_avatar_temp_path, :class => 'homepageEditProfileIcon', :remote => true, :title => '点击编辑Logo' %>
</div>
</div>
<% else %> <% else %>
<img src="images/user/male.jpg" width="74" height="74" /> <a href="javascript:void(0)" class="user_leftinfo_img" style="cursor: default">
<% end %> <%=image_tag(url_to_avatar(@user),width:"74", height: "74", :id=>'nh_source_tx') %>
</a>
<% end %>
<% if (@user.user_extensions && (@user.user_extensions.identity != 2) ) %> <% if (@user.user_extensions && (@user.user_extensions.identity != 2) ) %>
<span class="<%= @user.user_extensions.gender == 1 ? 'user_leftinfo_female' : 'user_leftinfo_male' %> "></span> <span class="<%= @user.user_extensions.gender == 1 ? 'user_leftinfo_female' : 'user_leftinfo_male' %> "></span>
<% end %> <% end %>
@ -154,25 +159,13 @@
</div> </div>
<div class="user_leftnav "> <div class="user_leftnav ">
<% hidden_courses = Setting.find_by_name("hidden_courses") %> <% if hidden_unproject_infos %>
<% unvisiable = hidden_courses && hidden_courses.value == "1"%>
<% if !unvisiable %>
<ul class="users_accordion mb10"> <ul class="users_accordion mb10">
<li id="user_01" class="user_icons_course"> <li id="user_01" class="user_icons_course">
<%= link_to '课程',{:controller => "users", :action => "user_courselist", :id => @user.id}, :id => "user_course_list" %> <%= 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) %> <% courses = @user.favorite_courses.visible.where("is_delete =?", 0).select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS a").order("a desc").limit(10) %>
<% all_count = @user.courses.visible.where("is_delete =?", 0).count%> <div class="<%= courses.empty? ? 'none' : ''%>" id="homepage_left_course_list">
<div class="<%= courses.empty? ? 'none' : ''%>" > <%=render :partial => 'layouts/homepage_left_course_list', :locals => {:courses => courses} %>
<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>
<% 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> </div>
</li> </li>
<% if is_current_user %> <% if is_current_user %>
@ -197,19 +190,9 @@
<ul class="users_accordion mb10"> <ul class="users_accordion mb10">
<li id="user_06" class="user_icons_project"> <li id="user_06" class="user_icons_project">
<%= link_to '项目',{:controller => "users", :action => "user_projectlist", :id => @user.id}, :id => 'user_project_list'%> <%= link_to '项目',{:controller => "users", :action => "user_projectlist", :id => @user.id}, :id => 'user_project_list'%>
<% all_count = @user.projects.visible.count%> <% projects = @user.favorite_projects.visible.select("projects.*, (SELECT MAX(updated_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS a").order("a desc").limit(10)%>
<% 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' : ''%>" id="homepage_left_project_list">
<div class="<%= projects.empty? ? 'none' : ''%>" > <%=render :partial => 'layouts/homepage_left_project_list', :locals => {:projects => projects} %>
<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> </div>
</li> </li>
<% if is_current_user %> <% if is_current_user %>
@ -231,13 +214,17 @@
</ul> </ul>
</div><!--sy_class_leftnav end--> </div><!--sy_class_leftnav end-->
<%# 更新访问数,刷新的时候更新访问次数 %>
<% update_visiti_count @user %>
<div class="fontGrey5 mt10 ml20">访问计数 <%= @user.visits.to_i %> 自2016年5月</div> <div class="fontGrey5 mt10 ml20">访问计数 <%= @user.visits.to_i %> 自2016年5月</div>
</div> </div>
<div class="homepageRight"> <div class="homepageRight">
<%= yield %> <%= yield %>
</div> </div>
</div> </div>
<%= render :partial => 'layouts/new_feedback' %> <% if hidden_unproject_infos %>
<%= render :partial => 'layouts/new_feedback' %>
<% end %>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<%= render :partial => 'layouts/footer' %> <%= render :partial => 'layouts/footer' %>
@ -248,53 +235,10 @@
<span><%= l(:label_loading) %></span> <span><%= l(:label_loading) %></span>
</div> </div>
<div id="nh_tx_dialog_html" class="white_content" style="display:none;"> <div id="nh_tx_dialog_html" class="white_content" style="display:none;">
<div> <%=render :partial => 'layouts/upload_avatar', :locals => {:source => @user} %>
<div><a href="javascript:hideModal();" class="box_close"></a></div>
<div class="cl"></div>
<div class="pro_new">
<h3 class="box_h3 mb10">头像设置</h3>
<div class="uppicBox">
<input type="button" class="uppic_btn" onclick="$('#upload_user_image').click();" value="浏览.."/>
<%= file_field_tag 'avatar[image]',
:id => "upload_user_image",
:style => 'display:none;',#added by young
:size => "1",
:multiple => false,
:onchange => 'addInputAvatar(this);',
:data => {
:max_file_size => Setting.attachment_max_size.to_i.kilobytes,
:max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)),
:max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i,
:file_type => Redmine::Configuration['pic_types'].to_s,
:type_support_message => l(:error_pic_type),
:upload_path => upload_avatar_path(:format => 'js'),
:description_placeholder => nil ,# l(:label_optional_description)
:source_type => @user.class.to_s,
:source_id => @user.id.to_s
} %>
<!--<br/>-->
<!--<span>只支持jpg,png,gif,大小不超过5M</span>-->
</div>
<div class="showpicBox">
<p>预览</p>
<%= image_tag(url_to_avatar(@user), :style=>"width:96px;height:96px;",:class=>"mb5 mt10",:nhname=>'avatar_image') %>
<br/>
<span >96px*96px</span> <br />
<div class="mb20"></div>
<%= image_tag(url_to_avatar(@user), :style=>"width:48px;height:48px;",:class=>"mb5",:nhname=>'avatar_image') %>
<br />
<span>48px*48px</span> <br />
</div>
<div class="cl mb10"></div>
<a href="javascript:hideModal();" class=" fr grey_btn mr15 f14"> 取&nbsp;&nbsp;消</a>
<a href="<%= url_for(:controller => 'my', :action => 'save_user_avatar') %>" data-remote="true" class="blue_btn fr mr10 f14">确&nbsp;&nbsp;定</a>
</div><!--talknew end-->
<div class="cl"></div>
</div><!--floatbox end-->
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
$(function(){ $(function(){
$('#user_hide_course').hide();
$('#user_hide_project').hide(); $('#user_hide_project').hide();
autoUrl("user_brief_introduction_show"); autoUrl("user_brief_introduction_show");
if(<%= @is_course == 1 %>) { if(<%= @is_course == 1 %>) {

View File

@ -152,9 +152,7 @@
</div> </div>
<div class="user_leftnav "> <div class="user_leftnav ">
<% hidden_courses = Setting.find_by_name("hidden_courses") %> <% if hidden_unproject_infos %>
<% unvisiable = hidden_courses && hidden_courses.value == "1"%>
<% if !unvisiable %>
<ul class="users_accordion mb10"> <ul class="users_accordion mb10">
<li id="user_01" class="user_icons_course"> <li id="user_01" class="user_icons_course">
<a href ="javascript:void(0);" disabled="true">课程</a> <a href ="javascript:void(0);" disabled="true">课程</a>
@ -233,7 +231,9 @@
<%= yield %> <%= yield %>
</div> </div>
</div> </div>
<%= render :partial => 'layouts/new_feedback' %> <% if hidden_unproject_infos %>
<%= render :partial => 'layouts/forbidden_new_feedback' %>
<% end %>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<%= render :partial => 'layouts/footer_show' %> <%= render :partial => 'layouts/footer_show' %>

View File

@ -116,7 +116,11 @@
) if @message.destroyable_by?(User.current) %> ) if @message.destroyable_by?(User.current) %>
</li> </li>
<% end %> <% end %>
<li><%= link_to "发送", "javascript:void(0);", :onclick => "show_send(#{@message.id},#{User.current.id},'message');", :class => 'postOptionLink' %></li> <% if hidden_unproject_infos %>
<li><%= link_to "发送", "javascript:void(0);", :onclick => "show_send(#{@message.id},#{User.current.id},'message');", :class => 'postOptionLink' %></li>
<% else %>
<li><%= link_to "发送", "javascript:void(0);", :onclick => "show_send_hidden(#{@message.id},#{User.current.id},'message');", :class => 'postOptionLink' %></li>
<% end %>
</ul> </ul>
</li> </li>
</ul> </ul>

View File

@ -60,7 +60,7 @@
</li> </li>
<li><label class="fl">说明:</label><textarea id = "remarks" class="winbox_textarea fl" placeholder="如果您有特别需要说明的内容请填入"></textarea></li> <li><label class="fl">说明:</label><textarea id = "remarks" class="winbox_textarea fl" placeholder="如果您有特别需要说明的内容请填入"></textarea></li>
<div class="cl"></div> <div class="cl"></div>
<li><label class="fl">&nbsp;&nbsp;</label><button class="fl winbox_btn_blue mt10" onclick = "commit_add_school();">确定</button></li> <li><label class="fl">&nbsp;&nbsp;</label><button id="apply_school" class="fl winbox_btn_blue mt10">确定</button></li>
</ul> </ul>
<script type="text/javascript"> <script type="text/javascript">
@ -103,8 +103,9 @@
if(data.result == 0){ if(data.result == 0){
$("input[name='province']").val(data.name); $("input[name='province']").val(data.name);
$("input[name='occupation']").val(data.school_id); $("input[name='occupation']").val(data.school_id);
var htmlvalue = "</br><div style='width:550px;text-align:center'>添加成功!您可以继续使用了。</div></br><div style='width:550px;text-align:center'>后续我们将对您的高校(单位)进行审核,如有问题我们再联系您。</div></br><div style='width:67px; margin:0 auto; text-align:center'></div>"; var htmlvalue = "</br><div style='width:550px;text-align:center'>添加成功!您可以继续使用了。</div></br><div style='width:550px;text-align:center'>后续我们将对您的高校(单位)进行审核,如有问题我们再联系您。</div></br><div style='width:67px; margin:0 auto; text-align:center'></div>";
//$('#province').onload();
//$('#my_account_form_link').click();
pop_up_box(htmlvalue,500,30,50); pop_up_box(htmlvalue,500,30,50);
} }
else if (data.result == 1){ else if (data.result == 1){
@ -119,7 +120,32 @@
} }
}); });
} }
function pop_up_box(value,tWidth,tTop,tLeft){
if(!tWidth){
var tWidth = 580;
}
if(!tTop){
var tTop = 30;
}
if(!tLeft){
var tLeft = 50;
}
$("#ajax-modal").html(value);
showModal('ajax-modal', tWidth + "px");
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal(); my_account_form_submit();' style='margin-right: 5px; margin-top:-10px;right:0;' class='resourceClose'></a>");
$('#ajax-modal').parent().css("top", tTop+"%").css("left", tLeft+"%").css("padding-top", "10px").css("position", "fixed");
$('#ajax-modal').parent().addClass("resourceUploadPopup");
$('#ajax-modal').css("padding-left", "16px").css("padding-bottom", "16px");
function hideModal(){
$('#ajax-modal').hide();
}
}
function ifNameRepeat(){ function ifNameRepeat(){
//名称不能为空也不能重复 //名称不能为空也不能重复
@ -147,4 +173,8 @@
} }
}); });
} }
$('#apply_school').on("click",(function(e){
commit_add_school();
}));
</script> </script>

View File

@ -78,7 +78,7 @@
<span id="identity_hint" style="display: none"></span> <span id="identity_hint" style="display: none"></span>
</li> </li>
<li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" style="display:none;"><%= text_field_tag :lastname,@user.lastname+@user.firstname,:no_label=>true, :required => true,:nh_required=>"1",:class=>"w210" %> <li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" style="display:none;"><%= text_field_tag :lastname,@user.lastname+@user.firstname,:no_label=>true, :required => true,:nh_required=>"1",:class=>"w210" %><span id="last_name_notice" class="none c_red">姓名不能为空</span>
<li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" style="display:none;"> <li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" style="display:none;">
<% if User.current.user_extensions && User.current.user_extensions.gender && User.current.user_extensions.gender == 1 %> <% if User.current.user_extensions && User.current.user_extensions.gender && User.current.user_extensions.gender == 1 %>
@ -99,8 +99,13 @@
</p> </p>
<!--<input nhname="tag" nh_tag_0="true" nh_tag_1="true" id="occupation_name" type="text" style="display: none;width:117px;" readonly/>--> <!--<input nhname="tag" nh_tag_0="true" nh_tag_1="true" id="occupation_name" type="text" style="display: none;width:117px;" readonly/>-->
<% elsif User.current.user_extensions.identity == 3 || User.current.user_extensions.identity == 2 %> <% elsif User.current.user_extensions.identity == 3 || User.current.user_extensions.identity == 2 %>
<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="--请搜索您所在的高校(单位)--" > <% if User.current.user_extensions.school_id.nil? %>
<input nhname="tag" nh_tag_4="true" id="occupation" name="occupation" style="display: none;" class="w210" type="text" value="<%= @user.user_extensions.occupation %>" /> <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 %>" />
<% else %>
<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" style="display: none;" class="w210" type="text" value="<%= @user.user_extensions.occupation %>" />
<% end %>
<p class="fl ml10"> <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" ></a><a id="search_condition" href="javascript:void(0)"></a></span> <span id="hint" style="color: #7f7f7f;display: none"><a id="school_num" href="javascript:void(0)" style="color: red" ></a><a id="search_condition" href="javascript:void(0)"></a></span>
@ -169,13 +174,13 @@
<li> <li>
<%= select_tag( 'user[mail_notification]', options_for_select( user_mail_notification_options(@user), @user.mail_notification) ) %> <%= select_tag( 'user[mail_notification]', options_for_select( user_mail_notification_options(@user), @user.mail_notification) ) %>
<label class="ml10"><%= check_box_tag 'no_self_notified', 1, @user.pref[:no_self_notified],:style => "height:14px;" %>不要发送对我自己提交的修改的通知</label> <label class="ml10"><%= check_box_tag 'no_self_notified', 1, @user.pref[:no_self_notified], :style => "height:14px;" %>不要发送对我自己提交的修改的通知</label>
</li> </li>
<!--<li><input name="brief_introduction" class="w450" type="text" maxlength="255" value="<%#= (@user.user_extensions.nil?) ? '' : @user.user_extensions.brief_introduction %>"></li>--> <!--<li><input name="brief_introduction" class="w450" type="text" maxlength="255" value="<%#= (@user.user_extensions.nil?) ? '' : @user.user_extensions.brief_introduction %>"></li>-->
<li style="height:auto;"><textarea name="description" class="w450 h200" maxlength="255" style="resize:none;"><%= (@user.user_extensions.nil?) ? '' : @user.user_extensions.description %></textarea></li> <li style="height:auto;"><textarea name="description" class="w450 h200" maxlength="255" style="resize:none;"><%= (@user.user_extensions.nil?) ? '' : @user.user_extensions.description %></textarea></li>
<li style="display:none;"><%= f.select :language, :Chinese => :zh, :English => :en %></li> <li style="display:none;"><%= f.select :language, :Chinese => :zh, :English => :en %></li>
<li class="ml2"> <li class="ml2">
<a href="javascript:void(0);" id="my_account_form_link" class="blue_btn fl" style="background: #3b94d6; padding: 0 25px;">确定</a> <a href="javascript:void(0);" id="my_account_form_link" class="blue_btn fl" onclick="my_account_form_submit();" style="background: #3b94d6; padding: 0 25px;">确定</a>
<input type="submit" id="my_account_form_btn" style="display:none;"/> <input type="submit" id="my_account_form_btn" style="display:none;"/>
<!--<a href="javascript:void(0);" class="grey_btn ml10 fl">取消</a>--> <!--<a href="javascript:void(0);" class="grey_btn ml10 fl">取消</a>-->
</li> </li>
@ -560,44 +565,80 @@
$("#users_tb_2").click(); $("#users_tb_2").click();
<% end %> <% end %>
$('#my_account_form_link').on("click",(function(e){ // $('#my_account_form_link').on("click",(function(e){
//$('#my_account_form_link').click(function(e){ // //$('#my_account_form_link').click(function(e){
if($("#userIdentity").val() == -1 ) { // if($("#userIdentity").val() == -1 ) {
$("#identity_hint").html('<span style="color:red">请选择身份</span>').show(); // $("#identity_hint").html('<span style="color:red">请选择身份</span>').show();
e.stopImmediatePropagation(); // e.stopImmediatePropagation();
return; // return;
} // }
if( $("input[name='province']").val().trim() != '' && $("input[name='occupation']").val().trim() == ''){ //学校名字和id不对的话 // if( $("input[name='province']").val().trim() != '' && $("input[name='occupation']").val().trim() == ''){ //学校名字和id不对的话
$("#hint").html('<span style="color:red">单位名称必须是从下拉列表中选择的,不能手动修改</span>').show(); // $("#hint").html('<span style="color:red">单位名称必须是从下拉列表中选择的,不能手动修改</span>').show();
e.stopImmediatePropagation(); // e.stopImmediatePropagation();
return; // return;
} // }
//
//姓名不能为空 // //姓名不能为空
if( $("#lastname").val() == '' ){ // if( $("#lastname").val() == '' ){
$("#lastname").focus(); // $("#lastname").focus();
e.stopImmediatePropagation(); // $("#last_name_notice").show();
return; // e.stopImmediatePropagation();
} // return;
// }
if( $("input[name='province']").val().trim() == '' ){ //学校名字必须填写 //
$("#hint").html('<span style="color:red">高校(单位)名称不能为空</span>').show(); // if( $("input[name='province']").val().trim() == '' ){ //学校名字必须填写
e.stopImmediatePropagation(); // $("#hint").html('<span style="color:red">高校(单位)名称不能为空</span>').show();
return; // e.stopImmediatePropagation();
} // return;
// }
if($("#no").is(":visible") == true && $("#no").val() == ""){ //
$("#no").focus(); // if($("#no").is(":visible") == true && $("#no").val() == ""){
e.stopImmediatePropagation(); // $("#no").focus();
return; // e.stopImmediatePropagation();
} // return;
// }
$('#my_account_form_btn').click(); //
})); // $('#my_account_form').submit();
// }));
$('#my_password_form_link').click(function(){ $('#my_password_form_link').click(function(){
$('#my_password_form_btn').click(); $('#my_password_form_btn').click();
}); });
}); });
function my_account_form_submit(){
if($("#userIdentity").val() == -1 ) {
$("#identity_hint").html('<span style="color:red">请选择身份</span>').show();
e.stopImmediatePropagation();
return;
}
if( $("input[name='province']").val().trim() != '' && $("input[name='occupation']").val().trim() == ''){ //学校名字和id不对的话
$("#hint").html('<span style="color:red">单位名称必须是从下拉列表中选择的,不能手动修改</span>').show();
e.stopImmediatePropagation();
return;
}
//姓名不能为空
if( $("#lastname").val() == '' ){
$("#lastname").focus();
$("#last_name_notice").show();
e.stopImmediatePropagation();
return;
}
if( $("input[name='province']").val().trim() == '' ){ //学校名字必须填写
$("#hint").html('<span style="color:red">高校(单位)名称不能为空</span>').show();
e.stopImmediatePropagation();
return;
}
if($("#no").is(":visible") == true && $("#no").val() == ""){
$("#no").focus();
e.stopImmediatePropagation();
return;
}
$('#my_account_form').submit();
}
</script> </script>
<script type="text/javascript"> <script type="text/javascript">
function g(o){return document.getElementById(o);} function g(o){return document.getElementById(o);}

View File

@ -1,4 +1,4 @@
$("img[nhname='avatar_image']").attr('src',$("#nh_user_tx").attr('src')); $("img[nhname='avatar_image']").attr('src',$("#nh_source_tx").attr('src'));
$('#ajax-modal').html($("#nh_tx_dialog_html").html()); $('#ajax-modal').html($("#nh_tx_dialog_html").html());
showModal('ajax-modal','460px'); showModal('ajax-modal','460px');
$('#ajax-modal').siblings().hide(); $('#ajax-modal').siblings().hide();

View File

@ -1,3 +1,14 @@
$("#nh_user_tx").replaceWith('<%= image_tag(url_to_avatar(@user), :id=>'nh_user_tx',:style=>"width:78px;height:78px;overflow:hidden",:alt=>"头像") %>'); <% if @user %>
$("#nh_source_tx").replaceWith('<%= image_tag(url_to_avatar(@user), :id=>'nh_source_tx',:style=>"width:78px;height:78px;overflow:hidden",:alt=>"头像") %>');
$("#nh_user_logo").replaceWith('<%= image_tag(url_to_avatar(@user), :id=>'nh_user_logo',:width =>"40",:height => "40",:alt=>"头像") %>'); $("#nh_user_logo").replaceWith('<%= image_tag(url_to_avatar(@user), :id=>'nh_user_logo',:width =>"40",:height => "40",:alt=>"头像") %>');
<% elsif @course %>
$("#nh_source_tx").replaceWith('<%= image_tag(url_to_avatar(@course), :id=>'nh_source_tx',:style=>"width:96px;height:96px;overflow:hidden",:alt=>"班级logo") %>');
if($("#course_avatar_form").length > 0) {
window.location.href = "<%=settings_course_path(@course) %>";
}
<% elsif @project %>
$("#nh_source_tx").replaceWith('<%= image_tag(url_to_avatar(@project), :id=>'nh_source_tx',:style=>"width:60px;height:60px;overflow:hidden",:alt=>"项目logo") %>');
if($("#project_avatar_form").length > 0) {
window.location.href = "<%=settings_project_path(@project) %>";
}<% end %>
hideModal(); hideModal();

View File

@ -12,7 +12,7 @@
<%= link_to activity.try(:author).try(:realname), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %> <%= link_to activity.try(:author).try(:realname), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %>
<% end %> <% end %>
TO TO
<%= link_to activity.course.name.to_s+" | 班级问答区", course_boards_url_in_org(activity.course.id), :class => "newsBlue ml15 mr5"%> <%= link_to activity.course.name.to_s+" | 班级讨论区", course_boards_url_in_org(activity.course.id), :class => "newsBlue ml15 mr5"%>
</div> </div>
<div class="homepagePostTitle hidden m_w530 fl"> <div class="homepagePostTitle hidden m_w530 fl">
<% if activity.parent_id.nil? %> <!--+"(帖子标题)"--> <% if activity.parent_id.nil? %> <!--+"(帖子标题)"-->

View File

@ -61,19 +61,21 @@
<%= link_to "动态",organization_path(organization), :class => "homepageMenuText" %> <%= link_to "动态",organization_path(organization), :class => "homepageMenuText" %>
</div> </div>
<% when 'course' %> <% when 'course' %>
<div style="display:<%= field.hide == 0 ? 'block':'none' %>;" id="org_subfield_<%= field.id %>"> <% if hidden_unproject_infos %>
<div class="homepageLeftMenuBlock"> <div style="display:<%= field.hide == 0 ? 'block':'none' %>;" id="org_subfield_<%= field.id %>">
<a href="javascript:void(0);" class="homepageMenuText" onclick="$('#homepageLeftMenuCourses').slideToggle();">班级</a> <div class="homepageLeftMenuBlock">
<% if User.current.logged? and User.current.admin_of_org?(organization) %> <a href="javascript:void(0);" class="homepageMenuText" onclick="$('#homepageLeftMenuCourses').slideToggle();">班级</a>
<%=link_to "", join_course_menu_organization_path(organization),:remote => true, :method => "post", :class => "homepageMenuSetting fr", :title => "关联班级"%> <% if User.current.logged? and User.current.admin_of_org?(organization) %>
<% end %> <%=link_to "", join_course_menu_organization_path(organization),:remote => true, :method => "post", :class => "homepageMenuSetting fr", :title => "关联班级"%>
</div> <% end %>
<div class="homepageLeftMenuCourses" id="homepageLeftMenuCourses" style="display:<%= organization.courses.count == 0 ?'none':'' %>"> </div>
<ul > <div class="homepageLeftMenuCourses" id="homepageLeftMenuCourses" style="display:<%= organization.courses.count == 0 ?'none':'' %>">
<%= render :partial => 'layouts/org_courses',:locals=>{:courses=>organization.courses.where("is_delete=0").reorder('created_at').uniq.limit(5),:org_id=>organization.id,:page=>1}%> <ul >
</ul> <%= render :partial => 'layouts/org_courses',:locals=>{:courses=>organization.courses.where("is_delete=0").reorder('created_at').uniq.limit(5),:org_id=>organization.id,:page=>1}%>
</div> </ul>
</div> </div>
</div>
<% end %>
<% when 'project' %> <% when 'project' %>
<div style="display:<%= field.hide == 0 ? 'block':'none' %>;" id="org_subfield_<%= field.id %>"> <div style="display:<%= field.hide == 0 ? 'block':'none' %>;" id="org_subfield_<%= field.id %>">
<div class="homepageLeftMenuBlock"> <div class="homepageLeftMenuBlock">

View File

@ -32,8 +32,8 @@
<% end %> <% end %>
</li> </li>
<% if ( (User.current.id == member.organization.creator_id || User.current.admin_of_org?(member.organization) ) && member.user_id != member.organization.creator_id )%> <% if ( (User.current.id == member.organization.creator_id || User.current.admin_of_org?(member.organization) ) && member.user_id != member.organization.creator_id )%>
<a href="javascript:void(0);" style="color: #0781B4;margin-left: 30px;float: left" onclick="$(this).parent().height();$('#org-member-<%= member.id%>-roles-form').show();">编辑</a> <a href="javascript:void(0);" style="color: #0781B4;margin-left: 10px;float: left" onclick="$(this).parent().height();$('#org-member-<%= member.id%>-roles-form').show();">编辑</a>
<a href="javascript:void(0)" style = "color: #0781B4;margin-left: 30px;float: left" onclick = "ifDeleteOrgMember('<%= member.id %>','<%= username %>')" >删除</a> <a href="javascript:void(0)" style = "color: #0781B4;margin-left: 10px;float: left" onclick = "ifDeleteOrgMember('<%= member.id %>','<%= username %>')" >删除</a>
<%#= link_to '删除', Setting.protocol + "://" + Setting.host_name + "/org_member/" + member.id.to_s,:method=>'delete',:style=>'color: #0781B4;margin-left: 30px;float: left',:confirm=>'您确定要删除么?', :remote => true %><% end %> <%#= link_to '删除', Setting.protocol + "://" + Setting.host_name + "/org_member/" + member.id.to_s,:method=>'delete',:style=>'color: #0781B4;margin-left: 30px;float: left',:confirm=>'您确定要删除么?', :remote => true %><% end %>
<div class="cl"></div> <div class="cl"></div>
</ul> </ul>

View File

@ -106,7 +106,7 @@
<%= render :partial=>"org_member_list",:locals=> {:members=>@organization.org_members} %> <%= render :partial=>"org_member_list",:locals=> {:members=>@organization.org_members} %>
</div> </div>
</div> </div>
<div class="fr orgMemContainer"> <div class="fl ml10 orgMemContainer">
<div class="orgMemberAdd"> <div class="orgMemberAdd">
<p class="fontBlue fb mb5">添加成员</p> <p class="fontBlue fb mb5">添加成员</p>
<%= form_tag url_for(:controller => 'org_member', :action => 'create', :org => @organization),:id=>'org_member_add_form',:remote=>true do |f|%> <%= form_tag url_for(:controller => 'org_member', :action => 'create', :org => @organization),:id=>'org_member_add_form',:remote=>true do |f|%>

View File

@ -20,6 +20,7 @@
<ul class="resourcesSelect"> <ul class="resourcesSelect">
<li class="resourcesSelected"><a href="javascript:void(0);" class="resourcesIcon"></a> <li class="resourcesSelected"><a href="javascript:void(0);" class="resourcesIcon"></a>
<ul class="homepagePostType"> <ul class="homepagePostType">
<% if hidden_unproject_infos %>
<li> <li>
<ul class="homepagePostTypeHomework fl"> <ul class="homepagePostTypeHomework fl">
<li class="f14">课程动态</li> <li class="f14">课程动态</li>
@ -33,6 +34,7 @@
<!--<li><a href="javascript:void(0);" class="homepagePostTypeQuiz postTypeGrey">问卷动态</a></li>--> <!--<li><a href="javascript:void(0);" class="homepagePostTypeQuiz postTypeGrey">问卷动态</a></li>-->
</ul> </ul>
</li> </li>
<% end %>
<li> <li>
<ul class="homepagePostTypeProject fl"> <ul class="homepagePostTypeProject fl">
<li class="f14">项目动态</li> <li class="f14">项目动态</li>

View File

@ -43,7 +43,9 @@
<% if allow_pull_request(@project) %> <% if allow_pull_request(@project) %>
<div class="subNav"> <div class="subNav">
<%= link_to "Pull Requests", project_pull_requests_path(@project), :class => "f14 c_blue02" %> <%= 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" %> <% if User.current.member_of?(@project) %>
<%= link_to "+新建请求", new_project_pull_request_path(:project_id => @project.id), :class => "subnav_green" %>
<% end %>
</div> </div>
<% end %> <% end %>

View File

@ -38,7 +38,12 @@
<li class="homepagePostSettingIcon"> <li class="homepagePostSettingIcon">
<% if User.current.logged? %> <% if User.current.logged? %>
<ul class="homepagePostSettiongText"> <ul class="homepagePostSettiongText">
<li><%= link_to("发送", 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send('#{activity.id}',#{User.current.id},'news')") %></li> <% if hidden_unproject_infos %>
<li><%= link_to("发送", 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send('#{activity.id}',#{User.current.id},'news')") %></li>
<% else %>
<li><%= link_to("发送", 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send_hidden('#{activity.id}',#{User.current.id},'news')") %></li>
<% end %>
<li> <li>
<%= link_to(l(:button_edit), {:controller => 'news', :action => 'edit', :id => activity}, :class => 'postOptionLink') if activity.author == User.current %> <%= link_to(l(:button_edit), {:controller => 'news', :action => 'edit', :id => activity}, :class => 'postOptionLink') if activity.author == User.current %>
</li> </li>

View File

@ -1,9 +1,8 @@
<%= error_messages_for 'project' %> <%= error_messages_for 'project' %>
<%= labelled_form_for @project do |f| %> <%= labelled_form_for @project do |f| %>
<ul class="newpro_box "> <ul class="newpro_box ">
<li class="ml45 mb10"> <li class="ml45 mb10" id="project_avatar_form">
<%= render :partial=>"avatar/new_avatar_form",:locals=> {source:@project} %> <%= render :partial=>"avatar/new_avatar_form",:locals=> {source:@project} %>
<div class="cl"></div>
</li> </li>
<li > <li >
<label class="label02"><span class="c_red">*</span>&nbsp;项目名称&nbsp;&nbsp;</label> <label class="label02"><span class="c_red">*</span>&nbsp;项目名称&nbsp;&nbsp;</label>

View File

@ -5,8 +5,10 @@
<div id="pull_request_show"> <div id="pull_request_show">
<div id="mergeShow" class="f14 fontGrey2 merge-show"> <div id="mergeShow" class="f14 fontGrey2 merge-show">
<span class="mr10 open-status"><%= get_state(@request.state) %></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) %> 前 <span class="mr10 open-status"><%= get_state(@request.state) %></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) %> 前
<% unless @request.state == "merged" %> <% if User.current.login == @request.author.try(:username) || is_project_manager?(User.current.id, @project.id) %>
<%= link_to "#{@request.state == 'closed' ? '重新打开' : '关闭'}", update_pull_request_project_pull_request_path(@request.id, :project_id => @project.id, :state => @request.state =="closed" ? "reopen" : "close"), :class => "BlueCirBtn fr" %> <% unless @request.state == "merged" %>
<%= link_to "#{@request.state == 'closed' ? '重新打开' : '关闭'}", update_pull_request_project_pull_request_path(@request.id, :project_id => @project.id, :state => @request.state =="closed" ? "reopen" : "close"), :class => "BlueCirBtn fr" %>
<% end %>
<% end %> <% end %>
<div class="cl"></div> <div class="cl"></div>
</div> </div>

View File

@ -3,8 +3,9 @@
<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 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> <li><%= link_to "已处理<span class='project-number-dot'>#{@requests_merged_count}</span>".html_safe, project_pull_requests_path(:type => "2"), :remote => true %></li>
<li><%= link_to "已关闭<span class='project-number-dot'>#{@requests_closed_count}</span>".html_safe, project_pull_requests_path(:type => "3"), :remote => true %></li> <li><%= link_to "已关闭<span class='project-number-dot'>#{@requests_closed_count}</span>".html_safe, project_pull_requests_path(:type => "3"), :remote => true %></li>
<% if allow_pull_request(@project) && User.current.member_of?(@project) %>
<%= link_to "创建Pull Request", new_project_pull_request_path, :class => "BlueCirBtn fr ml10 mt10", :style => "width:110px;" %> <%= link_to "创建Pull Request", new_project_pull_request_path, :class => "BlueCirBtn fr ml10 mt10", :style => "width:110px;" %>
<% end %>
<div class="cl"></div> <div class="cl"></div>
</ul> </ul>
<div class="cl"></div> <div class="cl"></div>

View File

@ -127,46 +127,37 @@
<p class="fontBlue2"><%= @ha["functions"].to_i %></p> <p class="fontBlue2"><%= @ha["functions"].to_i %></p>
</div> </div>
</div> </div>
<!--<div class="analysis-tag-wrap f16"> <span class="analysis-tag fl mr15"></span> <span class="fb fl">贡献统计</span></div>--> <% unless @user_quality_infos.blank? %>
<!--<div class="analysis-block mt10 f12">--> <div class="analysis-tag-wrap f16"> <span class="analysis-tag fl mr15"></span> <span class="fb fl">贡献统计</span></div>
<!--<ul class="contribute-list">--> <div class="analysis-block mt10 f12">
<!--<li class="fl fontGrey2 contribute-list-avatar">&nbsp;</li>--> <ul class="contribute-list">
<!--<li class="fl fontGrey2 contribute-list-code">代码行数</li>--> <li class="fl fontGrey2 contribute-list-avatar">&nbsp;</li>
<!--<li class="fl fontGrey2 contribute-list-problem">引入质量问题数</li>--> <li class="fl fontGrey2 contribute-list-code">代码行数</li>
<!--<li class="fl fontGrey2 contribute-list-rate">引入质量问题数/代码行数</li>--> <li class="fl fontGrey2 contribute-list-problem">引入质量问题总数</li>
<!--<div class="cl"></div>--> <li class="fl fontGrey2 contribute-list-problem">未解决质量问题数</li>
<!--</ul>--> <li class="fl fontGrey2 contribute-list-rate">引入质量问题数/代码行数</li>
<!--<ul class="contribute-list">--> <div class="cl"></div>
<!--<li class="fl fontGrey2 contribute-list-avatar contribute-list-height">--> </ul>
<!--<div class="mt8"><img src="images/homepageImage.jpg" width="50" class="image-cir" />-->
<!--<p class="fontGrey2 hidden">小明</p>--> <% @user_quality_infos.each do |author_info| %>
<!--</div>--> <% user = get_user_by_mail(author_info[:email]) %>
<!--</li>--> <% unless author_info[:changes] == 0 %>
<!--<li class="fl fontGrey2 contribute-list-code contribute-list-height contribute-list-line-height">18340</li>--> <ul class="contribute-list">
<!--<li class="fl fontGrey2 contribute-list-problem contribute-list-height contribute-list-line-height">230</li>--> <li class="fl fontGrey2 contribute-list-avatar contribute-list-height">
<!--<li class="fl contribute-list-rate fontBlue2 contribute-list-height contribute-list-line-height">.012540</li>--> <div class="mt8">
<!--<div class="cl"></div>--> <%=link_to image_tag(url_to_avatar(user), :width => "50", :height => "50", :class => "image-cir"), user_path(user), :target => '_blank' %>
<!--</ul>--> <p class="fontGrey2 hidden"><%=link_to (user.id == 2 ? author_info[:email] : user.show_name), user_path(user) %></p>
<!--<ul class="contribute-list">--> </div>
<!--<li class="fl fontGrey2 contribute-list-avatar contribute-list-height">--> </li>
<!--<div class="mt8"><img src="images/homepageImage.jpg" width="50" class="image-cir" />--> <li class="fl fontGrey2 contribute-list-code contribute-list-height contribute-list-line-height"><%= author_info[:changes] %></li>
<!--<p class="fontGrey2 hidden">小王</p>--> <li class="fl fontGrey2 contribute-list-problem contribute-list-height contribute-list-line-height"><%= author_info[:all_issue_count] %></li>
<!--</div>--> <li class="fl fontGrey2 contribute-list-problem contribute-list-height contribute-list-line-height c_red"><%= author_info[:unresolved_issue_count] %></li>
<!--</li>--> <li class="fl contribute-list-rate fontBlue2 contribute-list-height contribute-list-line-height"><%= author_info[:ratio] %></li>
<!--<li class="fl fontGrey2 contribute-list-code contribute-list-height contribute-list-line-height">834</li>--> <div class="cl"></div>
<!--<li class="fl fontGrey2 contribute-list-problem contribute-list-height contribute-list-line-height">34</li>--> </ul>
<!--<li class="fl contribute-list-rate fontBlue2 contribute-list-height contribute-list-line-height">.04077</li>--> <% end %>
<!--<div class="cl"></div>--> <% end %>
<!--</ul>-->
<!--<ul class="contribute-list">--> </div>
<!--<li class="fl fontGrey2 contribute-list-avatar contribute-list-height">--> <% end %>
<!--<div class="mt8"><img src="images/homepageImage.jpg" width="50" class="image-cir" />-->
<!--<p class="fontGrey2 hidden">小亮</p>-->
<!--</div>-->
<!--</li>-->
<!--<li class="fl fontGrey2 contribute-list-code contribute-list-height contribute-list-line-height">134</li>-->
<!--<li class="fl fontGrey2 contribute-list-problem contribute-list-height contribute-list-line-height">10</li>-->
<!--<li class="fl contribute-list-rate fontBlue2 contribute-list-height contribute-list-line-height">.07462</li>-->
<!--<div class="cl"></div>-->
<!--</ul>-->
<!--</div>-->

View File

@ -52,7 +52,7 @@
<span title ="该项目是私有的"><%=work.project.name %></span> <span title ="该项目是私有的"><%=work.project.name %></span>
<% end %> <% end %>
<%#= link_to( work.project.name, project_path(work.project.id), :class => "linkBlue" )%> <%#= link_to( work.project.name, project_path(work.project.id), :class => "linkBlue" )%>
<span class="ml5">(综合评分:<font class="c_red"><%=work.project.project_score.score.to_i %></font>)</span> <span class="ml5">(综合评分:<font class="c_red"><%=static_project_score(work.project.project_score).to_i %></font>)</span>
</li> </li>
<% end %> <% end %>
<% end%> <% end%>

View File

@ -0,0 +1,10 @@
<% member = Member.where("user_id = #{@user.id} and course_id = #{course.id}").first %>
<% if User.current == @user %>
<% if member %>
<%= link_to "", cancel_or_collect_user_path(@user, :course => course.id), :class => "#{member.is_collect == 1 ? 'icons_sy_favorite' : 'icons_sy_star'}",:target => '_blank', :remote => true, :title => "#{member.is_collect == 1 ? '点击将其从个人主页的班级列表中移除' : '点击将其添加至个人主页的班级列表中'}" %>
<% end %>
<% else %>
<% if member %>
<span class="<%= member.is_collect == 1 ? 'icons_sy_favorite' : 'icons_sy_star'%>"></span>
<% end %>
<% end %>

View File

@ -0,0 +1,10 @@
<% member = Member.where("user_id = #{@user.id} and project_id = #{project.id}").first %>
<% if User.current == @user %>
<% if member %>
<%= link_to "", cancel_or_collect_user_path(@user, :project => project.id), :class => "#{member.is_collect == 1 ? 'icons_project_favorite mt3' : 'icons_project_star mt3'}",:target => '_blank', :remote => true, :title => "#{member.is_collect == 1 ? '点击将其从个人主页的班级列表中移除' : '点击将其添加至个人主页的班级列表中'}" %>
<% end %>
<% else %>
<% if member %>
<span class="<%= member.is_collect == 1 ? 'icons_project_favorite mt3' : 'icons_project_star mt3'%>"></span>
<% end %>
<% end %>

View File

@ -1,7 +1,7 @@
<div class = "cl"> </div> <div class = "cl"> </div>
<div id="course-boardlist"> <div id="course-boardlist">
<div class="listbox mt10" > <div class="listbox mt10" >
<h2 class="list-h2">问答区列表</h2> <h2 class="list-h2">讨论区列表</h2>
<div class="category"> <div class="category">
<span class="grayTxt ">排序:</span> <span class="grayTxt ">排序:</span>
<%= link_to "时间", {:controller => 'boards', :action => 'index', :type => @type, :sort => @b_sort, :order => 1 }, :class => "sortTxt", :remote => true %> <%= link_to "时间", {:controller => 'boards', :action => 'index', :type => @type, :sort => @b_sort, :order => 1 }, :class => "sortTxt", :remote => true %>

View File

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

View File

@ -1,30 +1,44 @@
<% unless courses.nil? %> <% unless courses.nil? %>
<% courses.each_with_index do |course, i| %> <% courses.each_with_index do |course, i| %>
<li class="syllabus_class_list <%=i > 2 ? 'none' : '' %>"> <li class="syllabus_class_list <%= i > 2 ? 'none' : '' %>">
<% allow_visit = User.current.member_of_course?(course) || User.current.admin? || course.is_public == 1 %> <% allow_visit = User.current.member_of_course?(course) || User.current.admin? || course.is_public == 1 %>
<a href="<%= allow_visit ? course_path(course.id) : "javascript:void(0)" %>" target="_blank" title="<%= allow_visit ? "" : "私有班级不可访问"%>"> <span id="collect_course_icon_<%=course.id %>">
<span class="icons_sy_cir "></span> <%=render :partial => 'collect_course', :locals => {:course => course} %>
<div class="fl"> </span>
<div class="syllabus_class_w ">
<p class="syllabus_class_title fl"><%=course.name %></p> <div class="fl">
<span class="<%= course.is_public == 0 ? 'hw_icon_private' : 'hw_icon_open' %> fl"></span> <div class="syllabus_class_w ">
<span class="fr sy_p_grey hidden" style="max-width: 120px;">主讲老师:<%=course.teacher.show_name %></span> <a href="<%= allow_visit ? course_path(course.id) : "javascript:void(0)" %>" class="syllabus_class_title fl" target="_blank" title="<%= allow_visit ? "" : "私有班级不可访问" %>"><%= course.name %></a>
<div class="cl"></div> <span class="<%= course.is_public == 0 ? 'syllabus_class_private' : 'syllabus_class_open' %> fl ml10 mt3 syllabus_class_property"><%= course.is_public == 0 ? '私有' : '公开' %></span>
</div> <span class="fr sy_p_grey hidden" style="max-width: 120px;">主讲老师:<%= link_to course.teacher.show_name, user_path(course.teacher) %></span>
<div class="">
<p class="fl grayTxt ">更新:<%=format_date Time.at(course.updatetime) %><span class="mr10"></span>学期:<%=current_time_and_term(course) %></p> <div class="cl"></div>
<p class="list-info fr grayTxt"><span><%=studentCount course %></span><span>学生</span><span>|</span><span><%=visable_course_homework course %></span><span>作业</span><span>|</span><span><%=visable_attachemnts_incourse(course).count %></span><span>资源</span></p>
<div class="cl"></div>
</div>
</div> </div>
<span class="icons_sy_arrow fl mt19 ml10" ></span> <div class="">
<div class="cl"></div> <p class="fl grayTxt ">更新:<%= format_date Time.at(course.updatetime) %><span class="mr10"></span>
</a> 学期:<%= current_time_and_term(course) %></p>
<p class="list-info fr grayTxt">
<% student_link = (User.current.logged? && course.open_student == 1 && course.is_public == 1) || (User.current.member_of_course?(course)) || User.current.admin? %>
<span><a href="<%= student_link ? course_member_path(course, :role => 2) : "javascript:void(0)" %>" target="_blank" title="<%= student_link ? "" : "学生列表不对外公开" %>"><%= studentCount course %></a></span><span>学生</span>
<span>|</span>
<span><a href="<%= allow_visit ? homework_common_index_path(:course => course.id) : "javascript:void(0)" %>" target="_blank" title="<%= allow_visit ? "" : "私有班级不可访问" %>"><%= visable_course_homework course %></a></span><span>作业</span>
<span>|</span>
<span><a href="<%= allow_visit ? course_files_path(course) : "javascript:void(0)" %>" target="_blank" title="<%= allow_visit ? "" : "私有班级不可访问" %>"><%= visable_attachemnts_incourse(course).count %></a></span><span>资源</span>
</p>
<div class="cl"></div>
</div>
</div>
<span class="icons_sy_arrow fl mt19 ml10"></span>
<div class="cl"></div>
</li> </li>
<% end %> <% end %>
<% if courses.count > 3 %> <% if courses.count > 3 %>
<li class="syllabus_class_list_more" id="syllabus_class_list_more_<%=syllabus.id %>"> <li class="syllabus_class_list_more" id="syllabus_class_list_more_<%= syllabus.id %>">
<a href="javascript:void(0);" id="expand_list_<%=syllabus.id %>" data-init="0" onclick="expand_course_list(<%=syllabus.id %>,'#syllabus_course_ul_<%=syllabus.id %> li','#expand_list_<%=syllabus.id %>',<%=courses.count %>)">共<%=courses.count %>个班级,点击全部展开</a> <a href="javascript:void(0);" id="expand_list_<%= syllabus.id %>" data-init="0" onclick="expand_course_list(<%=syllabus.id %>,'#syllabus_course_ul_<%=syllabus.id %> li','#expand_list_<%=syllabus.id %>',<%=courses.count %>)">共<%= courses.count %>
个班级,点击全部展开</a>
</li> </li>
<% end %> <% end %>
<% end %> <% end %>

View File

@ -72,6 +72,7 @@
l(:button_delete), l(:button_delete),
{:controller => 'issues',:action => 'delete_journal', :id => activity_id,:journal_id=>comment.id, :user_activity_id => user_activity_id}, {:controller => 'issues',:action => 'delete_journal', :id => activity_id,:journal_id=>comment.id, :user_activity_id => user_activity_id},
:method => 'get', :method => 'get',
:confirm => l(:text_are_you_sure),
:remote=>true, :remote=>true,
:class => 'fr mr20', :class => 'fr mr20',
:title => l(:button_delete) :title => l(:button_delete)

View File

@ -32,10 +32,12 @@
<% projects.each_with_index do |project, i| %> <% projects.each_with_index do |project, i| %>
<div class="syllabus_courses_list <%= i > 4 ? 'none' : ''%>" style="cursor: default;"> <div class="syllabus_courses_list <%= i > 4 ? 'none' : ''%>" style="cursor: default;">
<div class="sy_courses_open"> <div class="sy_courses_open">
<span class="icons_project_list fl mt5 mr10"></span> <span id="collect_project_icon_<%=project.id %>">
<%=render :partial => 'collect_project', :locals => {:project => project} %>
</span>
<h3><%= link_to project.name, project_path(project.id,:host=>Setting.host_name), :target => '_blank', :class => "new_project_title fl",:id => "show_project_#{project.id}", :title => (project.is_public? ? "公开项目:":"私有项目:") + project.name%></h3> <h3><%= link_to project.name, project_path(project.id,:host=>Setting.host_name), :target => '_blank', :class => "new_project_title fl",:id => "show_project_#{project.id}", :title => (project.is_public? ? "公开项目:":"私有项目:") + project.name%></h3>
<% unless project.is_public? %> <% unless project.is_public? %>
<span class="hw_icon_private fl"></span> <span class="syllabus_class_private fl ml10 mt3 syllabus_class_property">私有</span>
<% end %> <% end %>
<% projectUser = User.where("id=?",project.user_id).first %> <% projectUser = User.where("id=?",project.user_id).first %>
<%=link_to "<span class='fr grayTxt'>创建者:#{projectUser.try(:realname) != " " ? projectUser.lastname + projectUser.firstname : projectUser.try(:login)}</span>".html_safe, user_path(projectUser) %> <%=link_to "<span class='fr grayTxt'>创建者:#{projectUser.try(:realname) != " " ? projectUser.lastname + projectUser.firstname : projectUser.try(:login)}</span>".html_safe, user_path(projectUser) %>

View File

@ -68,7 +68,11 @@
) if activity.destroyable_by?(User.current) %> ) if activity.destroyable_by?(User.current) %>
</li> </li>
<% end %> <% end %>
<li><%= link_to "发送", "javascript:void(0);", :onclick => "show_send(#{activity.id}, #{User.current.id}, 'message');", :class => "postOptionLink" %></li> <% if hidden_unproject_infos %>
<li><%= link_to "发送", "javascript:void(0);", :onclick => "show_send(#{activity.id}, #{User.current.id}, 'message');", :class => "postOptionLink" %></li>
<% else %>
<li><%= link_to "发送", "javascript:void(0);", :onclick => "show_send_hidden(#{activity.id}, #{User.current.id}, 'message');", :class => "postOptionLink" %></li>
<% end %>
</ul> </ul>
</li> </li>
</ul> </ul>

View File

@ -35,7 +35,12 @@
<li class="homepagePostSettingIcon"> <li class="homepagePostSettingIcon">
<% if User.current.logged? %> <% if User.current.logged? %>
<ul class="homepagePostSettiongText"> <ul class="homepagePostSettiongText">
<li><%= link_to("发送", 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send('#{activity.id}',#{User.current.id},'news')") %></li> <% if hidden_unproject_infos %>
<li><%= link_to("发送", 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send('#{activity.id}',#{User.current.id},'news')") %></li>
<% else %>
<li><%= link_to("发送", 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send_hidden('#{activity.id}',#{User.current.id},'news')") %></li>
<% end %>
<li> <li>
<%= link_to( <%= link_to(
l(:button_edit), l(:button_edit),

View File

@ -4,11 +4,18 @@
<% unless send_ids.blank? %> <% unless send_ids.blank? %>
<% send_ids = send_ids.class == String ? send_ids : send_ids.join(",") %> <% send_ids = send_ids.class == String ? send_ids : send_ids.join(",") %>
<% end %> <% end %>
<select class="resourcesSendType" onclick="chooseSendType2('<%= send_id%>','<%= send_ids%>','<%= User.current.id %>','file', '<%= @type %>');"> <% if @hidden_unproject %>
<option value="1">班级</option> <select class="resourcesSendType" onclick="chooseSendType2('<%= send_id %>','<%= send_ids %>','<%= User.current.id %>','file', '<%= @type %>');">
<option value="2">项目</option> <option value="1">班级</option>
<option value="3" selected>组织</option> <option value="2">项目</option>
</select> <option value="3" selected>组织</option>
</select>
<% else %>
<select class="resourcesSendType" onclick="chooseSendType2hidden('<%= send_id %>', '<%= send_ids%>','<%= User.current.id %>','file', '<%= @type %>');">
<option value="1" >项目</option>
<option value="2" selected>组织</option>
</select>
<% end %>
</div> </div>
<%= form_tag search_user_org_user_path(user, :type => @type),:method => 'get', <%= form_tag search_user_org_user_path(user, :type => @type),:method => 'get',
:remote=>true,:id=>'search_user_org_form' do %> :remote=>true,:id=>'search_user_org_form' do %>

View File

@ -5,11 +5,18 @@
<% unless send_ids.blank? %> <% unless send_ids.blank? %>
<% send_ids = send_ids.class == String ? send_ids : send_ids.join(",") %> <% send_ids = send_ids.class == String ? send_ids : send_ids.join(",") %>
<% end %> <% end %>
<select class="resourcesSendType" onclick="chooseSendType2('<%= send_id %>','<%= send_ids %>','<%= User.current.id %>','file', '<%= @type %>');"> <% if @hidden_unproject %>
<option value="1">班级</option> <select class="resourcesSendType" onclick="chooseSendType2('<%= send_id %>','<%= send_ids %>','<%= User.current.id %>','file', '<%= @type %>');">
<option value="2" selected>项目</option> <option value="1">班级</option>
<option value="3">组织</option> <option value="2" selected>项目</option>
</select> <option value="3">组织</option>
</select>
<% else %>
<select class="resourcesSendType" onclick="chooseSendType2hidden('<%= send_id %>', '<%= send_ids%>','<%= User.current.id %>','file', '<%= @type %>');">
<option value="1" selected>项目</option>
<option value="2">组织</option>
</select>
<% end %>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>

View File

@ -87,6 +87,33 @@
} }
function show_send_hidden(){
$("#contextMenu").hide();
document.oncontextmenu = function() {return true;}
line.children().css("background-color",'white');
id = line.children().last().html();
user_id = line.children().eq(5).html();
allow = line.children().eq(13).html();
if( allow == 0){
alert('您无权发送私有资源')
}else{
if (lastSendType === '2'){ //如果已经发送过一次了,那么就应该沿用上次发送的类型。
$.ajax({
type: 'get',
url: '<%= search_user_project_user_path(User.current.id) %>' + "?send_id=" + id + "&type=<%= @type %>",
data:{send_type:'file'}
});
}else{
$.ajax({
type: 'get',
url: '<%= search_user_project_user_path(User.current.id)%>' + "?send_id=" + id + "&type=<%= @type %>",
data:{send_type:'file'}
});
}
}
}
function batch_send(){ function batch_send(){
if($("#resources_list_form").serialize() == ""){ if($("#resources_list_form").serialize() == ""){
alert('暂时不支持多页选择,您当前页没有选择任何资源'); alert('暂时不支持多页选择,您当前页没有选择任何资源');
@ -121,6 +148,35 @@
} }
} }
// 隐藏非项目信息特用
function batch_send_hidden(){
if($("#resources_list_form").serialize() == ""){
alert('暂时不支持多页选择,您当前页没有选择任何资源');
return ;
}
if (lastSendType === '1'){
$.ajax({
type: 'get',
url: '<%= search_user_project_user_path(User.current.id) %>' + '?' + $("#resources_list_form").serialize() + "&type=<%= @type %>",
data:{send_type:'file'}
});
}else if (lastSendType === '2'){
$.ajax({
type: 'get',
url: '<%= search_user_org_user_path(User.current.id) %>' + '?' + $("#resources_list_form").serialize() + "&type=<%= @type %>",
data:{send_type:'file'}
});
}
else{
$.ajax({
type: 'get',
url: '<%= search_user_project_user_path(User.current.id)%>' + '?'+ $("#resources_list_form").serialize() + "&type=<%= @type %>",
data:{send_type:'file'}
});
}
}
function preview(){ function preview(){
$("#contextMenu").hide(); $("#contextMenu").hide();
document.oncontextmenu = function() {return true;} document.oncontextmenu = function() {return true;}

View File

@ -3,6 +3,7 @@
<ul class="resourcesSelect"> <ul class="resourcesSelect">
<li class="resourcesSelected"><a href="javascript:void(0);" class="resourcesIcon"></a> <li class="resourcesSelected"><a href="javascript:void(0);" class="resourcesIcon"></a>
<ul class="homepagePostType"> <ul class="homepagePostType">
<% if hidden_unproject_infos %>
<li> <li>
<ul class="homepagePostTypeHomework fl"> <ul class="homepagePostTypeHomework fl">
<li class="f14"><strong>课程消息</strong></li> <li class="f14"><strong>课程消息</strong></li>
@ -12,7 +13,7 @@
<li><%= link_to "班级问卷", user_message_path(User.current, :type => 'poll'), :class => "homepagePostTypeQuiz postTypeGrey" %></a></li> <li><%= link_to "班级问卷", user_message_path(User.current, :type => 'poll'), :class => "homepagePostTypeQuiz postTypeGrey" %></a></li>
</ul> </ul>
</li> </li>
<% end %>
<li> <li>
<ul class="homepagePostTypeProject fl"> <ul class="homepagePostTypeProject fl">
<li class="f14"><strong>项目消息</strong></li> <li class="f14"><strong>项目消息</strong></li>
@ -23,6 +24,7 @@
</ul> </ul>
</li> </li>
<% if hidden_unproject_infos %>
<div class="cl"></div> <div class="cl"></div>
<li> <li>
<ul class="homepagePostTypeMore"> <ul class="homepagePostTypeMore">
@ -34,7 +36,18 @@
<li class="fl w100"><%= link_to "用户留言",user_message_path(User.current, :type => 'user_feedback'), :class => "homepageTypeUMessage postTypeGrey" %></li> <li class="fl w100"><%= link_to "用户留言",user_message_path(User.current, :type => 'user_feedback'), :class => "homepageTypeUMessage postTypeGrey" %></li>
</ul> </ul>
</li> </li>
<% else %>
<li class="fl ml15">
<ul>
<li class="f14"><strong>更多</strong></li>
<li><%= link_to "所有消息",user_message_path(User.current), :class => "resourcesTypeAll postTypeGrey" %></li>
<li><%= link_to "未读消息", user_message_path(User.current, :type => 'unviewed'), :class => "homepageTypeUnread postTypeGrey" %></li>
<li><%= link_to "系统消息", user_system_messages_path(User.current, :type => 'system_messages'), :class => "homepageTypeSystem postTypeGrey" %></li>
<li><%= link_to "贴吧帖子", user_message_path(User.current, :type => 'forum'), :class => "homepageTypePost postTypeGrey" %></li>
<li><%= link_to "用户留言",user_message_path(User.current, :type => 'user_feedback'), :class => "homepageTypeUMessage postTypeGrey" %></li>
</ul>
</li>
<% end %>
</ul> </ul>
</li> </li>
</ul> </ul>

View File

@ -0,0 +1,12 @@
<% if @hidden_unproject %>
<select class="resourcesSendType" onclick="chooseSendType2('<%= send_id %>', '<%= send_ids%>','<%= User.current.id %>','file', '<%= @type %>');">
<option value="1">班级</option>
<option value="2">项目</option>
<option value="3">组织</option>
</select>
<% else %>
<select class="resourcesSendType" onclick="chooseSendType2hidden('<%= send_id %>', '<%= send_ids%>','<%= User.current.id %>','file', '<%= @type %>');">
<option value="1">项目</option>
<option value="2">组织</option>
</select>
<% end %>

View File

@ -1,11 +1,18 @@
<div > <div >
<div class="relateText fl mb10 mr5">发送到</div> <div class="relateText fl mb10 mr5">发送到</div>
<div class="resourcesSendTo mr15"> <div class="resourcesSendTo mr15">
<select class="resourcesSendType" onclick="chooseSendType('<%= send_id%>','<%= send_ids%>','<%= User.current.id %>','message');"> <% if @hidden_unproject %>
<option value="1">班级</option> <select class="resourcesSendType" onclick="chooseSendType2('<%= send_id %>','<%= send_ids %>','<%= User.current.id %>','file', '<%= @type %>');">
<option value="2">项目</option> <option value="1">班级</option>
<option value="3" selected>组织</option> <option value="2">项目</option>
</select> <option value="3" selected>组织</option>
</select>
<% else %>
<select class="resourcesSendType" onclick="chooseSendType2hidden('<%= send_id %>', '<%= send_ids%>','<%= User.current.id %>','file', '<%= @type %>');">
<option value="1" >项目</option>
<option value="2" selected>组织</option>
</select>
<% end %>
</div> </div>
<%= form_tag search_user_org_user_path(user),:method => 'get', <%= form_tag search_user_org_user_path(user),:method => 'get',
:remote=>true,:id=>'search_user_org_form' do %> :remote=>true,:id=>'search_user_org_form' do %>

View File

@ -2,11 +2,18 @@
<div> <div>
<div class="sendText fl mr10" style="width: auto">发送到</div> <div class="sendText fl mr10" style="width: auto">发送到</div>
<div class="resourcesSendTo"> <div class="resourcesSendTo">
<select class="resourcesSendType" onclick="chooseSendType('<%= send_id %>','<%= send_ids %>','<%= User.current.id %>','message');"> <% if @hidden_unproject %>
<option value="1">班级</option> <select class="resourcesSendType" onclick="chooseSendType2('<%= send_id %>','<%= send_ids %>','<%= User.current.id %>','file', '<%= @type %>');">
<option value="2" selected>项目</option> <option value="1">班级</option>
<option value="3">组织</option> <option value="2" selected>项目</option>
</select> <option value="3">组织</option>
</select>
<% else %>
<select class="resourcesSendType" onclick="chooseSendType2hidden('<%= send_id %>', '<%= send_ids%>','<%= User.current.id %>','file', '<%= @type %>');">
<option value="1" selected>项目</option>
<option value="2">组织</option>
</select>
<% end %>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>

View File

@ -1,11 +1,18 @@
<div > <div >
<div class="relateText fl mb10 mr5">发送到</div> <div class="relateText fl mb10 mr5">发送到</div>
<div class="resourcesSendTo mr15"> <div class="resourcesSendTo mr15">
<select class="resourcesSendType" onclick="chooseSendType('<%= send_id%>','<%= send_ids%>','<%= User.current.id %>','news');"> <% if @hidden_unproject %>
<option value="1">班级</option> <select class="resourcesSendType" onclick="chooseSendType2('<%= send_id %>','<%= send_ids %>','<%= User.current.id %>','file', '<%= @type %>');">
<option value="2">项目</option> <option value="1">班级</option>
<option value="3" selected>组织</option> <option value="2">项目</option>
</select> <option value="3" selected>组织</option>
</select>
<% else %>
<select class="resourcesSendType" onclick="chooseSendType2hidden('<%= send_id %>', '<%= send_ids%>','<%= User.current.id %>','file', '<%= @type %>');">
<option value="1" >项目</option>
<option value="2" selected>组织</option>
</select>
<% end %>
</div> </div>
<%= form_tag search_user_org_user_path(user),:method => 'get', <%= form_tag search_user_org_user_path(user),:method => 'get',
:remote=>true,:id=>'search_user_org_form' do %> :remote=>true,:id=>'search_user_org_form' do %>

View File

@ -2,11 +2,18 @@
<div> <div>
<div class="sendText fl mr10" style="width: auto">发送到</div> <div class="sendText fl mr10" style="width: auto">发送到</div>
<div class="resourcesSendTo"> <div class="resourcesSendTo">
<select class="resourcesSendType" onclick="chooseSendType('<%= send_id %>','<%= send_ids %>','<%= User.current.id %>','news');"> <% if @hidden_unproject %>
<option value="1">班级</option> <select class="resourcesSendType" onclick="chooseSendType2('<%= send_id %>','<%= send_ids %>','<%= User.current.id %>','file', '<%= @type %>');">
<option value="2" selected>项目</option> <option value="1">班级</option>
<option value="3">组织</option> <option value="2" selected>项目</option>
</select> <option value="3">组织</option>
</select>
<% else %>
<select class="resourcesSendType" onclick="chooseSendType2hidden('<%= send_id %>', '<%= send_ids%>','<%= User.current.id %>','file', '<%= @type %>');">
<option value="1" selected>项目</option>
<option value="2">组织</option>
</select>
<% end %>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>

View File

@ -23,9 +23,15 @@
<a href="javascript:void(0);" class="replyGrey" onclick="batch_delete();">删除</a> </div> <a href="javascript:void(0);" class="replyGrey" onclick="batch_delete();">删除</a> </div>
<div class="cl"></div> <div class="cl"></div>
<div class="resourcesSelectSend mt10 fl"> <div class="resourcesSelectSend mt10 fl">
<div class="resourcesSelectSendButton fl mr15 inactive-border" onclick="batch_send();"> <% if hidden_unproject_infos %>
<a href="javascript:void(0);" class="sendButtonBlue db inactive-text" data-remote="true">发送至</a> <div class="resourcesSelectSendButton fl mr15 inactive-border" onclick="batch_send();">
</div> <a href="javascript:void(0);" class="sendButtonBlue db inactive-text" data-remote="true">发送至</a>
</div>
<% else %>
<div class="resourcesSelectSendButton fl mr15 inactive-border" onclick="batch_send_hidden();">
<a href="javascript:void(0);" class="sendButtonBlue db inactive-text" data-remote="true">发送至</a>
</div>
<% end %>
<div class="fl">选择&nbsp;<span class="c_red" id="res_count">0</span>&nbsp;个资源</div> <div class="fl">选择&nbsp;<span class="c_red" id="res_count">0</span>&nbsp;个资源</div>
</div> </div>
@ -45,7 +51,11 @@
<li><a tabindex="-1" href="#" onclick="if(<%= User.current.logged?%>)preview();" onfocus="this.blur()">预览</a></li> <li><a tabindex="-1" href="#" onclick="if(<%= User.current.logged?%>)preview();" onfocus="this.blur()">预览</a></li>
<li><a tabindex="-1" href="#" onclick="if(<%= User.current.logged?%>)rename();" onfocus="this.blur()">重命名</a></li> <li><a tabindex="-1" href="#" onclick="if(<%= User.current.logged?%>)rename();" onfocus="this.blur()">重命名</a></li>
<!-- data-remote="true" 这个属性会让ajax请求状态标志就在当前按钮的上方显示就不会滚动浏览器因而弹出框也会在当前窗口中央展示--> <!-- data-remote="true" 这个属性会让ajax请求状态标志就在当前按钮的上方显示就不会滚动浏览器因而弹出框也会在当前窗口中央展示-->
<li><a tabindex="-1" href="#" onclick="if(<%= User.current.logged?%>)show_send();" onfocus="this.blur()" >发送</a></li> <% if hidden_unproject_infos %>
<li><a tabindex="-1" href="#" onclick="if(<%= User.current.logged?%>)show_send();" onfocus="this.blur()" >发送</a></li>
<% else %>
<li><a tabindex="-1" href="#" onclick="if(<%= User.current.logged?%>)show_send_hidden();" onfocus="this.blur()" >发送</a></li>
<% end %>
<li><a tabindex="-1" href="#" onclick="if(<%= User.current.logged?%>)delete_file();" onfocus="this.blur()">删除</a></li> <li><a tabindex="-1" href="#" onclick="if(<%= User.current.logged?%>)delete_file();" onfocus="this.blur()">删除</a></li>
</ul> </ul>
</ul> </ul>

View File

@ -4,10 +4,12 @@
<li> <li>
<a href="<%= resource_search_user_path(:id => @user.id, :type => @type, :status => 1, :search => @switch_search) %>" id="resource_type_all" class="resourcesTypeAll resourcesGrey" data-method="get" data-remote="true">全部 </a> <a href="<%= resource_search_user_path(:id => @user.id, :type => @type, :status => 1, :search => @switch_search) %>" id="resource_type_all" class="resourcesTypeAll resourcesGrey" data-method="get" data-remote="true">全部 </a>
</li> </li>
<li> <% if hidden_unproject_infos %>
<a href="<%= resource_search_user_path(:id => @user.id, :type => @type, :status => 2, :search => @switch_search) %>" id="resource_type_course" class="homepagePostTypeAssignment postTypeGrey'" data-method="get" data-remote="true">班级资源 </a> <li>
<%#= link_to '课程资源' ,user_resource_user_path(:id => @user.id, :type => 2), id="resource_type_course", :remote => true, :method => 'get', :class=> 'homepagePostTypeAssignment postTypeGrey' %> <a href="<%= resource_search_user_path(:id => @user.id, :type => @type, :status => 2, :search => @switch_search) %>" id="resource_type_course" class="homepagePostTypeAssignment postTypeGrey'" data-method="get" data-remote="true">班级资源 </a>
</li> <%#= link_to '课程资源' ,user_resource_user_path(:id => @user.id, :type => 2), id="resource_type_course", :remote => true, :method => 'get', :class=> 'homepagePostTypeAssignment postTypeGrey' %>
</li>
<% end %>
<li> <li>
<a href="<%= resource_search_user_path(:id => @user.id, :type => @type, :status => 3, :search => @switch_search) %>" id="resource_type_project" class="homepagePostTypeQuiz postTypeGrey" data-method="get" data-remote="true">项目资源 </a> <a href="<%= resource_search_user_path(:id => @user.id, :type => @type, :status => 3, :search => @switch_search) %>" id="resource_type_project" class="homepagePostTypeQuiz postTypeGrey" data-method="get" data-remote="true">项目资源 </a>
<%#= link_to '项目资源' ,user_resource_user_path(:id => @user.id, :type => 3), id="resource_type_project", :remote => true, :method => 'get', :class => 'homepagePostTypeQuiz postTypeGrey' %> <%#= link_to '项目资源' ,user_resource_user_path(:id => @user.id, :type => 3), id="resource_type_project", :remote => true, :method => 'get', :class => 'homepagePostTypeQuiz postTypeGrey' %>

View File

@ -0,0 +1,11 @@
<% if @course %>
$("#homepage_left_course_list").html("<%= escape_javascript(render :partial => 'layouts/homepage_left_course_list', :locals => {:courses => @courses}) %>");
if($("#collect_course_icon_<%=@course.id %>").length > 0){
$("#collect_course_icon_<%=@course.id %>").html("<%= escape_javascript(render :partial => 'users/collect_course', :locals => {:course => @course}) %>");
}
<% elsif @project %>
$("#homepage_left_project_list").html("<%= escape_javascript(render :partial => 'layouts/homepage_left_project_list', :locals => {:projects => @projects}) %>");
if($("#collect_project_icon_<%=@project.id %>").length > 0){
$("#collect_project_icon_<%=@project.id %>").html("<%= escape_javascript(render :partial => 'users/collect_project', :locals => {:project => @project}) %>");
}
<% end %>

View File

@ -7,9 +7,7 @@
<ul class="homepagePostType"> <ul class="homepagePostType">
<li> <li>
<ul class="homepagePostTypeHomework fl"> <ul class="homepagePostTypeHomework fl">
<% hidden_courses = Setting.find_by_name("hidden_courses") %> <% if hidden_unproject_infos %>
<% unvisiable = hidden_courses && hidden_courses.value == "1"%>
<% if !unvisiable %>
<li class="f14">课程动态</li> <li class="f14">课程动态</li>
<li><%= link_to "作业动态", {:controller => "users", :action => "show", :type => "course_homework"}, :class => "homepagePostTypeAssignment postTypeGrey"%> <li><%= link_to "作业动态", {:controller => "users", :action => "show", :type => "course_homework"}, :class => "homepagePostTypeAssignment postTypeGrey"%>
<!--<a href="javascript:void(0);" class="homepagePostTypeAssignment postTypeGrey">作业动态</a>--></li> <!--<a href="javascript:void(0);" class="homepagePostTypeAssignment postTypeGrey">作业动态</a>--></li>

View File

@ -27,8 +27,9 @@
} else if(count > 0) { } else if(count > 0) {
var str = div.next().children().eq(0).attr('id'); var str = div.next().children().eq(0).attr('id');
var id = str.substring(19); var id = str.substring(19);
var user_id = <%= @user.id%>;
$.get( $.get(
'/users/expand_courses?syllabus_id=' + id '/users/'+user_id+'/expand_courses?syllabus_id=' + id
); );
} }
} }

View File

@ -8,12 +8,6 @@
function remote_get_resources(user_id,type){ function remote_get_resources(user_id,type){
} }
$(document).ready(function(){
$(".resource-switch").click(function(){
$(".resource-switch").children().removeClass("resource-tab-active");
$(this).children().addClass("resource-tab-active");
});
});
function remote_search(){ function remote_search(){
$("#resource_search_form").submit(); $("#resource_search_form").submit();
} }
@ -75,5 +69,10 @@
<div class="cl"></div> <div class="cl"></div>
<script>
$(".resource-switch").click(function(){
$(".resource-switch").children().removeClass("resource-tab-active");
$(this).children().addClass("resource-tab-active");
});
</script>

View File

@ -621,7 +621,7 @@ zh:
label_homework_info: 提交情况 #huang label_homework_info: 提交情况 #huang
label_course_news_description: '课程必须是高校正式开设的课程,或是围绕特定主题定期发布课程资料的公共开放课程;<br/>如果您想创建一个协作研究空间,请您前往“我的项目”页面创建项目,谢谢!' label_course_news_description: '课程必须是高校正式开设的课程,或是围绕特定主题定期发布课程资料的公共开放课程;<br/>如果您想创建一个协作研究空间,请您前往“我的项目”页面创建项目,谢谢!'
label_course_board: 问答 label_course_board: 讨论
label_version: 版本 label_version: 版本
label_version_new: 新建版本 label_version_new: 新建版本
@ -1743,7 +1743,7 @@ zh:
label_newbie_faq: '新手指引 & 问答' label_newbie_faq: '新手指引 & 问答'
label_hot_project: '热门项目' label_hot_project: '热门项目'
label_borad_project: 项目讨论区 label_borad_project: 项目讨论区
label_borad_course: 班级问答 label_borad_course: 班级讨论
label_borad_org_subfield: 资源栏目讨论区 label_borad_org_subfield: 资源栏目讨论区
view_borad_course: 课程讨论 view_borad_course: 课程讨论
label_memo_create_succ: 发布成功 label_memo_create_succ: 发布成功
@ -2143,7 +2143,7 @@ zh:
#微信模板消息 #微信模板消息
label_new_homework_template: 您有新作业了。 label_new_homework_template: 您有新作业了。
label_update_homework_template: 您的作业已被修改。 label_update_homework_template: 您的作业已被修改。
label_course_topic_template: 课程问答区有新帖子发布了。 label_course_topic_template: 班级讨论区有新帖子发布了。
label_topic_comment_template: 您的帖子有新回复了。 label_topic_comment_template: 您的帖子有新回复了。
label_project_topic_template: 项目讨论区有新帖子发布了。 label_project_topic_template: 项目讨论区有新帖子发布了。
label_issue_comment_template: 您的缺陷有新回复了。 label_issue_comment_template: 您的缺陷有新回复了。

View File

@ -567,7 +567,6 @@ RedmineApp::Application.routes.draw do
post 'user_select_homework' post 'user_select_homework'
post 'check_homework' post 'check_homework'
get 'all_journals' get 'all_journals'
get 'expand_courses'
end end
member do member do
@ -667,6 +666,8 @@ RedmineApp::Application.routes.draw do
post 'apply_for_resource' post 'apply_for_resource'
match 'manage_or_receive_homeworks', :to => 'users#manage_or_receive_homeworks', :via => :get match 'manage_or_receive_homeworks', :to => 'users#manage_or_receive_homeworks', :via => :get
get 'search_m_r_homeworks' get 'search_m_r_homeworks'
get 'expand_courses'
get 'cancel_or_collect'
# end # end
end end
#resources :blogs #resources :blogs

View File

@ -6,13 +6,17 @@ class MergeTwoHomeworks < ActiveRecord::Migration
work.update_column('homework_common_id', 3463) work.update_column('homework_common_id', 3463)
end end
end end
homework = HomeworkCommon.find 3387 begin
homework.destroy if homework homework = HomeworkCommon.find 3387
stu_works = StudentWork.where("homework_common_id = 3387") homework.destroy if homework
stu_work_ids = stu_works.empty? ? "(-1)" : "(" + stu_works.map{|work| work.id}.join(',') + ")" stu_works = StudentWork.where("homework_common_id = 3387")
stu_work_tests = StudentWorkTest.where("student_work_id in #{stu_work_ids}") stu_work_ids = stu_works.empty? ? "(-1)" : "(" + stu_works.map{|work| work.id}.join(',') + ")"
stu_work_tests.destroy_all if stu_work_tests stu_work_tests = StudentWorkTest.where("student_work_id in #{stu_work_ids}")
stu_works.destroy_all if stu_works stu_work_tests.destroy_all if stu_work_tests
stu_works.destroy_all if stu_works
rescue Exception => e
puts e
end
end end
def down def down

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