diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index b95e363cb..5e0ef4638 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -564,6 +564,7 @@ class CoursesController < ApplicationController def delete_member member = @course.members.find params[:member_id] student_role = member.member_roles.where("role_id = 10").first + teacher_role = member.member_roles.where("role_id = 7 || role_id = 9").first if member && member.deletable? && student_role user_admin = CourseInfos.where("user_id = ? and course_id = ?", member.user_id, @course.id) if user_admin.size > 0 @@ -572,8 +573,9 @@ class CoursesController < ApplicationController joined = StudentsForCourse.where('student_id = ? and course_id = ?', member.user_id,@course.id) joined.destroy_all - if member.member_roles.count > 1 + if member.member_roles.count > 1&& student_role && teacher_role student_role.destroy + teacher_role.update_attribute("is_current", 1) member.update_attribute("course_group_id", 0) else member.destroy diff --git a/app/controllers/homework_common_controller.rb b/app/controllers/homework_common_controller.rb index b479fa206..b9a49dbcb 100644 --- a/app/controllers/homework_common_controller.rb +++ b/app/controllers/homework_common_controller.rb @@ -261,20 +261,20 @@ class HomeworkCommonController < ApplicationController work_ids = "(" + @homework.student_works.has_committed.map(&:id).join(",") + ")" if @homework.homework_type != 3 @homework.student_works.has_committed.each do |student_work| - absence_penalty_count = student_work.user.student_works_evaluation_distributions.where("student_work_id IN #{work_ids}").count - student_work.user.student_works_scores.where("student_work_id IN #{work_ids}").count + absence_penalty_count = student_work.user.student_works_evaluation_distributions.where("student_work_id IN #{work_ids}").count - student_work.user.student_works_scores.where("student_work_id IN #{work_ids} and reviewer_role = 3").count student_work.absence_penalty = absence_penalty_count > 0 ? absence_penalty_count * @homework_detail_manual.absence_penalty : 0 student_work.save end else @homework.student_works.has_committed.each do |student_work| - absence_penalty_count = student_work.user.student_works_evaluation_distributions.where("student_work_id IN #{work_ids}").count - student_work.user.student_works_scores.where("student_work_id IN #{work_ids}").count + absence_penalty_count = student_work.user.student_works_evaluation_distributions.where("student_work_id IN #{work_ids}").count - student_work.user.student_works_scores.where("student_work_id IN #{work_ids} and reviewer_role = 3").count student_work.absence_penalty = absence_penalty_count > 0 ? absence_penalty_count * @homework_detail_manual.absence_penalty : 0 student_work.save pros = student_work.student_work_projects.where("is_leader = 0") user_ids = pros.empty? ? "(-1)" : "(" + pros.map{|stu|stu.user_id}.join(",") + ")" student_works = @homework.student_works.where("user_id in #{user_ids}") student_works.each do |st_work| - absence_penalty_count = st_work.user.student_works_evaluation_distributions.where("student_work_id IN #{work_ids}").count - st_work.user.student_works_scores.where("student_work_id IN #{work_ids}").count + absence_penalty_count = st_work.user.student_works_evaluation_distributions.where("student_work_id IN #{work_ids}").count - st_work.user.student_works_scores.where("student_work_id IN #{work_ids} and reviewer_role = 3").count st_work.absence_penalty = absence_penalty_count > 0 ? absence_penalty_count * @homework_detail_manual.absence_penalty : 0 st_work.save end diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 979f2d369..2bdaddb25 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -769,6 +769,14 @@ class ProjectsController < ApplicationController end end + # 配置成员弹框 + def delete_member_pop + @member = Member.find(params[:member].to_i) + respond_to do |format| + format.js + end + end + def close @project.close redirect_to project_url(@project) diff --git a/app/controllers/pull_requests_controller.rb b/app/controllers/pull_requests_controller.rb index bfc2ab9f7..ad60f2b70 100644 --- a/app/controllers/pull_requests_controller.rb +++ b/app/controllers/pull_requests_controller.rb @@ -1,9 +1,10 @@ - +# 如果你对改模块任何功能不清楚,请不要随便改 +# @Hjqreturn 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] + :update_pull_request, :pull_request_comments, :create_pull_request_comment, :compare_pull_request] layout "base_projects" include PullRequestsHelper @@ -46,10 +47,11 @@ class PullRequestsController < ApplicationController end # 主要取源项目和目标项目分支及标识(用户名/版本库名) + # @tip 为空的时候表明发送的pr请求有改动,为1的时候源分支和目标分支没有改动,则不能成功创建 def new # project_menu_type 为了控制base顶部导航 @project_menu_type = 6 - + @tip = params[:show_tip] identifier = get_rep_identifier_by_project @project @source_project_name = "#{get_user_name(@project.user_id)}/#{identifier}" @source_rev = @g.branches(@project.gpid).map{|b| b.name} @@ -84,17 +86,26 @@ class PullRequestsController < ApplicationController description = params[:description] source_branch = params[:source_branch] target_branch = params[:target_branch] + target_project_id = params[:target_project_id] begin - # 如果传送了目标项目ID,则PR请求发至目标项目 - if params[:forked_project_id] && params[:source_project] == "forked_project_name" - target_project_id = params[:forked_project_id].to_i - request = @g.create_merge_request(@project.gpid, title, User.current.gid, :description => description, :source_branch => source_branch, :target_branch => target_branch, :target_project_id => target_project_id) - @fork_project_name = Project.find(@project.forked_from_project_id).try(:name) - @fork_pr_message = true if @fork_project_name + # 如果分支有改动 + if compare_pull_request(source_branch, target_project_id, target_branch) + # 如果传送了目标项目ID即向fork源项目发送请求 + if params[:forked_project_id] && params[:source_project] == "forked_project_name" + target_project_id = params[:forked_project_id].to_i + request = @g.create_merge_request(@project.gpid, title, User.current.gid, :description => description, :source_branch => source_branch, :target_branch => target_branch, :target_project_id => target_project_id) + @fork_project_name = Project.find(@project.forked_from_project_id).try(:name) + @fork_pr_message = true if @fork_project_name + else + request = @g.create_merge_request(@project.gpid, title, User.current.gid, :description => description, :source_branch => source_branch, :target_branch => target_branch) + respond_to do |format| + format.js{redirect_to project_pull_request_path(request.id, :project_id => @project.id)} + end + end else - request = @g.create_merge_request(@project.gpid, title, User.current.gid, :description => description, :source_branch => source_branch, :target_branch => target_branch) + tip = 1 respond_to do |format| - format.js{redirect_to project_pull_request_path(request.id, :project_id => @project.id)} + format.js{redirect_to new_project_pull_request_path(:show_tip => tip)} end end rescue Exception => e @@ -102,8 +113,31 @@ class PullRequestsController < ApplicationController end end + # Compare branch for MR + # 判断源分支和目标分支是否有改动 + # status 为true 表示有改动; false:便是没有改动 + def compare_pull_request source_branch, target_project, target_branch + user_name_source = @project.owner.try(:login) + identifier = @repository.identifier.downcase + git_source_tree = '--git-dir=/home/git/repositories/' + user_name_source + '/' + identifier + '.git' + if target_project + forked_source_project = Project.find(target_project) + user_name_target = forked_source_project.owner.try(:login) + git_target_tree = '--git-dir=/home/git/repositories/' + user_name_target + '/' + identifier + '.git' + git_sourse_commit_id = @g.get_branch_commit_id(@project.gpid, git_source_tree, source_branch) + git_target_commit_id = @g.get_branch_commit_id(forked_source_project.gpid, git_target_tree, target_branch) + else + git_sourse_commit_id = @g.get_branch_commit_id(@project.gpid, git_source_tree, source_branch) + git_target_commit_id = @g.get_branch_commit_id(@project.gpid, git_source_tree, target_branch) + end + status = (git_sourse_commit_id.try(:commit_id) == git_target_commit_id.try(:commit_id) ? false : true) + end + + # @project_menu_type 为了控制base顶部导航 + # merge_when_succeeds def show - # project_menu_type 为了控制base顶部导航 + # compare_pull_request source_project, source_branch, target_project, target_branch + # compare_pull_request @project_menu_type = 6 @type = params[:type] @request = @g.merge_request(@project.gpid, params[:id]) @@ -266,7 +300,7 @@ class PullRequestsController < ApplicationController def find_project_and_repository @project = Project.find(params[:project_id]) render_404 if @project.gpid.blank? - @repository = Repository.where(:project_id => @project.id, :type => "Repository::Gitlab") + @repository = Repository.where(:project_id => @project.id, :type => "Repository::Gitlab").first rescue ActiveRecord::RecordNotFound render_404 end diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 0e8ca71c0..29176550a 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -102,7 +102,8 @@ class RepositoriesController < ApplicationController g = Gitlab.client if User.current.gid.nil? begin - g.sync_user(User.current) + s = Trustie::Gitlab::Sync.new + s.sync_user(User.current) ensure logger.error "Synv user failed ==>#{User.current.id}" end diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index f788efd3f..fb99f6507 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -988,20 +988,20 @@ class StudentWorkController < ApplicationController work_ids = "(" + @homework.student_works.has_committed.map(&:id).join(",") + ")" if @homework.homework_type != 3 @homework.student_works.has_committed.each do |student_work| - absence_penalty_count = student_work.user.student_works_evaluation_distributions.where("student_work_id IN #{work_ids}").count - student_work.user.student_works_scores.where("student_work_id IN #{work_ids}").count + absence_penalty_count = student_work.user.student_works_evaluation_distributions.where("student_work_id IN #{work_ids}").count - student_work.user.student_works_scores.where("student_work_id IN #{work_ids} and reviewer_role = 3").count student_work.absence_penalty = absence_penalty_count > 0 ? absence_penalty_count * homework_detail_manual.absence_penalty : 0 student_work.save end else @homework.student_works.has_committed.each do |student_work| - absence_penalty_count = student_work.user.student_works_evaluation_distributions.where("student_work_id IN #{work_ids}").count - student_work.user.student_works_scores.where("student_work_id IN #{work_ids}").count + absence_penalty_count = student_work.user.student_works_evaluation_distributions.where("student_work_id IN #{work_ids}").count - student_work.user.student_works_scores.where("student_work_id IN #{work_ids} and reviewer_role = 3").count student_work.absence_penalty = absence_penalty_count > 0 ? absence_penalty_count * homework_detail_manual.absence_penalty : 0 student_work.save pros = student_work.student_work_projects.where("is_leader = 0") user_ids = pros.empty? ? "(-1)" : "(" + pros.map{|stu|stu.user_id}.join(",") + ")" student_works = @homework.student_works.where("user_id in #{user_ids}") student_works.each do |st_work| - absence_penalty_count = st_work.user.student_works_evaluation_distributions.where("student_work_id IN #{work_ids}").count - st_work.user.student_works_scores.where("student_work_id IN #{work_ids}").count + absence_penalty_count = st_work.user.student_works_evaluation_distributions.where("student_work_id IN #{work_ids}").count - st_work.user.student_works_scores.where("student_work_id IN #{work_ids} and reviewer_role = 3").count st_work.absence_penalty = absence_penalty_count > 0 ? absence_penalty_count * homework_detail_manual.absence_penalty : 0 st_work.save end diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 3265d273b..56b536d30 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, :cancel_or_collect,:expand_courses,:homepage] + :sort_project_list,:my_homeworks,:manage_or_receive_homeworks,:search_m_r_homeworks, :cancel_or_collect,:expand_courses,:homepage, :user_issues] before_filter :auth_user_extension, only: :show #before_filter :rest_user_score, only: :show #before_filter :select_entry, only: :user_projects @@ -86,6 +86,60 @@ class UsersController < ApplicationController helper :issues include UsersHelper + # 获取我的任务 + # order 排序条件 + # subject 主题:搜索用(注意:搜索和列表调用同一方法,通过参数或者remote区分) + def user_issues + @subject = params[:subject] + # author_id = params[:author_id] + params[:assigned_to_id].to_i == 0 ? @assigned_to = nil : @assigned_to = params[:assigned_to_id].to_i + params[:author_id].to_i == 0 ? author_id = nil : author_id = params[:author_id].to_i + params[:project_id].to_i == 0 ? @project_id = nil : @project_id = params[:project_id] + if @project_id.nil? + if @assigned_to.nil? + if author_id.nil? + @issues = Issue.where("(author_id =? or assigned_to_id =? ) and subject like ?", + @user.id , @user.id, "%#{@subject}%").order('updated_on desc') + else + @issues = Issue.where("author_id =? and subject like ?", + author_id , "%#{@subject}%").order('updated_on desc') + end + else + @issues = Issue.where("assigned_to_id =? and subject like ?", @assigned_to, "%#{@subject}%").order('updated_on desc') + end + + else + if @assigned_to.nil? + if author_id.nil? + @issues = Issue.where("(author_id =? or assigned_to_id =? ) and project_id=? and subject like ?", + (author_id ? author_id : @user.id) , @user.id, @project_id, "%#{@subject}%").order('updated_on desc') + else + @issues = Issue.where("author_id =? and project_id=? and subject like ?", + author_id , @project_id, "%#{@subject}%").order('updated_on desc') + end + else + @issues = Issue.where("assigned_to_id =? and project_id=? and subject like ?", + @assigned_to, @project_id, "%#{@subject}%").order('updated_on desc') + end + end + @issues_filter = Issue.where("author_id =? or assigned_to_id =?", (author_id ? author_id : @user.id) , @user).order('updated_on desc') + @issues_assigned_count = Issue.where("assigned_to_id =? and subject like ?", @user.id, "%#{@subject}%").count + @issues_author_count = Issue.where("author_id =? and subject like ?", @user.id, "%#{@subject}%").count + @issue_open_count = Issue.where(" (author_id =? or assigned_to_id =?) and status_id in (1,2,3,4,6)", (author_id ? author_id : @user.id) , @user).count + @issue_close_count = Issue.where("(author_id =? or assigned_to_id =?) and status_id = 5", (author_id ? author_id : @user.id) , @user.id).count + @issue_count = @issues.count + @limit = 10 + @is_remote = true + @issue_pages = Paginator.new @issue_count, @limit, params['page'] || 1 + @offset ||= @issue_pages.offset + @issues = paginateHelper @issues, @limit + respond_to do |format| + format.html{render :layout => 'static_base'} + format.api + format.js + end + end + #展开所有回复 def show_all_replies case params[:type] diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 992cfcaf0..c52182b01 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -931,7 +931,10 @@ module ApplicationHelper def allow_pull_request project return 0 if project.gpid.nil? g = Gitlab.client - count = g.user_static(project.gpid, :rev => "master").count + # 之所以这样比较是为了解决gitlab本身的bug + commit_count = g.project(project.gpid).try(:commit_count).to_i + git_commit_cout = g.user_static(project.gpid, :rev => "master").count + count = commit_count > git_commit_cout ? commit_count : git_commit_cout count end @@ -3725,7 +3728,7 @@ end def homework_type_option type = [] option0 = [] - option0 << "请选择" + option0 << "请选择作业类型" option0 << 0 option1 = [] option1 << "普通作业" diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb index 7012b3dfa..bda7831fe 100644 --- a/app/helpers/issues_helper.rb +++ b/app/helpers/issues_helper.rb @@ -20,6 +20,8 @@ module IssuesHelper include ApplicationHelper include TagsHelper + require 'iconv' + def issue_list(issues, &block) ancestors = [] issues.each do |issue| @@ -119,10 +121,11 @@ module IssuesHelper end def principals_options_for_isuue_list(project) + conv = Iconv.new("GBK", "utf-8") if User.current.member_of?(project) - project.members.includes(:user).order("lower(users.login)").map{|c| [User.find(c.user_id).show_name, c.user_id]}.unshift(["<< #{l(:label_me)} >>", User.current.id]).unshift(["指派给", 0]) + project.members.includes(:user).sort{|x, y| conv.iconv(x.user.lastname) <=> conv.iconv(y.user.lastname)}.map{|c| [User.find(c.user_id).show_name, c.user_id]}.unshift(["<< #{l(:label_me)} >>", User.current.id]).unshift(["指派给", 0]) else - project.members.includes(:user).order("lower(users.login)").map{|c| [User.find(c.user_id).show_name, c.user_id]}.unshift(["指派给", 0]) + project.members.includes(:user).sort{|x, y| conv.iconv(x.user.lastname) <=> conv.iconv(y.user.lastname)}.map{|c| [User.find(c.user_id).show_name, c.user_id]}.unshift(["指派给", 0]) end end @@ -130,7 +133,6 @@ module IssuesHelper versions = Version.where(:project_id => project, :status => "open").map{|version| [version.name, version.id]}.unshift(["里程碑", 0]) end - def render_issue_subject_with_tree(issue) s = '' ancestors = issue.root? ? [] : issue.ancestors.visible.all diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index 7ca3ff6b7..3dff9c414 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -264,7 +264,9 @@ module ProjectsHelper # Returns a set of options for a select field, grouped by project. def version_options_for_select(versions, selected=nil) + project_name = versions.blank? ? "" : versions.first.project.name grouped = Hash.new {|h,k| h[k] = []} + grouped[project_name] << ["请选择里程碑", 0] versions.each do |version| grouped[version.project.name] << [version.name, version.id] end diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb index 95cd844f3..228e83080 100644 --- a/app/helpers/users_helper.rb +++ b/app/helpers/users_helper.rb @@ -29,6 +29,30 @@ module UsersHelper ["#{l(:status_locked)} (#{user_count_by_status[3].to_i})", '3']], selected.to_s) end + def issue_list(issues, &block) + ancestors = [] + issues.each do |issue| + while (ancestors.any? && !issue.is_descendant_of?(ancestors.last)) + ancestors.pop + end + yield issue, ancestors.size + ancestors << issue unless issue.leaf? + end + end + + # 我的issue 来源 + def options_for_issue_project_list( issues ) + issues = issues.group_by{|issue| issue.project_id} + issues.map{ |issue| [Project.find(issue[0]).name, issue[0]]}.unshift(["来源", 0]) + end + + # 我的issue指派给我 + def options_for_my_issue_list(issues) + # issues = issues.group_by{|issue| issue.assigned_to_id } + # issues.map{ |issue| [User.find(issue[0]).show_name, issue[0]]}.unshift(["指派给", 0]) + + end + def get_resource_type type case type when 'Course' diff --git a/app/models/dts.rb b/app/models/dts.rb index 3a9dcbcfb..cf5037eb2 100644 --- a/app/models/dts.rb +++ b/app/models/dts.rb @@ -1,5 +1,5 @@ class Dts < ActiveRecord::Base attr_accessible :Category, :Defect, :Description, :File, :IPLine, :IPLineCode, :Method, :Num, :PreConditions, :Review, :StartLine, :TraceInfo, :Variable, :project_id - belongs_to :project + # belongs_to :project end diff --git a/app/models/homework_common.rb b/app/models/homework_common.rb index c87cd3d42..3690df1f3 100644 --- a/app/models/homework_common.rb +++ b/app/models/homework_common.rb @@ -15,7 +15,7 @@ class HomeworkCommon < ActiveRecord::Base has_one :homework_detail_group, :dependent => :destroy has_many :student_work_projects, :dependent => :destroy has_many :homework_tests, :dependent => :destroy - has_many :student_works, :dependent => :destroy, :conditions => "is_test=0" + has_many :student_works, :dependent => :destroy, :conditions => "is_test=0 and is_delete != 1" has_many :student_works_evaluation_distributions, :through => :student_works #一个作业的分配的匿评列表 has_many :journals_for_messages, :as => :jour, :dependent => :destroy has_many :apply_homeworks, :dependent => :destroy diff --git a/app/models/issue.rb b/app/models/issue.rb index 9c3c8d168..1b47d80cc 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -853,7 +853,8 @@ class Issue < ActiveRecord::Base def assignable_versions return @assignable_versions if @assignable_versions - versions = project.shared_versions.open.all + # versions = project.shared_versions.open.all + versions = Version.where(:project_id => project.id, :status => "open").order("created_on desc") if fixed_version if fixed_version_id_changed? # nothing to do @@ -865,7 +866,7 @@ class Issue < ActiveRecord::Base versions << fixed_version end end - @assignable_versions = versions.uniq.sort + @assignable_versions = versions.uniq end # Returns true if this issue is blocked by another issue that is still open diff --git a/app/models/project.rb b/app/models/project.rb index 0ac10fb2b..8300daf82 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -82,7 +82,7 @@ class Project < ActiveRecord::Base has_one :course_extra, :class_name => 'Course', :foreign_key => :extra,:primary_key => :identifier, :dependent => :destroy has_many :applied_projects, :dependent => :destroy has_many :invite_lists, :dependent => :destroy - has_one :dts + # has_one :dts has_many :organizations,:through => :org_projects # end diff --git a/app/models/students_for_course.rb b/app/models/students_for_course.rb index 767d65b10..d9bf96770 100644 --- a/app/models/students_for_course.rb +++ b/app/models/students_for_course.rb @@ -9,11 +9,21 @@ class StudentsForCourse < ActiveRecord::Base validates_uniqueness_of :student_id, :scope => :course_id after_destroy :delete_student_works + after_create :recovery_student_works + #退出班级或删除学生时隐藏学生的作品 def delete_student_works course = self.course homework_ids = course.homework_commons.blank? ? "(-1)" : "(" + course.homework_commons.map{|hw| hw.id}.join(",") + ")" student_works = StudentWork.where("user_id = #{self.student_id} && homework_common_id in #{homework_ids}") - student_works.destroy_all + student_works.update_all(:is_delete => 1) + end + + #加入班级时还原作品 + def recovery_student_works + course = self.course + homework_ids = course.homework_commons.blank? ? "(-1)" : "(" + course.homework_commons.map{|hw| hw.id}.join(",") + ")" + student_works = StudentWork.where("user_id = #{self.student_id} && homework_common_id in #{homework_ids}") + student_works.update_all(:is_delete => 0) end end diff --git a/app/models/user.rb b/app/models/user.rb index 99b39543e..d6e4eb715 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -323,6 +323,7 @@ class User < Principal # id 转换成 登录名 # 如果是整数就去ID,否则就取login + # 含有特殊符号的则显示ID def to_param (self.login.to_i.to_s == self.login || self.login.include?(".") || self.login.include?("%") || self.login.include?("?")) ? id : login end diff --git a/app/services/courses_service.rb b/app/services/courses_service.rb index f72623d84..43bdf9e09 100644 --- a/app/services/courses_service.rb +++ b/app/services/courses_service.rb @@ -452,12 +452,20 @@ class CoursesService @state = 2 return @state end - @member = Member.where('course_id = ? and user_id = ?', params[:object_id], user.id) - if @member.nil? || @member.count == 0 + @member = Member.where('course_id = ? and user_id = ?', params[:object_id], user.id).first + if @member.nil? @state = 1 return @state end - @member.first.destroy + student_role = @member.member_roles.where("role_id = 10").first + teacher_role = @member.member_roles.where("role_id = 7 || role_id = 9").first + if @member.member_roles.count > 1 && student_role && teacher_role + student_role.destroy + teacher_role.update_attribute("is_current", 1) + @member.update_attribute("course_group_id", 0) + else + @member.destroy + end joined = StudentsForCourse.where('student_id = ? and course_id = ?', user.id, params[:object_id]) joined.each do |join| join.destroy diff --git a/app/views/common/403.html b/app/views/common/403.html index 78dc6dae7..dcfeb9f41 100644 --- a/app/views/common/403.html +++ b/app/views/common/403.html @@ -17,7 +17,8 @@ $(function(){ if(window.history.length == 1) { - $("#history_back").css("background","#CCC"); + $("#history_back").css("color","#CCC"); + $("#history_back").css("cursor","default"); } $("#subject").keydown(function(){ var curLength=$("#subject").val().length; @@ -50,7 +51,7 @@ 您没有访问权限,请先获取相应权限。 返回上页>> 给我留言>> - QQ反馈>> + QQ反馈>>

+<% elsif User.current.logged? && User.current.member_of_course?(@course) %> +
+ +
<% end %>
@@ -84,7 +96,7 @@ <% elsif is_teacher && is_ST %> <%= link_to '学生身份', switch_role_course_path(@course, :user_id => User.current.id, :curr_role => (is_TA ? 7 : 9), :tar_role => 10), :class => "sy_btn_orange mr10 fl", :title => "由教师身份切换至学生身份" %> <% end %> - <% unless (is_teacher || is_TA || is_TE) %> + <% unless (is_teacher || is_TA || is_TE || is_ST) %>
<%= join_in_course_header(@course, User.current) %>
<% end %> diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb index 19f7694b3..957f720be 100644 --- a/app/views/layouts/base_courses.html.erb +++ b/app/views/layouts/base_courses.html.erb @@ -276,6 +276,13 @@ $("#expand_tools_expand a").addClass('active'); $("#navContentCourse").toggle(); }); + + function delete_confirm(){ + var htmlvalue = '

提示

'+ + '

您确认要退出该班级吗?

确  定'+ + '取  消
'; + pop_box_new(htmlvalue, 300, 140); + } \ No newline at end of file diff --git a/app/views/layouts/new_base_user.html.erb b/app/views/layouts/new_base_user.html.erb index b79e5864e..07be357dc 100644 --- a/app/views/layouts/new_base_user.html.erb +++ b/app/views/layouts/new_base_user.html.erb @@ -204,9 +204,9 @@
  • <%= link_to "加入项目", applied_join_project_path, :remote => true, :method => "post", :style => "font-size:14px;" %>
  • - - - +
  • + <%= link_to "我的Issue", user_issues_user_path(@user), :style => "font-size:14px;" %> +
  • <% end %> diff --git a/app/views/repositories/_top.html.erb b/app/views/repositories/_top.html.erb index bc26ba2b0..1684c4975 100644 --- a/app/views/repositories/_top.html.erb +++ b/app/views/repositories/_top.html.erb @@ -1,5 +1,6 @@

    - <%=link_to @project.owner, user_path(@project.owner), :class => "repository-title-dec" %> / <%= link_to @project.name, project_path(@project), :class => "repository-title-dec" %> + <%=link_to @project.owner, user_path(@project.owner), :class => "repository-title-dec" %> / + <%=link_to @repository.identifier,({:controller => 'repositories', :action => 'show', :id => @project, :repository_id => gitlab_repository(@project).try(:identifier)}), :class => "repository-title-dec" %>

    \ No newline at end of file diff --git a/app/views/syllabuses/_syllabus_course_list.html.erb b/app/views/syllabuses/_syllabus_course_list.html.erb index 41566fbc8..1ce62a1b4 100644 --- a/app/views/syllabuses/_syllabus_course_list.html.erb +++ b/app/views/syllabuses/_syllabus_course_list.html.erb @@ -67,11 +67,11 @@ <% else %> <%= link_to "加入班级",join_private_courses_courses_path,:remote => true,:class => "hw_btn_green fr mt5",:method => "post"%> <% end %> - <% if User.current.allowed_to?(:as_teacher, course) || User.current.admin? %> + <% if User.current == course.teacher || User.current.admin? %> 归档 <% end %> <% else %> - <% if User.current.allowed_to?(:as_teacher, course) || User.current.admin? %> + <% if User.current == course.teacher || User.current.admin? %> 恢复 <% end %> <% end %> diff --git a/app/views/users/_all_issue_list.html.erb b/app/views/users/_all_issue_list.html.erb new file mode 100644 index 000000000..cc33fc95d --- /dev/null +++ b/app/views/users/_all_issue_list.html.erb @@ -0,0 +1,23 @@ +<% issue_list(issues) do |issue| -%> + + <%= render :partial => 'users/my_issue_list', :locals => {:activity => issue, :user_activity_id => issue.id} %> +<% end %> + +
    +
    + + +
    +
    + +
    +
    +
    diff --git a/app/views/users/_collect_project.html.erb b/app/views/users/_collect_project.html.erb index 99bbea3df..f12579ef5 100644 --- a/app/views/users/_collect_project.html.erb +++ b/app/views/users/_collect_project.html.erb @@ -1,7 +1,7 @@ <% member = Member.where("user_id = #{@user.id} and project_id = #{project.id}").first %> <% if User.current == @user %> <% if member %> - <%= link_to "", cancel_or_collect_user_path(@user, :project => project.id), :class => "#{member.is_collect == 1 ? 'icons_project_favorite mt3' : 'icons_project_star mt3'}",:target => '_blank', :remote => true, :title => "#{member.is_collect == 1 ? '点击将其从个人主页的班级列表中移除' : '点击将其添加至个人主页的班级列表中'}" %> + <%= link_to "", cancel_or_collect_user_path(@user, :project => project.id), :class => "#{member.is_collect == 1 ? 'icons_project_favorite mt3' : 'icons_project_star mt3'}",:target => '_blank', :remote => true, :title => "#{member.is_collect == 1 ? '点击将其从个人主页的项目列表中移除' : '点击将其添加至个人主页的项目列表中'}" %> <% end %> <% else %> <% if member %> diff --git a/app/views/users/_my_issue_assigned_filter.html.erb b/app/views/users/_my_issue_assigned_filter.html.erb new file mode 100644 index 000000000..52994bf85 --- /dev/null +++ b/app/views/users/_my_issue_assigned_filter.html.erb @@ -0,0 +1 @@ +<%= @issues_assigned_count %> \ No newline at end of file diff --git a/app/views/users/_my_issue_filter_all.html.erb b/app/views/users/_my_issue_filter_all.html.erb new file mode 100644 index 000000000..64242df9b --- /dev/null +++ b/app/views/users/_my_issue_filter_all.html.erb @@ -0,0 +1 @@ +<%= @issue_count %> \ No newline at end of file diff --git a/app/views/users/_my_issue_list.html.erb b/app/views/users/_my_issue_list.html.erb new file mode 100644 index 000000000..e214a27ed --- /dev/null +++ b/app/views/users/_my_issue_list.html.erb @@ -0,0 +1,98 @@ +<% unless activity.author.nil? %> +
    +
    + <% if activity.status_id.to_i == 5 %> + + <% else %> + + <% end %> +
    +
    + +
    + <%# if activity.try(:author).try(:realname) == ' ' %> + <%#= link_to activity.try(:author), user_path(activity.author_id), :class => "fl issues_list_name" %> + <%# else %> + <%#= link_to activity.try(:author).try(:realname), user_path(activity.author_id), :class => "fl issues_list_name" %> + <%# end %> + +

    <%= format_time(activity.created_on) %> 发布

    +

    <%= format_time(activity.updated_on) %> 更新

    +
    +
    + +
    +<% end %> + + + diff --git a/app/views/users/_selector_for_messages.html.erb b/app/views/users/_selector_for_messages.html.erb index 1e2e40e06..915c9dee9 100644 --- a/app/views/users/_selector_for_messages.html.erb +++ b/app/views/users/_selector_for_messages.html.erb @@ -19,7 +19,7 @@
  • 项目消息
  • <%= link_to "项目任务", user_message_path(User.current, :type => 'issue'), :class => "homepageTypePTask postTypeGrey" %>
  • <%= link_to "项目讨论", user_message_path(User.current, :type => 'forge_message'), :class => "homepagePostTypeForum postTypeGrey" %>
  • -
  • <%= link_to "项目新闻", user_message_path(User.current, :type => 'forge_news'), :class => "homepageTypePNews postTypeGrey" %>
  • +
  • <%= link_to "加入项目", user_message_path(User.current, :type => 'apply'), :class => "homepageTypeUApply postTypeGrey" %>
  • diff --git a/app/views/users/_user_homework_form.html.erb b/app/views/users/_user_homework_form.html.erb index 32ca4e50e..19a4abb5a 100644 --- a/app/views/users/_user_homework_form.html.erb +++ b/app/views/users/_user_homework_form.html.erb @@ -4,10 +4,17 @@ <%= javascript_include_tag 'homework','baiduTemplate' %> + + +
    +
    +

    我的Issue

    +
    +
    + + +
    + <%= form_tag( user_issues_user_path(@user), :remote=>'xls', :method => "post", :id=>"issue_query_form", :class => 'query_form') do %> +
    + + 清除 + +
    + +
    + +
    +
    + + <%= select( :project, :project_id, options_for_issue_project_list(@issues_filter), + { :include_blank => false,:selected => @project_id ? @project_id : 0 }, + { :onchange => "remote_function();add_style();",:id => "proeject_id", :name => "project_id", :class => "fl", :style=>"width: 80px; margin-right:20px;"} + )%> + + <%= select( :issue, :user_id, [[@user.show_name, @user.id]].unshift(["发布人",0]), + { :include_blank => false,:selected => @author_id ? @author_id : 0}, + {:onchange => "remote_function();add_style();",:id => "author_id", :name => "author_id", :class => "fl", :style => "visibility:hidden;width: 0px;margin:0px;padding:0px;"} + ) + %> + + + + <%= select( :issue, :user_id, [[@user.show_name, @user.id]].unshift(["指派给",0]), + { :include_blank => false, :selected => @assigned_to ? @assigned_to : 0}, + {:onchange=>"remote_function();add_style();",:id=>"assigned_to_id",:name=>"assigned_to_id",:class=>"fl", :style => "visibility:hidden; width:0px;margin:0px;padding:0px;"} ) + %> + + + + + +
    +
    +
    + <% end %> + <% if @issues.empty? %> +

    <%= l(:label_no_data) %>

    + <% else %> +
    + <%= render :partial => 'users/all_issue_list', :locals => {:issues => @issues, :issue_pages => @issue_pages,:issue_count => @issue_count, :subject => @subject } %> +
    + <% end %> +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + + + + + diff --git a/app/views/users/user_issues.js.erb b/app/views/users/user_issues.js.erb new file mode 100644 index 000000000..0c7f67ac1 --- /dev/null +++ b/app/views/users/user_issues.js.erb @@ -0,0 +1,3 @@ +$("#issue_filter_all").html("<%= escape_javascript(render :partial => 'users/my_issue_filter_all') %>"); +$("#issue_list").html("<%= escape_javascript(render :partial => 'users/all_issue_list',:locals => {:issues => @issues, :issue_pages=> @issue_pages, :issue_count => @issue_count })%>"); +$("#issue_list_pagination").html('<%= pagination_links_full @issue_pages, @issue_count, :issues => @issues, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true %>'); \ No newline at end of file diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 58efcc55f..ac18cda3e 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -1020,7 +1020,7 @@ zh: text_wiki_page_destroy_children: 删除子页面及其所有下级页面 text_wiki_page_reassign_children: 将子页面的上级页面设置为 text_own_membership_delete_confirmation: 你正在删除你现有的某些或全部权限,如果这样做了你可能将会再也无法编辑该课程了。你确定要继续吗? - text_own_membership_for_project_confirmation: 你正在删除现有的某些或全部权限,如果这样做了你可能将会再也无法编辑该项目了。你确定要继续吗? + text_own_membership_for_project_confirmation: 您正要将自己从项目中删除,如果继续,您将失去编辑该项目的权限。您是否确定要继续 text_zoom_in: 放大 text_zoom_out: 缩小 text_applied_project: "用户 %{id} 申请加入项目 %{project}" @@ -1270,7 +1270,7 @@ zh: #added by liuping - label_delete_confirm: 确认删除? + label_delete_confirm: 您是否确认删除? label_tags_bid: 需求名称 label_tags_syllabus_name: 课程名称 label_tags_course_name: 班级名称 diff --git a/config/routes.rb b/config/routes.rb index 781b5acbd..3848c4b46 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -641,6 +641,7 @@ RedmineApp::Application.routes.draw do get 'edit_brief_introduction' get "user_resource" + match "user_issues", :to => 'users#user_issues', :via => [:get, :post], :as => "user_issues" get "import_resources" get "import_resources_search" post "import_into_container" @@ -799,6 +800,7 @@ RedmineApp::Application.routes.draw do post 'close' post 'reopen' get 'forked_pop' + get 'delete_member_pop', :to => 'projects#delete_member_pop', :via => :get, :as => "delete_member_pop" get 'search_public_orgs_not_in_project' match 'copy', :via => [:get, :post] match 'set_public_or_private', :via => [:post] diff --git a/db/migrate/20161115082005_remove_column_to_projects.rb b/db/migrate/20161115082005_remove_column_to_projects.rb new file mode 100644 index 000000000..dc5febe7f --- /dev/null +++ b/db/migrate/20161115082005_remove_column_to_projects.rb @@ -0,0 +1,8 @@ +class RemoveColumnToProjects < ActiveRecord::Migration + def up + remove_column :projects, :commits_count, :issues_count, :attachments_count, :boards_count, :news_count, :acts_count, :journals_count, :boards_reply_count + end + + def down + end +end diff --git a/db/migrate/20161117015856_add_is_delete_to_student_works.rb b/db/migrate/20161117015856_add_is_delete_to_student_works.rb new file mode 100644 index 000000000..f6b3abdd6 --- /dev/null +++ b/db/migrate/20161117015856_add_is_delete_to_student_works.rb @@ -0,0 +1,5 @@ +class AddIsDeleteToStudentWorks < ActiveRecord::Migration + def change + add_column :student_works, :is_delete, :integer, :default => 0 + end +end diff --git a/db/schema.rb b/db/schema.rb index b645ba5ad..2739d5dcd 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -325,14 +325,16 @@ ActiveRecord::Schema.define(:version => 20161117060138) 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" @@ -516,20 +518,6 @@ ActiveRecord::Schema.define(:version => 20161117060138) do t.integer "container_id", :default => 0 end - create_table "course_class_post", :id => false, :force => true do |t| - t.integer "班级id", :default => 0, :null => false - t.string "班级名" - t.integer "帖子id", :default => 0, :null => false - t.integer "主贴id" - t.string "帖子标题", :default => "", :null => false - t.text "帖子内容" - t.integer "帖子用户id" - t.integer "帖子回复数", :default => 0, :null => false - t.integer "最后回帖id" - t.datetime "发帖时间", :null => false - t.datetime "帖子更新时间", :null => false - end - create_table "course_contributor_scores", :force => true do |t| t.integer "course_id" t.integer "user_id" @@ -1008,6 +996,10 @@ ActiveRecord::Schema.define(:version => 20161117060138) do t.datetime "updated_at", :null => false end + create_table "innodb_monitor", :id => false, :force => true do |t| + t.integer "a" + end + create_table "invite_lists", :force => true do |t| t.integer "project_id" t.integer "user_id" @@ -1595,17 +1587,13 @@ ActiveRecord::Schema.define(:version => 20161117060138) do t.boolean "hidden_repo", :default => false, :null => false t.integer "attachmenttype", :default => 1 t.integer "user_id" - t.integer "dts_test", :default => 0 t.string "enterprise_name" t.integer "organization_id" t.integer "project_new_type" t.integer "gpid" t.integer "forked_from_project_id" t.integer "forked_count" - t.integer "commits_count", :default => 0 t.integer "publish_resource", :default => 0 - t.integer "issues_count", :default => 0 - t.integer "attachments_count", :default => 0 t.integer "boards_count", :default => 0 t.integer "news_count", :default => 0 t.integer "acts_count", :default => 0 diff --git a/lib/gitlab-cli/lib/gitlab/client/repositories.rb b/lib/gitlab-cli/lib/gitlab/client/repositories.rb index 3630f40dd..60c58ef98 100644 --- a/lib/gitlab-cli/lib/gitlab/client/repositories.rb +++ b/lib/gitlab-cli/lib/gitlab/client/repositories.rb @@ -86,6 +86,11 @@ class Gitlab::Client get("/projects/#{project}/repository/user_static", :query => options) end + def get_branch_commit_id(project, git_tree, ref_name) + get("/projects/#{project}/repository/get_branch_commit_id?git_tree=#{git_tree}&ref_name=#{ref_name}") + end + + # Gets a specific commit identified by the commit hash or name of a branch or tag. # # @example diff --git a/lib/tasks/homework_evaluation.rake b/lib/tasks/homework_evaluation.rake index 2252bdaf5..7494e80f8 100644 --- a/lib/tasks/homework_evaluation.rake +++ b/lib/tasks/homework_evaluation.rake @@ -84,13 +84,13 @@ namespace :homework_evaluation do work_ids = "(" + homework_common.student_works.has_committed.map(&:id).join(",") + ")" if homework_common.homework_type != 3 homework_common.student_works.has_committed.each do |student_work| - absence_penalty_count = student_work.user.student_works_evaluation_distributions.where("student_work_id IN #{work_ids}").count - student_work.user.student_works_scores.where("student_work_id IN #{work_ids}").count + absence_penalty_count = student_work.user.student_works_evaluation_distributions.where("student_work_id IN #{work_ids}").count - student_work.user.student_works_scores.where("student_work_id IN #{work_ids} and reviewer_role = 3").count student_work.absence_penalty = absence_penalty_count > 0 ? absence_penalty_count * homework_detail_manual.absence_penalty : 0 student_work.save end else homework_common.student_works.has_committed.each do |student_work| - absence_penalty_count = student_work.user.student_works_evaluation_distributions.where("student_work_id IN #{work_ids}").count - student_work.user.student_works_scores.where("student_work_id IN #{work_ids}").count + absence_penalty_count = student_work.user.student_works_evaluation_distributions.where("student_work_id IN #{work_ids}").count - student_work.user.student_works_scores.where("student_work_id IN #{work_ids} and reviewer_role = 3").count student_work.absence_penalty = absence_penalty_count > 0 ? absence_penalty_count * homework_detail_manual.absence_penalty : 0 student_work.save if student_work.absence_penalty != 0 @@ -98,7 +98,7 @@ namespace :homework_evaluation do user_ids = pros.empty? ? "(-1)" : "(" + pros.map{|stu|stu.user_id}.join(",") + ")" student_works = homework_common.student_works.where("user_id in #{user_ids}") student_works.each do |st_work| - absence_penalty_count = st_work.user.student_works_evaluation_distributions.where("student_work_id IN #{work_ids}").count - st_work.user.student_works_scores.where("student_work_id IN #{work_ids}").count + absence_penalty_count = st_work.user.student_works_evaluation_distributions.where("student_work_id IN #{work_ids}").count - st_work.user.student_works_scores.where("student_work_id IN #{work_ids} and reviewer_role = 3").count st_work.absence_penalty = absence_penalty_count > 0 ? absence_penalty_count * @homework_detail_manual.absence_penalty : 0 st_work.save end diff --git a/public/500.html b/public/500.html index 1890e545f..10fa81023 100644 --- a/public/500.html +++ b/public/500.html @@ -1,8 +1,13 @@ + Trustie 500 error - + +
    - -

    网站正在维护,请稍后重试。 - 返回上页>> - 给我留言>> - QQ反馈>> + +

    网站正在维护,请稍后重试。 + 返回上页>> + QQ反馈>>

    - -
    diff --git a/public/images/sy/icons_sy.png b/public/images/sy/icons_sy.png index b019fc9ad..2897052b8 100644 Binary files a/public/images/sy/icons_sy.png and b/public/images/sy/icons_sy.png differ diff --git a/public/javascripts/course.js b/public/javascripts/course.js index 338930548..779b8805c 100644 --- a/public/javascripts/course.js +++ b/public/javascripts/course.js @@ -766,6 +766,12 @@ function submit_homework(id){ //验证新建作业的名字 function regex_homework_name() { + var type = $("#homework_type_option").children('option:selected').val(); + if(type == "0"){ + $('#select_type_nitice').show(); + return false; + } + var name = $.trim($("#homework_name").val()); if(name=="") diff --git a/public/stylesheets/css/common.css b/public/stylesheets/css/common.css index 5a7f18e26..bbc85f3ce 100644 --- a/public/stylesheets/css/common.css +++ b/public/stylesheets/css/common.css @@ -169,6 +169,7 @@ h4{ font-size:14px;}/*color:#3b3b3b;*/ .mr70{margin-right: 70px;} .mr75{margin-right: 75px;} .mr80{margin-right: 80px;} +.mr85{margin-right: 85px;} .mr95 {margin-right:95px !important;} .mr100 {margin-right:100px !important;} .mr118 {margin-right:118px !important;} @@ -330,6 +331,7 @@ h4{ font-size:14px;}/*color:#3b3b3b;*/ .W600{ width:600px !important;} .W700{ width:700px; max-width:700px; min-width:700px;} .W710{ width:708px;} +.W800{ width:800px !important;} .maxwidth150{max-width: 150px;} .m_w460{max-width: 460px;} .m_w500{max-width: 500px;} @@ -728,4 +730,85 @@ a:hover.hw_btn_blue,a:active.hw_btn_blue{ background: #3b94d6; color:#fff;} #popupWrap ul{cursor: default;} -.bg_checked{background-color: #64bdd9;} \ No newline at end of file +.bg_checked{background-color: #64bdd9;} + +/* 搜索 与课程相同 */ +.hw_search_box{ position:relative; } +.hw_search_box input.hw_search-input{ width:293px; height:28px; border:none; border:1px solid #e7e7e7; background:#fff; padding-left:5px;} +.hw_search_box a.hw_btn_search{display:block; width:20px; height:20px; background:url(../images/hw/icons_hw.png) 0 -57px no-repeat; position:absolute; right:5px; top:5px; cursor:pointer;} +.hw_search_box a:hover.hw_btn_search{background:url(../images/hw/icons_hw.png) -40px -57px no-repeat;} +.hw_files_icon{display:block; width:17px; height:14px; background:url(../images/hw/icons_hw.png) 0 -135px no-repeat;} +/* 编辑删除 与课程相同 */ +.sy_icons_edit{ display: inline-block; padding:9px;background:url(../images/sy/sy_icons02.png) 0 1px no-repeat; } +.sy_icons_del{ padding:9px;background:url(../images/sy/sy_icons02.png) 0 -21px no-repeat;} +.sy_icons_edit:hover{ background:url(../images/sy/sy_icons02.png) -20px 1px no-repeat; } +.sy_icons_del:hover{ background:url(../images/sy/sy_icons02.png) -20px -21px no-repeat;} +/* 翻页 与课程相同*/ +.pages a{ + display:block; + border:1px solid #d1d1d1; + color:#888; + float:left; + width:30px; + text-align:center; + padding:3px 0; + line-height:1.9; + margin-right:5px; +} +.pages a:hover{ + background-color:#3b94d6; + border:1px solid #3b94d6; + color:#fff; +} +a.pages-big{ + width:50px; +} +.pages .active{ + background-color:#3b94d6; + border:1px solid #3b94d6; + color:#fff; +} +.pages{ + width:330px; + + margin:20px auto 10px; +} +.sy_corange{ color: #ee4a1f;} +.sy_new_orange{font-size: 12px;padding: 0 5px;border-radius: 3px;line-height: 14px;color: #ff4a1b;border: 1px solid #ff4a1b;} +.sy_cgrey{ color: #888;} +a.sy_cgrey{ color: #888;} +.sy_corange{ color: #ee4a1f;} +a.sy_corange{ color: #ee4a1f;} +a.sy_cblue{ color: #3b94d6;} +/* 新增粉色关注按钮*/ +a.sy_btn_pink{ + display: inline-block; + color: #fff; + background: #ff7d7d; + 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_pink{ background: #e64c4c;} + +/* 我的缺陷列表*/ +.myissues_con{ width:968px; padding:15px; border:1px solid #ddd; background-color:#fff; color:#444; margin: 0 auto; } +.myissues_head{ width: 100%; height: 40px; line-height: 40px; background: #f4f4f4; } +.myissues_head h2{ font-size: 14px;} +select.issues_filter_active { font-weight: bold; color: #333;} +.issues_form_filter select.issues_filter_select_min02{width:60px; } +.issues_form_filter select.issues_filter_select_max{width:90px; } +.issues_list_txt li.issues_list_max{ width:90px } +.btn_newpro_grey{display: inline-block;color: #7b7b7b; border:1px solid #dbdbdb;background:#fff;text-align: center;font-size: 12px; padding:0 15px; height:24px; line-height: 24px; -webkit-border-radius:3px; -moz-border-radius:3px; -o-border-radius:3px; border-radius:3px;} +a:hover.btn_newpro_grey,a:active.btn_newpro_grey{ background: #eaeaea;} + +.my_issues_form_filter{ position: absolute; top:0; right: 0;} +.my_issues_form_filter select{ width:70px; height:30px; border:none; font-size:14px; border:none;border-right:none; color: #888; font-size: 12px; line-height: 30px; text-align:center} +.my_issues_form_filter select.issues_filter_select_min{width:50px; } +.my_issues_form_filter select{appearance:none;-moz-appearance:none;-webkit-appearance:none;} diff --git a/public/stylesheets/css/courses.css b/public/stylesheets/css/courses.css index ba2f9cea8..1f7301772 100644 --- a/public/stylesheets/css/courses.css +++ b/public/stylesheets/css/courses.css @@ -548,7 +548,7 @@ a:hover.blueCir{ background:#3598db; color:#fff;} #worksDescription p {word-wrap:break-word;} /*20160907作业详情更改*/ -.homework-type-option {border:1px solid #d9d9d9; width:98px; height:28px; color:#888; font-size:14px;} +.homework-type-option {border:1px solid #d9d9d9; width:138px; height:28px; color:#888; font-size:14px;} .homework-detail-tab {font-size:14px; color:#484848; overflow:hidden;} .homework-detail-tab li {float:left; width:100px; text-align:center; padding:3px 0; border-bottom:2px solid #ddd;} .homework-detail-tab li.selected {border-bottom:2px solid #f00;} diff --git a/public/stylesheets/css/project.css b/public/stylesheets/css/project.css index ead88aef7..4ccaab242 100644 --- a/public/stylesheets/css/project.css +++ b/public/stylesheets/css/project.css @@ -550,7 +550,7 @@ a:hover.upload_btn_grey{background:#8a8a8a;} /* 缺陷列表 */ .issues_greycirbg_btn{ background-color:#dedede; padding:1px 5px;-webkit-border-radius:3px;-moz-border-radius:3px;-o-border-radius:3px;border-radius:3px; } -.issues_greycirbg_btn:hover{background-color:#cbcbcb;} +.issues_greycirbg_btn:hover{ background-color:#cbcbcb; cursor:default; } .issues_con{ width:718px; padding:15px; border:1px solid #ddd; background-color:#fff; color:#444; } .issues_statistics{ line-height:35px;} .issues_statistics ul li{ float:left; } @@ -742,14 +742,15 @@ a:hover.hw_btn_blue,a:active.hw_btn_blue{ background: #3b94d6; color:#fff;} .issues_statistics ul li a{ font-size:12px; margin:5px; color:#888; } .issues_statistics ul li a.act{} + .issues_form_filter select{ width:84px; height:35px; font-size:14px; border:1px solid #c8c8c8; border-right:none; background-color:#fff; margin-bottom: 10px; color: #888;} .issues_form_filter input{ height:33px;width:91px; border:1px solid #c8c8c8;background-color:#fff;} .issues_form_filter select:focus,.issues_form_filter input:focus{border:1px solid #c8c8c8; border-right:none;} -.issues_form_filter select{appearance:none;-moz-appearance:none;-webkit-appearance:none; background: url("/images/new_project/arrow.png") no-repeat scroll right center transparent;} +.issues_form_filter select{appearance:none;-moz-appearance:none;-webkit-appearance:none; background: url("../images/project/arrow.png") no-repeat scroll right center transparent;} input.issues_calendar_input{ padding-left:5px; color:#444; border-right:none;} -.issues_data_img{ display:block; width:25px; height:33px; border:1px solid #c8c8c8; border-left:none; background:url("/images/public_icon.png") -29px 9px no-repeat; } +.issues_data_img{ display:block; width:25px; height:33px; border:1px solid #c8c8c8; border-left:none; background: url("../images/public_icon.png") -29px 9px no-repeat; } /* 缺陷Tab */ -.issues_con_list{border:1px solid #dbdbdb; } +.issues_con_list{border:1px solid #c8c8c8; } #issues_list_nav {border-bottom:1px solid #d0d0d0;} #issues_list_nav li {float:left; padding:10px 15px; text-align:center; } #issues_list_nav li a{font-size:12px; color:#444;} @@ -764,12 +765,13 @@ input.issues_calendar_input{ padding-left:5px; color:#444; border-right:none;} .issues_form_filter select:focus,.issues_form_filter input:focus{border:none; } .issues_filter_data input{height:28px;width:91px; border:1px solid #c8c8c8;background-color:#fff;} .issues_form_filter select{appearance:none;-moz-appearance:none;-webkit-appearance:none; background: url("/images/new_project/arrow.png") no-repeat scroll right center transparent;} +.issues_form_filter select.my_issues_filter{ background:none; width:50px; margin-left: 10px;margin-right: 10px;} input.issues_calendar_input{ padding-left:5px; color:#444; border-right:none;} -.issues_data_img{ display:block; width:25px; height:28px; border:1px solid #c8c8c8; border-left:none; background: url("/images/public_icon.png") -27px 7px no-repeat; } +.issues_data_img{ display:block; width:25px; height:28px; border:1px solid #c8c8c8; border-left:none; background: url("../images/public_icon.png") -29px 9px no-repeat; } .issues_list_box{ padding:15px; padding-right: 0px; border-bottom:1px dashed #c8c8c8;} .issues_list_titlebox{ font-size:14px; font-weight:bold; margin-bottom:8px;} -a.issues_list_title{ color:#444; max-width:380px; overflow:hidden; text-overflow:ellipsis; -o-text-overflow:ellipsis; white-space:nowrap; } +a.issues_list_title{ color:#444; max-width:260px; overflow:hidden; text-overflow:ellipsis; -o-text-overflow:ellipsis; white-space:nowrap; } a:hover.issues_list_title{color:#3b94d6;} .issues_list_titlebox span{ font-size: 12px;color: #888; font-weight: normal; } .issues_ciricons_01{ width: 22px; height: 22px; display: inline-block; background: url("/images/new_project/icons_issue.png") 0 0 no-repeat;} @@ -778,10 +780,9 @@ a:hover.issues_list_title{color:#3b94d6;} .issues_list_name{ font-size: 12px;} .issues_list_name:hover{ color: #3b94d6;} .issues_list_small{ font-size: 12px; color: #666;} -.issues_list_txt li{ height: 24px; line-height: 24px; float: left; font-size: 12px; width: 70px; text-align: center; overflow:hidden; text-overflow:ellipsis; -o-text-overflow:ellipsis; white-space:nowrap;} +.issues_list_txt li{ height: 50px; line-height: 50px; float: left; font-size: 12px; width: 70px; text-align: center; overflow:hidden; text-overflow:ellipsis; -o-text-overflow:ellipsis; white-space:nowrap;} .issues_list_txt li.issues_list_min{ width: 50px;} - /* 搜索 与课程相同 */ .hw_search_box{ position:relative; } .hw_search_box input.hw_search-input{ width:293px; height:28px; border:none; border:1px solid #e7e7e7; background:#fff; padding-left:5px;padding-right: 25px;} @@ -832,7 +833,7 @@ a.sy_corange{ color: #ee4a1f;} a.sy_cblue{ color: #3b94d6;} /* 我的缺陷列表*/ -.myissues_con{ width:968px; padding:15px; border:1px solid #ddd; background-color:#fff; color:#444; } +.myissues_con{ width:968px; padding:15px; border:1px solid #ddd; background-color:#fff; color:#444;} .myissues_head{ width: 100%; height: 40px; line-height: 40px; background: #f4f4f4; } .myissues_head h2{ font-size: 14px;} select.issues_filter_active { font-weight: bold; color: #333;} @@ -1031,3 +1032,13 @@ a.pro_new_users { max-width:80px; overflow:hidden;overflow:hidden;text-overflow: a:hover.pro_new_users {color: #3b94d6} .pro_new_users img{ width:40px;height:40px; border: 3px solid #fff;-webkit-border-radius:50px;-moz-border-radius:50px;-o-border-radius:50px;border-radius:50px;} .pro_new_users img:hover{border: 3px solid #e6e6e6;} + +/*质量分析*/ +.quality_info{ border:1px solid #ddd; background-color:#fff; width: 998px;} +.quality_info h2{ background: #fff; font-size: 14px; color: #333; height: 40px; line-height: 40px; padding-left: 15px; border-bottom:1px solid #e5e5e5;} +table.quality_list{ border:none; border-collapse: collapse; width: 100%; margin-bottom: 4px; } +table.quality_list tbody td, table.quality_list tbody tr td { + border-bottom: solid 1px #ddd; + font-size: 11px; + padding: 4px 10px 4px 3px; +} diff --git a/public/stylesheets/css/public.css b/public/stylesheets/css/public.css index baffbe737..96abaf93d 100644 --- a/public/stylesheets/css/public.css +++ b/public/stylesheets/css/public.css @@ -1530,6 +1530,7 @@ a.syllabusbox_a_blue{ .simulation-title {position:absolute; background-color:#fff; padding:5px 10px; z-index:99; white-space:nowrap; box-shadow: 0px 2px 8px rgba(146, 153, 169, 0.5); display:none; color:#666; border:1px solid #666; line-height:1;} /*项目创建*/ .project_new_input {border: 1px solid #ddd;height: 20px;width: 794px;background: #fff;padding: 5px;} +.project_new_input_project_new:focus {border: 1px solid #ddd;height: 20px;width: 794px;background: #fff;padding: 5px;} /*新版项目列表新增*/ .new_project_title{ font-size:16px; color:#333; max-width:480px; font-weight:normal;white-space:nowrap; overflow:hidden; text-overflow:ellipsis; } diff --git a/public/stylesheets/project.css b/public/stylesheets/project.css index 5903c96e9..3bbea4b3f 100644 --- a/public/stylesheets/project.css +++ b/public/stylesheets/project.css @@ -1289,3 +1289,4 @@ a.pages-big{ width:50px;} .W420 {width:420px;} .W300 {width:300px !important;} .W600{ width:600px;} +