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"
case ac.act_type
when "HomeworkCommon"
"课程作业"
"班级作业"
when "News"
"课程通知"
"班级通知"
when "Message"
"课程问答"
"班级讨论"
when "Poll"
"课程问卷"
"班级问卷"
when "Course"
"课程"
"班级"
end
elsif ac.container_type == "Project"
case ac.act_type

View File

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

View File

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

View File

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

View File

@ -325,6 +325,7 @@ class FilesController < ApplicationController
@containers = [ Project.includes(:attachments).reorder(sort).find(@project.id)]
show_attachments @containers
# get_attachment_for_tip(@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)]
show_attachments @containers
# get_attachment_for_tip(@all_attachments)
@tag_list = attachment_tag_list @all_attachments
@ -440,6 +442,39 @@ class FilesController < ApplicationController
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
@file = Attachment.find(params[:id])
@can_quote = attachment_candown @file
@ -883,6 +918,7 @@ class FilesController < ApplicationController
end
@all_attachments = @result
get_attachment_for_tip(@all_attachments)
@limit = 10
@feedback_count = @all_attachments.count
@feedback_pages = Paginator.new @feedback_count, @limit, params['page']

View File

@ -94,8 +94,10 @@ class HomeworkCommonController < ApplicationController
end
end
status = false
if @homework.publish_time <= Date.today && homework_detail_manual.comment_status == 0
homework_detail_manual.comment_status = 1
status = true
end
eval_start = homework_detail_manual.evaluation_start
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_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"
redirect_to manage_or_receive_homeworks_user_path(User.current.id)
elsif params[:is_manage] == "2"

View File

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

View File

@ -229,7 +229,7 @@ class MembersController < ApplicationController
user_ids.each do |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])
# 这里的判断只能通过角色名,可以弄成常量
if role_ids && role_ids.include?("10")

View File

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

View File

@ -1,8 +1,10 @@
class PullRequestsController < ApplicationController
before_filter :authorize_logged
before_filter :find_project_and_repository
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]
layout "base_projects"
include PullRequestsHelper
include ApplicationHelper
@ -235,6 +237,13 @@ class PullRequestsController < ApplicationController
end
private
def authorize_logged
if !User.current.logged?
redirect_to signin_path
return
end
end
def connect_gitlab
@g = Gitlab.client
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 =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键值对
@ha = {}
@complexity["msr"].each do |com|

View File

@ -734,24 +734,33 @@ class StudentWorkController < ApplicationController
end
def destroy
if @work.destroy
if @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1
pros = @work.student_work_projects.where("is_leader = 0")
pros.each do |pro|
pro.destroy
end
project = @work.student_work_projects.where("is_leader = 1").first
project.update_attributes(:student_work_id => nil)
elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 0
@work.student_work_projects.each do |pro2|
pro2.destroy
if @homework.homework_type == 3
if @work.destroy
if @homework.homework_detail_group.base_on_project == 1
pros = @work.student_work_projects.where("is_leader = 0")
pros.each do |pro|
pro.destroy
end
project = @work.student_work_projects.where("is_leader = 1").first
project.update_attributes(:student_work_id => nil)
elsif @homework.homework_detail_group.base_on_project == 0
@work.student_work_projects.each do |pro2|
pro2.destroy
end
end
end
respond_to do |format|
format.html {
redirect_to student_work_index_url(:homework => @homework.id)
}
end
else
@work.attachments.destroy_all
@work.student_works_scores.destroy_all
@work.course_messages.destroy_all
@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
@ -793,6 +802,8 @@ class StudentWorkController < ApplicationController
end
elsif @homework.homework_type == 1
@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
@student_work = StudentWork.new
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,
:user_courses4show,:user_projects4show,:user_course_activities,:user_project_activities,:user_feedback4show,:user_visitorlist,:user_messages,:edit_brief_introduction,
:user_import_homeworks,:user_search_homeworks,:user_import_resource, :user_system_messages,:choose_user_course,:user_courselist,:user_projectlist,:sort_syllabus_list,
:sort_project_list,:my_homeworks,:manage_or_receive_homeworks,:search_m_r_homeworks]
: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 :rest_user_score, only: :show
#before_filter :select_entry, only: :user_projects
@ -1115,23 +1115,8 @@ class UsersController < ApplicationController
homework_detail_programing.save if homework_detail_programing
homework_detail_group.save if homework_detail_group
if homework.homework_type != 3
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
#('#{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
if homework.homework_type != 3 && homework_detail_manual.comment_status == 1
create_works_list homework
end
if params[:quotes] && !params[:quotes].blank?
@ -1474,15 +1459,15 @@ class UsersController < ApplicationController
#显示更多用户课程
def user_courses4show
@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)
@all_count = @user.courses.visible.where("is_delete =?", 0).count
@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.favorite_courses.visible.where("is_delete =?", 0).count
end
#显示更多用户项目
def user_projects4show
@page = params[:page].to_i + 1
@projects = @user.projects.visible.select("projects.*,(SELECT MAX(updated_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS a").order("a desc").limit(10).offset(@page * 10)
@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).offset(@page * 10)
@all_count = @user.favorite_projects.visible.count
end
def user_course_activities
@ -2167,6 +2152,7 @@ class UsersController < ApplicationController
#这里仅仅是传递需要发送的资源id
@send_id = params[:send_id]
@send_ids = params[:checkbox1] || params[:send_ids]
@hidden_unproject = hidden_unproject_infos
respond_to do |format|
format.js
end
@ -2186,6 +2172,7 @@ class UsersController < ApplicationController
#这里仅仅是传递需要发送的资源id
@send_id = params[:send_id]
@send_ids = params[:checkbox1] || params[:send_ids] #搜索的时候 和 直接 用表格提交的时候的send_ids
@hidden_unproject = hidden_unproject_infos
respond_to do |format|
format.js
end
@ -3349,6 +3336,7 @@ class UsersController < ApplicationController
#这里仅仅是传递需要发送的资源id
@send_id = params[:send_id]
@send_ids = params[:checkbox1] || params[:send_ids]
@hidden_unproject = hidden_unproject_infos
respond_to do |format|
format.js
end
@ -3439,6 +3427,28 @@ class UsersController < ApplicationController
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
@order, @c_sort, @type, @list_type = 1, 2, 1, 1
#limit = 5

View File

@ -37,6 +37,13 @@ module ApplicationHelper
# super
# 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
user = User.find_by_mail(mail)
@ -820,16 +827,17 @@ module ApplicationHelper
return @result
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
return false if project.gpid.nil?
g = Gitlab.client
count = g.user_static(project.gpid, :rev => "master").count
if User.current.member_of?(project) && count > 0
true
else
false
end
count
end
# 判断版本库是否初始为gitlab
@ -2519,7 +2527,7 @@ module ApplicationHelper
def footer_logo(ul_class=nil, li_class=nil)
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/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/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" )
@ -3447,8 +3455,26 @@ def course_syllabus_option user = User.current
type
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)
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))
end

View File

@ -7,7 +7,7 @@ module OrgMemberHelper
scope = []
end
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|
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)
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
if new_role_ids.include?(7) && new_role_ids.include?(10)
member_roles << MemberRole.new(:role_id => 7)

View File

@ -131,6 +131,22 @@ class Principal < ActiveRecord::Base
columns.uniq.map {|field| "#{table}.#{field}"}
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
# Make sure we don't try to insert NULL values (see #4632)

View File

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

View File

@ -34,7 +34,7 @@ class Tracker < ActiveRecord::Base
end
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'
acts_as_list

View File

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

View File

@ -17,7 +17,8 @@
: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
:source_id => source.id.to_s,
:is_direct => 0
} %>
<!--</span>-->
<% 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']");
imgSpan.attr({"src":'<%= "#{@urlfile.to_s}?#{Time.now.to_i}" %>'});
<% else %>

View File

@ -22,7 +22,7 @@
<div class="homepageRight mt0 ml10">
<div class="homepageRightBanner">
<div class="NewsBannerName">
班级问答
班级讨论
</div>
</div>
<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)) %>
<% if show_nav?(@course.boards.first ? @course.boards.first.topics.count : 0) %>
<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)}") %>
</li>
<% end %>

View File

@ -17,7 +17,7 @@
<div class="cl"></div>
<li class="ml45">
<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>
</li>
<div class="cl"></div>

View File

@ -7,6 +7,9 @@
$("#course_is_public").attr("checked",true);
<% end %>
}
if(document.getElementById("course_list")) {
window.location.href = "<%=course_files_path(@course) %>";
}
<% else %>
<% if @course.is_public? %>
$("#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;">
<ul>
<%= 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} %>
<div class="cl"></div>
</li>
<li class="ml45 mb10">
<label><span class="c_red">*</span>&nbsp;<%= l(:label_tags_syllabus_name)%>&nbsp;&nbsp;</label>

View File

@ -94,7 +94,7 @@
</p>
</div>
<% end %>
<div class="resources mt10" style="padding-bottom:5px;">
<div class="resources mt10 pr" style="padding-bottom:5px;">
<div class="reTop mb5">
<%= 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"%>
@ -115,13 +115,22 @@
</div>
<div class="cl"></div>
<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_r" style="color: #808080" id="course_filter_order">
<%= render :partial => 'course_file_filter_order', :locals => {:remote => @is_remote, :sort => @sort, :order => @order} %>
</p>
<!--<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_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 class="cl"></div>
<!--<div class="resource_tip_box fontGrey2">-->
<!--<em></em>-->
<!--<span></span>-->
<!--<p class="mb5">私有资源:<br/>仅对本班级成员可见</p>-->
<!--<p>公共资源:<br/>对所有用户可见</p>-->
<!--</div>-->
</div>
<div id="course_list">
<%= 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">
<% if (delete_allowed || User.current.id == file.author_id) && file.container_id == org_subfield.id && file.container_type == "OrgSubfield" %>
<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>
<% if file.container.try(:organization).try(:is_public?) %>
<li>

View File

@ -65,7 +65,7 @@
</p>
</div>
<% end %>
<div class="resources mt10" style="padding-bottom:5px;">
<div class="resources mt10 pr" style="padding-bottom:5px;">
<div class="reTop mb5">
<%= 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"%>
@ -85,6 +85,9 @@
</div>
<div class="cl"></div>
<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_r" style="color: #808080">
<% if @order == "asc" %>
@ -100,6 +103,14 @@
</div>
</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 id="course_list">
<%= 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? || ((delete_allowed || User.current.id == file.author_id) && file.container_id == project.id && file.container_type == "Project") %>
<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>
<% if project.is_public? %>
<li>
@ -20,7 +24,11 @@
<% end %>
<% else %>
<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>
<% 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 %>');
<% 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}) %>");
// $("#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 %>');
<% 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",
"fileManagerJson":"/kindeditor/filemanager"});
// $("#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 %>");

View File

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

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>
</li>
<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 class="fl">
<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) %>
<% student_num = studentCount(@course) %>
<% 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') %>
&nbsp;&gt;&nbsp;
<% if @course.syllabus %>
@ -30,7 +30,16 @@
<div class="cl"></div>
<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 class="sy_class_id fl">
<p>邀 请 码<br />
@ -54,7 +63,7 @@
</p>
<div class="cl"></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">学时:<span class="sy_cblack"><%= @course.class_period %>学时</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="<%= 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"><%= 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>
</ul>
@ -22,7 +24,7 @@
<strong><%= l(:label_partners)%></strong>
</li>
<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 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>

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">服务协议</a>|</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>
</ul>
@ -22,7 +24,7 @@
<strong><%= l(:label_partners)%></strong>
</li>
<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 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>

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">
<%= link_to "资源库", user_resource_user_path(User.current, :type => 6), :class => "c_white f16 db p10" %>
</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"%>
</li>
<li class="navHomepageMenu fl mr30">
<%= link_to "帮助中心", "https://#{Setting.host_name}/forums/1/memos/1168", :class =>"c_white f16 db p10" %>
</li>
</li>
<li class="navHomepageMenu fl mr30">
<%= link_to "帮助中心", "https://#{Setting.host_name}/forums/1/memos/1168", :class =>"c_white f16 db p10" %>
</li>
<% end %>
</ul>
</div>
<script>

View File

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

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>
<% end %>
<% 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>
<% if count == 0 %>
<%= 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>
<% end %>
<% 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>
<% 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" %>

View File

@ -1,5 +1,6 @@
<%# course_model %>
<% 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)) %>
<% homework_num = visable_course_homework @course %>
@ -18,7 +19,7 @@
<%= heads_for_theme %>
<%= 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'%>
<%= javascript_include_tag "course","header","attachments",'prettify' %>
<%= javascript_include_tag "course","avatars","header","attachments",'prettify' %>
<!-- page specific tags -->
<%= yield :header_tags -%>
<!-- MathJax的配置 -->
@ -65,7 +66,7 @@
<% unless show_nav?(@course.boards.first ? @course.boards.first.topics.count : 0) %>
<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 %>
<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)}") %>
</li>
<% end %>
@ -130,10 +131,13 @@
<%= render :partial => 'courses/course_activity_users', :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>
<%= render :partial => 'courses/recommendation', :locals => {:course => @course} %>
</div>
<%# 更新访问数,刷新的时候更新访问次数 %>
<% update_visiti_count @course %>
<div class="fontGrey5 mt10 ml20">访问计数 <%= @course.visits.to_i %> 自2016年5月</div>
</div><!--sy_class_l end-->
<div class="fl">
<%= yield %>
@ -151,6 +155,9 @@
<span><%= l(:label_loading) %></span>
</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 %>
</body>
<script>

View File

@ -13,7 +13,7 @@
<%= javascript_heads %>
<%= 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' %>
<%= 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 %>
<!-- page specific tags -->
@ -50,7 +50,16 @@
<div id="LSide" class="fl">
<div class="project_info">
<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 class="pr_info_id fl mb5 f14">
<%= l(:label_project_ivite_code)%>
@ -242,13 +251,17 @@
});
</script>
</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;">
<span><%= l(:label_loading) %></span>
</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 %>
</body>
</html>

View File

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

View File

@ -59,7 +59,9 @@
<div class="cl"></div>
<%= render :partial => 'layouts/footer' %>
<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;">
<span><%= l(:label_loading) %></span>
</div>

View File

@ -103,12 +103,17 @@
<div class="homepageLeft mt10" id="LSide">
<div class="user_leftinfo mb10">
<% 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%>
<% elsif User.current.logged? %>
<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="pr" style="width: 80px; margin:0 auto;">
<%=link_to image_tag(url_to_avatar(@user),width:"74", height: "74", :id=>'nh_source_tx'), my_clear_user_avatar_temp_path, :class => "user_leftinfo_img", :remote => true%>
<div class="homepageEditProfile undis">
<%=link_to '', my_clear_user_avatar_temp_path, :class => 'homepageEditProfileIcon', :remote => true, :title => '点击编辑Logo' %>
</div>
</div>
<% else %>
<img src="images/user/male.jpg" width="74" height="74" />
<% end %>
<a href="javascript:void(0)" class="user_leftinfo_img" style="cursor: default">
<%=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) ) %>
<span class="<%= @user.user_extensions.gender == 1 ? 'user_leftinfo_female' : 'user_leftinfo_male' %> "></span>
<% end %>
@ -154,25 +159,13 @@
</div>
<div class="user_leftnav ">
<% hidden_courses = Setting.find_by_name("hidden_courses") %>
<% unvisiable = hidden_courses && hidden_courses.value == "1"%>
<% if !unvisiable %>
<% if hidden_unproject_infos %>
<ul class="users_accordion mb10">
<li id="user_01" class="user_icons_course">
<%= link_to '课程',{:controller => "users", :action => "user_courselist", :id => @user.id}, :id => "user_course_list" %>
<% courses = @user.courses.visible.where("is_delete =?", 0).select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS a").order("a desc").limit(10) %>
<% all_count = @user.courses.visible.where("is_delete =?", 0).count%>
<div class="<%= courses.empty? ? 'none' : ''%>" >
<div id="homepageLeftMenuCourses">
<ul class="user_sub_menu" id="user_courses_li">
<%= render :partial => 'layouts/user_courses', :locals => {:courses => courses,:user => @user,:all_count => all_count,:page => 0} %>
</ul>
</div>
<% 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 %>
<%= link_to '班级',{:controller => "users", :action => "user_courselist", :id => @user.id}, :id => "user_course_list" %>
<% courses = @user.favorite_courses.visible.where("is_delete =?", 0).select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS a").order("a desc").limit(10) %>
<div class="<%= courses.empty? ? 'none' : ''%>" id="homepage_left_course_list">
<%=render :partial => 'layouts/homepage_left_course_list', :locals => {:courses => courses} %>
</div>
</li>
<% if is_current_user %>
@ -197,19 +190,9 @@
<ul class="users_accordion mb10">
<li id="user_06" class="user_icons_project">
<%= link_to '项目',{:controller => "users", :action => "user_projectlist", :id => @user.id}, :id => 'user_project_list'%>
<% all_count = @user.projects.visible.count%>
<% projects = @user.projects.visible.select("projects.*, (SELECT MAX(updated_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS a").order("a desc").limit(10)%>
<div class="<%= projects.empty? ? 'none' : ''%>" >
<div id="homepageLeftMenuForge">
<ul class="user_sub_menu" id="user_projects_li">
<%= render :partial => 'layouts/user_projects', :locals => {:projects => projects,:user => @user, :all_count => all_count, :page => 0} %>
</ul>
</div>
<% if !projects.empty? %>
<a class="user_navmorebox" href="javascript:void(0);" id="user_hide_project" onclick="leftProjectslistChange();">
<span id="hide_show_projecticon" class="user_icons_closeclass"></span>
</a>
<% end %>
<% projects = @user.favorite_projects.visible.select("projects.*, (SELECT MAX(updated_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS a").order("a desc").limit(10)%>
<div class="<%= projects.empty? ? 'none' : ''%>" id="homepage_left_project_list">
<%=render :partial => 'layouts/homepage_left_project_list', :locals => {:projects => projects} %>
</div>
</li>
<% if is_current_user %>
@ -231,13 +214,17 @@
</ul>
</div><!--sy_class_leftnav end-->
<%# 更新访问数,刷新的时候更新访问次数 %>
<% update_visiti_count @user %>
<div class="fontGrey5 mt10 ml20">访问计数 <%= @user.visits.to_i %> 自2016年5月</div>
</div>
<div class="homepageRight">
<%= yield %>
</div>
</div>
<%= render :partial => 'layouts/new_feedback' %>
<% if hidden_unproject_infos %>
<%= render :partial => 'layouts/new_feedback' %>
<% end %>
</div>
<div class="cl"></div>
<%= render :partial => 'layouts/footer' %>
@ -248,53 +235,10 @@
<span><%= l(:label_loading) %></span>
</div>
<div id="nh_tx_dialog_html" class="white_content" style="display:none;">
<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_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-->
<%=render :partial => 'layouts/upload_avatar', :locals => {:source => @user} %>
</div>
<script type="text/javascript">
$(function(){
$('#user_hide_course').hide();
$('#user_hide_project').hide();
autoUrl("user_brief_introduction_show");
if(<%= @is_course == 1 %>) {

View File

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

View File

@ -116,7 +116,11 @@
) if @message.destroyable_by?(User.current) %>
</li>
<% 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>
</li>
</ul>

View File

@ -60,7 +60,7 @@
</li>
<li><label class="fl">说明:</label><textarea id = "remarks" class="winbox_textarea fl" placeholder="如果您有特别需要说明的内容请填入"></textarea></li>
<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>
<script type="text/javascript">
@ -103,8 +103,9 @@
if(data.result == 0){
$("input[name='province']").val(data.name);
$("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>";
//$('#province').onload();
//$('#my_account_form_link').click();
pop_up_box(htmlvalue,500,30,50);
}
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(){
//名称不能为空也不能重复
@ -147,4 +173,8 @@
}
});
}
$('#apply_school').on("click",(function(e){
commit_add_school();
}));
</script>

View File

@ -78,7 +78,7 @@
<span id="identity_hint" style="display: none"></span>
</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;">
<% if User.current.user_extensions && User.current.user_extensions.gender && User.current.user_extensions.gender == 1 %>
@ -99,8 +99,13 @@
</p>
<!--<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 %>
<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 %>" />
<% if User.current.user_extensions.school_id.nil? %>
<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">
<!-- <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>
@ -169,13 +174,13 @@
<li>
<%= 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><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="display:none;"><%= f.select :language, :Chinese => :zh, :English => :en %></li>
<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;"/>
<!--<a href="javascript:void(0);" class="grey_btn ml10 fl">取消</a>-->
</li>
@ -560,44 +565,80 @@
$("#users_tb_2").click();
<% end %>
$('#my_account_form_link').on("click",(function(e){
//$('#my_account_form_link').click(function(e){
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();
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_btn').click();
}));
// $('#my_account_form_link').on("click",(function(e){
// //$('#my_account_form_link').click(function(e){
// 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();
// }));
$('#my_password_form_link').click(function(){
$('#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 type="text/javascript">
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());
showModal('ajax-modal','460px');
$('#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=>"头像") %>');
<% 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();

View File

@ -12,7 +12,7 @@
<%= link_to activity.try(:author).try(:realname), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %>
<% end %>
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 class="homepagePostTitle hidden m_w530 fl">
<% if activity.parent_id.nil? %> <!--+"(帖子标题)"-->

View File

@ -61,19 +61,21 @@
<%= link_to "动态",organization_path(organization), :class => "homepageMenuText" %>
</div>
<% when 'course' %>
<div style="display:<%= field.hide == 0 ? 'block':'none' %>;" id="org_subfield_<%= field.id %>">
<div class="homepageLeftMenuBlock">
<a href="javascript:void(0);" class="homepageMenuText" onclick="$('#homepageLeftMenuCourses').slideToggle();">班级</a>
<% if User.current.logged? and User.current.admin_of_org?(organization) %>
<%=link_to "", join_course_menu_organization_path(organization),:remote => true, :method => "post", :class => "homepageMenuSetting fr", :title => "关联班级"%>
<% end %>
</div>
<div class="homepageLeftMenuCourses" id="homepageLeftMenuCourses" style="display:<%= organization.courses.count == 0 ?'none':'' %>">
<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}%>
</ul>
</div>
</div>
<% if hidden_unproject_infos %>
<div style="display:<%= field.hide == 0 ? 'block':'none' %>;" id="org_subfield_<%= field.id %>">
<div class="homepageLeftMenuBlock">
<a href="javascript:void(0);" class="homepageMenuText" onclick="$('#homepageLeftMenuCourses').slideToggle();">班级</a>
<% if User.current.logged? and User.current.admin_of_org?(organization) %>
<%=link_to "", join_course_menu_organization_path(organization),:remote => true, :method => "post", :class => "homepageMenuSetting fr", :title => "关联班级"%>
<% end %>
</div>
<div class="homepageLeftMenuCourses" id="homepageLeftMenuCourses" style="display:<%= organization.courses.count == 0 ?'none':'' %>">
<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}%>
</ul>
</div>
</div>
<% end %>
<% when 'project' %>
<div style="display:<%= field.hide == 0 ? 'block':'none' %>;" id="org_subfield_<%= field.id %>">
<div class="homepageLeftMenuBlock">

View File

@ -32,8 +32,8 @@
<% end %>
</li>
<% 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: 30px;float: left" onclick = "ifDeleteOrgMember('<%= member.id %>','<%= username %>')" >删除</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: 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 %>
<div class="cl"></div>
</ul>

View File

@ -106,7 +106,7 @@
<%= render :partial=>"org_member_list",:locals=> {:members=>@organization.org_members} %>
</div>
</div>
<div class="fr orgMemContainer">
<div class="fl ml10 orgMemContainer">
<div class="orgMemberAdd">
<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|%>

View File

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

View File

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

View File

@ -38,7 +38,12 @@
<li class="homepagePostSettingIcon">
<% if User.current.logged? %>
<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>
<%= link_to(l(:button_edit), {:controller => 'news', :action => 'edit', :id => activity}, :class => 'postOptionLink') if activity.author == User.current %>
</li>

View File

@ -1,9 +1,8 @@
<%= error_messages_for 'project' %>
<%= labelled_form_for @project do |f| %>
<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} %>
<div class="cl"></div>
</li>
<li >
<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="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) %> 前
<% 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" %>
<% if User.current.login == @request.author.try(:username) || is_project_manager?(User.current.id, @project.id) %>
<% 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 %>
<div class="cl"></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><%= 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>
<%= link_to "创建Pull Request", new_project_pull_request_path, :class => "BlueCirBtn fr ml10 mt10", :style => "width:110px;" %>
<% 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;" %>
<% end %>
<div class="cl"></div>
</ul>
<div class="cl"></div>

View File

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

View File

@ -52,7 +52,7 @@
<span title ="该项目是私有的"><%=work.project.name %></span>
<% end %>
<%#= 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>
<% 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 id="course-boardlist">
<div class="listbox mt10" >
<h2 class="list-h2">问答区列表</h2>
<h2 class="list-h2">讨论区列表</h2>
<div class="category">
<span class="grayTxt ">排序:</span>
<%= 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">
<%= link_to activity.author.show_name, user_path(activity.author_id, :host=>Setting.host_user), :class => "newsBlue mr15" %>
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 class="homepagePostTitle hidden m_w530 fl">
<% if activity.parent_id.nil? %> <!--+"(帖子标题)"-->

View File

@ -1,30 +1,44 @@
<% unless courses.nil? %>
<% 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 %>
<a href="<%= allow_visit ? course_path(course.id) : "javascript:void(0)" %>" target="_blank" title="<%= allow_visit ? "" : "私有班级不可访问"%>">
<span class="icons_sy_cir "></span>
<div class="fl">
<div class="syllabus_class_w ">
<p class="syllabus_class_title fl"><%=course.name %></p>
<span class="<%= course.is_public == 0 ? 'hw_icon_private' : 'hw_icon_open' %> fl"></span>
<span class="fr sy_p_grey hidden" style="max-width: 120px;">主讲老师:<%=course.teacher.show_name %></span>
<div class="cl"></div>
</div>
<div class="">
<p class="fl grayTxt ">更新:<%=format_date Time.at(course.updatetime) %><span class="mr10"></span>学期:<%=current_time_and_term(course) %></p>
<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>
<span id="collect_course_icon_<%=course.id %>">
<%=render :partial => 'collect_course', :locals => {:course => course} %>
</span>
<div class="fl">
<div class="syllabus_class_w ">
<a href="<%= allow_visit ? course_path(course.id) : "javascript:void(0)" %>" class="syllabus_class_title fl" target="_blank" title="<%= allow_visit ? "" : "私有班级不可访问" %>"><%= course.name %></a>
<span class="<%= course.is_public == 0 ? 'syllabus_class_private' : 'syllabus_class_open' %> fl ml10 mt3 syllabus_class_property"><%= course.is_public == 0 ? '私有' : '公开' %></span>
<span class="fr sy_p_grey hidden" style="max-width: 120px;">主讲老师:<%= link_to course.teacher.show_name, user_path(course.teacher) %></span>
<div class="cl"></div>
</div>
<span class="icons_sy_arrow fl mt19 ml10" ></span>
<div class="cl"></div>
</a>
<div class="">
<p class="fl grayTxt ">更新:<%= format_date Time.at(course.updatetime) %><span class="mr10"></span>
学期:<%= 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>
<% end %>
<% if courses.count > 3 %>
<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>
<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>
</li>
<% end %>
<% end %>

View File

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

View File

@ -32,10 +32,12 @@
<% projects.each_with_index do |project, i| %>
<div class="syllabus_courses_list <%= i > 4 ? 'none' : ''%>" style="cursor: default;">
<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>
<% unless project.is_public? %>
<span class="hw_icon_private fl"></span>
<span class="syllabus_class_private fl ml10 mt3 syllabus_class_property">私有</span>
<% end %>
<% 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) %>

View File

@ -68,7 +68,11 @@
) if activity.destroyable_by?(User.current) %>
</li>
<% 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>
</li>
</ul>

View File

@ -35,7 +35,12 @@
<li class="homepagePostSettingIcon">
<% if User.current.logged? %>
<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>
<%= link_to(
l(:button_edit),

View File

@ -4,11 +4,18 @@
<% unless send_ids.blank? %>
<% send_ids = send_ids.class == String ? send_ids : send_ids.join(",") %>
<% end %>
<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" selected>组织</option>
</select>
<% 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" 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>
<%= form_tag search_user_org_user_path(user, :type => @type),:method => 'get',
:remote=>true,:id=>'search_user_org_form' do %>

View File

@ -5,11 +5,18 @@
<% unless send_ids.blank? %>
<% send_ids = send_ids.class == String ? send_ids : send_ids.join(",") %>
<% end %>
<select class="resourcesSendType" onclick="chooseSendType2('<%= send_id %>','<%= send_ids %>','<%= User.current.id %>','file', '<%= @type %>');">
<option value="1">班级</option>
<option value="2" selected>项目</option>
<option value="3">组织</option>
</select>
<% if @hidden_unproject %>
<select class="resourcesSendType" onclick="chooseSendType2('<%= send_id %>','<%= send_ids %>','<%= User.current.id %>','file', '<%= @type %>');">
<option value="1">班级</option>
<option value="2" selected>项目</option>
<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 class="cl"></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(){
if($("#resources_list_form").serialize() == ""){
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(){
$("#contextMenu").hide();
document.oncontextmenu = function() {return true;}

View File

@ -3,6 +3,7 @@
<ul class="resourcesSelect">
<li class="resourcesSelected"><a href="javascript:void(0);" class="resourcesIcon"></a>
<ul class="homepagePostType">
<% if hidden_unproject_infos %>
<li>
<ul class="homepagePostTypeHomework fl">
<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>
</ul>
</li>
<% end %>
<li>
<ul class="homepagePostTypeProject fl">
<li class="f14"><strong>项目消息</strong></li>
@ -23,6 +24,7 @@
</ul>
</li>
<% if hidden_unproject_infos %>
<div class="cl"></div>
<li>
<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>
</ul>
</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>
</li>
</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 class="relateText fl mb10 mr5">发送到</div>
<div class="resourcesSendTo mr15">
<select class="resourcesSendType" onclick="chooseSendType('<%= send_id%>','<%= send_ids%>','<%= User.current.id %>','message');">
<option value="1">班级</option>
<option value="2">项目</option>
<option value="3" selected>组织</option>
</select>
<% 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" 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>
<%= form_tag search_user_org_user_path(user),:method => 'get',
:remote=>true,:id=>'search_user_org_form' do %>

View File

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

View File

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

View File

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

View File

@ -23,9 +23,15 @@
<a href="javascript:void(0);" class="replyGrey" onclick="batch_delete();">删除</a> </div>
<div class="cl"></div>
<div class="resourcesSelectSend mt10 fl">
<div class="resourcesSelectSendButton fl mr15 inactive-border" onclick="batch_send();">
<a href="javascript:void(0);" class="sendButtonBlue db inactive-text" data-remote="true">发送至</a>
</div>
<% if hidden_unproject_infos %>
<div class="resourcesSelectSendButton fl mr15 inactive-border" onclick="batch_send();">
<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>
@ -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?%>)rename();" onfocus="this.blur()">重命名</a></li>
<!-- 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>
</ul>
</ul>

View File

@ -4,10 +4,12 @@
<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>
</li>
<li>
<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>
<%#= link_to '课程资源' ,user_resource_user_path(:id => @user.id, :type => 2), id="resource_type_course", :remote => true, :method => 'get', :class=> 'homepagePostTypeAssignment postTypeGrey' %>
</li>
<% if hidden_unproject_infos %>
<li>
<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>
<%#= 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>
<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' %>

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

View File

@ -27,8 +27,9 @@
} else if(count > 0) {
var str = div.next().children().eq(0).attr('id');
var id = str.substring(19);
var user_id = <%= @user.id%>;
$.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){
}
$(document).ready(function(){
$(".resource-switch").click(function(){
$(".resource-switch").children().removeClass("resource-tab-active");
$(this).children().addClass("resource-tab-active");
});
});
function remote_search(){
$("#resource_search_form").submit();
}
@ -75,5 +69,10 @@
<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_course_news_description: '课程必须是高校正式开设的课程,或是围绕特定主题定期发布课程资料的公共开放课程;<br/>如果您想创建一个协作研究空间,请您前往“我的项目”页面创建项目,谢谢!'
label_course_board: 问答
label_course_board: 讨论
label_version: 版本
label_version_new: 新建版本
@ -1743,7 +1743,7 @@ zh:
label_newbie_faq: '新手指引 & 问答'
label_hot_project: '热门项目'
label_borad_project: 项目讨论区
label_borad_course: 班级问答
label_borad_course: 班级讨论
label_borad_org_subfield: 资源栏目讨论区
view_borad_course: 课程讨论
label_memo_create_succ: 发布成功
@ -2143,7 +2143,7 @@ zh:
#微信模板消息
label_new_homework_template: 您有新作业了。
label_update_homework_template: 您的作业已被修改。
label_course_topic_template: 课程问答区有新帖子发布了。
label_course_topic_template: 班级讨论区有新帖子发布了。
label_topic_comment_template: 您的帖子有新回复了。
label_project_topic_template: 项目讨论区有新帖子发布了。
label_issue_comment_template: 您的缺陷有新回复了。

View File

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

View File

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

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