diff --git a/app/api/mobile/entities/activity.rb b/app/api/mobile/entities/activity.rb index 6f5a3db74..9deeec58e 100644 --- a/app/api/mobile/entities/activity.rb +++ b/app/api/mobile/entities/activity.rb @@ -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 diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb index 731a251f2..02dfe9a45 100644 --- a/app/controllers/account_controller.rb +++ b/app/controllers/account_controller.rb @@ -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 diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index fa2c87f8c..7ec532d79 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -202,6 +202,11 @@ class AttachmentsController < ApplicationController end @attachment.save @newfiledense = filedense + end + if @project + + elsif @course + end respond_to do |format| format.js diff --git a/app/controllers/avatar_controller.rb b/app/controllers/avatar_controller.rb index b5c174b0c..9d90cb9f2 100644 --- a/app/controllers/avatar_controller.rb +++ b/app/controllers/avatar_controller.rb @@ -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" diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb index cd3870e9a..988768414 100644 --- a/app/controllers/files_controller.rb +++ b/app/controllers/files_controller.rb @@ -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'] diff --git a/app/controllers/homework_common_controller.rb b/app/controllers/homework_common_controller.rb index 2f50c8105..6704f7401 100644 --- a/app/controllers/homework_common_controller.rb +++ b/app/controllers/homework_common_controller.rb @@ -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" diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index f108c685a..4c9411538 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -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 diff --git a/app/controllers/members_controller.rb b/app/controllers/members_controller.rb index d661350c6..97222f0bd 100644 --- a/app/controllers/members_controller.rb +++ b/app/controllers/members_controller.rb @@ -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") diff --git a/app/controllers/my_controller.rb b/app/controllers/my_controller.rb index 3aefdfd1d..c4935a1af 100644 --- a/app/controllers/my_controller.rb +++ b/app/controllers/my_controller.rb @@ -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 diff --git a/app/controllers/pull_requests_controller.rb b/app/controllers/pull_requests_controller.rb index 5e21f9af0..b67a74439 100644 --- a/app/controllers/pull_requests_controller.rb +++ b/app/controllers/pull_requests_controller.rb @@ -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 diff --git a/app/controllers/quality_analysis_controller.rb b/app/controllers/quality_analysis_controller.rb index a0b275dc7..3a9eff0ce 100644 --- a/app/controllers/quality_analysis_controller.rb +++ b/app/controllers/quality_analysis_controller.rb @@ -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| diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index 722845ef7..5e13149df 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -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| diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index e929153ad..b385fe610 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -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 diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index aabacb6e0..3c125a185 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -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 + diff --git a/app/helpers/org_member_helper.rb b/app/helpers/org_member_helper.rb index e16051eaf..8e7d1e2ef 100644 --- a/app/helpers/org_member_helper.rb +++ b/app/helpers/org_member_helper.rb @@ -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 } diff --git a/app/models/member.rb b/app/models/member.rb index cb15e067b..bb336e936 100644 --- a/app/models/member.rb +++ b/app/models/member.rb @@ -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) diff --git a/app/models/principal.rb b/app/models/principal.rb index 0c87ec0c6..e65816e83 100644 --- a/app/models/principal.rb +++ b/app/models/principal.rb @@ -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) diff --git a/app/models/student_work.rb b/app/models/student_work.rb index 09ef15583..183570081 100644 --- a/app/models/student_work.rb +++ b/app/models/student_work.rb @@ -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 diff --git a/app/models/tracker.rb b/app/models/tracker.rb index af56d23bf..4ef18b7b0 100644 --- a/app/models/tracker.rb +++ b/app/models/tracker.rb @@ -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 diff --git a/app/models/user.rb b/app/models/user.rb index b863c1f70..f2b2b6824 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -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表中的邮箱信息 diff --git a/app/views/avatar/_new_avatar_form.html.erb b/app/views/avatar/_new_avatar_form.html.erb index 2593bf1f5..d13a2a4d5 100644 --- a/app/views/avatar/_new_avatar_form.html.erb +++ b/app/views/avatar/_new_avatar_form.html.erb @@ -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 } %> <% content_for :header_tags do %> diff --git a/app/views/avatar/upload.js.erb b/app/views/avatar/upload.js.erb index 41cf3ab77..c2fa23242 100644 --- a/app/views/avatar/upload.js.erb +++ b/app/views/avatar/upload.js.erb @@ -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 %> diff --git a/app/views/boards/_course_show.html.erb b/app/views/boards/_course_show.html.erb index 46191b5d3..6759e33ce 100644 --- a/app/views/boards/_course_show.html.erb +++ b/app/views/boards/_course_show.html.erb @@ -22,7 +22,7 @@
- 班级问答区 + 班级讨论区
diff --git a/app/views/courses/_tool_expand.html.erb b/app/views/courses/_tool_expand.html.erb index 5f9e512d7..72ae83b92 100644 --- a/app/views/courses/_tool_expand.html.erb +++ b/app/views/courses/_tool_expand.html.erb @@ -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) %>
  • - 问答区 + 讨论区 <%= link_to( "",course_boards_path(@course, :flag => true, :is_new => 1), :class => 'sy_class_add', :title =>"#{l(:label_message_new)}") %>
  • <% end %> diff --git a/app/views/courses/new.html.erb b/app/views/courses/new.html.erb index f53c8c716..4d823280b 100644 --- a/app/views/courses/new.html.erb +++ b/app/views/courses/new.html.erb @@ -17,7 +17,7 @@
  • - +
  • diff --git a/app/views/courses/private_or_public.js.erb b/app/views/courses/private_or_public.js.erb index 835728626..609b5aedd 100644 --- a/app/views/courses/private_or_public.js.erb +++ b/app/views/courses/private_or_public.js.erb @@ -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 %>)"); diff --git a/app/views/courses/settings.html.erb b/app/views/courses/settings.html.erb index fabd687e0..0ac041921 100644 --- a/app/views/courses/settings.html.erb +++ b/app/views/courses/settings.html.erb @@ -27,9 +27,8 @@
      <%= labelled_form_for @course do |f| %> -
    • +
    • <%= render :partial => "avatar/new_avatar_form", :locals => {source: @course} %> -
    • diff --git a/app/views/files/_course_file.html.erb b/app/views/files/_course_file.html.erb index 946449680..b5a15bc1f 100644 --- a/app/views/files/_course_file.html.erb +++ b/app/views/files/_course_file.html.erb @@ -94,7 +94,7 @@

    <% end %> -
    +
    <%= 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 @@
    -

    共有 <%= @all_attachments.count%> 个资源

    -

    - <%= render :partial => 'course_file_filter_order', :locals => {:remote => @is_remote, :sort => @sort, :order => @order} %> -

    + + + +

    共有 <%= @all_attachments.count%> 个资源

    +

    + <%= render :partial => 'course_file_filter_order', :locals => {:remote => @is_remote, :sort => @sort, :order => @order} %> +

    + + + + + +
    <%= render :partial => 'course_list',:locals => {course: @course,all_attachments: @all_attachments,sort:@sort,order:@order,curse_attachments:@obj_attachments} %> diff --git a/app/views/files/_org_subfield_list.html.erb b/app/views/files/_org_subfield_list.html.erb index e567435a5..de37ed054 100644 --- a/app/views/files/_org_subfield_list.html.erb +++ b/app/views/files/_org_subfield_list.html.erb @@ -63,7 +63,11 @@
  • <% if (delete_allowed || User.current.id == file.author_id) && file.container_id == org_subfield.id && file.container_type == "OrgSubfield" %>
      -
    • <%= link_to("发       送".html_safe, 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send('#{file.id}','#{User.current.id}','file')") %>
    • + <% if hidden_unproject_infos %> +
    • <%= link_to("发       送".html_safe, 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send('#{file.id}','#{User.current.id}','file')") %>
    • + <% else %> +
    • <%= link_to("发       送".html_safe, 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send_hidden('#{file.id}','#{User.current.id}','file')") %>
    • + <% end %>
    • <%= link_to '更新版本',attachments_versions_path(file),:class => "postOptionLink",:remote=>true %>
    • <% if file.container.try(:organization).try(:is_public?) %>
    • diff --git a/app/views/files/_project_file.html.erb b/app/views/files/_project_file.html.erb index 40e5163a8..7504fbecb 100644 --- a/app/views/files/_project_file.html.erb +++ b/app/views/files/_project_file.html.erb @@ -65,7 +65,7 @@

  • <% end %> -
    +
    <%= 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 @@
    + + +

    共有 <%= @all_attachments.count%> 个资源

    <% if @order == "asc" %> @@ -100,6 +103,14 @@

    + <%# if !User.current.member_of?(@project) && show_attachment_tip(@project.id, "Project") %> + + + + + + + <%# end %>
    <%= render :partial => 'project_list',:locals => {project: @project, all_attachments: @all_attachments, sort:@sort, order:@order, project_attachments:@obj_attachments} %> diff --git a/app/views/files/_tip_attachment_count.html.erb b/app/views/files/_tip_attachment_count.html.erb new file mode 100644 index 000000000..b50e7bcaa --- /dev/null +++ b/app/views/files/_tip_attachment_count.html.erb @@ -0,0 +1,15 @@ +共有 <%= @tip_all_attachments %> 个资源 +公共资源:<%= @tip_all_public_attachments %>个 +<% if @project %> + <% if !User.current.member_of?(@project) && params[:tag_name] %> + 私有资源:0个 + <% else %> + 私有资源:<%= @tip_all_private_attachments %>个 + <% end %> +<% elsif @course %> + <% if !User.current.member_of_course?(@course) && params[:tag_name] %> + 私有资源:0个 + <% else %> + 私有资源:<%= @tip_all_private_attachments %>个 + <% end %> +<% end %> diff --git a/app/views/files/_tool_settings.html.erb b/app/views/files/_tool_settings.html.erb index a0ce42eac..5d96d8da2 100644 --- a/app/views/files/_tool_settings.html.erb +++ b/app/views/files/_tool_settings.html.erb @@ -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") %>
      -
    • <%= link_to("发       送".html_safe, 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send('#{file.id}','#{User.current.id}','file')") %>
    • + <% if hidden_unproject_infos %> +
    • <%= link_to("发       送".html_safe, 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send('#{file.id}','#{User.current.id}','file')") %>
    • + <% else %> +
    • <%= link_to("发       送".html_safe, 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send_hidden('#{file.id}','#{User.current.id}','file')") %>
    • + <% end %>
    • <%= link_to '更新版本',attachments_versions_path(file),:class => "postOptionLink",:remote=>true %>
    • <% if project.is_public? %>
    • @@ -20,7 +24,11 @@ <% end %> <% else %>
        -
      • <%= link_to("发  送".html_safe, 'javascript:void(0)',:class => "postOptionLink2",:onclick=>"show_send('#{file.id}','#{User.current.id}','file')") %>
      • + <% if hidden_unproject_infos %> +
      • <%= link_to("发  送".html_safe, 'javascript:void(0)',:class => "postOptionLink2",:onclick=>"show_send('#{file.id}','#{User.current.id}','file')") %>
      • + <% else %> +
      • <%= link_to("发  送".html_safe, 'javascript:void(0)',:class => "postOptionLink2",:onclick=>"show_send_hidden('#{file.id}','#{User.current.id}','file')") %>
      • + <% end %>
      <% end %> <% end %> diff --git a/app/views/files/search_tag_attachment.js.erb b/app/views/files/search_tag_attachment.js.erb index dff75023b..11d4ad297 100644 --- a/app/views/files/search_tag_attachment.js.erb +++ b/app/views/files/search_tag_attachment.js.erb @@ -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 %> diff --git a/app/views/issues/_issue_reply_banner.html.erb b/app/views/issues/_issue_reply_banner.html.erb new file mode 100644 index 000000000..d68b2e38b --- /dev/null +++ b/app/views/issues/_issue_reply_banner.html.erb @@ -0,0 +1,5 @@ +<% count = @issue.journals.count %> +回复<%= count>0 ? "(#{count})" : "" %> + + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>@issue, :user_activity_id=>@issue.id,:type=>"activity"}%> + \ No newline at end of file diff --git a/app/views/issues/_jounal_refresh.js.erb b/app/views/issues/_jounal_refresh.js.erb index 0945ba04d..df3d605f4 100644 --- a/app/views/issues/_jounal_refresh.js.erb +++ b/app/views/issues/_jounal_refresh.js.erb @@ -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 %>"); \ No newline at end of file diff --git a/app/views/issues/show.html.erb b/app/views/issues/show.html.erb index 13642c0ca..40728d451 100644 --- a/app/views/issues/show.html.erb +++ b/app/views/issues/show.html.erb @@ -36,7 +36,9 @@
      -
      回复(<%= @issue.journals.count %>)
      +
      + <%=render :partial => 'issue_reply_banner' %> +
      diff --git a/app/views/layouts/_base_footer.html.erb b/app/views/layouts/_base_footer.html.erb index 7253af03d..bef18d7fc 100644 --- a/app/views/layouts/_base_footer.html.erb +++ b/app/views/layouts/_base_footer.html.erb @@ -26,7 +26,7 @@ <%= link_to image_tag('/images/footer_logo/nudt.png',:size=>'100x30',:alt=>l(:label_co_organizer_NUDT)),"http://www.nudt.edu.cn/special.asp?classid=12", :target => "_blank" %> - <%= link_to image_tag('/images/footer_logo/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" %> <%= 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" %> diff --git a/app/views/layouts/_base_footer_public.html.erb b/app/views/layouts/_base_footer_public.html.erb index 7c5ab571e..18152c745 100644 --- a/app/views/layouts/_base_footer_public.html.erb +++ b/app/views/layouts/_base_footer_public.html.erb @@ -24,7 +24,7 @@ <%= l(:label_sponsor)%>
    • - <%= l(:label_partners)%><%= l(:label_co_organizer_EECS)%> + <%= l(:label_partners)%><%= l(:label_co_organizer_EECS)%>
    • <%= l(:label_co_organizer_BHU)%> diff --git a/app/views/layouts/_course_base_info.html.erb b/app/views/layouts/_course_base_info.html.erb index 09832b66c..c2fe181fe 100644 --- a/app/views/layouts/_course_base_info.html.erb +++ b/app/views/layouts/_course_base_info.html.erb @@ -2,7 +2,7 @@ <% teacher_num = TeacherAndAssistantCount(@course) %> <% student_num = studentCount(@course) %> <% course_file_num = visable_attachemnts_incourse(@course).count %> -

      +

      <%= link_to(@course.teacher.show_name, user_path(@course.teacher), :class => 'sy_cgrey') %>  >  <% if @course.syllabus %> @@ -30,7 +30,16 @@

      邀 请 码
      @@ -54,7 +63,7 @@

      -

      +

      主讲老师:<%= link_to(@course.teacher.show_name, user_path(@course.teacher), :class => 'sy_cblue') %> 学时:<%= @course.class_period %>学时 学期:<%= current_time_and_term @course %> diff --git a/app/views/layouts/_footer.html.erb b/app/views/layouts/_footer.html.erb index a639e1203..affbc61c5 100644 --- a/app/views/layouts/_footer.html.erb +++ b/app/views/layouts/_footer.html.erb @@ -4,7 +4,9 @@

    • <%= l(:label_about_us)%>|
    • 服务协议|
    • -
    • <%= link_to l(:label_surpport_group), "#{Setting.protocol}://#{Setting.host_name}/forums/1/memos/1168", :class => "f_grey mw20", :target=>"_blank" %>|
    • + <% if hidden_unproject_infos %> +
    • <%= link_to l(:label_surpport_group), "#{Setting.protocol}://#{Setting.host_name}/forums/1/memos/1168", :class => "f_grey mw20", :target=>"_blank" %>|
    • + <% end %>
    • <%= l(:label_forums)%>
    @@ -22,7 +24,7 @@ <%= l(:label_partners)%>
  • - <%#= l(:label_co_organizer_EECS)%>北京大学 + <%#= l(:label_co_organizer_EECS)%>北京大学
  • <%#= l(:label_co_organizer_BHU)%>北京航空航天大学 diff --git a/app/views/layouts/_footer_show.html.erb b/app/views/layouts/_footer_show.html.erb index bb29956d3..99e71762d 100644 --- a/app/views/layouts/_footer_show.html.erb +++ b/app/views/layouts/_footer_show.html.erb @@ -4,7 +4,9 @@
  • <%= l(:label_about_us)%>|
  • 服务协议|
  • -
  • <%= link_to l(:label_surpport_group), "javascript:void(0);", :class => "f_grey mw20", :target=>"_blank" %>|
  • + <% if hidden_unproject_infos %> +
  • <%= link_to l(:label_surpport_group), "javascript:void(0);", :class => "f_grey mw20", :target=>"_blank" %>|
  • + <% end %>
  • <%= l(:label_forums)%>
  • @@ -22,7 +24,7 @@ <%= l(:label_partners)%>
  • - <%#= l(:label_co_organizer_EECS)%>北京大学 + <%#= l(:label_co_organizer_EECS)%>北京大学
  • <%#= l(:label_co_organizer_BHU)%>北京航空航天大学 diff --git a/app/views/layouts/_forbidden_new_feedback.html.erb b/app/views/layouts/_forbidden_new_feedback.html.erb new file mode 100644 index 000000000..03c9855f9 --- /dev/null +++ b/app/views/layouts/_forbidden_new_feedback.html.erb @@ -0,0 +1,40 @@ +<%= javascript_include_tag "feedback" %> + +
    +
    +
    + +
    +
    + <% 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) %> + + + <%= l(:label_submit)%> + + <% end %> +
    +
    + + <%#= l(:label_technical_support) %> + + + + Trustie师姐师兄答疑群 +
    +
    +
    +
    +
    +
    + <%= l(:label_submit)%> + +
    +
    diff --git a/app/views/layouts/_homepage_left_course_list.html.erb b/app/views/layouts/_homepage_left_course_list.html.erb new file mode 100644 index 000000000..1f1f03210 --- /dev/null +++ b/app/views/layouts/_homepage_left_course_list.html.erb @@ -0,0 +1,17 @@ +<% all_count = @user.favorite_courses.visible.where("is_delete =?", 0).count%> +
    +
      + <%= render :partial => 'layouts/user_courses', :locals => {:courses => courses,:user => @user,:all_count => all_count,:page => 0} %> +
    +
    +<% if !courses.empty? %> + + + +<% end %> + + \ No newline at end of file diff --git a/app/views/layouts/_homepage_left_project_list.html.erb b/app/views/layouts/_homepage_left_project_list.html.erb new file mode 100644 index 000000000..d3fcaf2b5 --- /dev/null +++ b/app/views/layouts/_homepage_left_project_list.html.erb @@ -0,0 +1,17 @@ +<% all_count = @user.favorite_projects.visible.count%> +
    +
      + <%= render :partial => 'layouts/user_projects', :locals => {:projects => projects,:user => @user, :all_count => all_count, :page => 0} %> +
    +
    +<% if !projects.empty? %> + + + +<% end %> + + \ No newline at end of file diff --git a/app/views/layouts/_logined_header.html.erb b/app/views/layouts/_logined_header.html.erb index 753022d75..1f35c4728 100644 --- a/app/views/layouts/_logined_header.html.erb +++ b/app/views/layouts/_logined_header.html.erb @@ -10,12 +10,14 @@
  • - - + + + <% end %>
    +<% if hidden_unproject_infos %> + <%= render :partial => 'layouts/new_feedback' %> +<% end %> -
    123
    -<%= render :partial => 'layouts/new_feedback' %> + <%= call_hook :view_layouts_base_body_bottom %> diff --git a/app/views/layouts/base_users_new.html.erb b/app/views/layouts/base_users_new.html.erb index c1f6a5644..976de8235 100644 --- a/app/views/layouts/base_users_new.html.erb +++ b/app/views/layouts/base_users_new.html.erb @@ -298,6 +298,7 @@
    + <%= render :partial => 'layouts/new_feedback' %> diff --git a/app/views/layouts/new_base.html.erb b/app/views/layouts/new_base.html.erb index e9703a943..d28171f5f 100644 --- a/app/views/layouts/new_base.html.erb +++ b/app/views/layouts/new_base.html.erb @@ -59,7 +59,9 @@
    <%= render :partial => 'layouts/footer' %>
    -<%= render :partial => 'layouts/new_feedback' %> +<% if hidden_unproject_infos %> + <%= render :partial => 'layouts/new_feedback' %> +<% end %> diff --git a/app/views/layouts/new_base_user.html.erb b/app/views/layouts/new_base_user.html.erb index a107bfe15..7774265aa 100644 --- a/app/views/layouts/new_base_user.html.erb +++ b/app/views/layouts/new_base_user.html.erb @@ -103,12 +103,17 @@
    <% 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? %> - <%=image_tag(url_to_avatar(@user),width:"74", height: "74", :id=>'nh_user_tx') %> +
    + <%=link_to image_tag(url_to_avatar(@user),width:"74", height: "74", :id=>'nh_source_tx'), my_clear_user_avatar_temp_path, :class => "user_leftinfo_img", :remote => true%> +
    + <%=link_to '', my_clear_user_avatar_temp_path, :class => 'homepageEditProfileIcon', :remote => true, :title => '点击编辑Logo' %> +
    +
    <% else %> - - <% end %> + + <%=image_tag(url_to_avatar(@user),width:"74", height: "74", :id=>'nh_source_tx') %> + + <% end %> <% if (@user.user_extensions && (@user.user_extensions.identity != 2) ) %> <% end %> @@ -154,25 +159,13 @@
    - <% hidden_courses = Setting.find_by_name("hidden_courses") %> - <% unvisiable = hidden_courses && hidden_courses.value == "1"%> - <% if !unvisiable %> + <% if hidden_unproject_infos %>
    + <%# 更新访问数,刷新的时候更新访问次数 %> + <% update_visiti_count @user %>
    访问计数 <%= @user.visits.to_i %> (自2016年5月)
    <%= yield %>
    - <%= render :partial => 'layouts/new_feedback' %> + <% if hidden_unproject_infos %> + <%= render :partial => 'layouts/new_feedback' %> + <% end %>
    <%= render :partial => 'layouts/footer' %> @@ -248,53 +235,10 @@ <%= l(:label_loading) %> diff --git a/app/views/my/account.html.erb b/app/views/my/account.html.erb index 71694da60..e58beb8d6 100644 --- a/app/views/my/account.html.erb +++ b/app/views/my/account.html.erb @@ -78,7 +78,7 @@ -
  • <%= text_field_tag :lastname,@user.lastname+@user.firstname,:no_label=>true, :required => true,:nh_required=>"1",:class=>"w210" %> +
  • <%= text_field_tag :lastname,@user.lastname+@user.firstname,:no_label=>true, :required => true,:nh_required=>"1",:class=>"w210" %>姓名不能为空
  • <% if User.current.user_extensions && User.current.user_extensions.gender && User.current.user_extensions.gender == 1 %> @@ -99,8 +99,13 @@

    <% elsif User.current.user_extensions.identity == 3 || User.current.user_extensions.identity == 2 %> - - + <% if User.current.user_extensions.school_id.nil? %> + + + <% else %> + + + <% end %>

    @@ -169,13 +174,13 @@

  • <%= select_tag( 'user[mail_notification]', options_for_select( user_mail_notification_options(@user), @user.mail_notification) ) %> - +
  • <%= f.select :language, :Chinese => :zh, :English => :en %>
  • - 确定 + 确定
  • @@ -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('请选择身份').show(); - e.stopImmediatePropagation(); - return; - } - if( $("input[name='province']").val().trim() != '' && $("input[name='occupation']").val().trim() == ''){ //学校名字和id不对的话 - $("#hint").html('单位名称必须是从下拉列表中选择的,不能手动修改').show(); - e.stopImmediatePropagation(); - return; - } - - //姓名不能为空 - if( $("#lastname").val() == '' ){ - $("#lastname").focus(); - e.stopImmediatePropagation(); - return; - } - - if( $("input[name='province']").val().trim() == '' ){ //学校名字必须填写 - $("#hint").html('高校(单位)名称不能为空').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('请选择身份').show(); +// e.stopImmediatePropagation(); +// return; +// } +// if( $("input[name='province']").val().trim() != '' && $("input[name='occupation']").val().trim() == ''){ //学校名字和id不对的话 +// $("#hint").html('单位名称必须是从下拉列表中选择的,不能手动修改').show(); +// e.stopImmediatePropagation(); +// return; +// } +// +// //姓名不能为空 +// if( $("#lastname").val() == '' ){ +// $("#lastname").focus(); +// $("#last_name_notice").show(); +// e.stopImmediatePropagation(); +// return; +// } +// +// if( $("input[name='province']").val().trim() == '' ){ //学校名字必须填写 +// $("#hint").html('高校(单位)名称不能为空').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('请选择身份').show(); + e.stopImmediatePropagation(); + return; + } + if( $("input[name='province']").val().trim() != '' && $("input[name='occupation']").val().trim() == ''){ //学校名字和id不对的话 + $("#hint").html('单位名称必须是从下拉列表中选择的,不能手动修改').show(); + e.stopImmediatePropagation(); + return; + } + + //姓名不能为空 + if( $("#lastname").val() == '' ){ + $("#lastname").focus(); + $("#last_name_notice").show(); + e.stopImmediatePropagation(); + return; + } + + if( $("input[name='province']").val().trim() == '' ){ //学校名字必须填写 + $("#hint").html('高校(单位)名称不能为空').show(); + e.stopImmediatePropagation(); + return; + } + + if($("#no").is(":visible") == true && $("#no").val() == ""){ + $("#no").focus(); + e.stopImmediatePropagation(); + return; + } + + $('#my_account_form').submit(); +} diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 59aca719b..d153ffe95 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -621,7 +621,7 @@ zh: label_homework_info: 提交情况 #huang label_course_news_description: '课程必须是高校正式开设的课程,或是围绕特定主题定期发布课程资料的公共开放课程;
    如果您想创建一个协作研究空间,请您前往“我的项目”页面创建项目,谢谢!' - 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: 您的缺陷有新回复了。 diff --git a/config/routes.rb b/config/routes.rb index 6cbc0812d..89ebf1064 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -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 diff --git a/db/migrate/20160511055221_merge_two_homeworks.rb b/db/migrate/20160511055221_merge_two_homeworks.rb index a30bc983b..42aabbbd9 100644 --- a/db/migrate/20160511055221_merge_two_homeworks.rb +++ b/db/migrate/20160511055221_merge_two_homeworks.rb @@ -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 diff --git a/db/migrate/20160824073554_add_is_collect_to_members.rb b/db/migrate/20160824073554_add_is_collect_to_members.rb new file mode 100644 index 000000000..17e088398 --- /dev/null +++ b/db/migrate/20160824073554_add_is_collect_to_members.rb @@ -0,0 +1,5 @@ +class AddIsCollectToMembers < ActiveRecord::Migration + def change + add_column :members, :is_collect, :integer, :default => 1 + end +end diff --git a/db/migrate/20160830090214_delete_null_at_messages.rb b/db/migrate/20160830090214_delete_null_at_messages.rb new file mode 100644 index 000000000..304a6bc4e --- /dev/null +++ b/db/migrate/20160830090214_delete_null_at_messages.rb @@ -0,0 +1,17 @@ +class DeleteNullAtMessages < ActiveRecord::Migration + def up + count = AtMessage.all.count / 30 + 2 + transaction do + for i in 1 ... count do i + AtMessage.page(i).per(30).each do |am| + if am.at_message.nil? + am.destroy + end + end + end + end + end + + def down + end +end diff --git a/db/schema.rb b/db/schema.rb index 47b3bf210..b5bd5f778 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20160810081337) do +ActiveRecord::Schema.define(:version => 20160830090214) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -52,28 +52,6 @@ ActiveRecord::Schema.define(:version => 20160810081337) do add_index "api_keys", ["access_token"], :name => "index_api_keys_on_access_token" add_index "api_keys", ["user_id"], :name => "index_api_keys_on_user_id" - create_table "application_settings", :force => true do |t| - t.integer "default_projects_limit" - t.boolean "signup_enabled" - t.boolean "signin_enabled" - t.boolean "gravatar_enabled" - t.text "sign_in_text" - t.datetime "created_at" - t.datetime "updated_at" - t.string "home_page_url" - t.integer "default_branch_protection", :default => 2 - t.boolean "twitter_sharing_enabled", :default => true - t.text "restricted_visibility_levels" - t.boolean "version_check_enabled", :default => true - t.integer "max_attachment_size", :default => 10, :null => false - t.integer "default_project_visibility" - t.integer "default_snippet_visibility" - t.text "restricted_signup_domains" - t.boolean "user_oauth_applications", :default => true - t.string "after_sign_out_path" - t.integer "session_expire_delay", :default => 10080, :null => false - end - create_table "applied_messages", :force => true do |t| t.integer "user_id" t.integer "applied_id" @@ -82,17 +60,16 @@ ActiveRecord::Schema.define(:version => 20160810081337) do t.integer "status", :default => 0 t.datetime "created_at", :null => false t.datetime "updated_at", :null => false + t.string "name" t.integer "applied_user_id" t.integer "role" t.integer "project_id" - t.string "name" end create_table "applied_projects", :force => true do |t| - t.integer "project_id", :null => false - t.integer "user_id", :null => false - t.integer "role", :default => 0 - t.integer "applied_user_id" + t.integer "project_id", :null => false + t.integer "user_id", :null => false + t.integer "role", :default => 0 end create_table "apply_add_schools", :force => true do |t| @@ -207,20 +184,6 @@ ActiveRecord::Schema.define(:version => 20160810081337) do t.string "typeName", :limit => 50 end - create_table "audit_events", :force => true do |t| - t.integer "author_id", :null => false - t.string "type", :null => false - t.integer "entity_id", :null => false - t.string "entity_type", :null => false - t.text "details" - t.datetime "created_at" - t.datetime "updated_at" - end - - add_index "audit_events", ["author_id"], :name => "index_audit_events_on_author_id" - add_index "audit_events", ["entity_id", "entity_type"], :name => "index_audit_events_on_entity_id_and_entity_type" - add_index "audit_events", ["type"], :name => "index_audit_events_on_type" - create_table "auth_sources", :force => true do |t| t.string "type", :limit => 30, :default => "", :null => false t.string "name", :limit => 60, :default => "", :null => false @@ -318,17 +281,6 @@ ActiveRecord::Schema.define(:version => 20160810081337) do add_index "boards", ["last_message_id"], :name => "index_boards_on_last_message_id" add_index "boards", ["project_id"], :name => "boards_project_id" - create_table "broadcast_messages", :force => true do |t| - t.text "message", :null => false - t.datetime "starts_at" - t.datetime "ends_at" - t.integer "alert_type" - t.datetime "created_at" - t.datetime "updated_at" - t.string "color" - t.string "font" - end - create_table "bug_to_osps", :force => true do |t| t.integer "osp_id" t.integer "relative_memo_id" @@ -358,16 +310,14 @@ ActiveRecord::Schema.define(:version => 20160810081337) do add_index "changeset_parents", ["parent_id"], :name => "changeset_parents_parent_ids" create_table "changesets", :force => true do |t| - t.integer "repository_id", :null => false - t.string "revision", :null => false + t.integer "repository_id", :null => false + t.string "revision", :null => false t.string "committer" - t.datetime "committed_on", :null => false + t.datetime "committed_on", :null => false t.text "comments" t.date "commit_date" t.string "scmid" t.integer "user_id" - t.integer "project_id" - t.integer "type", :default => 0 end add_index "changesets", ["committed_on"], :name => "index_changesets_on_committed_on" @@ -647,11 +597,8 @@ ActiveRecord::Schema.define(:version => 20160810081337) do t.string "qrcode" end - add_index "courses", ["id"], :name => "id", :unique => true add_index "courses", ["invite_code"], :name => "index_courses_on_invite_code", :unique => true add_index "courses", ["syllabus_id"], :name => "index_courses_on_syllabus_id" - add_index "courses", ["tea_id"], :name => "tea_id" - add_index "courses", ["visits"], :name => "visits" create_table "custom_fields", :force => true do |t| t.string "type", :limit => 30, :default => "", :null => false @@ -714,15 +661,6 @@ ActiveRecord::Schema.define(:version => 20160810081337) do add_index "delayed_jobs", ["priority", "run_at"], :name => "delayed_jobs_priority" - create_table "deploy_keys_projects", :force => true do |t| - t.integer "deploy_key_id", :null => false - t.integer "project_id", :null => false - t.datetime "created_at" - t.datetime "updated_at" - end - - add_index "deploy_keys_projects", ["project_id"], :name => "index_deploy_keys_projects_on_project_id" - create_table "discuss_demos", :force => true do |t| t.string "title" t.text "body" @@ -772,16 +710,6 @@ ActiveRecord::Schema.define(:version => 20160810081337) do t.datetime "created_at" end - create_table "emails", :force => true do |t| - t.integer "user_id", :null => false - t.string "email", :null => false - t.datetime "created_at" - t.datetime "updated_at" - end - - add_index "emails", ["email"], :name => "index_emails_on_email", :unique => true - add_index "emails", ["user_id"], :name => "index_emails_on_user_id" - create_table "enabled_modules", :force => true do |t| t.integer "project_id" t.string "name", :null => false @@ -804,25 +732,6 @@ ActiveRecord::Schema.define(:version => 20160810081337) do add_index "enumerations", ["id", "type"], :name => "index_enumerations_on_id_and_type" add_index "enumerations", ["project_id"], :name => "index_enumerations_on_project_id" - create_table "events", :force => true do |t| - t.string "target_type" - t.integer "target_id" - t.string "title" - t.text "data" - t.integer "project_id" - t.datetime "created_at" - t.datetime "updated_at" - t.integer "action" - t.integer "author_id" - end - - add_index "events", ["action"], :name => "index_events_on_action" - add_index "events", ["author_id"], :name => "index_events_on_author_id" - add_index "events", ["created_at"], :name => "index_events_on_created_at" - add_index "events", ["project_id"], :name => "index_events_on_project_id" - add_index "events", ["target_id"], :name => "index_events_on_target_id" - add_index "events", ["target_type"], :name => "index_events_on_target_type" - create_table "exercise_answers", :force => true do |t| t.integer "user_id" t.integer "exercise_question_id" @@ -925,15 +834,6 @@ ActiveRecord::Schema.define(:version => 20160810081337) do add_index "forge_messages", ["forge_message_id", "forge_message_type"], :name => "index_forge_messages_on_forge_message_id_and_forge_message_type" add_index "forge_messages", ["user_id", "project_id", "created_at"], :name => "index_forge_messages_on_user_id_and_project_id_and_created_at" - create_table "forked_project_links", :force => true do |t| - t.integer "forked_to_project_id", :null => false - t.integer "forked_from_project_id", :null => false - t.datetime "created_at" - t.datetime "updated_at" - end - - add_index "forked_project_links", ["forked_to_project_id"], :name => "index_forked_project_links_on_forked_to_project_id", :unique => true - create_table "forums", :force => true do |t| t.string "name", :null => false t.text "description" @@ -1063,17 +963,6 @@ ActiveRecord::Schema.define(:version => 20160810081337) do t.datetime "updated_at", :null => false end - create_table "identities", :force => true do |t| - t.string "extern_uid" - t.string "provider" - t.integer "user_id" - t.datetime "created_at" - t.datetime "updated_at" - end - - add_index "identities", ["created_at", "id"], :name => "index_identities_on_created_at_and_id" - add_index "identities", ["user_id"], :name => "index_identities_on_user_id" - create_table "invite_lists", :force => true do |t| t.integer "project_id" t.integer "user_id" @@ -1220,20 +1109,6 @@ ActiveRecord::Schema.define(:version => 20160810081337) do t.integer "private", :default => 0 end - create_table "keys", :force => true do |t| - t.integer "user_id" - t.datetime "created_at" - t.datetime "updated_at" - t.text "key" - t.string "title" - t.string "type" - t.string "fingerprint" - t.boolean "public", :default => false, :null => false - end - - add_index "keys", ["created_at", "id"], :name => "index_keys_on_created_at_and_id" - add_index "keys", ["user_id"], :name => "index_keys_on_user_id" - create_table "kindeditor_assets", :force => true do |t| t.string "asset" t.integer "file_size" @@ -1245,27 +1120,6 @@ ActiveRecord::Schema.define(:version => 20160810081337) do t.integer "owner_type", :default => 0 end - create_table "label_links", :force => true do |t| - t.integer "label_id" - t.integer "target_id" - t.string "target_type" - t.datetime "created_at" - t.datetime "updated_at" - end - - add_index "label_links", ["label_id"], :name => "index_label_links_on_label_id" - add_index "label_links", ["target_id", "target_type"], :name => "index_label_links_on_target_id_and_target_type" - - create_table "labels", :force => true do |t| - t.string "title" - t.string "color" - t.integer "project_id" - t.datetime "created_at" - t.datetime "updated_at" - end - - add_index "labels", ["project_id"], :name => "index_labels_on_project_id" - create_table "member_roles", :force => true do |t| t.integer "member_id", :null => false t.integer "role_id", :null => false @@ -1283,6 +1137,7 @@ ActiveRecord::Schema.define(:version => 20160810081337) do t.boolean "mail_notification", :default => false, :null => false t.integer "course_id", :default => -1 t.integer "course_group_id", :default => 0 + t.integer "is_collect", :default => 1 end add_index "members", ["project_id"], :name => "index_members_on_project_id" @@ -1317,47 +1172,6 @@ ActiveRecord::Schema.define(:version => 20160810081337) do t.integer "viewed_count", :default => 0 end - create_table "merge_request_diffs", :force => true do |t| - t.string "state" - t.text "st_commits", :limit => 2147483647 - t.text "st_diffs", :limit => 2147483647 - t.integer "merge_request_id", :null => false - t.datetime "created_at" - t.datetime "updated_at" - end - - add_index "merge_request_diffs", ["merge_request_id"], :name => "index_merge_request_diffs_on_merge_request_id", :unique => true - - create_table "merge_requests", :force => true do |t| - t.string "target_branch", :null => false - t.string "source_branch", :null => false - t.integer "source_project_id", :null => false - t.integer "author_id" - t.integer "assignee_id" - t.string "title" - t.datetime "created_at" - t.datetime "updated_at" - t.integer "milestone_id" - t.string "state" - t.string "merge_status" - t.integer "target_project_id", :null => false - t.integer "iid" - t.text "description" - t.integer "position", :default => 0 - t.datetime "locked_at" - end - - add_index "merge_requests", ["assignee_id"], :name => "index_merge_requests_on_assignee_id" - add_index "merge_requests", ["author_id"], :name => "index_merge_requests_on_author_id" - add_index "merge_requests", ["created_at", "id"], :name => "index_merge_requests_on_created_at_and_id" - add_index "merge_requests", ["created_at"], :name => "index_merge_requests_on_created_at" - add_index "merge_requests", ["milestone_id"], :name => "index_merge_requests_on_milestone_id" - add_index "merge_requests", ["source_branch"], :name => "index_merge_requests_on_source_branch" - add_index "merge_requests", ["source_project_id"], :name => "index_merge_requests_on_source_project_id" - add_index "merge_requests", ["target_branch"], :name => "index_merge_requests_on_target_branch" - add_index "merge_requests", ["target_project_id", "iid"], :name => "index_merge_requests_on_target_project_id_and_iid", :unique => true - add_index "merge_requests", ["title"], :name => "index_merge_requests_on_title" - create_table "message_alls", :force => true do |t| t.integer "user_id" t.integer "message_id" @@ -1392,39 +1206,6 @@ ActiveRecord::Schema.define(:version => 20160810081337) do add_index "messages", ["last_reply_id"], :name => "index_messages_on_last_reply_id" add_index "messages", ["parent_id"], :name => "messages_parent_id" - create_table "milestones", :force => true do |t| - t.string "title", :null => false - t.integer "project_id", :null => false - t.text "description" - t.date "due_date" - t.datetime "created_at" - t.datetime "updated_at" - t.string "state" - t.integer "iid" - end - - add_index "milestones", ["created_at", "id"], :name => "index_milestones_on_created_at_and_id" - add_index "milestones", ["due_date"], :name => "index_milestones_on_due_date" - add_index "milestones", ["project_id", "iid"], :name => "index_milestones_on_project_id_and_iid", :unique => true - add_index "milestones", ["project_id"], :name => "index_milestones_on_project_id" - - create_table "namespaces", :force => true do |t| - t.string "name", :null => false - t.string "path", :null => false - t.integer "owner_id" - t.datetime "created_at" - t.datetime "updated_at" - t.string "type" - t.string "description", :default => "", :null => false - t.string "avatar" - end - - add_index "namespaces", ["created_at", "id"], :name => "index_namespaces_on_created_at_and_id" - add_index "namespaces", ["name"], :name => "index_namespaces_on_name", :unique => true - add_index "namespaces", ["owner_id"], :name => "index_namespaces_on_owner_id" - add_index "namespaces", ["path"], :name => "index_namespaces_on_path", :unique => true - add_index "namespaces", ["type"], :name => "index_namespaces_on_type" - create_table "news", :force => true do |t| t.integer "project_id" t.string "title", :limit => 60, :default => "", :null => false @@ -1450,31 +1231,6 @@ ActiveRecord::Schema.define(:version => 20160810081337) do t.datetime "updated_at", :null => false end - create_table "notes", :force => true do |t| - t.text "note" - t.string "noteable_type" - t.integer "author_id" - t.datetime "created_at" - t.datetime "updated_at" - t.integer "project_id" - t.string "attachment" - t.string "line_code" - t.string "commit_id" - t.integer "noteable_id" - t.boolean "system", :default => false, :null => false - t.text "st_diff", :limit => 2147483647 - end - - add_index "notes", ["author_id"], :name => "index_notes_on_author_id" - add_index "notes", ["commit_id"], :name => "index_notes_on_commit_id" - add_index "notes", ["created_at", "id"], :name => "index_notes_on_created_at_and_id" - add_index "notes", ["created_at"], :name => "index_notes_on_created_at" - add_index "notes", ["noteable_id", "noteable_type"], :name => "index_notes_on_noteable_id_and_noteable_type" - add_index "notes", ["noteable_type"], :name => "index_notes_on_noteable_type" - add_index "notes", ["project_id", "noteable_type"], :name => "index_notes_on_project_id_and_noteable_type" - add_index "notes", ["project_id"], :name => "index_notes_on_project_id" - add_index "notes", ["updated_at"], :name => "index_notes_on_updated_at" - create_table "notificationcomments", :force => true do |t| t.string "notificationcommented_type" t.integer "notificationcommented_id" @@ -1484,49 +1240,6 @@ ActiveRecord::Schema.define(:version => 20160810081337) do t.datetime "updated_at", :null => false end - create_table "oauth_access_grants", :force => true do |t| - t.integer "resource_owner_id", :null => false - t.integer "application_id", :null => false - t.string "token", :null => false - t.integer "expires_in", :null => false - t.text "redirect_uri", :null => false - t.datetime "created_at", :null => false - t.datetime "revoked_at" - t.string "scopes" - end - - add_index "oauth_access_grants", ["token"], :name => "index_oauth_access_grants_on_token", :unique => true - - create_table "oauth_access_tokens", :force => true do |t| - t.integer "resource_owner_id" - t.integer "application_id" - t.string "token", :null => false - t.string "refresh_token" - t.integer "expires_in" - t.datetime "revoked_at" - t.datetime "created_at", :null => false - t.string "scopes" - end - - add_index "oauth_access_tokens", ["refresh_token"], :name => "index_oauth_access_tokens_on_refresh_token", :unique => true - add_index "oauth_access_tokens", ["resource_owner_id"], :name => "index_oauth_access_tokens_on_resource_owner_id" - add_index "oauth_access_tokens", ["token"], :name => "index_oauth_access_tokens_on_token", :unique => true - - create_table "oauth_applications", :force => true do |t| - t.string "name", :null => false - t.string "uid", :null => false - t.string "secret", :null => false - t.text "redirect_uri", :null => false - t.string "scopes", :default => "", :null => false - t.datetime "created_at" - t.datetime "updated_at" - t.integer "owner_id" - t.string "owner_type" - end - - add_index "oauth_applications", ["owner_id", "owner_type"], :name => "index_oauth_applications_on_owner_id_and_owner_type" - add_index "oauth_applications", ["uid"], :name => "index_oauth_applications_on_uid", :unique => true - create_table "onclick_times", :force => true do |t| t.integer "user_id" t.datetime "onclick_time" @@ -1684,23 +1397,6 @@ ActiveRecord::Schema.define(:version => 20160810081337) do t.integer "allow_teacher", :default => 0 end - create_table "permissions", :force => true do |t| - t.string "controller", :limit => 30, :default => "", :null => false - t.string "action", :limit => 30, :default => "", :null => false - t.string "description", :limit => 60, :default => "", :null => false - t.boolean "is_public", :default => false, :null => false - t.integer "sort", :default => 0, :null => false - t.boolean "mail_option", :default => false, :null => false - t.boolean "mail_enabled", :default => false, :null => false - end - - create_table "permissions_roles", :id => false, :force => true do |t| - t.integer "permission_id", :default => 0, :null => false - t.integer "role_id", :default => 0, :null => false - end - - add_index "permissions_roles", ["role_id"], :name => "permissions_roles_role_id" - create_table "phone_app_versions", :force => true do |t| t.string "version" t.text "description" @@ -1783,11 +1479,6 @@ ActiveRecord::Schema.define(:version => 20160810081337) do t.datetime "updated_at", :null => false end - create_table "project_import_data", :force => true do |t| - t.integer "project_id" - t.text "data" - end - create_table "project_infos", :force => true do |t| t.integer "project_id" t.integer "user_id" @@ -1880,16 +1571,6 @@ ActiveRecord::Schema.define(:version => 20160810081337) do add_index "projects_trackers", ["project_id", "tracker_id"], :name => "projects_trackers_unique", :unique => true add_index "projects_trackers", ["project_id"], :name => "projects_trackers_project_id" - create_table "protected_branches", :force => true do |t| - t.integer "project_id", :null => false - t.string "name", :null => false - t.datetime "created_at" - t.datetime "updated_at" - t.boolean "developers_can_push", :default => false, :null => false - end - - add_index "protected_branches", ["project_id"], :name => "index_protected_branches_on_project_id" - create_table "pull_requests", :force => true do |t| t.integer "pull_request_id" t.integer "gpid" @@ -2046,25 +1727,6 @@ ActiveRecord::Schema.define(:version => 20160810081337) do t.integer "is_teacher_score", :default => 0 end - create_table "services", :force => true do |t| - t.string "type" - t.string "title" - t.integer "project_id" - t.datetime "created_at" - t.datetime "updated_at" - t.boolean "active", :default => false, :null => false - t.text "properties" - t.boolean "template", :default => false - t.boolean "push_events", :default => true - t.boolean "issues_events", :default => true - t.boolean "merge_requests_events", :default => true - t.boolean "tag_push_events", :default => true - t.boolean "note_events", :default => true, :null => false - end - - add_index "services", ["created_at", "id"], :name => "index_services_on_created_at_and_id" - add_index "services", ["project_id"], :name => "index_services_on_project_id" - create_table "settings", :force => true do |t| t.string "name", :default => "", :null => false t.text "value" @@ -2103,26 +1765,6 @@ ActiveRecord::Schema.define(:version => 20160810081337) do t.datetime "updated_at", :null => false end - create_table "snippets", :force => true do |t| - t.string "title" - t.text "content", :limit => 2147483647 - t.integer "author_id", :null => false - t.integer "project_id" - t.datetime "created_at" - t.datetime "updated_at" - t.string "file_name" - t.datetime "expires_at" - t.string "type" - t.integer "visibility_level", :default => 0, :null => false - end - - add_index "snippets", ["author_id"], :name => "index_snippets_on_author_id" - add_index "snippets", ["created_at", "id"], :name => "index_snippets_on_created_at_and_id" - add_index "snippets", ["created_at"], :name => "index_snippets_on_created_at" - add_index "snippets", ["expires_at"], :name => "index_snippets_on_expires_at" - add_index "snippets", ["project_id"], :name => "index_snippets_on_project_id" - add_index "snippets", ["visibility_level"], :name => "index_snippets_on_visibility_level" - create_table "softapplications", :force => true do |t| t.string "name" t.text "description" @@ -2203,10 +1845,11 @@ ActiveRecord::Schema.define(:version => 20160810081337) do t.integer "absence_penalty", :default => 0 t.float "system_score", :default => 0.0 t.boolean "is_test", :default => false - t.float "work_score" t.integer "simi_id" t.integer "simi_value" + t.float "work_score" t.integer "work_status", :default => 0 + t.datetime "commit_time" end add_index "student_works", ["homework_common_id", "user_id"], :name => "index_student_works_on_homework_common_id_and_user_id" @@ -2254,13 +1897,13 @@ ActiveRecord::Schema.define(:version => 20160810081337) do create_table "sub_domains", :force => true do |t| t.integer "org_subfield_id" - t.integer "priority" + t.integer "priority", :default => 0 t.string "name" t.string "field_type" - t.integer "hide" - t.integer "status" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.integer "hide", :default => 0 + t.integer "status", :default => 0 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false end create_table "subfield_subdomain_dirs", :force => true do |t| @@ -2270,17 +1913,6 @@ ActiveRecord::Schema.define(:version => 20160810081337) do t.datetime "updated_at", :null => false end - create_table "subscriptions", :force => true do |t| - t.integer "user_id" - t.integer "subscribable_id" - t.string "subscribable_type" - t.boolean "subscribed" - t.datetime "created_at" - t.datetime "updated_at" - end - - add_index "subscriptions", ["subscribable_id", "subscribable_type", "user_id"], :name => "subscriptions_user_id_and_ref_fields", :unique => true - create_table "syllabuses", :force => true do |t| t.string "title" t.text "description" @@ -2510,8 +2142,9 @@ ActiveRecord::Schema.define(:version => 20160810081337) do t.string "remark" t.integer "groupid" t.integer "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "bindtype", :default => 0 end create_table "users", :force => true do |t| @@ -2541,17 +2174,6 @@ ActiveRecord::Schema.define(:version => 20160810081337) do add_index "users", ["id", "type"], :name => "index_users_on_id_and_type" add_index "users", ["type"], :name => "index_users_on_type" - create_table "users_star_projects", :force => true do |t| - t.integer "project_id", :null => false - t.integer "user_id", :null => false - t.datetime "created_at" - t.datetime "updated_at" - end - - add_index "users_star_projects", ["project_id"], :name => "index_users_star_projects_on_project_id" - add_index "users_star_projects", ["user_id", "project_id"], :name => "index_users_star_projects_on_user_id_and_project_id", :unique => true - add_index "users_star_projects", ["user_id"], :name => "index_users_star_projects_on_user_id" - create_table "versions", :force => true do |t| t.integer "project_id", :default => 0, :null => false t.string "name", :default => "", :null => false @@ -2603,23 +2225,6 @@ ActiveRecord::Schema.define(:version => 20160810081337) do t.datetime "updated_at", :null => false end - create_table "web_hooks", :force => true do |t| - t.string "url" - t.integer "project_id" - t.datetime "created_at" - t.datetime "updated_at" - t.string "type", :default => "ProjectHook" - t.integer "service_id" - t.boolean "push_events", :default => true, :null => false - t.boolean "issues_events", :default => false, :null => false - t.boolean "merge_requests_events", :default => false, :null => false - t.boolean "tag_push_events", :default => false - t.boolean "note_events", :default => false, :null => false - end - - add_index "web_hooks", ["created_at", "id"], :name => "index_web_hooks_on_created_at_and_id" - add_index "web_hooks", ["project_id"], :name => "index_web_hooks_on_project_id" - create_table "wechat_logs", :force => true do |t| t.string "openid", :null => false t.text "request_raw" diff --git a/lib/gitlab-cli/lib/gitlab/client/repositories.rb b/lib/gitlab-cli/lib/gitlab/client/repositories.rb index e998ab56b..80d1058b5 100644 --- a/lib/gitlab-cli/lib/gitlab/client/repositories.rb +++ b/lib/gitlab-cli/lib/gitlab/client/repositories.rb @@ -117,6 +117,11 @@ class Gitlab::Client end alias_method :repo_rep_stats, :rep_stats + def rep_user_stats(project, options={}) + get("/projects/#{project}/repository/rep_user_stats", :query => options) + end + alias_method :repo_rep_stats, :rep_stats + # Gets a tree activities of project repository. # # @example diff --git a/lib/tasks/homework_publishtime.rake b/lib/tasks/homework_publishtime.rake index 5eaeb37cb..2f999384c 100644 --- a/lib/tasks/homework_publishtime.rake +++ b/lib/tasks/homework_publishtime.rake @@ -8,6 +8,22 @@ namespace :homework_publishtime do homework_detail_manual = homework.homework_detail_manual if homework_detail_manual.comment_status == 0 homework_detail_manual.update_column('comment_status', 1) + 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 + sql = "insert into student_works (name, homework_common_id,user_id, created_at, updated_at) values" + str + ActiveRecord::Base.connection.execute sql + end + end course = homework.course course.members.each do |m| homework.course_messages << CourseMessage.new(:user_id => m.user_id, :course_id => course.id, :viewed => false, :status => nil) diff --git a/public/assets/wechat/course_discussion.html b/public/assets/wechat/course_discussion.html index 2395129c3..4e309e6d6 100644 --- a/public/assets/wechat/course_discussion.html +++ b/public/assets/wechat/course_discussion.html @@ -16,7 +16,7 @@
    {{discussion.subject}}
    -
    {{discussion.course_project_name}} - 课程问答区{{discussion.created_on}}
    +
    {{discussion.course_project_name}} - 班级讨论区{{discussion.created_on}}
    diff --git a/public/images/footer_logo/CVICSE.png b/public/images/footer_logo/CVICSE.png index c252e0f93..6fa4566f7 100644 Binary files a/public/images/footer_logo/CVICSE.png and b/public/images/footer_logo/CVICSE.png differ diff --git a/public/images/footer_logo/ISCAS_logo.png b/public/images/footer_logo/ISCAS_logo.png index 7c2eb9ff7..f682f6ee0 100644 Binary files a/public/images/footer_logo/ISCAS_logo.png and b/public/images/footer_logo/ISCAS_logo.png differ diff --git a/public/images/syllabus/sy_icons_star.png b/public/images/syllabus/sy_icons_star.png new file mode 100644 index 000000000..2256346d9 Binary files /dev/null and b/public/images/syllabus/sy_icons_star.png differ diff --git a/public/javascripts/application.js b/public/javascripts/application.js index 0b2e807e6..d576ba42f 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -1153,6 +1153,31 @@ function show_send(id, user_id, send_type){ } } +//为了隐藏非项目功能 +//var sendType = '1'; +var lastSendType ;//初始为发送到我的项目 +function show_send_hidden(id, user_id, send_type){ + if (lastSendType === '1'){ //如果已经发送过一次了,那么就应该沿用上次发送的类型。 + $.ajax({ + type: 'get', + url: '/users/' + user_id + '/search_user_project', + data:{send_id:id, send_type:send_type} + }); + }else if( lastSendType == '2'){//组织 + $.ajax({ + type: 'get', + url: '/users/' + user_id + '/search_user_org', + data:{send_id:id, send_type:send_type} + }); + }else{ + $.ajax({ + type: 'get', + url: '/users/' + user_id + '/search_user_project', + data:{send_id:id, send_type:send_type} + }); + } +} + //id 发送的id //发送的id数组 //send_type:发送的类型,file对应文件,message对应帖子,news对应通知或新闻 @@ -1216,6 +1241,30 @@ function chooseSendType2(res_id,res_ids, user_id, send_type, type){ lastSendType = sendType; } +//隐藏项目其它信息特用 +function chooseSendType2hidden(res_id,res_ids, user_id, send_type, type){ + console.log(res_ids); + sendType = $(".resourcesSendType").val(); + if (sendType === lastSendType) { + return; + } else if(lastSendType != null) { //不是第一次点击的时候 + if (sendType == '1') { + $.ajax({ + type: 'get', + url: '/users/' + user_id + '/search_user_project' + '?' + "&type=" + type, + data:{send_id:res_id, send_ids:res_ids ,send_type:send_type} + }); + }else if(sendType == '2'){ + $.ajax({ + type: 'get', + url: '/users/' + user_id + '/search_user_org' + '?' + "&type=" + type, + data:{send_id:res_id, send_ids:res_ids, send_type:send_type} + }); + } + } + lastSendType = sendType; +} + //组织新建和配置中,选择组织为私有后,disbled掉允许游客下载选项 function disable_down(source, des, hint){ if (source.attr("checked")){ @@ -2099,3 +2148,15 @@ function throttle_me(method, context, e, condition, url){ },500); } +//头像、logo编辑图标显隐 +function edit_img(){ + $(".homepageEditProfile").parent().mouseover(function(){ + $(".homepageEditProfile").show(); + }); + $(".homepageEditProfile").parent().mouseout(function(){ + $(".homepageEditProfile").hide(); + }); +} + +$(document).ready(edit_img); + diff --git a/public/javascripts/avatars.js b/public/javascripts/avatars.js index 05b0df2fe..2d7224119 100644 --- a/public/javascripts/avatars.js +++ b/public/javascripts/avatars.js @@ -39,7 +39,7 @@ ajaxUpload.uploading++; - uploadBlob(file, $(inputEl).data('upload-path'),$(inputEl).data('source-type'), $(inputEl).data('source-id'),{ + uploadBlob(file, $(inputEl).data('upload-path'),$(inputEl).data('source-type'), $(inputEl).data('source-id'),$(inputEl).data('is-direct'),{ loadstartEventHandler: onLoadstart.bind(progressSpan), progressEventHandler: onProgress.bind(progressSpan) }) @@ -82,14 +82,14 @@ return false; } - function uploadBlob(blob, uploadUrl, source_type,source_id, options) { + function uploadBlob(blob, uploadUrl, source_type,source_id,is_direct, options) { var actualOptions = $.extend({ loadstartEventHandler: $.noop, progressEventHandler: $.noop }, options); - uploadUrl = uploadUrl + '?source_type=' + source_type + '&source_id=' + source_id; + uploadUrl = uploadUrl + '?source_type=' + source_type + '&source_id=' + source_id + '&is_direct=' + is_direct; if (blob instanceof window.File) { uploadUrl += '&filename=' + encodeURIComponent(blob.name); } diff --git a/public/javascripts/project.js b/public/javascripts/project.js index 13ed76aa4..4d2c0c91a 100644 --- a/public/javascripts/project.js +++ b/public/javascripts/project.js @@ -607,11 +607,11 @@ function regexTopicDescription() $("#message_content_span").css('color','#ff0000'); return false; } - else if(name.length >=6000){ - $("#message_content_span").text("描述最多3000个汉字(或6000个英文字符)"); - $("#message_content_span").css('color','#ff0000'); - return false; - } +// else if(name.length >=6000){ +// $("#message_content_span").text("描述最多3000个汉字(或6000个英文字符)"); +// $("#message_content_span").css('color','#ff0000'); +// return false; +// } else { $("#message_content_span").text("填写正确"); @@ -621,11 +621,11 @@ function regexTopicDescription() } function submit_topic_project() { -// if(regexTopicSubject() && regexTopicDescription()) -// { + if(regexTopicSubject() && regexTopicDescription()) + { message_content_editor.sync(); $("#message-form-project").submit(); -// } + } } function reset_topic(){ diff --git a/public/stylesheets/css/common.css b/public/stylesheets/css/common.css index fbce13354..c275aec90 100644 --- a/public/stylesheets/css/common.css +++ b/public/stylesheets/css/common.css @@ -398,7 +398,7 @@ a:hover.c_grey{ color:#333;} .fontGrey2 {color:#888888;} .fontGrey3 {color:#484848;} .fontGrey4{color:#999999;} -.fontGrey5 {color:#a1a1a1;} +.fontGrey5 {color:#ddd;} .fontGrey6 {color:#7a7a7a;} .fontGrey7 {color:#555;} .fontBlue {color:#3498db;} diff --git a/public/stylesheets/css/org.css b/public/stylesheets/css/org.css index 3677c8bd8..3ce1eca33 100644 --- a/public/stylesheets/css/org.css +++ b/public/stylesheets/css/org.css @@ -17,14 +17,14 @@ .orgUrlInput {width:200px; outline:none; border:1px solid #eaeaea; height:22px;} a.saveBtn {padding:2px 10px; background-color:#269ac9; color:#ffffff;} a.saveBtn:hover {background-color:#297fb8;} -.orgMemberList {width:420px; float:left;} +.orgMemberList {width:300px; float:left;} .orgColumnList {width:688px; float:left;} .orgListUser {width:110px; float:left;padding-right: 10px;} -.orgListRole {width:180px; float:left;} +.orgListRole {width:100px; float:left;} .orgOrder {width:70px; float:left; text-align:center;} .orgSubNum {width:30px; float:left; text-align:center;} .subNumBlock {cursor:pointer;background-color:#fffce6;color: #0d90c3; width:30px; height:17px; line-height:17px; margin:7px 0; vertical-align:middle;} -.orgMemContainer {width:268px;} +.orgMemContainer {width:378px;} .orgMemberAdd {float:right;} .orgAddSearch {border:1px solid #dddddd; outline:none; width:180px; height:22px; color:#9b9b9b;} diff --git a/public/stylesheets/css/project.css b/public/stylesheets/css/project.css index 1c7563a58..454fce294 100644 --- a/public/stylesheets/css/project.css +++ b/public/stylesheets/css/project.css @@ -498,9 +498,9 @@ a:hover.upload_btn_grey{background:#8a8a8a;} .image-cir {border-radius:50%;} .analysis-genral-icon {position:absolute; padding:1px 5px; display:inline-block; top:5px;} .contribute-list-avatar {width:80px; vertical-align:middle; text-align:center;} -.contribute-list-code {width:160px; vertical-align:middle; text-align:center;} -.contribute-list-problem {width:170px; vertical-align:middle; text-align:center;} -.contribute-list-rate {width:228px; vertical-align:middle; text-align:center;} +.contribute-list-code {width:130px; vertical-align:middle; text-align:center;} +.contribute-list-problem {width:130px; vertical-align:middle; text-align:center;} +.contribute-list-rate {width:168px; vertical-align:middle; text-align:center;} .contribute-list-height {height:80px;} .contribute-list-line-height {line-height:80px;} @@ -551,32 +551,7 @@ a:hover.upload_btn_grey{background:#8a8a8a;} /*新版项目列表新增*/ .new_project_title{ font-size:16px; color:#333; max-width:560px; font-weight:normal;white-space:nowrap; overflow:hidden; text-overflow:ellipsis; } .icons_project_list{ width:8px; height:8px; border:2px solid #fff; background:#3b94d6;-webkit-border-radius:50px;-moz-border-radius:50px;-o-border-radius:50px;border-radius:50px;-webkit-box-shadow: 0px 2px 5px rgba(146, 153, 169, 0.5);-moz-box-shadow: 0px 2px 5px rgba(146, 153, 169, 0.5);box-shadow: 0px 2px 5px rgba(146, 153, 169, 0.5); } +.icons_project_favorite {background: url(/images/syllabus/sy_icons_star.png) 0px 0px no-repeat; width:20px; height:20px; display:block; float:left;} +.icons_project_star{background: url(/images/syllabus/sy_icons_star.png) 0px -27px no-repeat; width:20px; height:20px; display:block; float:left;} .new_projectlist_more{ text-align:center;} .new_projectlist_more a:hover{ color:#3b94d6;} -/*新版项目引用的新版课程大纲中的公共样式*/ -.icons_tishi{ - width: 110px; - height: 110px; - margin: 135px auto 20px; -} -.sy_tab_con_p{ - font-size: 16px; - text-align: center; - margin-bottom:100px; - color:#888; -} -a.sy_btn_green{ - display:inline-block; - color: #fff; - background: #60b25e; - text-align: center; - font-size: 12px; - padding:0 15px; - height: 30px; - line-height: 30px; - -webkit-border-radius:3px; - -moz-border-radius:3px; - -o-border-radius:3px; - border-radius:3px; -} -a:hover.sy_btn_green{ background: #51a74f;} \ No newline at end of file diff --git a/public/stylesheets/css/public.css b/public/stylesheets/css/public.css index f9d344cf3..378fb3ba9 100644 --- a/public/stylesheets/css/public.css +++ b/public/stylesheets/css/public.css @@ -100,7 +100,7 @@ a.sendButtonBlue:hover {color:#ffffff;} a.resourcesTypeAll {background:url(../images/homepage_icon.png) -180px -89px no-repeat; padding-left:23px;} a.resourcesTypeAtt {background:url(../images/homepage_icon.png) -180px -49px no-repeat; padding-left:23px;} a.resourcesTypeUser {background:url(../images/homepage_icon.png) -178px -453px no-repeat; padding-left:23px;} -.resourcesType {width:75px; background-color:#ffffff; float:left; list-style:none; position:absolute; border:1px solid #eaeaea; border-radius:5px; top:15px; padding:10px 20px; left:-90px; font-size:12px; color:#888888; display:none; line-height:2;} +.resourcesType {width:75px; background-color:#ffffff; float:left; list-style:none; position:absolute; border:1px solid #eaeaea; border-radius:5px; top:15px; padding:10px 20px; left:-90px; font-size:12px; color:#888888; display:none; line-height:2; z-index:999;} /*.resourcesUploadBox {float:right; width:103px; height:34px; background-color:#64bdd9; line-height:34px; vertical-align:middle; text-align:center; margin-left:12px;}*/ /*.resourcesUploadBox:hover {background-color:#0781b4;}*/ @@ -1416,6 +1416,40 @@ a:hover.comment_ding_link{ color:#269ac9;} border:1px solid #fcd9b4; height:34px; } -a.syllabusbox_a_blue{ - color:#3b94d6 !important; -} \ No newline at end of file +a.syllabusbox_a_blue { + color: #3b94d6 !important; +} + +.icons_tishi{ + width: 110px; + height: 110px; + margin: 135px auto 20px; +} +.sy_tab_con_p{ + font-size: 16px; + text-align: center; + margin-bottom:100px; + color:#888; +} +a.sy_btn_green{ + display:inline-block; + color: #fff; + background: #60b25e; + text-align: center; + font-size: 12px; + padding:0 15px; + height: 30px; + line-height: 30px; + -webkit-border-radius:3px; + -moz-border-radius:3px; + -o-border-radius:3px; + border-radius:3px; + } +a:hover.sy_btn_green{ background: #51a74f;} + +/*资源提示框*/ +.resource_tip_box {position:absolute; padding:5px 10px; white-space:nowrap; background-color:#fff; right:-150px; top:20px; box-shadow:0px 2px 8px rgba(146, 153, 169, 0.5);} +.resource_tip_box em {display:block; border-width:10px; position:absolute;top:35px; left:-20px; border-style:dashed solid dashed dashed; border-color:transparent #eaeaea transparent transparent; font-size:0; line-height:0;} +.resource_tip_box span {display:block; border-width:10px; position:absolute;top:35px; left:-18px; border-style:dashed solid dashed dashed; border-color:transparent #fff transparent transparent; font-size:0; line-height:0;} + + diff --git a/public/stylesheets/css/structure.css b/public/stylesheets/css/structure.css index 1d2c106e2..7004c0928 100644 --- a/public/stylesheets/css/structure.css +++ b/public/stylesheets/css/structure.css @@ -199,7 +199,7 @@ a.postTypeGrey:hover {color:#269ac9;} .homepagePostBrief {width:720px; margin:0px auto; position:relative;} .homepagePostPortrait {float:left; width:50px;} .homepagePostDes {float:left; width:655px; margin-left:15px; overflow:hidden;} -.homepagePostTo {font-size:14px; color:#484848; margin-bottom:5px;} +.homepagePostTo {font-size:14px; color:#484848; margin-bottom:5px; margin-right: 20px;} .homepagePostTitle {font-size:14px; color:#484848; margin-bottom:5px; font-weight:bold;} .homepagePostSubmitContainer {height:25px; margin-top: 8px; margin-bottom: 5px;} .homepagePostSubmit {font-size:14px; color:#888888; border:1px solid #dddddd; background-color:#eaeaea; float:left; margin-right:20px; padding:0px 10px;} @@ -455,8 +455,8 @@ a.topnav_login_box:hover {color:#a1ebff;} /*底部*/ #Footer{background-color:#ffffff; padding-bottom:15px; color:#666666;} /*margin-bottom:10px;*/ -.footerAboutContainer {width:auto; border-bottom:1px solid #efefef;} -.footerAbout{ width:365px; margin:0 auto;height:35px; line-height:35px; padding-top: 10px;} +.footerAboutContainer {width:auto; border-bottom:1px solid #efefef; text-align:center;} +.footerAbout{margin:0 auto;height:35px; line-height:35px; padding-top: 10px; display:inline-block;} .languageBox {width:55px; height:20px; margin-left:5px; outline:none; color:#666666; border:1px solid #d9d9d9;} .departments{ width:855px; margin:5px auto;height:40px;line-height:40px;} .departments li {height:40px; line-height:40px;} diff --git a/public/stylesheets/sy_public.css b/public/stylesheets/sy_public.css index deeb36c15..454bdcb4a 100644 --- a/public/stylesheets/sy_public.css +++ b/public/stylesheets/sy_public.css @@ -109,21 +109,6 @@ a:hover.btn_green_big{ background: #60b25e; color: #fff; } -a.sy_btn_green{ - display:inline-block; - color: #fff; - background: #60b25e; - text-align: center; - font-size: 12px; - padding:0 15px; - height: 30px; - line-height: 30px; - -webkit-border-radius:3px; - -moz-border-radius:3px; - -o-border-radius:3px; - border-radius:3px; -} -a:hover.sy_btn_green{ background: #51a74f;} /*a.sy_btn_grey{*/ /*color: #333;*/ diff --git a/public/stylesheets/syllabus.css b/public/stylesheets/syllabus.css index 9e6a9817d..d6e7c19e9 100644 --- a/public/stylesheets/syllabus.css +++ b/public/stylesheets/syllabus.css @@ -80,6 +80,8 @@ input.syllabus_input_min{ .icons_sy_setting{background: url(../images/syllabus/icons_syllabus.png) -51px -33px no-repeat; width:20px; height:20px; display:block; position:absolute; right:10px; top:10px; } .icons_sy_setting:hover{background: url(../images/syllabus/icons_syllabus.png) -25px -33px no-repeat; } .icons_sy_cir{background: url(../images/syllabus/icons_syllabus.png) 0px -82px no-repeat; width:15px; height:15px; display:block; position:absolute; left:-8px; top:25px;} +.icons_sy_favorite{background: url(../images/syllabus/sy_icons_star.png) 0px 0px no-repeat; width:20px; height:20px; display:block; position:absolute; left:-10px; top:25px;} +.icons_sy_star{background: url(../images/syllabus/sy_icons_star.png) 0px -27px no-repeat; width:20px; height:20px; display:block; position:absolute; left:-10px; top:25px;} .icons_sy_arrow{background: url(../images/syllabus/icons_syllabus.png) -31px -81px no-repeat; width:20px; height:20px; display:block; } .syllabus_h2_top{ font-size:18px; color:#333; font-weight:normal; padding:10px 15px;border-bottom:1px solid #e7e7e7; } .syllabus_category{ padding:10px 15px; background-color:#f6f6f6; border-bottom:1px solid #e7e7e7;} @@ -94,8 +96,11 @@ input.syllabus_input_min{ .syllabus_class_list_more{padding:8px; text-align:center;border-left:1px solid #e7e7e7;border-bottom:1px solid #e7e7e7;} .syllabus_class_list_more:hover{ background:#ececec;} .syllabus_class_list_more a{ color:#ff7e00;} -.syllabus_class_title{ font-size:14px; color:#333; max-width:480px; margin-bottom:3px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; } +a.syllabus_class_title{ font-size:14px; color:#333; max-width:480px; margin-bottom:3px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; } .syllabus_class_w{ width:650px;} +.syllabus_class_property {font-size:12px; padding:0 5px; border-radius:3px; line-height:14px;} +.syllabus_class_private {color:#ff4a1b; border:1px solid #ff4a1b;} +.syllabus_class_open {color:#7dd26c; border:1px solid #7dd26c;} /*新建页面*/ @@ -164,17 +169,6 @@ input.syllabus_input_min{ border-bottom:none; } /* 课程大纲 */ -.icons_tishi{ - width: 110px; - height: 110px; - margin: 135px auto 20px; -} -.sy_tab_con_p{ - font-size: 16px; - text-align: center; - margin-bottom:100px; - color:#888; -} .sy_classlist{ padding: 15px 15px; border-bottom: 1px dashed #e6e6e6; @@ -320,16 +314,16 @@ a.sy_class_option:hover { } .sy_class_logo{ - width:110px; - height:110px; + width:96px; + height:96px; } .sy_class_id{ - width:108px; - height:78px; + width:94px; + height:70px; border:1px solid #f1f1f1; background:#fff; text-align:center; - padding-top:30px; + padding-top:24px; } .sy_class_id p{ font-size:16px; @@ -375,7 +369,7 @@ a.sy_class_option:hover { line-height: 22px; } -.sy_class_titbox{margin-bottom:5px; padding-top:10px; } +.sy_class_titbox{ padding-top:5px; } a.sy_btn_orange{ display:block; border:1px solid #ee4a1f; @@ -425,9 +419,9 @@ a:hover.sy_btn_orange{ .accordion li > a span { margin-top:15px; - font-size:12px; + font-size:11px; padding: 0 10px; - background: #ccc; + background: #eee; -webkit-border-radius: 15px; -moz-border-radius: 15px; border-radius: 15px; @@ -439,7 +433,7 @@ a:hover.sy_btn_orange{ .accordion > li > a.active span { margin-left:10px; color: #888; - background: #ccc; + background: #ddd; } /* Images */ .accordion > li > a:before {