diff --git a/.gitignore b/.gitignore index 8a40f3ca7..9d33b264c 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,8 @@ /config/database.yml /config/configuration.yml /config/additional_environment.rb +/config/oneapm.yml +/config/environments/production.rb /files/* diff --git a/app/assets/javascripts/syllabus_member.js.coffee b/app/assets/javascripts/syllabus_member.js.coffee new file mode 100644 index 000000000..761567942 --- /dev/null +++ b/app/assets/javascripts/syllabus_member.js.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/ diff --git a/app/assets/stylesheets/syllabus_member.css.scss b/app/assets/stylesheets/syllabus_member.css.scss new file mode 100644 index 000000000..579bf153b --- /dev/null +++ b/app/assets/stylesheets/syllabus_member.css.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the SyllabusMember controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index ad0fab173..14d5961cd 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,3 +1,4 @@ +# encoding: utf-8 # Redmine - project management software # Copyright (C) 2006-2013 Jean-Philippe Lang # @@ -685,6 +686,61 @@ class ApplicationController < ActionController::Base :content_type => 'application/atom+xml' end + def issue_ratio_change done_ratio, status_id + if done_ratio == 100 || status_id == 3 + "已完成" + else + done_ratio.to_s + "%" + end + end + + def issue_priority_change priority_id + case priority_id + when 1 + "低" + when 2 + "正常" + when 3 + "高" + when 4 + "紧急" + when 5 + "立即" + end + end + + def issue_status_change status_id + case status_id + when 1 + "新增" + when 2 + "正在解决" + when 3 + "已解决" + when 4 + "反馈" + when 5 + "关闭" + when 6 + "拒绝" + end + end + + def issue_tracker_change tracker_id + case tracker_id + when 1 + "缺陷" + when 2 + "功能" + when 3 + "支持" + when 4 + "任务" + when 5 + "周报" + end + end + def self.accept_rss_auth(*actions) if actions.any? self.accept_rss_auth_actions = actions diff --git a/app/controllers/homework_common_controller.rb b/app/controllers/homework_common_controller.rb index b8c6a4a0a..4511e5a1f 100644 --- a/app/controllers/homework_common_controller.rb +++ b/app/controllers/homework_common_controller.rb @@ -58,10 +58,9 @@ class HomeworkCommonController < ApplicationController def edit @user = User.current - @is_in_course = params[:is_in_course] + @hw_status = params[:hw_status].to_i @is_manage = params[:is_manage] - @course_activity = params[:course_activity].to_i - if @is_in_course.to_i == 1 || @course_activity == 1 + if @hw_status != 1 @left_nav_type = 3 respond_to do |format| format.html{render :layout => 'base_courses'} @@ -160,18 +159,19 @@ class HomeworkCommonController < ApplicationController create_works_list @homework end + @hw_status = params[:hw_status].to_i if params[:is_manage] == "1" redirect_to manage_or_receive_homeworks_user_path(User.current.id) elsif params[:is_manage] == "2" redirect_to my_homeworks_user_path(User.current.id) - elsif params[:is_in_course] == "1" - redirect_to homework_common_index_path(:course => @course.id) - elsif params[:is_in_course] == "0" - redirect_to user_homeworks_user_path(User.current.id) - elsif params[:is_in_course] == "-1" && params[:course_activity] == "0" + elsif @hw_status == 1 redirect_to user_path(User.current.id) - elsif params[:is_in_course] == "-1" && params[:course_activity] == "1" + elsif @hw_status == 2 redirect_to course_path(@course.id) + elsif @hw_status == 5 + redirect_to student_work_index_url(:homework => @homework.id) + else + redirect_to homework_common_index_path(:course => @course.id) end end end @@ -181,14 +181,13 @@ class HomeworkCommonController < ApplicationController if @homework.destroy respond_to do |format| format.html { - if params[:is_in_course] == "1" - redirect_to homework_common_index_path(:course => @course.id) - elsif params[:is_in_course] == "0" - redirect_to user_homeworks_user_path(User.current.id) - elsif params[:is_in_course] == "-1" && params[:course_activity] == "0" - redirect_to user_path(User.current.id) - elsif params[:is_in_course] == "-1" && params[:course_activity] == "1" - redirect_to course_path(@course.id) + @hw_status = params[:hw_status].to_i + if @hw_status == 1 + redirect_to user_path(User.current.id) + elsif @hw_status == 2 + redirect_to course_path(@course.id) + else + redirect_to homework_common_index_path(:course => @course.id) end } end @@ -246,8 +245,8 @@ class HomeworkCommonController < ApplicationController @statue = 3 end @user_activity_id = params[:user_activity_id].to_i - @is_in_course = params[:is_in_course].to_i - @course_activity = params[:course_activity].to_i + @hw_status = params[:hw_status].to_i + @is_teacher = User.current.admin? || User.current.allowed_to?(:as_teacher, @course) end #关闭匿评 @@ -265,8 +264,8 @@ class HomeworkCommonController < ApplicationController send_message_anonymous_comment(@homework, m_status = 3) Mailer.send_mail_anonymous_comment_close(@homework).deliver @user_activity_id = params[:user_activity_id].to_i - @is_in_course = params[:is_in_course].to_i - @course_activity = params[:course_activity].to_i + @hw_status = params[:hw_status].to_i + @is_teacher = User.current.admin? || User.current.allowed_to?(:as_teacher, @course) respond_to do |format| format.js end @@ -294,8 +293,7 @@ class HomeworkCommonController < ApplicationController end @percent = format("%.2f",(@cur_size.to_f / ( @totle_size == 0 ? 1 : @totle_size)) * 100) @user_activity_id = params[:user_activity_id].to_i - @is_in_course = params[:is_in_course].to_i - @course_activity = params[:course_activity].to_i + @hw_status = params[:hw_status].to_i respond_to do |format| format.js end @@ -307,8 +305,7 @@ class HomeworkCommonController < ApplicationController else @user_activity_id = -1 end - @is_in_course = params[:is_in_course] if params[:is_in_course] - @course_activity = params[:course_activity] if params[:course_Activity] + @hw_status = params[:hw_status].to_i respond_to do |format| format.js end @@ -321,8 +318,8 @@ class HomeworkCommonController < ApplicationController @homework.update_column('is_open', 0) end @user_activity_id = params[:user_activity_id] - @is_in_course = params[:is_in_course] if params[:is_in_course] - @course_activity = params[:course_activity] if params[:course_Activity] + @hw_status = params[:hw_status].to_i + @is_teacher = User.current.admin? || User.current.allowed_to?(:as_teacher,@course) end def alert_open_student_works @@ -331,8 +328,7 @@ class HomeworkCommonController < ApplicationController else @user_activity_id = -1 end - @is_in_course = params[:is_in_course] if params[:is_in_course] - @course_activity = params[:course_activity] if params[:course_Activity] + @hw_status = params[:hw_status].to_i respond_to do |format| format.js end @@ -363,8 +359,7 @@ class HomeworkCommonController < ApplicationController else @user_activity_id = -1 end - @is_in_course = params[:is_in_course] - @course_activity = params[:course_activity].to_i + @hw_status = params[:hw_status].to_i end #设置匿评参数 @@ -381,8 +376,8 @@ class HomeworkCommonController < ApplicationController @homework_detail_manual.evaluation_num = params[:evaluation_num] @homework_detail_manual.save @user_activity_id = params[:user_activity_id].to_i - @is_in_course = params[:is_in_course].to_i - @course_activity = params[:course_activity].to_i + @hw_status = params[:hw_status].to_i + @is_teacher = User.current.admin? || User.current.allowed_to?(:as_teacher,@course) end end @@ -393,8 +388,7 @@ class HomeworkCommonController < ApplicationController else @user_activity_id = -1 end - @is_in_course = params[:is_in_course] - @course_activity = params[:course_activity].to_i + @hw_status = params[:hw_status].to_i end private diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index 6fb2868bc..0940dbdf8 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -58,65 +58,104 @@ class IssuesController < ApplicationController include ApplicationHelper def index - retrieve_query - sort_init(@query.sort_criteria.empty? ? [['id', 'desc']] : @query.sort_criteria) - sort_update(@query.sortable_columns) - @query.sort_criteria = sort_criteria.to_a - - @project_base_tag = (params[:project_id] || @issue.project) ? 'base_projects':'base' - - if @query.valid? - case params[:format] - when 'csv', 'pdf' - @limit = 10#Setting.issues_export_limit.to_i - when 'atom' - @limit = 10#Setting.feeds_limit.to_i - when 'xml', 'json' - @offset, @limit = api_offset_and_limit({:limit => 10}) - else - @limit = 10#per_page_option + # 为了性能所有用了两种模式,issue的@query查询所有的没有优势 + # 但是对过滤条件很有有时 + if params[:set_filter] != "1" + @project_base_tag = (params[:project_id] || @issue.project) ? 'base_projects':'base' + if User.current.member_of?(@project) + @issues_filter = Issue.where(:project_id => @project.id).order('updated_on desc') + else + @issues_filter = Issue.where(:project_id => @project.id, :is_private => 0).order('updated_on desc') end - @assign_to_id = params[:assigned_to_id] - @author_id = params[:author_id] - @priority_id = params[:priority_id] - @status_id = params[:status_id] - @subject = params[:subject] - @done_ratio = params[:done_ratio] - @issue_count = @query.issue_count - @issue_pages = Paginator.new @issue_count, @limit, params['page'] - params[:page] = (params[:page] || 1).to_i + 1 #页码需要加1 + open_and_close_num(@project) + @issue_count = @issues_filter.count + @limit = 10 + @is_remote = true + @issue_pages = Paginator.new @issue_count, @limit, params['page'] || 1 @offset ||= @issue_pages.offset - @issues = @query.issues(:include => [:assigned_to, :tracker, :priority, :category, :fixed_version], - :order => 'issues.updated_on desc', - :offset => @offset, - :limit => @limit) - if params[:set_filter] - @set_filter = params[:set_filter] - end - @issue_count_by_group = @query.issue_count_by_group + @issues = paginateHelper @issues_filter, @limit respond_to do |format| format.js format.html { render :template => 'issues/index', :layout => @project_base_tag }#by young - format.api { - Issue.load_visible_relations(@issues) if include_in_api_response?('relations') + format.api {Issue.load_visible_relations(@issues) if include_in_api_response?('relations')} + format.xls {filename = "#{@project.name.to_s}_#{l(:label_issue_list_xls)}.xls" + send_data(issue_list_xls(@issues_filter), :type => 'application/octet-stream', :filename => filename_for_content_disposition(filename)) } - # format.json { render :json => @issues.map { |issue| issue.to_json}} #:json => @issues.map { |issue| issue.to_json} - format.atom { render_feed(@issues, :title => "#{@project || Setting.app_title}: #{l(:label_issue_plural)}") } - format.csv { send_data(query_to_csv(@issues, @query, params), :type => 'text/csv; header=present', :filename => 'issues.csv') } - format.pdf { send_data(issues_to_pdf(@issues, @project, @query), :type => 'application/pdf', :filename => 'issues.pdf') } end else - respond_to do |format| - format.html { render(:template => 'issues/index', :layout => @project_base_tag) }#by young - format.any(:atom, :csv, :pdf) { render(:nothing => true) } - format.api { render_validation_errors(@query) } - format.js + retrieve_query + sort_init(@query.sort_criteria.empty? ? [['id', 'desc']] : @query.sort_criteria) + sort_update(@query.sortable_columns) + @query.sort_criteria = sort_criteria.to_a + @project_base_tag = (params[:project_id] || @issue.project) ? 'base_projects':'base' + if @query.valid? + @tracker_id = params[:tracker_id] + @assign_to_id = params[:assigned_to_id] + @author_id = params[:author_id] + @status_id = params[:status_id] + @subject = params[:subject] + @done_ratio = params[:done_ratio] + @fixed_version_id = params[:fixed_version_id] + @issue_count = @query.issue_count + @test = params[:test] + @project_sort = 'issues.updated_on desc' + if params[:test] != "0" + case @test + when "1" + @project_sort = 'issues.created_on desc' + when "2" + @project_sort = 'issues.created_on asc' + when "3" + @project_sort = 'issues.updated_on desc' + when "4" + @project_sort = 'issues.updated_on asc' + end + end + open_and_close_num(@project) + @issues_filter_assign_count = @query.issues.select{|issue| issue.assigned_to_id == User.current.id }.count + @issues_filter_author_count = @query.issues.select{|issue| issue.author_id == User.current.id }.count + @issues_filter = @query.issues(:order => @project_sort) + @limit = 10 + @is_remote = true + @issue_pages = Paginator.new @issue_count, @limit, params['page'] || 1 + @offset ||= @issue_pages.offset + @issues = paginateHelper @issues_filter, @limit + respond_to do |format| + format.js + format.html { render :template => 'issues/index', :layout => @project_base_tag }#by young + format.api {Issue.load_visible_relations(@issues) if include_in_api_response?('relations')} + # format.json { render :json => @issues.map { |issue| issue.to_json}} #:json => @issues.map { |issue| issue.to_json} + format.atom { render_feed(@issues, :title => "#{@project || Setting.app_title}: #{l(:label_issue_plural)}") } + format.csv { send_data(query_to_csv(@issues, @query, params), :type => 'text/csv; header=present', :filename => 'issues.csv') } + format.pdf { send_data(issues_to_pdf(@issues, @project, @query), :type => 'application/pdf', :filename => 'issues.pdf') } + format.xls {filename = "#{@project.name.to_s}_#{l(:label_issue_list_xls)}.xls" + send_data(issue_list_xls(@issues_filter), :type => 'application/octet-stream', :filename => filename_for_content_disposition(filename)) + } + end + else + respond_to do |format| + format.html { render(:template => 'issues/index', :layout => @project_base_tag) }#by young + format.any(:atom, :csv, :pdf) { render(:nothing => true) } + format.api { render_validation_errors(@query) } + format.js + end end end rescue ActiveRecord::RecordNotFound render_404 end + # 获取issue的开启统计数 + def open_and_close_num project + if User.current.member_of?(project) + @issue_open_count = Issue.where("project_id=#{project.id} and status_id in (1,2,3,4,6)").count + @issue_close_count = Issue.where(:project_id => project.id, :status_id => 5 ).count + else + @issue_open_count = Issue.where("project_id=#{project.id} and status_id in (1,2,3,4,6) and is_private = 0").count + @issue_close_count = Issue.where(:project_id => project.id, :status_id => 5, :is_private => 0).count + end + end + def show # 打开编辑内容 @is_edit = true unless params[:edit].nil? diff --git a/app/controllers/messages_controller.rb b/app/controllers/messages_controller.rb index 3e41e2c91..5731244c3 100644 --- a/app/controllers/messages_controller.rb +++ b/app/controllers/messages_controller.rb @@ -38,47 +38,45 @@ class MessagesController < ApplicationController # Show a topic and its replies def show @isReply = true - page = params[:page] - # Find the page of the requested reply - if params[:r] && page.nil? - offset = @topic.children.count(:conditions => ["#{Message.table_name}.id < ?", params[:r].to_i]) - page = 1 + offset / REPLIES_PER_PAGE - end + # page = params[:page] + # # Find the page of the requested reply + # if params[:r] && page.nil? + # offset = @topic.children.count(:conditions => ["#{Message.table_name}.id < ?", params[:r].to_i]) + # page = 1 + offset / REPLIES_PER_PAGE + # end all_comments = [] - @reply_count = get_all_children(all_comments, @topic).count + @replies = get_all_children(all_comments, @topic) + @reply_count = @replies.count @reply = Message.new(:subject => "RE: #{@message.subject}") if @course - messages_replies = @topic.children. - includes(:author, :attachments, {:board => :project}). - reorder("#{Message.table_name}.created_on DESC"). + #@replies = @topic.children. + #includes(:author, :attachments, :praise_tread_cache, {:board => :project}). + #reorder("#{Message.table_name}.created_on DESC"). #limit(@reply_pages.per_page). #offset(@reply_pages.offset). - all - @replies = paginateHelper messages_replies,10 - @reply = Message.new(:subject => "RE: #{@message.subject}") + #all + #@replies = paginateHelper messages_replies,10 @left_nav_type = 2 render :action => "show", :layout => "base_courses"#by young elsif @project - @reply_pages = Paginator.new @reply_count, REPLIES_PER_PAGE, page - @replies = @topic.children. - includes(:author, :attachments, {:board => :project}). - reorder("#{Message.table_name}.created_on DESC"). - limit(@reply_pages.per_page). - offset(@reply_pages.offset). - all + #@reply_pages = Paginator.new @reply_count, REPLIES_PER_PAGE, page + # @replies = @topic.children. + # includes(:author, :attachments, {:board => :project}). + # reorder("#{Message.table_name}.created_on DESC"). + # limit(@reply_pages.per_page). + # offset(@reply_pages.offset). + # all - @reply = Message.new(:subject => "RE: #{@message.subject}") render :action => "show", :layout => "base_projects"#by young else - @reply_pages = Paginator.new @reply_count, REPLIES_PER_PAGE, page - @replies = @topic.children. - includes(:author, :attachments, {:board => :project}). - reorder("#{Message.table_name}.created_on DESC"). - limit(@reply_pages.per_page). - offset(@reply_pages.offset). - all + # @reply_pages = Paginator.new @reply_count, REPLIES_PER_PAGE, page + # @replies = @topic.children. + # includes(:author, :attachments, {:board => :project}). + # reorder("#{Message.table_name}.created_on DESC"). + # limit(@reply_pages.per_page). + # offset(@reply_pages.offset). + # all - @reply = Message.new(:subject => "RE: #{@message.subject}") @organization = @org_subfield.organization render :action => "show", :layout => "base_org"#by young end @@ -92,7 +90,13 @@ class MessagesController < ApplicationController @message.board = @board @message.safe_attributes = params[:message] if request.post? - @message.save_attachments(params[:attachments]) + if @project + is_public = @project.is_public + elsif @course + is_public = @course.is_public + end + # 公开项目/课程上传的资源是公开的,私有项目上传的是私有的 + @message.save_attachments_containers(params[:attachments], User.current, is_public) if @message.save # 更新kindeditor上传的图片资源所有者 if params[:asset_id] diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 8d4c09ded..df40eb378 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -325,27 +325,27 @@ class ProjectsController < ApplicationController end # 版本库统计图 - unless @project.gpid.nil? || @project.project_score.changeset_num == 0 - # rep_statics_commit = @project.rep_statics.order("commits_num desc") - rep_statics_commit = RepStatics.find_by_sql("SELECT * FROM `rep_statics` where project_id = #{@project.id} order by commits_num desc limit 10") - rep_statics_code = RepStatics.find_by_sql("SELECT * FROM `rep_statics` where project_id = #{@project.id} order by changeset desc limit 10") - # rep_statics_code = @project.rep_statics.sort_by {|u| u.changeset}.reverse - @a_uname = rep_statics_commit.map {|s| s.uname } - @a_uname_code = rep_statics_code.map {|s| s.uname } - @a_commits_num = rep_statics_commit.map {|s| s.commits_num.to_i } - @a_commits_add = rep_statics_code.map {|s| s.add.to_i } - @a_commits_del = rep_statics_code.map {|s| s.del.to_i } - @a_commits_changeset = rep_statics_code.map {|s| s.changeset.to_i } - g = Gitlab.client - begin - gid = @project.gpid - g_project = g.project(gid) - g_branch = g_project.default_branch.to_s - rescue =>e - logger.error("get default branch failed: " + e) - end - @rev = g_branch.nil? ? "master" : g_branch - end + # unless @project.gpid.nil? || @project.project_score.changeset_num == 0 + # # rep_statics_commit = @project.rep_statics.order("commits_num desc") + # rep_statics_commit = RepStatics.find_by_sql("SELECT * FROM `rep_statics` where project_id = #{@project.id} order by commits_num desc limit 10") + # rep_statics_code = RepStatics.find_by_sql("SELECT * FROM `rep_statics` where project_id = #{@project.id} order by changeset desc limit 10") + # # rep_statics_code = @project.rep_statics.sort_by {|u| u.changeset}.reverse + # @a_uname = rep_statics_commit.map {|s| s.uname } + # @a_uname_code = rep_statics_code.map {|s| s.uname } + # @a_commits_num = rep_statics_commit.map {|s| s.commits_num.to_i } + # @a_commits_add = rep_statics_code.map {|s| s.add.to_i } + # @a_commits_del = rep_statics_code.map {|s| s.del.to_i } + # @a_commits_changeset = rep_statics_code.map {|s| s.changeset.to_i } + # g = Gitlab.client + # begin + # gid = @project.gpid + # g_project = g.project(gid) + # g_branch = g_project.default_branch.to_s + # rescue =>e + # logger.error("get default branch failed: " + e) + # end + # @rev = g_branch.nil? ? "master" : g_branch + # end # 根据对应的请求,返回对应的数据 respond_to do |format| format.html diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index a79890870..d4042abf5 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -34,7 +34,7 @@ class RepositoriesController < ApplicationController before_filter :find_project_by_project_id, :only => [:new, :create, :newrepo, :stats, :quality_analysis] before_filter :find_repository, :only => [:edit, :update, :destroy, :committers] - before_filter :find_project_repository, :except => [:new, :create, :newcreate, :edit, :update, :destroy, :committers, :newrepo, :to_gitlab, :forked, :project_archive] + before_filter :find_project_repository, :except => [:new, :create, :newcreate, :edit, :update, :destroy, :committers, :newrepo, :to_gitlab, :forked, :project_archive, :export_rep_static] before_filter :find_changeset, :only => [:revision, :add_related_issue, :remove_related_issue] before_filter :authorize , :except => [:newrepo,:newcreate,:fork, :to_gitlab, :forked, :commit_diff, :project_archive, :quality_analysis] # 链接gitlab @@ -69,6 +69,20 @@ class RepositoriesController < ApplicationController end + def export_rep_static + @project = Project.find(params[:id]) + gpid = @project.gpid + rev = params[:rev] + cycle = params[:cycle] + respond_to do |format| + format.html + format.xls{ + filename = "#{@project.name.to_s}_#{l(:label_rep_xls)}.xls" + send_data(export_rep_xls(gpid, :rev => rev, :cycle => "1"), :type => 'application/octet-stream', :filename => filename_for_content_disposition(filename)) + } + end + end + def forked @project = Project.find(params[:id]) @repository = Repository.where("project_id =? and type =?", @project.id, "Repository::Gitlab") diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index cd80575a2..27b6ed272 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -521,6 +521,7 @@ class StudentWorkController < ApplicationController # 消息传过来的ID @message_student_work_id = params[:student_work_id] @left_nav_type = 3 + @tab = params[:tab].to_i respond_to do |format| format.js format.html @@ -1012,8 +1013,7 @@ class StudentWorkController < ApplicationController redirect_to student_work_index_url(:homework => @homework.id) else @user_activity_id = params[:user_activity_id].to_i - @is_in_course = params[:is_in_course].to_i - @course_activity = params[:course_activity].to_i + @hw_status = params[:hw_status].to_i respond_to do |format| format.js end @@ -1035,8 +1035,7 @@ class StudentWorkController < ApplicationController student_work.save end @user_activity_id = params[:user_activity_id].to_i - @is_in_course = params[:is_in_course].to_i - @course_activity = params[:course_activity].to_i + @hw_status = params[:hw_status].to_i end def revise_attachment @@ -1058,8 +1057,7 @@ class StudentWorkController < ApplicationController def new_student_work_project @user_activity_id = params[:user_activity_id].to_i - @is_in_course = params[:is_in_course].to_i - @course_activity = params[:course_activity].to_i + @hw_status = params[:hw_status].to_i respond_to do |format| format.js end @@ -1078,8 +1076,8 @@ class StudentWorkController < ApplicationController @project.is_leader = 1 if @project.save @user_activity_id = params[:user_activity_id].to_i - @is_in_course = params[:is_in_course].to_i - @course_activity = params[:course_activity].to_i + @hw_status = params[:hw_status].to_i + @is_teacher = User.current.allowed_to?(:as_teacher,@homework.course) || User.current.admin? respond_to do |format| format.js end @@ -1129,8 +1127,8 @@ class StudentWorkController < ApplicationController relate_pro = StudentWorkProject.where("user_id = #{User.current.id} and homework_common_id = #{@homework.id}").first if relate_pro.destroy @user_activity_id = params[:user_activity_id].to_i - @is_in_course = params[:is_in_course].to_i - @course_activity = params[:course_activity].to_i + @hw_status = params[:hw_status].to_i + @is_teacher = User.current.allowed_to?(:as_teacher,@homework.course) || User.current.admin? respond_to do |format| format.js end diff --git a/app/controllers/syllabus_member_controller.rb b/app/controllers/syllabus_member_controller.rb new file mode 100644 index 000000000..ac686c0a2 --- /dev/null +++ b/app/controllers/syllabus_member_controller.rb @@ -0,0 +1,64 @@ +class SyllabusMemberController < ApplicationController + + def syl_member_autocomplete + @syllabus = Syllabus.find(params[:syllabus]) + @flag = params[:flag] || false + respond_to do |format| + format.js + end + end + + def create + @syllabus = Syllabus.find(params[:syllabus]) + if params[:membership].nil? + @fail_hint = l(:label_blank_user_lists_for_org) + else + member_ids = params[:membership][:user_ids] + last_rank = @syllabus.syllabus_members.order("rank asc").last.rank + user_ids = @syllabus.syllabus_members.map{|sy| sy.user_id} + member_ids.each_with_index do |user_id, i| + unless user_ids.include?(user_id.to_i) + member = SyllabusMember.create(:user_id => user_id, :rank => last_rank + 1 + i) + @syllabus.syllabus_members << member + end + end + @members = @syllabus.syllabus_members.order("rank asc") + end + respond_to do |format| + format.js + end + end + + def destroy + member = SyllabusMember.find(params[:id]) + @syllabus = member.syllabus + after_syl_members = @syllabus.syllabus_members.where("rank > #{member.rank}") + after_syl_members.update_all("rank = rank - 1") + member.destroy + @members = @syllabus.syllabus_members.order("rank asc") + respond_to do |format| + format.js + end + end + + def update_rank + member = SyllabusMember.find(params[:id]) + @syllabus = member.syllabus + members = @syllabus.syllabus_members + if params[:opr] == 'up' && member.rank > 2 + before_mem = members.where("rank = #{member.rank - 1}").first + if before_mem && member.update_attribute('rank', member.rank - 1) + before_mem.update_attribute('rank', before_mem.rank + 1) + end + elsif params[:opr] == 'down' && member.rank > 1 && member.rank < members.count + after_mem = members.where("rank = #{member.rank + 1}").first + if after_mem && member.update_attribute('rank', member.rank + 1) + after_mem.update_attribute('rank', after_mem.rank - 1) + end + end + @members = @syllabus.syllabus_members.order("rank asc") + respond_to do |format| + format.js + end + end +end diff --git a/app/controllers/syllabuses_controller.rb b/app/controllers/syllabuses_controller.rb index e77b19511..f0d1254bc 100644 --- a/app/controllers/syllabuses_controller.rb +++ b/app/controllers/syllabuses_controller.rb @@ -6,7 +6,7 @@ class SyllabusesController < ApplicationController include CoursesHelper before_filter :is_logged, :only => [:index, :show, :edit, :new, :update, :destroy, :delete_syllabus] - before_filter :find_syllabus, :only => [:show, :edit, :update, :destroy, :syllabus_courselist, :edit_syllabus_eng_name, :edit_syllabus_title, :update_base_info, :delete_syllabus, :delete_des] + before_filter :find_syllabus, :only => [:show, :edit, :update, :destroy, :syllabus_courselist, :edit_syllabus_eng_name, :edit_syllabus_title, :update_base_info, :delete_syllabus, :delete_des, :members] def index user = User.current @syllabuses = user.syllabuses @@ -170,6 +170,15 @@ class SyllabusesController < ApplicationController end end + def members + @members = @syllabus.syllabus_members.includes(:user => {:user_extensions => [], :courses => []}).order("rank asc") + @show = params[:show] ? params[:show].to_i : 0 + respond_to do |format| + format.js + format.html{render :layout => 'base_syllabus'} + end + end + private def find_syllabus @syllabus = Syllabus.find params[:id] diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 2a91b75ae..87dc127a0 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -115,8 +115,7 @@ class UsersController < ApplicationController else @user_activity_id = -1 end - @is_in_course = params[:is_in_course].to_i - @course_activity = params[:course_activity].to_i + @hw_status = params[:hw_status].to_i when 'JournalsForMessage' @reply = JournalsForMessage.find params[:reply_id] @user_activity_id = params[:user_activity_id] @@ -1123,11 +1122,8 @@ class UsersController < ApplicationController quotes_homework = HomeworkCommon.find params[:quotes].to_i quotes_homework.update_column(:quotes, quotes_homework.quotes+1) end - if params[:is_in_course] == "1" - redirect_to homework_common_index_path(:course => homework.course_id) - else - redirect_to user_homeworks_user_path(User.current.id) - end + + redirect_to homework_common_index_path(:course => homework.course_id) end end else @@ -1683,7 +1679,7 @@ class UsersController < ApplicationController container_type = 'Project' act_type = 'Issue' when "project_message" - container_type = 'Course' + container_type = 'Project' act_type = 'Message' when "user_journals" container_type = 'Principal' @@ -2156,11 +2152,9 @@ class UsersController < ApplicationController @user = User.current if !params[:search].nil? search = "%#{params[:search].to_s.strip.downcase}%" - @course = @user.courses.where(" #{Course.table_name}.id = #{params[:search].to_i } or #{Course.table_name}.name like :p",:p=>search) - .select { |course| @user.allowed_to?(:as_teacher,course) and course.is_delete == 0 } + @course = @user.courses.not_deleted.where(" #{Course.table_name}.id = #{params[:search].to_i } or #{Course.table_name}.name like :p",:p=>search) else - @course = @user.courses - .select { |course| @user.allowed_to?(:as_teacher,course) and course.is_delete == 0 } + @course = @user.courses.not_deleted end @search = params[:search] @type = params[:type] @@ -2178,7 +2172,7 @@ class UsersController < ApplicationController @user = User.current if !params[:search].nil? search = "%#{params[:search].to_s.strip.downcase}%" - @projects = @user.projects.where(" #{Project.table_name}.id = #{params[:search].to_i } or #{Project.table_name}.name like :p",:p=>search) + @projects = @user.projects.visible.where(" #{Project.table_name}.id = #{params[:search].to_i } or #{Project.table_name}.name like :p",:p=>search) else @projects = @user.projects.visible end @@ -3575,8 +3569,7 @@ class UsersController < ApplicationController obj = HomeworkCommon.where('id = ?', params[:id].to_i).first @type = 'HomeworkCommon' @journals = obj.journals_for_messages.reorder("created_on desc") - @is_in_course = params[:is_in_course].to_i if params[:is_in_course] - @course_activity = params[:course_activity].to_i if params[:course_activity] + @hw_status = params[:hw_status].to_i if params[:hw_status] @is_teacher = User.current.allowed_to?(:as_teacher,obj.course) @user_activity_id = params[:user_activity_id].to_i if params[:user_activity_id] end diff --git a/app/controllers/versions_controller.rb b/app/controllers/versions_controller.rb index defc36868..7e9d63e58 100644 --- a/app/controllers/versions_controller.rb +++ b/app/controllers/versions_controller.rb @@ -53,7 +53,6 @@ class VersionsController < ApplicationController @offset ||= @versions_pages.offset @versions = @versions.slice(@offset, @limit) #end by young - @issues_by_version = {} if @selected_tracker_ids.any? && @versions.any? @@ -81,6 +80,11 @@ class VersionsController < ApplicationController all } format.api + # format.xls { + # @issues = @version.fixed_issues.visible.includes(:status, :tracker, :priority).reorder("#{Tracker.table_name}.position, #{Issue.table_name}.id").all + # filename = "#{@version.name.to_s}_#{l(:label_issue_list_xls)}.xls" + # send_data(issue_list_xls(@issues), :type => 'application/octet-stream', :filename => filename_for_content_disposition(filename)) + # } end end diff --git a/app/controllers/words_controller.rb b/app/controllers/words_controller.rb index 499272706..9c8954ed9 100644 --- a/app/controllers/words_controller.rb +++ b/app/controllers/words_controller.rb @@ -110,8 +110,8 @@ class WordsController < ApplicationController else @user_activity_id = -1 end - @is_in_course = params[:is_in_course].to_i - @course_activity = params[:course_activity].to_i + @hw_status = params[:hw_status].to_i + @is_teacher = User.current.allowed_to?(:as_teacher, @homework.course) || User.current.admin? elsif @journal_destroyed.jour_type == 'Syllabus' @syllabus = Syllabus.find @journal_destroyed.jour_id @count = @syllabus.journals_for_messages.count @@ -308,10 +308,9 @@ class WordsController < ApplicationController update_org_activity(@homework_common.class,@homework_common.id) respond_to do |format| format.js{ - @user_activity_id = params[:user_activity_id] - @is_in_course = params[:is_in_course] - @course_activity = params[:course_activity] - @homework_common_id = params[:homework_common_id] + @user_activity_id = params[:user_activity_id].to_i + @hw_status = params[:hw_status].to_i + @is_teacher = User.current.allowed_to?(:as_teacher, @homework_common.course) || User.current.admin? } end else @@ -344,8 +343,8 @@ class WordsController < ApplicationController respond_to do |format| format.js{ @user_activity_id = params[:user_activity_id].to_i - @is_in_course = params[:is_in_course].to_i - @course_activity = params[:course_activity].to_i + @hw_status = params[:hw_status].to_i + @is_teacher = User.current.allowed_to?(:as_teacher, @homework_common.course) || User.current.admin? } end else diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index d3b28fb20..6215a79d0 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -63,6 +63,69 @@ module ApplicationHelper result end + # 项目版本库导出Excel功能 + def export_rep_xls(gpid, options = {}) + g = Gitlab.client + cycle = params[:cycle] + rev = params[:rev] + if cycle == "week" + statics = g.rep_stats_week(gpid, :rev => rev) + elsif cycle == "month" + statics = g.rep_stats_month(gpid, :rev => rev) + end + xls_report = StringIO.new + book = Spreadsheet::Workbook.new + sheet1 = book.create_worksheet :name => "版本库" + blue = Spreadsheet::Format.new :color => :blue, :weight => :bold, :size => 10 + sheet1.row(0).default_format = blue + sheet1.row(0).concat([l(:rep_branch),l(:rep_author),l(:rep_changeset),l(:rep_code_add),l(:rep_code_delete),l(:rep_code_modified),l(:rep_sode_time),l(:rep_sode_cycle),l(:rep_author_mail)]) + count_row = 1 + statics.each do |static| + user = User.where(:mail => static.email).first + sheet1[count_row,0] = rev + sheet1[count_row,1] = user.nil? ? static.uname : user.show_name + sheet1[count_row,2] = static.commits_num + sheet1[count_row,3] = static.add + sheet1[count_row,4] = static.del + sheet1[count_row,5] = static.changes + sheet1[count_row,6] = Time.now.strftime('%Y-%m-%d %H:%M:%S') + sheet1[count_row,7] = cycle == "week" ? "最近1周" : "最近一月" + sheet1[count_row,8] = static.email + count_row += 1 + end + book.write xls_report + xls_report.string + end + + # 项目issue列表导出Excel功能 + def issue_list_xls issues + xls_report = StringIO.new + book = Spreadsheet::Workbook.new + sheet1 = book.create_worksheet :name => "issues" + blue = Spreadsheet::Format.new :color => :blue, :weight => :bold, :size => 10 + sheet1.row(0).default_format = blue + sheet1.row(0).concat([l(:issue_xls_id),l(:issue_xls_tracker_id),l(:issue_xls_title),l(:issue_xls_description),l(:issue_xls_status),l(:issue_xls_assign),l(:issue_xls_priority),l(:issue_xls_author),l(:issue_xls_created_at),l(:milestone),l(:issue_xls_start),l(:issue_xls_due),l(:issue_xls_ratio)]) + count_row = 1 + issues.each do |issue| + sheet1[count_row,0] = issue.id + sheet1[count_row,1] = issue_tracker_change(issue.tracker_id) + sheet1[count_row,2] = issue.subject + sheet1[count_row,3] = (issue.description.gsub(/<\/?.*?>/,"")).html_safe + sheet1[count_row,4] = issue_status_change(issue.status_id) + sheet1[count_row,5] = issue.assigned_to.try(:show_name) + sheet1[count_row,6] = issue_priority_change(issue.priority_id) + sheet1[count_row,7] = issue.author.show_name + sheet1[count_row,8] = issue.created_on.nil? ? issue.created_on : issue.created_on.strftime('%Y-%m-%d %H:%M:%S') + sheet1[count_row,9] = issue.fixed_version.try(:name) + sheet1[count_row,10] = issue.start_date.nil? ? issue.start_date : issue.start_date.strftime('%Y-%m-%d') + sheet1[count_row,11] = issue.due_date.nil? ? issue.due_date : issue.due_date.strftime('%Y-%m-%d') + sheet1[count_row,12] = issue_ratio_change(issue.done_ratio, issue.status_id) + count_row += 1 + end + book.write xls_report + xls_report.string + end + # 获取用户单位 # 优先获取高校信息,如果改信息不存在则获取occupation def get_occupation_from_user user @@ -1799,7 +1862,11 @@ module ApplicationHelper end def link_to_function(name, function, html_options={}) - content_tag(:a, name, {:href => '#', :onclick => "#{function}; return false;"}.merge(:class => " c_purple")) + content_tag(:a, name, {:href => '#', :onclick => "#{function}; return false;"}.merge(:class => "BlueCirBtnMini ml10",:style => "display:inline-block; height:20px; line-height:20px;")) + end + + def link_to_function_none(name, function, html_options={}) + content_tag(:a, name, {:href => '#', :onclick => "#{function}; return false;"}.merge(:style => "display:inline-block; height:20px; line-height:20px;")) end # Helper to render JSON in views @@ -1821,8 +1888,8 @@ module ApplicationHelper end def check_all_links(form_name) - link_to_function(l(:button_check_all), "checkAll('#{form_name}', true)") + "  ".html_safe + " | "+ "  ".html_safe + - link_to_function(l(:button_uncheck_all), "checkAll('#{form_name}', false)") + link_to_function_none(l(:button_check_all), "checkAll('#{form_name}', true)") + "  ".html_safe + " | "+ "  ".html_safe + + link_to_function_none(l(:button_uncheck_all), "checkAll('#{form_name}', false)") end # 本次修改,修改为只显示关闭的所占%比 @@ -2689,15 +2756,15 @@ module ApplicationHelper end #获取匿评相关连接代码 - def homework_anonymous_comment (homework, is_in_course, user_activity_id = -1, course_activity = -1) + def homework_anonymous_comment (homework, hw_status, user_activity_id = -1) if homework.homework_detail_manual.comment_status == 0 ||Time.parse(homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d") link = link_to "启动匿评","javascript:void(0)", :class => "postOptionLink", :title => "作业截止日期之前不可以启动匿评" elsif homework.student_works.has_committed.count >= 2 && homework.homework_detail_manual#作业份数大于2 case homework.homework_detail_manual.comment_status when 1 - link = link_to '启动匿评', Setting.protocol + "://" + Setting.host_name + "/homework_common/" + homework.id.to_s + "/alert_anonymous_comment?is_in_course=" + is_in_course.to_s + "&user_activity_id=" + user_activity_id.to_s + "&course_activity=" + course_activity.to_s, id: "#{homework.id}_start_anonymous_comment", remote: true, disable_with: '加载中...',:class => 'postOptionLink' + link = link_to '启动匿评', Setting.protocol + "://" + Setting.host_name + "/homework_common/" + homework.id.to_s + "/alert_anonymous_comment?hw_status=" + hw_status.to_s + "&user_activity_id=" + user_activity_id.to_s, id: "#{homework.id}_start_anonymous_comment", remote: true, disable_with: '加载中...',:class => 'postOptionLink' when 2 - link = link_to '关闭匿评', Setting.protocol + "://" + Setting.host_name + "/homework_common/" + homework.id.to_s + "/alert_anonymous_comment?is_in_course=" + is_in_course.to_s + "&user_activity_id=" + user_activity_id.to_s + "&course_activity=" + course_activity.to_s, id: "#{homework.id}_stop_anonymous_comment", remote: true,:class => 'postOptionLink' + link = link_to '关闭匿评', Setting.protocol + "://" + Setting.host_name + "/homework_common/" + homework.id.to_s + "/alert_anonymous_comment?hw_status=" + hw_status.to_s + "&user_activity_id=" + user_activity_id.to_s, id: "#{homework.id}_stop_anonymous_comment", remote: true,:class => 'postOptionLink' when 3 # link = link_to "匿评结束","javascript:void(0)", :class => "postOptionLink", :title => "匿评结束" end @@ -2745,7 +2812,7 @@ module ApplicationHelper count = homework.student_works.has_committed.count if User.current.member_of_course?(homework.course) if is_teacher #老师显示作品数量 - link_to "作品(#{count})", student_work_index_url_in_org(homework.id), :class => "c_blue" + link_to "作品(#{count})", student_work_index_url_in_org(homework.id, 2), :class => "c_blue" else #学生显示提交作品、修改作品等按钮 work = cur_user_works_for_homework homework project = cur_user_projects_for_homework homework @@ -2763,20 +2830,20 @@ module ApplicationHelper end else if homework.homework_detail_manual && homework.homework_detail_manual.comment_status == 2 && StudentWorksEvaluationDistribution.where("student_work_id = #{work.id}").count > 0 #匿评作业,且作业状态不是在开启匿评之前 - link_to "作品匿评", student_work_index_url_in_org(homework.id), :class => 'c_blue', :title => "开启匿评后不可修改作品" + link_to "作品匿评", student_work_index_url_in_org(homework.id, 2), :class => 'c_blue', :title => "开启匿评后不可修改作品" elsif homework.homework_detail_manual && homework.homework_detail_manual.comment_status == 3 - link_to "查看作品(#{count})",student_work_index_url_in_org(homework.id), :class => 'c_blue', :title => "匿评已结束" + link_to "查看作品(#{count})",student_work_index_url_in_org(homework.id, 2), :class => 'c_blue', :title => "匿评已结束" elsif homework.homework_type == 2 && Time.parse(homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d")#编程作业不能修改作品 link_to "修改作品(#{count})", new_student_work_url_without_domain(homework.id),:class => 'c_blue' elsif Time.parse(homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d") && work.user_id == User.current.id link_to "修改作品(#{count})", edit_student_work_url_without_domain(work.id),:class => 'c_blue' else - link_to "查看作品(#{count})", student_work_index_url_in_org(homework.id), :class => 'c_blue', :title => "作业截止后不可修改作品" + link_to "查看作品(#{count})", student_work_index_url_in_org(homework.id, 2), :class => 'c_blue', :title => "作业截止后不可修改作品" end end end else - link_to "作品(#{count})",student_work_index_url_in_org(homework.id),:class => "c_blue" + link_to "作品(#{count})",student_work_index_url_in_org(homework.id, 2),:class => "c_blue" end end @@ -2799,15 +2866,15 @@ module ApplicationHelper end else if homework.homework_detail_manual && homework.homework_detail_manual.comment_status == 2 #匿评作业,且作业状态不是在开启匿评之前 - link_to "作品匿评", student_work_index_url_in_org(homework.id), :class => 'hw_btn_green2 fr mt5', :title => "开启匿评后不可修改作品", :target => '_blank' + link_to "作品匿评", student_work_index_url_in_org(homework.id, 2), :class => 'hw_btn_green2 fr mt5', :title => "开启匿评后不可修改作品", :target => '_blank' elsif homework.homework_detail_manual && homework.homework_detail_manual.comment_status == 3 - link_to "查看作品",student_work_index_url_in_org(homework.id), :class => 'hw_btn_green2 fr mt5', :title => "匿评已结束", :target => '_blank' + link_to "查看作品",student_work_index_url_in_org(homework.id, 2), :class => 'hw_btn_green2 fr mt5', :title => "匿评已结束", :target => '_blank' elsif homework.homework_type == 2 && Time.parse(homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d")#编程作业不能修改作品 link_to "修改作品", new_student_work_url_without_domain(homework.id),:class => 'hw_btn_green2 fr mt5', :target => '_blank' elsif Time.parse(homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d") && work.user_id == User.current.id link_to "修改作品", edit_student_work_url_without_domain(work.id),:class => 'hw_btn_green2 fr mt5', :target => '_blank' else - link_to "查看作品", student_work_index_url_in_org(homework.id), :class => 'hw_btn_green2 fr mt5', :title => "作业截止后不可修改作品", :target => '_blank' + link_to "查看作品", student_work_index_url_in_org(homework.id, 2), :class => 'hw_btn_green2 fr mt5', :title => "作业截止后不可修改作品", :target => '_blank' end end end @@ -3136,13 +3203,13 @@ def homework_common_index_url_in_org(course_id) Setting.protocol + "://" + Setting.host_name + "/homework_common?course=" + course_id.to_s end -def student_work_index_url_in_org(homework_id, is_focus = '', show_work_id = '') +def student_work_index_url_in_org(homework_id, tab = 1, is_focus = '', show_work_id = '') if is_focus != '' - Setting.protocol + "://" + Setting.host_name + "/student_work?homework=" + homework_id.to_s + "&is_focus=" + is_focus.to_s + Setting.protocol + "://" + Setting.host_name + "/student_work?homework=" + homework_id.to_s + "&tab=" + tab.to_s + "&is_focus=" + is_focus.to_s elsif show_work_id != '' - Setting.protocol + "://" + Setting.host_name + "/student_work?homework=" + homework_id.to_s + "&show_work_id=" + show_work_id.to_s + Setting.protocol + "://" + Setting.host_name + "/student_work?homework=" + homework_id.to_s + "&tab=" + tab.to_s + "&show_work_id=" + show_work_id.to_s else - Setting.protocol + "://" + Setting.host_name + "/student_work?homework=" + homework_id.to_s + Setting.protocol + "://" + Setting.host_name + "/student_work?homework=" + homework_id.to_s + "&tab=" + tab.to_s end end @@ -3246,7 +3313,12 @@ end #获取所有子节点 def get_all_children result, jour - if (jour.kind_of? JournalsForMessage) || (jour.kind_of? Message) || (jour.kind_of? BlogComment) || (jour.kind_of? OrgDocumentComment) + if jour.kind_of? Message + jour.children.includes(:author, :praise_tread_cache).each do |jour_child| + result << jour_child + get_all_children result, jour_child + end + elsif (jour.kind_of? JournalsForMessage) || (jour.kind_of? BlogComment) || (jour.kind_of? OrgDocumentComment) jour.children.each do |jour_child| result << jour_child get_all_children result, jour_child diff --git a/app/helpers/homework_common_helper.rb b/app/helpers/homework_common_helper.rb index 2d3c72c20..d79a7a432 100644 --- a/app/helpers/homework_common_helper.rb +++ b/app/helpers/homework_common_helper.rb @@ -57,12 +57,12 @@ module HomeworkCommonHelper end #根据传入作业确定跳转到开启匿评还是关闭匿评功能 - def alert_anonyoms_path homework,homework_detail_manual,user_activity_id,is_in_course,course_activity + def alert_anonyoms_path homework,homework_detail_manual,user_activity_id,hw_status link = "" if homework_detail_manual.comment_status == 1 - link = start_anonymous_comment_homework_common_url homework.id,:user_activity_id=>user_activity_id,:is_in_course=>is_in_course,:course_activity=>course_activity + link = start_anonymous_comment_homework_common_url homework.id,:user_activity_id=>user_activity_id,:hw_status=>hw_status elsif homework_detail_manual.comment_status == 2 - link = stop_anonymous_comment_homework_common_url homework.id,:user_activity_id=>user_activity_id,:is_in_course=>is_in_course,:course_activity=>course_activity + link = stop_anonymous_comment_homework_common_url homework.id,:user_activity_id=>user_activity_id,:hw_status=>hw_status end link end diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb index 5a124849f..7aec64718 100644 --- a/app/helpers/issues_helper.rb +++ b/app/helpers/issues_helper.rb @@ -57,6 +57,15 @@ module IssuesHelper "#{@cached_label_priority}: #{h(issue.priority.name)}".html_safe end + def states_done_ratio(issue) + done_ratio = issue.done_ratio + if done_ratio == 100 + "#{l(:label_done_ratio_endding)}".html_safe + else + "#{l(:label_done_ratio_doing)}".html_safe + end + end + def issue_heading(issue) #h("#{issue.tracker} ##{issue.id}") # h("#{issue.tracker} #{issue.source_from}") @@ -117,6 +126,11 @@ module IssuesHelper end end + def options_for_version_isuue_list(project) + 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/queries_helper.rb b/app/helpers/queries_helper.rb index 43d01a5dd..5cc72a82d 100644 --- a/app/helpers/queries_helper.rb +++ b/app/helpers/queries_helper.rb @@ -255,16 +255,20 @@ module QueriesHelper # Give it a name, required to be valid @query = IssueQuery.new(:name => "_") @query.project = @project - params[:f] = %w(subject status_id priority_id author_id assigned_to_id created_on) unless params[:status_id].nil? + params[:f] = %w(subject tracker_id status_id done_ratio author_id assigned_to_id fixed_version_id created_on) unless params[:status_id].nil? params[:op] = {'subject' => "~" , 'status_id' => ( params[:status_id] == '0' ? "!":"=" ), - 'priority_id' => ( params[:priority_id] == '0' ? "!":"=" ), - 'author_id' => ( params[:author_id] == '0' ? "!":"=" ), + 'author_id' =>(params[:author_id] == '0' ? "!":"=" ), + 'done_ratio' => ( params[:done_ratio]== '-1' ? "!":"="), + 'tracker_id' => ( params[:tracker_id] == '0' ? "!":"=" ), + 'fixed_version_id' => ( params[:fixed_version_id] == '0' ? "!":"=" ), 'assigned_to_id' => ( params[:assigned_to_id] == '0' ? "!":"=" )} unless params[:status_id].nil? params[:v] = {'subject' => [params[:subject]], 'status_id' => [params[:status_id]], - 'priority_id' => [params[:priority_id]], 'author_id' => [params[:author_id]], + 'done_ratio' => [params[:done_ratio]], + 'tracker_id' => [params[:tracker_id]], + 'fixed_version_id' => [params[:fixed_version_id]], 'assigned_to_id' => [params[:assigned_to_id]]} unless params[:status_id].nil? if(params[:status_id] != nil) if( params[:issue_create_date_start]!=nil && params[:issue_create_date_start]!='' && diff --git a/app/helpers/syllabus_member_helper.rb b/app/helpers/syllabus_member_helper.rb new file mode 100644 index 000000000..491928d74 --- /dev/null +++ b/app/helpers/syllabus_member_helper.rb @@ -0,0 +1,17 @@ +module SyllabusMemberHelper + include ApplicationHelper + + def find_user_not_in_current_syllabus_by_name syllabus + if params[:q] && params[:q].lstrip.rstrip != "" + scope = Principal.active.sorted.not_member_of_syllabus(syllabus).like(params[:q]) + else + scope = [] + end + principals = paginateHelper scope,10 + s = content_tag('ul', project_member_check_box_tags_ex('membership[user_ids][]', principals), :id => 'principals', :class => 'sy_new_tchlist') + 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 + "/syllabus_member/syl_member_autocomplete?" + parameters.merge(:q => params[:q],:flag => true,:syllabus=> syllabus, :format => 'js').to_query, :remote => true + } + s + content_tag('ul', links,:class => 'wlist',:style=>'float:left !important', :id => "syllabus_member_pagination_links" ) + end +end diff --git a/app/helpers/syllabuses_helper.rb b/app/helpers/syllabuses_helper.rb index 7e815950b..b9e3d09c1 100644 --- a/app/helpers/syllabuses_helper.rb +++ b/app/helpers/syllabuses_helper.rb @@ -4,6 +4,20 @@ module SyllabusesHelper Syllabus.tagged_with(tag_name).order('updated_at desc') end + def find_user_not_in_current_syllabus_by_name syllabus + if params[:q] && params[:q].lstrip.rstrip != "" + scope = Principal.active.sorted.not_member_of_syllabus(syllabus).like(params[:q]) + else + scope = [] + end + principals = paginateHelper scope,10 + s = content_tag('ul', project_member_check_box_tags_ex('membership[user_ids][]', principals), :id => 'principals', :class => 'sy_new_tchlist') + 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 + "/syllabus_member/syl_member_autocomplete?" + parameters.merge(:q => params[:q],:flag => true,:syllabus=> syllabus, :format => 'js').to_query, :remote => true + } + s + content_tag('ul', links,:class => 'wlist',:style=>'float:left !important', :id => "syllabus_member_pagination_links" ) + end + def teacher_count syllabus count = 0 courses = syllabus.courses diff --git a/app/helpers/watchers_helper.rb b/app/helpers/watchers_helper.rb index d846071b5..7f027009a 100644 --- a/app/helpers/watchers_helper.rb +++ b/app/helpers/watchers_helper.rb @@ -344,7 +344,7 @@ module WatchersHelper def exit_project_link(project) link_to(l(:label_exit_project),exit_cur_project_path(project.id), :remote => true, :confirm => l(:lable_sure_exit_project), - :class => "pr_join_a_quit" ) + :class => "sy_btn_grey mr5" ) end #项目关注、取消关注 @@ -361,8 +361,8 @@ module WatchersHelper :object_id => (objects.size == 1 ? objects.first.id : objects.map(&:id).sort)) method = watched ? 'delete' : 'post' link_to text, url, :remote => true, :method => method, - :class => "pr_join_a" ,:id=>id - end + :class => "sy_btn_pink mr5" ,:id=>id + end # 申请加入项目 def join_in_project_link(project, user, options=[]) @@ -372,9 +372,9 @@ module WatchersHelper method = 'post' @applied_flag = project.instance_of?(Project) if applied - link = "#{text}" + link = "#{text}" else - link = link_to(text, url, :remote => true, :method => method, :id => "#{project.id}", :class => "pr_join_a") + link = link_to(text, url, :remote => true, :method => method, :id => "#{project.id}", :class => "sy_btn_pink mr5") end link.html_safe # if applied diff --git a/app/models/at_message.rb b/app/models/at_message.rb index 5a175fe76..10afe3e79 100644 --- a/app/models/at_message.rb +++ b/app/models/at_message.rb @@ -89,7 +89,7 @@ class AtMessage < ActiveRecord::Base status = -1 end when 'JournalsForMessage' - if at_message.jour && at_message.jour.course + if at_message.jour && defined? at_message.jour.course #作业回复 shield_type = "Course" container_id = at_message.jour.course.id @@ -99,7 +99,7 @@ class AtMessage < ActiveRecord::Base else type = "journal_for_message" detail_id = topic.id - detail_title = at_message.subject + detail_title = topic.notes.nil? ? "" : topic.notes end else status = -1 diff --git a/app/models/blog_comment.rb b/app/models/blog_comment.rb index 8959e9c29..6290840a3 100644 --- a/app/models/blog_comment.rb +++ b/app/models/blog_comment.rb @@ -12,6 +12,8 @@ class BlogComment < ActiveRecord::Base belongs_to :last_reply, :class_name => 'BlogComment', :foreign_key => 'last_comment_id' # 虚拟关联 has_many :user_acts, :class_name => 'UserAcivity',:as =>:act + has_many :praise_tread, as: :praise_tread_object, dependent: :destroy + has_one :praise_tread_cache, as: :object, dependent: :destroy acts_as_watchable validates_presence_of :title, :content diff --git a/app/models/comment.rb b/app/models/comment.rb index 633c9a825..27a917b93 100644 --- a/app/models/comment.rb +++ b/app/models/comment.rb @@ -27,6 +27,8 @@ class Comment < ActiveRecord::Base has_many :course_messages, :class_name =>'CourseMessage', :as => :course_message, :dependent => :destroy has_many :forge_messages, :class_name => 'ForgeMessage', :as => :forge_message, :dependent => :destroy #end + has_many :praise_tread, as: :praise_tread_object, dependent: :destroy + has_one :praise_tread_cache, as: :object, dependent: :destroy acts_as_event :datetime => :updated_on, :description => :comments, :type => 'news', diff --git a/app/models/contest.rb b/app/models/contest.rb index 650e363a8..4fbd5441e 100644 --- a/app/models/contest.rb +++ b/app/models/contest.rb @@ -13,6 +13,7 @@ class Contest < ActiveRecord::Base has_many :join_in_competitions, foreign_key: 'competition_id', :dependent => :destroy has_many :join_in_contests, class_name: 'JoinInCompetition', foreign_key: 'competition_id', :dependent => :destroy has_many :praise_tread, as: :praise_tread_object, dependent: :destroy + has_one :praise_tread_cache, as: :object, dependent: :destroy has_many :contestnotifications, :dependent => :destroy, :include => :author diff --git a/app/models/homework_common.rb b/app/models/homework_common.rb index 7a082cecf..dfff273a0 100644 --- a/app/models/homework_common.rb +++ b/app/models/homework_common.rb @@ -19,6 +19,8 @@ class HomeworkCommon < ActiveRecord::Base has_many :student_works_evaluation_distributions, :through => :student_works #一个作业的分配的匿评列表 has_many :journals_for_messages, :as => :jour, :dependent => :destroy has_many :apply_homeworks, :dependent => :destroy + has_many :praise_tread, as: :praise_tread_object, dependent: :destroy + has_one :praise_tread_cache, as: :object, dependent: :destroy has_many :acts, :class_name => 'Activity', :as => :act, :dependent => :destroy #用户活动 # 课程动态 has_many :course_acts, :class_name => 'CourseActivity',:as =>:course_act ,:dependent => :destroy diff --git a/app/models/issue.rb b/app/models/issue.rb index 222a4f4e2..9c3c8d168 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -53,6 +53,7 @@ class Issue < ActiveRecord::Base has_many :forge_acts, :class_name => 'ForgeActivity',:as =>:forge_act ,:dependent => :destroy # end has_many :praise_tread, as: :praise_tread_object, dependent: :destroy + has_one :praise_tread_cache, as: :object, dependent: :destroy # ForgeMessage虚拟关联(多态) has_many :forge_messages, :class_name => 'ForgeMessage',:as =>:forge_message ,:dependent => :destroy diff --git a/app/models/journal.rb b/app/models/journal.rb index f22015f47..f14484a31 100644 --- a/app/models/journal.rb +++ b/app/models/journal.rb @@ -35,6 +35,8 @@ class Journal < ActiveRecord::Base # 被ForgeMessage虚拟关联 has_many :forge_messages, :class_name => 'ForgeMessage',:as =>:forge_message ,:dependent => :destroy has_many :at_messages, as: :at_message, dependent: :destroy + has_many :praise_tread, as: :praise_tread_object, dependent: :destroy + has_one :praise_tread_cache, as: :object, dependent: :destroy acts_as_attachable attr_accessor :indice acts_as_tree :counter_cache => :comments_count, :order => "#{Journal.table_name}.created_on ASC" diff --git a/app/models/journals_for_message.rb b/app/models/journals_for_message.rb index 68cb9da15..30d8120ef 100644 --- a/app/models/journals_for_message.rb +++ b/app/models/journals_for_message.rb @@ -68,6 +68,8 @@ class JournalsForMessage < ActiveRecord::Base has_many :user_feedback_messages, :class_name => 'UserFeedbackMessage', :as =>:journals_for_message, :dependent => :destroy has_many :at_messages, as: :at_message, dependent: :destroy + has_many :praise_tread, as: :praise_tread_object, dependent: :destroy + has_one :praise_tread_cache, as: :object, dependent: :destroy validates :notes, presence: true, if: :is_homework_jour? after_create :act_as_activity, :act_as_course_activity, :act_as_course_message, diff --git a/app/models/memo.rb b/app/models/memo.rb index ee9f4c8db..793d534d4 100644 --- a/app/models/memo.rb +++ b/app/models/memo.rb @@ -48,6 +48,8 @@ class Memo < ActiveRecord::Base acts_as_attachable has_many :user_score_details, :class_name => 'UserScoreDetails',:as => :score_changeable_obj has_many :praise_tread, as: :praise_tread_object, dependent: :destroy + has_one :praise_tread_cache, as: :object, dependent: :destroy + # 消息 has_many :memo_messages, :class_name =>'MemoMessage', :dependent => :destroy # end diff --git a/app/models/message.rb b/app/models/message.rb index 14add0d02..3192907fe 100644 --- a/app/models/message.rb +++ b/app/models/message.rb @@ -26,6 +26,7 @@ class Message < ActiveRecord::Base belongs_to :board,:touch => true belongs_to :author, :class_name => 'User', :foreign_key => 'author_id' has_many :praise_tread, as: :praise_tread_object, dependent: :destroy + has_one :praise_tread_cache, as: :object, dependent: :destroy # has_many :org_subfield_messages, :dependent => :destroy # has_many :org_subfields, :through => :org_subfield_messages diff --git a/app/models/news.rb b/app/models/news.rb index 58bbc40ac..0a893e34e 100644 --- a/app/models/news.rb +++ b/app/models/news.rb @@ -40,6 +40,9 @@ class News < ActiveRecord::Base has_many :forge_messages, :class_name => 'ForgeMessage', :as => :forge_message, :dependent => :destroy #end + has_many :praise_tread, as: :praise_tread_object, dependent: :destroy + has_one :praise_tread_cache, as: :object, dependent: :destroy + #转发表 has_many :forwards, :as => :from, :dependent => :destroy diff --git a/app/models/org_document_comment.rb b/app/models/org_document_comment.rb index dd7734a54..a87fe783f 100644 --- a/app/models/org_document_comment.rb +++ b/app/models/org_document_comment.rb @@ -6,6 +6,8 @@ class OrgDocumentComment < ActiveRecord::Base belongs_to :organization belongs_to :creator, :class_name => 'User', :foreign_key => 'creator_id' has_many :editor_of_documents, :dependent => :destroy + has_many :praise_tread, as: :praise_tread_object, dependent: :destroy + has_one :praise_tread_cache, as: :object, dependent: :destroy acts_as_tree :order => "#{OrgDocumentComment.table_name}.sticky asc, #{OrgDocumentComment.table_name}.created_at desc" acts_as_attachable has_many :org_acts, :class_name => 'OrgActivity',:as =>:org_act ,:dependent => :destroy diff --git a/app/models/praise_tread_cache.rb b/app/models/praise_tread_cache.rb index 739b45876..27f4104fc 100644 --- a/app/models/praise_tread_cache.rb +++ b/app/models/praise_tread_cache.rb @@ -1,6 +1,7 @@ class PraiseTreadCache < ActiveRecord::Base attr_accessible :object_id,:object_type,:praise_num,:tread_num - + belongs_to :object, :polymorphic => true + def plus(flag,num) case flag when 0 diff --git a/app/models/principal.rb b/app/models/principal.rb index e65816e83..7c2b24587 100644 --- a/app/models/principal.rb +++ b/app/models/principal.rb @@ -97,6 +97,16 @@ class Principal < ActiveRecord::Base end } + scope :not_member_of_syllabus, lambda {|syllabus| + syllabuses = [syllabus] unless syllabus.is_a?(Array) + if syllabuses.empty? + where("1=0") + else + ids = syllabuses.map(&:id) + where("#{Principal.table_name}.id NOT IN (SELECT DISTINCT user_id FROM #{SyllabusMember.table_name} WHERE syllabus_id IN (?))", ids) + end + } + scope :sorted, lambda { order(*Principal.fields_for_order_statement)} scope :applied_members, lambda {|project| diff --git a/app/models/project.rb b/app/models/project.rb index e80306036..0ac10fb2b 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -305,6 +305,11 @@ class Project < ActiveRecord::Base errors[:identifier].blank? && !(new_record? || identifier.blank?) end + # returns project's creater + def creater + User.find(self.user_id).try(:show_name) + end + # returns latest created projects # non public projects will be returned only if user is a member of those def self.latest(user=nil, count=5) diff --git a/app/models/syllabus.rb b/app/models/syllabus.rb index 29b675d25..f72463503 100644 --- a/app/models/syllabus.rb +++ b/app/models/syllabus.rb @@ -9,6 +9,9 @@ class Syllabus < ActiveRecord::Base belongs_to :user has_many :courses has_many :journals_for_messages, :as => :jour, :dependent => :destroy + has_many :syllabus_members, :dependent => :destroy + has_many :praise_tread, as: :praise_tread_object, dependent: :destroy + has_one :praise_tread_cache, as: :object, dependent: :destroy attr_accessible :description, :user_id, :title, :eng_name, :syllabus_type, :credit, :hours, :theory_hours, :practice_hours, :applicable_major, :pre_course safe_attributes 'title','user', 'description', 'eng_name', 'syllabus_type', 'credit', 'hours', 'theory_hours', 'practice_hours', 'credit', 'applicable_major', 'pre_course' diff --git a/app/models/syllabus_member.rb b/app/models/syllabus_member.rb new file mode 100644 index 000000000..40d3dacbe --- /dev/null +++ b/app/models/syllabus_member.rb @@ -0,0 +1,5 @@ +class SyllabusMember < ActiveRecord::Base + belongs_to :syllabus + belongs_to :user + attr_accessible :rank, :user_id, :syllabus_id +end diff --git a/app/models/user.rb b/app/models/user.rb index f2b2b6824..c1a830809 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -91,6 +91,7 @@ class User < Principal has_many :homework_attaches, :through => :homework_users has_many :homework_evaluations has_many :syllabuses, :dependent => :destroy + has_many :syllabus_members, :dependent => :destroy #问卷相关关关系 has_many :poll_users, :dependent => :destroy has_many :poll_votes, :dependent => :destroy diff --git a/app/views/calendars/show.html.erb b/app/views/calendars/show.html.erb index 39cab4a53..05ce3bcac 100644 --- a/app/views/calendars/show.html.erb +++ b/app/views/calendars/show.html.erb @@ -1,16 +1,10 @@ -
+

<%= @query.new_record? ? l(:label_calendar) : h(@query.name) %>

<%= form_tag({:controller => 'calendars', :action => 'show', :project_id => @project}, :method => :get, :id => 'query_form') do %> <%= hidden_field_tag 'set_filter', '1' %> -
"> - <%= l(:label_filter_plural) %> -
"> - <%= render :partial => 'queries/filters', :locals => {:query => @query} %> -
-

<%= link_to_previous_month(@year, @month) %> | <%= link_to_next_month(@year, @month) %>

@@ -40,3 +34,7 @@ <% end %> <% html_title(l(:label_calendar)) -%> + + diff --git a/app/views/common/_calendar.html.erb b/app/views/common/_calendar.html.erb index e4ce4da2c..2f4c61a77 100644 --- a/app/views/common/_calendar.html.erb +++ b/app/views/common/_calendar.html.erb @@ -1,4 +1,4 @@ - +
@@ -20,13 +20,13 @@
<%= h("#{i.project} -") unless @project && @project == i.project %> <%= link_to_issue i, :truncate => 30 %> + (<%= states_done_ratio i %>) <%= render_issue_tooltip i %>
<% else %> - - <%= h("#{i.project} -") unless @project && @project == i.project %> - <%= link_to_version i%> - + + <%= h("#{i.project} -") unless @project && @project == i.project %> + <%= link_to_version i%> <% end %> <% end %> diff --git a/app/views/courses/_course_activity.html.erb b/app/views/courses/_course_activity.html.erb index c71e5ade4..a7f99f2b0 100644 --- a/app/views/courses/_course_activity.html.erb +++ b/app/views/courses/_course_activity.html.erb @@ -60,7 +60,7 @@ <% act = activity.course_act %> <% case activity.course_act_type.to_s %> <% when 'HomeworkCommon' %> - <%= render :partial => 'users/course_homework', :locals => {:activity => act, :user_activity_id => activity.id, :course_activity => 1} %> + <%= render :partial => 'users/course_homework', :locals => {:activity => act, :user_activity_id => activity.id, :hw_status => 2} %> <% when 'News' %> <%= render :partial => 'users/course_news', :locals => {:activity => act, :user_activity_id => activity.id} %> <% when 'Message' %> diff --git a/app/views/courses/_courses_jours.html.erb b/app/views/courses/_courses_jours.html.erb index 0aefb0d18..05691db9e 100644 --- a/app/views/courses/_courses_jours.html.erb +++ b/app/views/courses/_courses_jours.html.erb @@ -7,9 +7,9 @@ span.ke-icon-emoticons:hover{background-position:-79px -671px;width:50px;height:26px;} div.ke-toolbar .ke-outline{border:none;} - div.respond-form .reply_btn{margin-left:565px;margin-top:5px;} + div.respond-form .reply_btn{margin-left:625px;margin-top:5px;} div.recall_con{width:570px;} - div.recall_con .reply_btn{margin-left:525px;margin-top:5px;} + div.recall_con .reply_btn{margin-left:585px;margin-top:5px;} /*.ke-container{height: 80px !important;}*/ <%= content_for(:header_tags) do %> @@ -19,7 +19,7 @@ -
+

<%= l(:label_leave_message) %>

<% if !User.current.logged?%> diff --git a/app/views/courses/_history.html.erb b/app/views/courses/_history.html.erb index 35e0726a8..eb7ecff7a 100644 --- a/app/views/courses/_history.html.erb +++ b/app/views/courses/_history.html.erb @@ -5,7 +5,7 @@
<%= link_to image_tag(url_to_avatar(journal.user),:width => '46',:height => '46'), user_path(journal.user) %>
-
+
diff --git a/app/views/courses/_user_homework_search_list.html.erb b/app/views/courses/_user_homework_search_list.html.erb index 750e7537c..ecc0d1d7e 100644 --- a/app/views/courses/_user_homework_search_list.html.erb +++ b/app/views/courses/_user_homework_search_list.html.erb @@ -26,7 +26,7 @@ } } - <%= render :partial => 'users/user_homework_detail', :locals => {:homework_common => homework_common,:is_in_course => is_in_course} %> + <%= render :partial => 'users/course_homework', :locals => {:activity => homework_common,:user_activity_id => homework_common.id, :hw_status => 3} %> <% end%> <% if homework_commons.count == 10%> <%= link_to "点击展开更多",homework_search_course_path(course_id,:page => page,:search=>search),:id => "user_show_more_homework",:remote => "true",:class => "loadMore f_grey"%> diff --git a/app/views/courses/feedback.html.erb b/app/views/courses/feedback.html.erb index 5eae03656..3b2d3030c 100644 --- a/app/views/courses/feedback.html.erb +++ b/app/views/courses/feedback.html.erb @@ -2,7 +2,7 @@
-
+

<%= l(:label_contest_userresponse) %>

diff --git a/app/views/courses/homework_search.js.erb b/app/views/courses/homework_search.js.erb index 3c644ad9e..5e2f81f01 100644 --- a/app/views/courses/homework_search.js.erb +++ b/app/views/courses/homework_search.js.erb @@ -1,5 +1,5 @@ <% if @page == 0 %> - $("#user_homework_list").replaceWith("<%= escape_javascript( render :partial => 'courses/user_homework_search_list',:locals => {:homework_commons => @homeworks, :page => @page, :is_in_course => 1,:course_id => @course.id,:search=>@search} )%>"); + $("#user_homework_list").replaceWith("<%= escape_javascript( render :partial => 'courses/user_homework_search_list',:locals => {:homework_commons => @homeworks, :page => @page, :course_id => @course.id,:search=>@search} )%>"); <% else %> - $("#user_show_more_homework").replaceWith("<%= escape_javascript( render :partial => 'courses/user_homework_search_list',:locals => {:homework_commons => @homeworks, :page => @page, :is_in_course => 1,:course_id => @course.id,:search=>@search} )%>"); + $("#user_show_more_homework").replaceWith("<%= escape_javascript( render :partial => 'courses/user_homework_search_list',:locals => {:homework_commons => @homeworks, :page => @page, :course_id => @course.id,:search=>@search} )%>"); <% end %> \ No newline at end of file diff --git a/app/views/courses/new.html.erb b/app/views/courses/new.html.erb index 4c4374a29..f754c4540 100644 --- a/app/views/courses/new.html.erb +++ b/app/views/courses/new.html.erb @@ -17,12 +17,13 @@
  • - +
  • 正确示例:计算机系2016秋季A班
  • 错误示例:软件工程 - 计算机系2016秋季A班
  • +
  • 班级是一个由教师、助教(教辅)和学生组成的临时的教学群体,在规定的时间内(如一个学期)完成一门课程规定的教学任务。本质上,一门课程就是一个教学计划。
  • diff --git a/app/views/exercise/student_exercise_list.html.erb b/app/views/exercise/student_exercise_list.html.erb index 1cbe058a1..443a9f5f1 100644 --- a/app/views/exercise/student_exercise_list.html.erb +++ b/app/views/exercise/student_exercise_list.html.erb @@ -84,7 +84,7 @@
  • -
    +
    <% if @exercise.exercise_status == 1 %> diff --git a/app/views/gantts/show.html.erb b/app/views/gantts/show.html.erb index 2808a99cc..759f8c232 100644 --- a/app/views/gantts/show.html.erb +++ b/app/views/gantts/show.html.erb @@ -1,321 +1,323 @@ -
    -

    <% @gantt.view = self %> - <%= @query.new_record? ? l(:label_gantt) : h(@query.name) %>

    -
    - -<%= form_tag({:controller => 'gantts', :action => 'show', - :project_id => @project, :month => params[:month], - :year => params[:year], :months => params[:months]}, - :method => :get, :id => 'query_form') do %> -<%= hidden_field_tag 'set_filter', '1' %> -
    "> - <%= l(:label_filter_plural) %> -
    "> - <%= render :partial => 'queries/filters', :locals => {:query => @query} %> -
    -
    -
    - - - - -
    -
    - <%= l(:label_related_issues) %> - -
    -
    -
    - <%= l(:label_gantt_progress_line) %> - -
    -
    -
    - - -

    - <%= gantt_zoom_link(@gantt, :in) %> - <%= gantt_zoom_link(@gantt, :out) %> -

    - -

    -<%= text_field_tag 'months', @gantt.months, :size => 2 %> -<%= l(:label_months_from) %> -<%= select_month(@gantt.month_from, :prefix => "month", :discard_type => true) %> -<%= select_year(@gantt.year_from, :prefix => "year", :discard_type => true) %> -<%= hidden_field_tag 'zoom', @gantt.zoom %> - -<%= link_to_function l(:button_apply), '$("#query_form").submit()', - :class => 'icon icon-checked' %> -<%= link_to l(:button_clear), { :project_id => @project, :set_filter => 1 }, - :class => 'icon icon-reload' %> -

    -<% end %> - -<%= error_messages_for 'query' %> -<% if @query.valid? %> -<% - zoom = 1 - @gantt.zoom.times { zoom = zoom * 2 } - - subject_width = 330 - header_height = 18 - - headers_height = header_height - show_weeks = false - show_days = false - - if @gantt.zoom > 1 - show_weeks = true - headers_height = 2 * header_height - if @gantt.zoom > 2 - show_days = true - headers_height = 3 * header_height - end - end - - # Width of the entire chart - g_width = ((@gantt.date_to - @gantt.date_from + 1) * zoom).to_i - @gantt.render(:top => headers_height + 8, - :zoom => zoom, - :g_width => g_width, - :subject_width => subject_width) - g_height = [(20 * (@gantt.number_of_rows + 6)) + 150, 206].max - t_height = g_height + headers_height -%> - -<% if @gantt.truncated %> -

    <%= l(:notice_gantt_chart_truncated, :max => @gantt.max_rows) %>

    -<% end %> - - - - - - - -
    - <% - style = "" - style += "position:relative;" - style += "height: #{t_height + 24}px;" - style += "width: #{subject_width + 1}px;" - %> - <%= content_tag(:div, :style => style) do %> - <% - style = "" - style += "right:-2px;" - style += "width: #{subject_width}px;" - style += "height: #{headers_height}px;" - style += 'background: #eee;' - %> - <%= content_tag(:div, "", :style => style, :class => "gantt_hdr") %> - <% - style = "" - style += "right:-2px;" - style += "width: #{subject_width}px;" - style += "height: #{t_height}px;" - style += 'border-left: 1px solid #c0c0c0;' - style += 'overflow: hidden;' - %> - <%= content_tag(:div, "", :style => style, :class => "gantt_hdr") %> - <%= content_tag(:div, :class => "gantt_subjects") do %> - <%= @gantt.subjects.html_safe %> - <% end %> - <% end %> - -
    -<% - style = "" - style += "width: #{g_width - 1}px;" - style += "height: #{headers_height}px;" - style += 'background: #eee;' -%> -<%= content_tag(:div, ' '.html_safe, :style => style, :class => "gantt_hdr") %> - -<% ###### Months headers ###### %> -<% - month_f = @gantt.date_from - left = 0 - height = (show_weeks ? header_height : header_height + g_height) -%> -<% @gantt.months.times do %> - <% - width = (((month_f >> 1) - month_f) * zoom - 1).to_i - style = "" - style += "left: #{left}px;" - style += "width: #{width}px;" - style += "height: #{height}px;" - %> - <%= content_tag(:div, :style => style, :class => "gantt_hdr") do %> - <%= link_to h("#{month_f.year}-#{month_f.month}"), - @gantt.params.merge(:year => month_f.year, :month => month_f.month), - :title => "#{month_name(month_f.month)} #{month_f.year}" %> - <% end %> - <% - left = left + width + 1 - month_f = month_f >> 1 - %> -<% end %> - -<% ###### Weeks headers ###### %> -<% if show_weeks %> - <% - left = 0 - height = (show_days ? header_height - 1 : header_height - 1 + g_height) - %> - <% if @gantt.date_from.cwday == 1 %> - <% - # @date_from is monday - week_f = @gantt.date_from - %> - <% else %> - <% - # find next monday after @date_from - week_f = @gantt.date_from + (7 - @gantt.date_from.cwday + 1) - width = (7 - @gantt.date_from.cwday + 1) * zoom - 1 - style = "" - style += "left: #{left}px;" - style += "top: 19px;" - style += "width: #{width}px;" - style += "height: #{height}px;" - %> - <%= content_tag(:div, ' '.html_safe, - :style => style, :class => "gantt_hdr") %> - <% left = left + width + 1 %> - <% end %> - <% while week_f <= @gantt.date_to %> - <% - width = ((week_f + 6 <= @gantt.date_to) ? - 7 * zoom - 1 : - (@gantt.date_to - week_f + 1) * zoom - 1).to_i - style = "" - style += "left: #{left}px;" - style += "top: 19px;" - style += "width: #{width}px;" - style += "height: #{height}px;" - %> - <%= content_tag(:div, :style => style, :class => "gantt_hdr") do %> - <%= content_tag(:small) do %> - <%= week_f.cweek if width >= 16 %> - <% end %> - <% end %> - <% - left = left + width + 1 - week_f = week_f + 7 - %> - <% end %> -<% end %> - -<% ###### Days headers ####### %> -<% if show_days %> - <% - left = 0 - height = g_height + header_height - 1 - wday = @gantt.date_from.cwday - %> - <% (@gantt.date_to - @gantt.date_from + 1).to_i.times do %> - <% - width = zoom - 1 - style = "" - style += "left: #{left}px;" - style += "top:37px;" - style += "width: #{width}px;" - style += "height: #{height}px;" - style += "font-size:0.7em;" - clss = "gantt_hdr" - clss << " nwday" if @gantt.non_working_week_days.include?(wday) - %> - <%= content_tag(:div, :style => style, :class => clss) do %> - <%= day_letter(wday) %> - <% end %> - <% - left = left + width + 1 - wday = wday + 1 - wday = 1 if wday > 7 - %> - <% end %> -<% end %> - -<%= @gantt.lines.html_safe %> - -<% ###### Today red line (excluded from cache) ###### %> -<% if Date.today >= @gantt.date_from and Date.today <= @gantt.date_to %> - <% - today_left = (((Date.today - @gantt.date_from + 1) * zoom).floor() - 1).to_i - style = "" - style += "position: absolute;" - style += "height: #{g_height}px;" - style += "top: #{headers_height + 1}px;" - style += "left: #{today_left}px;" - style += "width:10px;" - style += "border-left: 1px dashed red;" - %> - <%= content_tag(:div, ' '.html_safe, :style => style, :id => 'today_line') %> -<% end %> -<% - style = "" - style += "position: absolute;" - style += "height: #{g_height}px;" - style += "top: #{headers_height + 1}px;" - style += "left: 0px;" - style += "width: #{g_width - 1}px;" -%> -<%= content_tag(:div, '', :style => style, :id => "gantt_draw_area") %> -
    -
    - - - - - - -
    - <%= link_to_content_update("\xc2\xab " + l(:label_previous), - params.merge(@gantt.params_previous)) %> - - <%= link_to_content_update(l(:label_next) + " \xc2\xbb", - params.merge(@gantt.params_next)) %> -
    - -<% other_formats_links do |f| %> - <%= f.link_to 'PDF', :url => params.merge(@gantt.params) %> - <%= f.link_to('PNG', :url => params.merge(@gantt.params)) if @gantt.respond_to?('to_image') %> -<% end %> -<% end # query.valid? %> - -<% content_for :sidebar do %> - <%= render :partial => 'issues/sidebar' %> -<% end %> - -<% html_title(l(:label_gantt)) -%> - -<% content_for :header_tags do %> - <%= javascript_include_tag 'raphael' %> - <%= javascript_include_tag 'gantt' %> -<% end %> - -<%= javascript_tag do %> - var issue_relation_type = <%= raw Redmine::Helpers::Gantt::DRAW_TYPES.to_json %>; - $(document).ready(drawGanttHandler); - $(window).resize(drawGanttHandler); - $(function() { - $("#draw_rels").change(drawGanttHandler); - $("#draw_progress_line").change(drawGanttHandler); - }); -<% end %> +
    +

    <% @gantt.view = self %> + <%= @query.new_record? ? l(:label_gantt) : h(@query.name) %>

    +
    + +<%= form_tag({:controller => 'gantts', :action => 'show', + :project_id => @project, :month => params[:month], + :year => params[:year], :months => params[:months]}, + :method => :get, :id => 'query_form') do %> +<%= hidden_field_tag 'set_filter', '1' %> + + + + + + + + + + + + + +

    +<%= text_field_tag 'months', @gantt.months, :size => 2 %> +<%= l(:label_months_from) %> +<%= select_month(@gantt.month_from, :prefix => "month", :discard_type => true) %> +<%= select_year(@gantt.year_from, :prefix => "year", :discard_type => true) %> +<%= hidden_field_tag 'zoom', @gantt.zoom %> + +<%= link_to_function l(:button_apply), '$("#query_form").submit()', + :class => 'icon icon-checked' %> +<%= link_to l(:button_clear), { :project_id => @project, :set_filter => 1 }, + :class => 'icon icon-reload' %> +

    +<% end %> + +<%= error_messages_for 'query' %> +<% if @query.valid? %> +<% + zoom = 1 + @gantt.zoom.times { zoom = zoom * 2 } + + subject_width = 330 + header_height = 18 + + headers_height = header_height + show_weeks = false + show_days = false + + if @gantt.zoom > 1 + show_weeks = true + headers_height = 2 * header_height + if @gantt.zoom > 2 + show_days = true + headers_height = 3 * header_height + end + end + + # Width of the entire chart + g_width = ((@gantt.date_to - @gantt.date_from + 1) * zoom).to_i + @gantt.render(:top => headers_height + 8, + :zoom => zoom, + :g_width => g_width, + :subject_width => subject_width) + g_height = [(20 * (@gantt.number_of_rows + 6)) + 150, 206].max + t_height = g_height + headers_height +%> + +<%# if @gantt.truncated %> + +<%# end %> + + + + + + + +
    + <% + style = "" + style += "position:relative;" + style += "height: #{t_height + 24}px;" + style += "width: #{subject_width + 1}px;" + %> + <%= content_tag(:div, :style => style) do %> + <% + style = "" + style += "right:-2px;" + style += "width: #{subject_width}px;" + style += "height: #{headers_height}px;" + style += 'background: #eee;' + style += 'z-index: 1;' + %> + <%= content_tag(:div, "", :style => style, :class => "gantt_hdr") %> + <% + style = "" + style += "right:-2px;" + style += "width: #{subject_width}px;" + style += "height: #{t_height}px;" + style += 'border-left: 1px solid #c0c0c0;' + style += 'overflow: hidden;' + %> + <%= content_tag(:div, "", :style => style, :class => "gantt_hdr") %> + <%= content_tag(:div, :class => "gantt_subjects") do %> + <%= @gantt.subjects.html_safe %> + <% end %> + <% end %> + +
    +<% + style = "" + style += "width: #{g_width - 1}px;" + style += "height: #{headers_height}px;" + style += 'background: #eee;' +%> +<%= content_tag(:div, ' '.html_safe, :style => style, :class => "gantt_hdr") %> + +<% ###### Months headers ###### %> +<% + month_f = @gantt.date_from + left = 0 + height = (show_weeks ? header_height : header_height + g_height) +%> +<% @gantt.months.times do %> + <% + width = (((month_f >> 1) - month_f) * zoom - 1).to_i + style = "" + style += "left: #{left}px;" + style += "width: #{width}px;" + style += "height: #{height}px;" + %> + <%= content_tag(:div, :style => style, :class => "gantt_hdr") do %> + <%= link_to h("#{month_f.year}-#{month_f.month}"), + @gantt.params.merge(:year => month_f.year, :month => month_f.month), + :title => "#{month_name(month_f.month)} #{month_f.year}" %> + <% end %> + <% + left = left + width + 1 + month_f = month_f >> 1 + %> +<% end %> + +<% ###### Weeks headers ###### %> +<% if show_weeks %> + <% + left = 0 + height = (show_days ? header_height - 1 : header_height - 1 + g_height) + %> + <% if @gantt.date_from.cwday == 1 %> + <% + # @date_from is monday + week_f = @gantt.date_from + %> + <% else %> + <% + # find next monday after @date_from + week_f = @gantt.date_from + (7 - @gantt.date_from.cwday + 1) + width = (7 - @gantt.date_from.cwday + 1) * zoom - 1 + style = "" + style += "left: #{left}px;" + style += "top: 19px;" + style += "width: #{width}px;" + style += "height: #{height}px;" + %> + <%= content_tag(:div, ' '.html_safe, + :style => style, :class => "gantt_hdr") %> + <% left = left + width + 1 %> + <% end %> + <% while week_f <= @gantt.date_to %> + <% + width = ((week_f + 6 <= @gantt.date_to) ? + 7 * zoom - 1 : + (@gantt.date_to - week_f + 1) * zoom - 1).to_i + style = "" + style += "left: #{left}px;" + style += "top: 19px;" + style += "width: #{width}px;" + style += "height: #{height}px;" + %> + <%= content_tag(:div, :style => style, :class => "gantt_hdr") do %> + <%= content_tag(:small) do %> + <%= week_f.cweek if width >= 16 %> + <% end %> + <% end %> + <% + left = left + width + 1 + week_f = week_f + 7 + %> + <% end %> +<% end %> + +<% ###### Days headers ####### %> +<% if show_days %> + <% + left = 0 + height = g_height + header_height - 1 + wday = @gantt.date_from.cwday + %> + <% (@gantt.date_to - @gantt.date_from + 1).to_i.times do %> + <% + width = zoom - 1 + style = "" + style += "left: #{left}px;" + style += "top:37px;" + style += "width: #{width}px;" + style += "height: #{height}px;" + style += "font-size:0.7em;" + clss = "gantt_hdr" + clss << " nwday" if @gantt.non_working_week_days.include?(wday) + %> + <%= content_tag(:div, :style => style, :class => clss) do %> + <%= day_letter(wday) %> + <% end %> + <% + left = left + width + 1 + wday = wday + 1 + wday = 1 if wday > 7 + %> + <% end %> +<% end %> + +<%= @gantt.lines.html_safe %> + +<% ###### Today red line (excluded from cache) ###### %> +<% if Date.today >= @gantt.date_from and Date.today <= @gantt.date_to %> + <% + today_left = (((Date.today - @gantt.date_from + 1) * zoom).floor() - 1).to_i + style = "" + style += "position: absolute;" + style += "height: #{g_height}px;" + style += "top: #{headers_height + 1}px;" + style += "left: #{today_left}px;" + style += "width:10px;" + style += "border-left: 1px dashed red;" + %> + <%= content_tag(:div, ' '.html_safe, :style => style, :id => 'today_line') %> +<% end %> +<% + style = "" + style += "position: absolute;" + style += "height: #{g_height}px;" + style += "top: #{headers_height + 1}px;" + style += "left: 0px;" + style += "width: #{g_width - 1}px;" +%> +<%= content_tag(:div, '', :style => style, :id => "gantt_draw_area") %> +
    +
    + + + + + + +
    + <%= link_to_content_update("\xc2\xab " + l(:label_previous), + params.merge(@gantt.params_previous)) %> + + <%= link_to_content_update(l(:label_next) + " \xc2\xbb", + params.merge(@gantt.params_next)) %> +
    + + +<% end # query.valid? %> + +<% content_for :sidebar do %> + <%= render :partial => 'issues/sidebar' %> +<% end %> + +<% html_title(l(:label_gantt)) -%> + +<% content_for :header_tags do %> + <%= javascript_include_tag 'raphael' %> + <%= javascript_include_tag 'gantt' %> +<% end %> + +<%= javascript_tag do %> + var issue_relation_type = <%= raw Redmine::Helpers::Gantt::DRAW_TYPES.to_json %>; + $(document).ready(drawGanttHandler); + $(window).resize(drawGanttHandler); + $(function() { + $("#draw_rels").change(drawGanttHandler); + $("#draw_progress_line").change(drawGanttHandler); + }); +<% end %> + + diff --git a/app/views/homework_common/_alert_anonyoms.html.erb b/app/views/homework_common/_alert_anonyoms.html.erb index 79840cb35..8834d6746 100644 --- a/app/views/homework_common/_alert_anonyoms.html.erb +++ b/app/views/homework_common/_alert_anonyoms.html.erb @@ -32,7 +32,7 @@

    <% end %>
    - + 确  定 diff --git a/app/views/homework_common/_alert_open_student_works.html.erb b/app/views/homework_common/_alert_open_student_works.html.erb index 73c7f0b47..4eda8e458 100644 --- a/app/views/homework_common/_alert_open_student_works.html.erb +++ b/app/views/homework_common/_alert_open_student_works.html.erb @@ -22,7 +22,7 @@

    <% end %>
    - + 确  定 diff --git a/app/views/homework_common/_homework_index_list.html.erb b/app/views/homework_common/_homework_index_list.html.erb index 9b11017e8..dcbe8d411 100644 --- a/app/views/homework_common/_homework_index_list.html.erb +++ b/app/views/homework_common/_homework_index_list.html.erb @@ -1,4 +1,4 @@ -<%= render :partial => 'users/user_homework_list', :locals => {:homework_commons => homework_commons,:page => 0,:is_in_course => 1,:course_id => course_id} %> +<%= render :partial => 'users/user_homework_list', :locals => {:homework_commons => homework_commons,:page => 0,:course_id => course_id} %>
      diff --git a/app/views/homework_common/_set_evalutation_att.html.erb b/app/views/homework_common/_set_evalutation_att.html.erb index bc4e8e733..eff138305 100644 --- a/app/views/homework_common/_set_evalutation_att.html.erb +++ b/app/views/homework_common/_set_evalutation_att.html.erb @@ -1,5 +1,5 @@
      - <%= form_for('new_form',:url => {:controller => 'homework_common',:action => 'set_evaluation_attr',:homework => @homework.id,:user_activity_id=>user_activity_id,:is_in_course=>is_in_course,:course_activity=>course_activity},:method => "post",:remote => true) do |f|%> + <%= form_for('new_form',:url => {:controller => 'homework_common',:action => 'set_evaluation_attr',:homework => @homework.id,:user_activity_id=>user_activity_id,:hw_status=>hw_status},:method => "post",:remote => true) do |f|%> 匿评设置
      diff --git a/app/views/homework_common/alert_forbidden_anonymous_comment.js.erb b/app/views/homework_common/alert_forbidden_anonymous_comment.js.erb index 1e81df9e7..354f217e2 100644 --- a/app/views/homework_common/alert_forbidden_anonymous_comment.js.erb +++ b/app/views/homework_common/alert_forbidden_anonymous_comment.js.erb @@ -1,4 +1,4 @@ -$('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/alert_forbidden_anonymous', :locals => {:user_activity_id => @user_activity_id,:is_in_course => @is_in_course,:course_activity => @course_activity}) %>'); +$('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/alert_forbidden_anonymous', :locals => {:user_activity_id => @user_activity_id,:hw_status => @hw_status}) %>'); showModal('ajax-modal', '500px'); $('#ajax-modal').siblings().remove(); $('#ajax-modal').before("" + diff --git a/app/views/homework_common/edit.html.erb b/app/views/homework_common/edit.html.erb index 4a3de027b..ec5ecc31c 100644 --- a/app/views/homework_common/edit.html.erb +++ b/app/views/homework_common/edit.html.erb @@ -1,5 +1,5 @@ -
      +
      编辑作业
      @@ -56,8 +54,7 @@ <% end %> <%= form_for @homework do |f| %> - - +
      <%= render :partial => 'users/user_homework_form', :locals => { :homework => @homework,:f => f,:edit_mode => true } %> diff --git a/app/views/homework_common/open_student_works.js.erb b/app/views/homework_common/open_student_works.js.erb index e171e65d1..c65034689 100644 --- a/app/views/homework_common/open_student_works.js.erb +++ b/app/views/homework_common/open_student_works.js.erb @@ -1,7 +1,10 @@ -<% if @user_activity_id.to_i == -1 %> -$("#homework_common_<%= @homework.id %>").replaceWith("<%= escape_javascript(render :partial => "users/user_homework_detail",:locals => {:homework_common => @homework, :is_in_course => @is_in_course})%>"); -sd_create_editor_from_data(<%= @homework.id%>,"","100%", "<%=@homework.class.to_s%>"); +<% if @hw_status == 5 %> +$("#homework_post_brief").html("<%= escape_javascript(render :partial => 'student_work/homework_post_brief', :locals => {:homework => @homework, :is_teacher => @is_teacher}) %>"); <% else %> -$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_homework', :locals => {:activity => @homework,:user_activity_id =>@user_activity_id,:course_activity=>@course_activity}) %>"); +$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_homework', :locals => {:activity => @homework,:user_activity_id =>@user_activity_id,:hw_status=>@hw_status}) %>"); +<% end %> +<% if @user_activity_id != @homework.id %> sd_create_editor_from_data(<%= @user_activity_id%>,"","100%", "UserActivity"); +<% else %> +sd_create_editor_from_data(<%= @homework.id%>,"","100%", "<%=@homework.class.to_s%>"); <% end %> \ No newline at end of file diff --git a/app/views/homework_common/score_rule_set.js.erb b/app/views/homework_common/score_rule_set.js.erb index f83b51b55..2ea1fe4a5 100644 --- a/app/views/homework_common/score_rule_set.js.erb +++ b/app/views/homework_common/score_rule_set.js.erb @@ -1,4 +1,4 @@ -$('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/set_score_rule',:locals => {:homework => @homework, :student_path => false, :user_activity_id => @user_activity_id,:is_in_course => @is_in_course,:course_activity =>@course_activity,:remote=>true}) %>'); +$('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/set_score_rule',:locals => {:homework => @homework, :student_path => false, :user_activity_id => @user_activity_id,:hw_status => @hw_status,:remote=>true}) %>'); showModal('ajax-modal', '350px'); $('#ajax-modal').siblings().remove(); $('#ajax-modal').before("" + diff --git a/app/views/homework_common/set_evaluation_attr.js.erb b/app/views/homework_common/set_evaluation_attr.js.erb index 987abd351..e084967c7 100644 --- a/app/views/homework_common/set_evaluation_attr.js.erb +++ b/app/views/homework_common/set_evaluation_attr.js.erb @@ -1,8 +1,11 @@ clickCanel(); -<% if @user_activity_id != -1 %> -$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_homework', :locals => {:activity => @homework,:user_activity_id =>@user_activity_id,:course_activity=>@courae_activity}) %>"); +<% if @hw_status == 5 %> +$("#homework_post_brief").html("<%= escape_javascript(render :partial => 'student_work/homework_post_brief', :locals => {:homework => @homework, :is_teacher => @is_teacher}) %>"); +<% else %> +$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_homework', :locals => {:activity => @homework,:user_activity_id =>@user_activity_id,:hw_status=>@hw_status}) %>"); +<% end %> +<% if @user_activity_id != @homework.id %> sd_create_editor_from_data(<%= @user_activity_id%>,"","100%", "UserActivity"); <% else %> -$("#homework_common_<%= @homework.id %>").replaceWith("<%= escape_javascript(render :partial => 'users/user_homework_detail', :locals => {:homework_common => @homework,:is_in_course => @is_in_course}) %>"); sd_create_editor_from_data(<%= @homework.id%>,"","100%", "<%=@homework.class.to_s%>"); <% end %> \ No newline at end of file diff --git a/app/views/homework_common/start_anonymous_comment.js.erb b/app/views/homework_common/start_anonymous_comment.js.erb index 91a68011e..809ba5b05 100644 --- a/app/views/homework_common/start_anonymous_comment.js.erb +++ b/app/views/homework_common/start_anonymous_comment.js.erb @@ -1,13 +1,15 @@ <% if @statue == 1%> alert('启动成功'); - <% if @user_activity_id == -1 %> - $("#homework_common_<%= @homework.id %>").replaceWith("<%= escape_javascript(render :partial => "users/user_homework_detail",:locals => {:homework_common => @homework, :is_in_course => @is_in_course})%>"); - $("#evaluation_start_time_<%=@homework.id %>").html("匿评开启时间:<%=format_time(Time.now) %>"); - sd_create_editor_from_data(<%= @homework.id%>,"","100%", "<%=@homework.class.to_s%>"); + <% if @hw_status == 5 %> + $("#homework_post_brief").html("<%= escape_javascript(render :partial => 'student_work/homework_post_brief', :locals => {:homework => @homework, :is_teacher => @is_teacher}) %>"); <% else %> - $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_homework', :locals => {:activity => @homework,:user_activity_id =>@user_activity_id,:course_activity=>@course_activity}) %>"); - $("#evaluation_start_time_<%=@user_activity_id %>").html("匿评开启时间:<%=format_time(Time.now) %>"); + $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_homework', :locals => {:activity => @homework,:user_activity_id =>@user_activity_id,:hw_status=>@hw_status}) %>"); + <% end %> + $("#evaluation_start_time_<%=@user_activity_id %>").html("匿评开启时间:<%=format_time(Time.now) %>"); + <% if @user_activity_id != @homework.id %> sd_create_editor_from_data(<%= @user_activity_id%>,"","100%", "UserActivity"); + <% else %> + sd_create_editor_from_data(<%= @homework.id%>,"","100%", "<%=@homework.class.to_s%>"); <% end %> /*$("#<%#= @homework.id %>_start_anonymous_comment").replaceWith('<%#= escape_javascript(link_to "关闭匿评", alert_anonymous_comment_homework_common_path(@homework), remote: true, id:"#{@homework.id}_stop_anonymous_comment",:class => "postOptionLink")%>');*/ <% elsif @statue == 2 %> diff --git a/app/views/homework_common/start_evaluation_set.js.erb b/app/views/homework_common/start_evaluation_set.js.erb index 6ed74d0f0..3ece646dc 100644 --- a/app/views/homework_common/start_evaluation_set.js.erb +++ b/app/views/homework_common/start_evaluation_set.js.erb @@ -1,4 +1,4 @@ -$('#ajax-modal').html('<%= escape_javascript(render :partial => 'homework_common/set_evalutation_att',:locals => {:user_activity_id => @user_activity_id,:is_in_course => @is_in_course,:course_activity =>@course_activity,:remote=>true}) %>'); +$('#ajax-modal').html('<%= escape_javascript(render :partial => 'homework_common/set_evalutation_att',:locals => {:user_activity_id => @user_activity_id,:hw_status => @hw_status,:remote=>true}) %>'); var datepickerOptions={dateFormat: 'yy-mm-dd', firstDay: 0, showOn: 'button', buttonImageOnly: true, buttonImage: '/images/public_icon.png', showButtonPanel: true, showWeek: true, showOtherMonths: true, selectOtherMonths: true}; showModal('ajax-modal', '350px'); $('#ajax-modal').siblings().remove(); diff --git a/app/views/homework_common/stop_anonymous_comment.js.erb b/app/views/homework_common/stop_anonymous_comment.js.erb index 874374476..027f477a7 100644 --- a/app/views/homework_common/stop_anonymous_comment.js.erb +++ b/app/views/homework_common/stop_anonymous_comment.js.erb @@ -1,12 +1,14 @@ alert('关闭成功'); -<% if @user_activity_id == -1 %> -$("#homework_common_<%= @homework.id %>").replaceWith("<%= escape_javascript(render :partial => "users/user_homework_detail",:locals => {:homework_common => @homework, :is_in_course => @is_in_course})%>"); +<% if @hw_status == 5 %> +$("#homework_post_brief").html("<%= escape_javascript(render :partial => 'student_work/homework_post_brief', :locals => {:homework => @homework, :is_teacher => @is_teacher}) %>"); +<% else %> +$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_homework', :locals => {:activity => @homework,:user_activity_id =>@user_activity_id,:hw_status=>@hw_status}) %>"); +<% end %> $("#evaluation_end_time_<%=@homework.id %>").html("匿评关闭时间:<%=format_time(Time.now) %>"); -sd_create_editor_from_data(<%= @homework.id%>,"","100%", "<%=@homework.class.to_s%>"); +<% if @user_activity_id != @homework.id %> +sd_create_editor_from_data(<%= @user_activity_id%>,"","100%", "UserActivity"); <% else %> -$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_homework', :locals => {:activity => @homework,:user_activity_id =>@user_activity_id,:course_activity=>@course_activity}) %>"); -$("#evaluation_end_time_<%=@user_activity_id %>").html("匿评关闭时间:<%=format_time(Time.now) %>"); -sd_create_editor_from_data(<%= @user_activity_id%>,"","100%", 'UserActivity'); +sd_create_editor_from_data(<%= @homework.id%>,"","100%", "<%=@homework.class.to_s%>"); <% end %> /* $("#<%#= @homework.id %>_stop_anonymous_comment").replaceWith('');*/ diff --git a/app/views/issues/_all_list.html.erb b/app/views/issues/_all_list.html.erb new file mode 100644 index 000000000..afd630b2c --- /dev/null +++ b/app/views/issues/_all_list.html.erb @@ -0,0 +1,16 @@ +<% issue_list(issues) do |issue, level| -%> + + <%= render :partial => 'issues/project_issue', :locals => {:activity => issue, :user_activity_id => issue.id} %> +<% end %> +
      +
      +
        + <%= pagination_links_full @issue_pages, @issue_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true%> +
      +
      +
      +
      diff --git a/app/views/issues/_attributes.html.erb b/app/views/issues/_attributes.html.erb index 9dba6a6c8..f7d7b4d50 100644 --- a/app/views/issues/_attributes.html.erb +++ b/app/views/issues/_attributes.html.erb @@ -25,6 +25,14 @@
    • + + +
    • +
    • <% if @issue.safe_attribute? 'assigned_to_id' %> @@ -36,7 +44,7 @@
    • <% if @issue.safe_attribute?('fixed_version_id') && @issue.assignable_versions.any? %> - + <%= f.select :fixed_version_id, version_options_for_select(@issue.assignable_versions, @issue.fixed_version), {:include_blank => true, :required => @issue.required_attribute?('fixed_version_id'), :no_label => true}, :class => "w150" %> @@ -74,7 +82,13 @@ <% if @issue.safe_attribute? 'estimated_hours' %> <%= f.text_field :estimated_hours, :size => 22, :disabled => !@issue.leaf?, :no_label => true, :required => @issue.required_attribute?('estimated_hours') %> - <%= l(:field_hours) %> + <% end %> +
    • +
      +
    • + + <% if @issue.safe_attribute? 'estimated_hours' %> + <%= f.text_field :estimated_hours, :size => 22, :disabled => !@issue.leaf?, :no_label => true %> <% end %>
    • diff --git a/app/views/issues/_attributes_show.html.erb b/app/views/issues/_attributes_show.html.erb index 15160facb..7ff59fd9d 100644 --- a/app/views/issues/_attributes_show.html.erb +++ b/app/views/issues/_attributes_show.html.erb @@ -40,7 +40,7 @@ <% end %>
      <% unless @issue.disabled_core_fields.include?('fixed_version_id') %> -
    •  目标版本  : 

      <%= (@issue.fixed_version ? link_to_version(@issue.fixed_version, :class => "pro_info_p") : "--") %> +
    •  <%=l(:milestone)%>  : 

      <%= (@issue.fixed_version ? link_to_version(@issue.fixed_version, :class => "pro_info_p") : "--") %>
    • <% end %>
      diff --git a/app/views/issues/_form.html.erb b/app/views/issues/_form.html.erb index 1be21cbc1..5a0820092 100644 --- a/app/views/issues/_form.html.erb +++ b/app/views/issues/_form.html.erb @@ -18,6 +18,10 @@ <% end %> + + + +
      diff --git a/app/views/issues/_issue_filter.html.erb b/app/views/issues/_issue_filter.html.erb new file mode 100644 index 000000000..07ebb047f --- /dev/null +++ b/app/views/issues/_issue_filter.html.erb @@ -0,0 +1 @@ +<%= @issues_filter_assign_count %> \ No newline at end of file diff --git a/app/views/issues/_issue_filter_all.html.erb b/app/views/issues/_issue_filter_all.html.erb new file mode 100644 index 000000000..64242df9b --- /dev/null +++ b/app/views/issues/_issue_filter_all.html.erb @@ -0,0 +1 @@ +<%= @issue_count %> \ No newline at end of file diff --git a/app/views/issues/_issue_filter_author.html.erb b/app/views/issues/_issue_filter_author.html.erb new file mode 100644 index 000000000..8b9bed9f9 --- /dev/null +++ b/app/views/issues/_issue_filter_author.html.erb @@ -0,0 +1 @@ +<%= @issues_filter_author_count %><%#= @project.issues.where(:author_id => User.current.id ).visible.all.count %> \ No newline at end of file diff --git a/app/views/issues/_list.html.erb b/app/views/issues/_list.html.erb index 0eb3b4a0c..4fee89d6a 100644 --- a/app/views/issues/_list.html.erb +++ b/app/views/issues/_list.html.erb @@ -6,6 +6,11 @@ <%= render :partial => 'users/project_issue', :locals => {:activity => issue, :user_activity_id => issue.id} %> <% end %> - <% if issues.count == 10%> - <%= link_to "点击展开更多",project_issues_path({:project_id => project.id}.merge(params)),:id => "show_more_issues",:remote => "true",:class => "loadMore mt10 f_grey"%> - <% end%> +
      +
      +
        + <%= pagination_links_full @issue_pages, @issue_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true%> +
      +
      +
      +
      diff --git a/app/views/issues/_new_issue_list.html.erb b/app/views/issues/_new_issue_list.html.erb new file mode 100644 index 000000000..494ea48ed --- /dev/null +++ b/app/views/issues/_new_issue_list.html.erb @@ -0,0 +1,93 @@ +
      + + <% unless @project.enabled_modules.where("name = 'issue_tracking'").empty? %> + <%= form_tag({:controller => 'issues', :action => 'index', :project_id => @project},:remote=>'true', :method => :get,:id=>"issue_query_form", :class => 'query_form') do %> + <%= hidden_field_tag 'set_filter', '1' %> +
      + + 清除 +
      + + + <%= calendar_for('issue_create_date_end_show')%> +
      +
      + + + <%= calendar_for('issue_create_date_start_show')%> +
      + + + + +
      + +
      + +
      +
      + <%= select(:issue, :tracker_id, [["缺陷",1],["功能",2],["支持",3],["任务",4],["周报",5]].unshift(["类型",0]), + {:include_blank => false, :selected => @tracker_id ? @tracker_id : 0}, + {:onchange => "remote_function();", :id => "tracker_id", :name => "tracker_id", :class => "fl issues_filter_select_min"}) %> + <%= select( :issue, :user_id, principals_options_for_isuue_list(@project), + { :include_blank => false,:selected=>@assign_to_id ? @assign_to_id : 0}, + {:onchange=>"remote_function();",:id=>"assigned_to_id",:name=>"assigned_to_id",:class=>"fl"}) + %> + + <%= select(:issue, :fixed_version_id, options_for_version_isuue_list(@project), + {:include_blank => false, :selected => @fixed_version_id ? @fixed_version_id : 0}, + {:onchange => "remote_function();", :id => "fixed_version_id", :name => "fixed_version_id", :class => "f1"}) %> + + <%= select( :issue,:status, [["新增",1],["正在解决",2],["已解决",3],["反馈",4],["关闭",5],["拒绝",6]].unshift(["状态",0]), + { :include_blank => false,:selected=>@status_id ? @status_id : 0 + }, + {:onchange=>"remote_function();",:id=>"status_id",:name=>"status_id",:class=>"fl issues_filter_select_min"} + ) %> + + <%= select(:issue, :done_ratio, [["10%",1],["20%",2],["30%",3],["40%",4],["50%",5],["60%",6],["70%",7],["80%",8],["90%",9],["10%",10]].unshift(["完成度",0]), + {:include_blank => false, :selected => @done_ratio ? @done_ratio : 0 }, + {:onchange => "remote_function();", :id => "done_ratio", :name => "done_ratio", :class => "f1"}) %> + + <%= select(:issue, :test, [["最早创建",1],["最早更新",2]].unshift(["排序",0]), + {:include_blank => false, :selected => @order ? @order : 0 }, + {:onchange => "remote_function();", :id => "test", :name => "test", :class => "fr issues_filter_select_min"}) %> +
      +
      +
      + <% if @issues.empty? %> +

      <%= l(:label_no_data) %>

      + <% else %> +
      + <%= render :partial => 'issues/all_list', :locals => {:issues => @issues, :query => @query,:issue_pages=>@issue_pages,:issue_count=>@issue_count,:project=>@project,:subject=>@subject} %> +
      + <% end %> + <%#= render :partial => 'issues/all_list', :locals => {:issues => @issues, :query => @query,:issue_pages=>@issue_pages,:issue_count=>@issue_count,:project=>@project,:subject=>@subject} %> +
      + + <% end %> + <% end %> +
      diff --git a/app/views/issues/_project_issue.html.erb b/app/views/issues/_project_issue.html.erb new file mode 100644 index 000000000..cf04baa14 --- /dev/null +++ b/app/views/issues/_project_issue.html.erb @@ -0,0 +1,74 @@ +<% unless activity.author.nil? %> +
      +
      + <% if activity.status_id.to_i == 5 %> + + <% else %> + + <% end %> +
      +
      +
      + <%= activity.subject.to_s %> + <% if activity.journals.count > 0%> + + <%= activity.journals.count %> + <% 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) %>发布

      +
      +
      +
        +
      • + <% case activity.tracker_id %> + <% when 1%> + 缺陷 + <% when 2%> + 功能 + <% when 3%> + 支持 + <% when 4%> + 任务 + <% when 5%> + 周报 + <% end %> +
      • + +
      • + <% unless activity.assigned_to_id.nil? %> + <% if activity.try(:assigned_to).try(:realname).empty? %> + <%= link_to activity.assigned_to, user_path(activity.assigned_to_id), :class => "c_grey" %> + <% else %> + <%= link_to activity.try(:assigned_to).try(:realname), user_path(activity.assigned_to_id), :class => "c_grey" %> + <% end %> + <% end %>
      • +
      • <%= activity.fixed_version %>
      • +
      • <%= activity.status.name%>
      • +
      • <%= activity.done_ratio %>%
      • +
      • + <%= link_to "", issue_path(activity.id, :edit => 'true'), :class => 'sy_icons_edit fl mt15', :accesskey => accesskey(:edit) if activity.editable? && User.current.allowed_to?(:edit_issues, activity.project) %> + <% if !defined?(project_id) && !defined?(user_id) %> + <%= link_to "", issue_path(activity.id), :data => {:confirm => issues_destroy_confirmation_message(activity)}, :method => :delete, :class => 'sy_icons_del fl mt15' if User.current.allowed_to?(:delete_issues, activity.project) %> + <% elsif defined?(project_id) %> + <%= link_to "", issue_path(activity.id, :page_classify => "project_page", :page_id => project_id), :data => {:confirm => issues_destroy_confirmation_message(activity)}, :method => :delete, :class => 'sy_icons_del fl mt15' if User.current.allowed_to?(:delete_issues, activity.project) %> + <% elsif defined?(user_id) %> + <%= link_to "", issue_path(activity.id, :page_classify => "user_page", :page_id => user_id), :data => {:confirm => issues_destroy_confirmation_message(activity)}, :method => :delete, :class => 'sy_icons_del fl mt15' if User.current.allowed_to?(:delete_issues, activity.project) %> + <% end %> +
      • +
      +
      +<% end %> + diff --git a/app/views/issues/index.html.erb b/app/views/issues/index.html.erb index e4557b787..732e4d9af 100644 --- a/app/views/issues/index.html.erb +++ b/app/views/issues/index.html.erb @@ -2,7 +2,20 @@ <%= import_ke(enable_at: true,init_activity: true) %> <% end %> - -
      -
      -
      <%= l(:label_issue_tracking) %>
      -
      -
      - <% unless @project.enabled_modules.where("name = 'issue_tracking'").empty? %> - <%= form_tag({:controller => 'issues', :action => 'index', :project_id => @project},:remote=>'true', :method => :get,:id=>"issue_query_form", :class => 'query_form') do %> - <%= hidden_field_tag 'set_filter', '1' %> - - <%#= link_to '新建问题', new_project_issue_path(@project) , :class => "green_u_btn fr ml10" %> -

      <%= l(:label_issues_sum) %>:<%= @project.project_score.issue_num %> - <%= l(:lable_issues_undo) %>:<%= @project.issues.where('status_id in (1,2,4,6)').visible.all.count %> -

      - -
      -
      - - <%= select( :issue, :user_id, principals_options_for_isuue_list(@project), - { :include_blank => false,:selected=>@assign_to_id ? @assign_to_id : 0 - }, - {:onchange=>"remote_function();",:id=>"assigned_to_id",:name=>"assigned_to_id",:class=>"w90 mr18"} - ) - %> - <%= select( :issue,:prior, [["低",1],["正常",2],["高",3],["紧急",4],["立刻",5]].unshift(["优先级",0]), - { :include_blank => false,:selected=>@priority_id ? @priority_id : 0 - }, - {:onchange=>"remote_function();",:id=>"priority_id",:name=>"priority_id",:class=>"w90 mr18"} - ) - %> - <%= select( :issue,:status, [["新增",1],["正在解决",2],["已解决",3],["反馈",4],["关闭",5],["拒绝",6]].unshift(["状态",0]), - { :include_blank => false,:selected=>@status_id ? @status_id : 0 - }, - {:onchange=>"remote_function();",:id=>"status_id",:name=>"status_id",:class=>"w90 mr18"} - ) - %> - <%= select( :issue,:user_id, @project.members.order("lower(users.login)").map{|c| [c.name, c.user_id]}.unshift(["作者",0]), - { :include_blank => false,:selected=>@author_id ? @author_id : 0 - }, - {:onchange=>"remote_function();",:id=>"author_id",:name=>"author_id",:class=>"w90 mr18"} - ) - %> -
      -
      -
       
      -
      - - <%= text_field_tag 'issue_create_date_start_show', '创建日期起始',:readonly=>true, :size=>13, :nhname=>'date_show',:style=>'float:left;'%> - <%= calendar_for('issue_create_date_start_show') %> + +
      +
      + + <% unless @project.enabled_modules.where("name = 'issue_tracking'").empty? %> + <%= form_tag({:controller => 'issues', :action => 'index', :project_id => @project},:remote=>'xls', :method => :get,:id=>"issue_query_form", :class => 'query_form') do %> + <%= hidden_field_tag 'set_filter', '1' %> + <%= hidden_field_tag 'export_issue_hidden', '0' %> + +
      + + 清除 + +
      + + + <%= calendar_for('issue_create_date_end_show')%>
      -
       - 
      -
      - - <%= text_field_tag 'issue_create_date_end_show', '创建日期结束',:readonly=>true, :size=>13, :nhname=>'date_show',:style=>'float:left;'%> - <%= calendar_for('issue_create_date_end_show') %> +
      + + + <%= calendar_for('issue_create_date_start_show')%>
      -
      -
      - <% end %> + + +
      -
      - <% end %> -
      +
      +
        +
      • + 所有 + <%= render :partial => "issues/issue_filter_all" %> +
      • + +
        -
        - <% if !@query.new_record? && @query.editable_by?(User.current) %> - <%= link_to l(:button_edit), edit_query_path(@query), :class => 'icon icon-edit' %> - <%= delete_link query_path(@query) %> - <% end %> -
        - <% html_title(@query.new_record? ? l(:label_issue_plural) : @query.name) %> -
        -
        +
      - <%= error_messages_for 'query' %> - <% if @query.valid? %> - <% if @issues.empty? %> -

      - <%= l(:label_no_data) %> -

      - <% else %> -
      - <%= render :partial => 'issues/list', :locals => {:issues => @issues, :query => @query,:issue_pages=>@issue_pages,:issue_count=>@issue_count,:project=>@project,:subject=>@subject} %> -
      +
      +
      + <%= select(:issue, :tracker, [["缺陷",1],["功能",2],["支持",3],["任务",4],["周报",5]].unshift(["类型",0]), + {:include_blank => false, :selected => @tracker_id ? @tracker_id : 0}, + {:onchange => "remote_function();", :id => "tracker_id", :name => "tracker_id", :class => "fl issues_filter_select_min"}) %> - <% end %> + <%#= select( :issue,:user_id, @project.members.order("lower(users.login)").map{|c| [c.name, c.user_id]}.unshift(["作者",0]), + { :include_blank => false,:selected=>@author_id ? @author_id : 0}, + {:onchange=>"remote_function();",:id=>"author_id",:name=>"author_id",:class=>"fl "} + ) + %> + + <%= select( :issue, :user_id, principals_options_for_isuue_list(@project), + { :include_blank => false,:selected=>@assign_to_id ? @assign_to_id : 0 + }, + {:onchange=>"remote_function();",:id=>"assigned_to_id",:name=>"assigned_to_id",:class=>"fl"} + ) + %> + <%= select(:issue, :fixed_version, options_for_version_isuue_list(@project), + {:include_blank => false, :selected => @fixed_version_id ? @fixed_version_id : 0}, + {:onchange => "remote_function();", :id => "fixed_version_id", :name => "fixed_version_id", :class => "fl"}) %> + + <%= select( :issue,:status, [["新增",1],["正在解决",2],["已解决",3],["反馈",4],["关闭",5],["拒绝",6]].unshift(["状态",0]), + { :include_blank => false,:selected=>@status_id ? @status_id : 0 + }, + {:onchange=>"remote_function();",:id=>"status_id",:name=>"status_id",:class=>"fl issues_filter_select_min"} + ) + %> + <%#= select( :issue,:prior, [["低",1],["正常",2],["高",3],["紧急",4],["立刻",5]].unshift(["优先级",0]), + { :include_blank => false,:selected=>@priority_id ? @priority_id : 0 + }, + {:onchange=>"remote_function();",:id=>"priority_id",:name=>"priority_id",:class=>"fl"} + ) + %> + + <%#= select(:issue, :done_ratio, [["10%",1],["20%",2],["30%",3],["40%",4],["50%",5],["60%",6],["70%",7],["80%",8],["90%",9],["100%",10]].unshift(["完成度",0]), + {:include_blank => false, :selected => @done_ratio ? @done_ratio : 0 }, + {:onchange => "remote_function();", :id => "done_ratio", :name => "done_ratio", :class => "f1"}) %> + <%= select( :issue,:done_ratio, ((0..10).to_a.collect { |r| ["#{r*10} %", r*10] }).unshift(["完成度",-1]), + {:include_blank => false, :selected => @done_ratio ? @done_ratio : -1}, + {:onchange=>"remote_function();",:id=>"done_ratio",:name=>"done_ratio",:class=>"fl"}) %> + + + <%#= select(:issue, :test, [["最新创建",1],["最早创建",2],["最近更新",3],["最早更新", 4]].unshift(["排序",0]), + {:include_blank => false, :selected => @order ? @order : 0 }, + {:onchange => "remote_function();", :id => "test", :name => "test", :class => "fr issues_filter_select_min"}) %> + + <%= select(:issue, :test, [["最新创建",1],["最早创建",2],["最近更新",3],["最早更新", 4]].unshift(["排序",0]), + {:include_blank => false, :selected => @test ? @test : 0 }, + {:onchange => "remote_function();", :id => "test", :name => "test", :class => "fr issues_filter_select_min"}) %> + + <%= select( :issue,:user_id, @project.members.order("lower(users.login)").map{|c| [c.name, c.user_id]}.unshift(["作者",0]), + { :include_blank => false,:selected=>@author_id ? @author_id : 0}, + {:onchange=>"remote_function();",:id=>"author_id",:name=>"author_id",:style=>"display:none;"} + ) + %> - - - - - - - - - - <% end %> - <%= call_hook(:view_issues_index_bottom, {:issues => @issues, :project => @project, :query => @query}) %> - <% content_for :sidebar do %> - <%= render :partial => 'issues/sidebar' %> - <% end %> - <% content_for :header_tags do %> - <%= auto_discovery_link_tag(:atom, - {:query_id => @query, :format => 'atom', - :page => nil, :key => User.current.rss_key}, - :title => l(:label_issue_plural)) %> - <%= auto_discovery_link_tag(:atom, - {:controller => 'journals', :action => 'index', - :query_id => @query, :format => 'atom', - :page => nil, :key => User.current.rss_key}, - :title => l(:label_changes_details)) %> + + + + + <%#= select(:issue, :tracker_id, [["缺陷",1],["功能",2],["支持",3],["任务",4],["周报",5]].unshift(["类型",0]), + {:include_blank => false, :selected => @tracker_id ? @tracker_id : 0}, + {:onchange => "remote_function();", :id => "tracker_id", :name => "tracker_id", :class => "fl issues_filter_select_min"}) %> + <%#= select( :issue, :user_id, principals_options_for_isuue_list(@project), + { :include_blank => false,:selected=>@assign_to_id ? @assign_to_id : 0}, + {:onchange=>"remote_function();",:id=>"assigned_to_id",:name=>"assigned_to_id",:class=>"fl"}) + %> + + <%#= select(:issue, :fixed_version_id, options_for_version_isuue_list(@project), + {:include_blank => false, :selected => @fixed_version_id ? @fixed_version_id : 0}, + {:onchange => "remote_function();", :id => "fixed_version_id", :name => "fixed_version_id", :class => "f1"}) %> + + <%#= select( :issue, :status, [["新增",1],["正在解决",2],["已解决",3],["反馈",4],["关闭",5],["拒绝",6]].unshift(["状态",0]), + { :include_blank => false,:selected=>@status_id ? @status_id : 0 + }, + {:onchange=>"remote_function();",:id=>"status_id",:name=>"status_id",:class=>"fl issues_filter_select_min"} + ) %> + + <%#= select( :issue,:done_ratio, ((0..10).to_a.collect { |r| ["#{r*10} %", r*10] }), + {:include_blank => false, :selected => @done_ratio ? @done_ratio : 0}, + {:onchange=>"remote_function();",:id=>"done_ratio",:name=>"done_ratio",:class=>"fl"}) %> + + <%#= select(:issue, :done_ratio, [["10%",1],["20%",2],["30%",3],["40%",4],["50%",5],["60%",6],["70%",7],["80%",8],["90%",9],["10%",10]].unshift(["完成度",0]), + {:include_blank => false, :selected => @done_ratio ? @done_ratio : 0 }, + {:onchange => "remote_function();", :id => "done_ratio", :name => "done_ratio", :class => "f1"}) %> + + <%#= select(:issue, :test, [["最早创建",1],["最早更新",2]].unshift(["排序",0]), + {:include_blank => false, :selected => @order ? @order : 0 }, + {:onchange => "remote_function();", :id => "test", :name => "test", :class => "fr issues_filter_select_min"}) %> +
      +
      +
      + <% end %> <% end %> + <% if @issues.empty? %> +

      <%= l(:label_no_data) %>

      + <% else %> +
      + <%= render :partial => 'issues/all_list', :locals => {:issues => @issues, :query => @query,:issue_pages=>@issue_pages,:issue_count=>@issue_count,:project=>@project,:subject=>@subject} %> +
      + <% end %> + <%#= render :partial => 'issues/all_list', :locals => {:issues => @issues, :query => @query,:issue_pages=>@issue_pages,:issue_count=>@issue_count,:project=>@project,:subject=>@subject} %> +
      - <%= context_menu issues_context_menu_path %> -
      \ No newline at end of file +
      +
      diff --git a/app/views/issues/index.js.erb b/app/views/issues/index.js.erb index 399c6a977..f792cf70f 100644 --- a/app/views/issues/index.js.erb +++ b/app/views/issues/index.js.erb @@ -1,6 +1,7 @@ //$("#issue_list").html("<%#= escape_javascript(render :partial => 'issues/list',:locals => {:issues => @issues, :query => @query,:issue_pages=>@issue_pages,:issue_count=>@issue_count})%>"); -<% if @set_filter && @issue_pages.page == 1%> //只有搜索的第一页才需要替换整个issue_list,其余的都是替换show_more_issues - $("#issue_list").html("<%= escape_javascript(render :partial => 'issues/list',:locals => {:issues => @issues, :query => @query,:issue_pages=>@issue_pages,:issue_count=>@issue_count,:project=>@project})%>"); -<%else%> - $("#show_more_issues").replaceWith("<%= escape_javascript( render :partial => 'issues/list', :locals => {:issues => @issues, :query => @query,:issue_pages=>@issue_pages,:issue_count=>@issue_count,:project=>@project} )%>"); -<%end%> +//$("#issue_assigned_count").html("<%#= escape_javascript(render :partial => 'issues/issue_filter') %>"); +$("#issue_filter_all").html("<%= escape_javascript(render :partial => 'issues/issue_filter_all') %>"); +//$("#issue_author_count").html("<%#= escape_javascript(render :partial => 'issues/issue_filter_author') %>"); +$("#issue_list").html("<%= escape_javascript(render :partial => 'issues/all_list',:locals => {:issues => @issues, :query => @query, :issue_pages=> @issue_pages, :issue_count => @issue_count, :project=> @project})%>"); +$("#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 %>'); + diff --git a/app/views/layouts/_base_project_top.html.erb b/app/views/layouts/_base_project_top.html.erb new file mode 100644 index 000000000..2610b585b --- /dev/null +++ b/app/views/layouts/_base_project_top.html.erb @@ -0,0 +1,46 @@ +
      + + <%# 更新访问数,刷新的时候更新访问次数 %> + <% update_visiti_count @project %> +

      <%= l(:label_project_ivite_code)%>
      <%= (User.current.member_of?(@project) || User.current.admin?) ? @project.invite_code : "******" %>

      +
      +
      +

      + <%= @project.creater %>/ + <%= @project.name %> +

      + <%= @project.is_public? ? l(:label_public) : l(:label_private) %> +
      +

      + 项目评分: + <% if @project.project_type == 0 %> + <%# unless static_project_score(@project.project_score) == 0 %> + <%= link_to(format("%.2f" ,static_project_score(@project.project_score)).to_i, + {:controller => 'projects', + :action => 'show_projects_score', + :remote => true, + :id => @project.id}, :class => "sy_cblue" ) %> + <%# end %> + <% end %> + + 浏览:<%= @project.visits.to_i %> + 关注:<%= link_to "#{@project.watcher_users.count}", {:controller=>"projects", :action=>"watcherlist", :id => @project.id}, :class => 'sy_corange' %> + 成员:<%= link_to "#{@project.members.count}", project_member_path(@project), :class => 'sy_corange', :id => 'project_members_number' %> +

      +
      + <%= render 'layouts/join_exit_project' %> +
      +
      +
      +
      \ No newline at end of file diff --git a/app/views/layouts/_forbidden_new_feedback.html.erb b/app/views/layouts/_forbidden_new_feedback.html.erb index 03c9855f9..9dc4a560b 100644 --- a/app/views/layouts/_forbidden_new_feedback.html.erb +++ b/app/views/layouts/_forbidden_new_feedback.html.erb @@ -3,38 +3,49 @@
      -
      - - - - +
      + 问题和建议 + × +
      -
      -
      +
      +
      <% 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.text_area :subject, :id=>"subject", :class => "opnionText mb5", :placeholder => "完善您的基本资料后,可在此输入问题和建议", :disabled => "disabled" %> <%= f.hidden_field :content,:id => 'hidden', :required => true , :value => l(:label_feedback_value) %> - - - <%= l(:label_submit)%> - + + + <%#= l(:label_submit)%> + +
      <% end %>
      -
      +
      +
      +
      <%#= l(:label_technical_support) %> - Trustie师姐师兄答疑群 + +

      加入QQ群

      +
      +
      +

      关注官方微信

      +
      -
      -
      - <%= l(:label_submit)%> - +
      +
      +
      + +
      +
      + × +
      diff --git a/app/views/layouts/_join_exit_project.html.erb b/app/views/layouts/_join_exit_project.html.erb index 7d2f1b4d2..4166256ab 100644 --- a/app/views/layouts/_join_exit_project.html.erb +++ b/app/views/layouts/_join_exit_project.html.erb @@ -1,19 +1,18 @@ -
      + -
      - <%= render :partial => "projects/applied_status" %> -
      + <%= render :partial => "projects/applied_status" %> + <% if User.current.admin? || User.current.allowed_to?({:controller => 'projects', :action => 'settings'}, @project) %> - <%= link_to "#{l(:button_configure)}".html_safe, settings_project_path(@project), :class => "pr_join_a" %> + <%= link_to "#{l(:button_configure)}", settings_project_path(@project), :class => "sy_btn_blue mr5" %> <% end %> - <% if (User.current.login? && User.current.member_of?(@project) && Member.where(:user_id => User.current.id, :project_id => @project.id).first.roles.to_s.include?("Manager")) || User.current.admin? %> - <%= link_to "#{text}".html_safe,"javascript:void(0)" ,:onClick => "show_window();", :class => "pr_join_a",:id => "setting_project_type"%> - <% end %> + + + <% if (User.current.member_of? @project) && User.current.login? && !User.current.admin && !Member.where(:user_id => User.current.id, :project_id => @project.id).first.roles.to_s.include?("Manager") %> <%= exit_project_link(@project) %> <% end %> -
      + diff --git a/app/views/layouts/_new_feedback.html.erb b/app/views/layouts/_new_feedback.html.erb index db90c47c4..ee8575a3c 100644 --- a/app/views/layouts/_new_feedback.html.erb +++ b/app/views/layouts/_new_feedback.html.erb @@ -15,7 +15,7 @@ <%= f.text_area :subject, :id=>"subject", :class => "opnionText mb5", :placeholder => l(:label_feedback_tips) %> <%= f.hidden_field :content,:id => 'hidden', :required => true , :value => l(:label_feedback_value) %> 还能输入50个字符 - + <%= l(:label_submit)%>
      diff --git a/app/views/layouts/_syllabus_teacher_list.html.erb b/app/views/layouts/_syllabus_teacher_list.html.erb index 344036ccf..817836bbb 100644 --- a/app/views/layouts/_syllabus_teacher_list.html.erb +++ b/app/views/layouts/_syllabus_teacher_list.html.erb @@ -1,10 +1,12 @@

      教师团队 - 增加教师 + <% if User.current == @syllabus.user || User.current.admin? %> + 增加教师 + <% end %>

        - <% teacher = syllabus.user %> - <%# teachers.each do |teacher| %> + <% members.each do |member| %> + <% teacher = member.user %>
      • <%= link_to image_tag(url_to_avatar(teacher), :width => "60", :height => "60", :class => "sy_teachers_img fl mr15"), user_path(teacher), :target => "_blank", :alt => "用户头像" %>
        @@ -17,5 +19,5 @@
      • - <%# end %> + <% end %>
      \ No newline at end of file diff --git a/app/views/layouts/_user_courses.html.erb b/app/views/layouts/_user_courses.html.erb index 60db07db0..3e9ba3019 100644 --- a/app/views/layouts/_user_courses.html.erb +++ b/app/views/layouts/_user_courses.html.erb @@ -1,19 +1,16 @@ <% courses.each do |course|%> -
    • +
    • <% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,course)) %> -

      - <% title = "#{course.syllabus.title}".html_safe %> - <%= link_to title, syllabus_path(course.syllabus_id), :target => '_blank', :class => 'hidden', :style => "max-width:91px; display:inline-block;"%> - · - <% classes = "#{course.name}".html_safe %> - <%= link_to classes, course_path(course.id,:host=>Setting.host_course), :target => '_blank', :class => 'hidden', :style => "max-width:91px; display:inline-block;"%> - - 课程名称:<%= course.syllabus.title %>
      - 班级名称:<%= course.name+'('+current_time_and_term(course)+')' %>
      - 班级属性:<%= course.is_public? ? '公开' : '私有' %> -
      +

      + <%= link_to course.syllabus.title + course.name, course_path(course.id,:host=>Setting.host_course), :target => '_blank', :class => 'hidden', :style => 'display:block;'%>

      + <%#= link_to course.name+"("+current_time_and_term_short(course)+")", course_path(course.id,:host=>Setting.host_course), :id => "show_course_#{course.id}", :class => 'course_list_menu hidden', :target => '_blank', :title => (course.is_public? ? "公开班级:":"私有班级:")+course.name+"("+current_time_and_term(course)+")"%> <% count = ShieldActivity.where("container_type='User' and container_id=#{user.id} and shield_type='Course' and shield_id=#{course.id}").count %> @@ -113,25 +110,26 @@ } $(".course_list_menu").each(function(){ - var courseWidth = $(this).children().eq(0).children().width(); - var classWidth = $(this).children().eq(2).children().width(); - var newClassWidth = 182 - courseWidth; - var newCourseWidth = 182 - classWidth; - console.log(courseWidth, classWidth); - if(courseWidth < 91 && classWidth > 91){ - $(this).children().eq(2).css("max-width",newClassWidth + "px"); - } - if(classWidth < 91 && courseWidth > 91){ - $(this).children().eq(0).css("max-width",newCourseWidth + "px"); - } + $(this).mouseenter(function(){ + $(".sub-menu-title").hide(); + $(this).next().stop(); + $(this).next().show(); + }); + $(this).mouseleave(function(){ + $(this).next().delay(500).hide(0); + }); }) - $(".course-name").each(function(){ - $(this).mouseenter(function(){ - $(this).parent().parent().children().eq(3).show(); - }); - $(this).mouseleave(function(){ - $(this).parent().parent().children().eq(3).hide(); - }); - }) + $(".sub-menu-title").each(function(){ + var boxWidth = $(this).width(); + var leftAttr = boxWidth + 30 + $(this).css("left",-leftAttr); + $(this).mouseover(function(){ + $(this).stop(); + $(this).show(); + }); + $(this).mouseout(function(){ + $(this).delay(500).hide(0); + }); + }); diff --git a/app/views/layouts/base_projects.html.erb b/app/views/layouts/base_projects.html.erb index d3e72cc5a..b0de79d7c 100644 --- a/app/views/layouts/base_projects.html.erb +++ b/app/views/layouts/base_projects.html.erb @@ -12,7 +12,7 @@ <%= favicon %> <%= javascript_heads %> <%= heads_for_theme %> - <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common','css/structure','scm','css/public', 'css/project','css/popup','prettify','repository' %> + <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common','css/structure','scm','css/public', 'css/project','css/popup','prettify','repository','css/gantt', 'css/calendar' %> <%= javascript_include_tag 'cookie','project',"avatars", 'header','prettify','select_list_move','attachments' %> <%= call_hook :view_layouts_base_html_head %> @@ -47,88 +47,17 @@
      + <%= render :partial => 'layouts/base_project_top' %>
      -
      - -
      - <%= l(:label_project_ivite_code)%> - <%= (User.current.member_of?(@project) || User.current.admin?) ? @project.invite_code : "******" %> -
      - -
      - <% text = @project.project_new_type == 1 ? l(:label_development_team) : (@project.project_new_type == 2 ? l(:label_research_group) : l(:label_friend_organization))%> - <% typeclass = @project.project_new_type == 1 ? "pr_kafa" : (@project.project_new_type == 2 ? "pr_keyan" : "pr_friend")%> - <%= render 'layouts/join_exit_project',{:text => text, :typeclass => typeclass} %> -
      - -
      -
      - <%= link_to "#{@project.name}", project_path(@project.id), :class=>"pr_info_name fl c_dark fb break_word" %> - <% if @project.is_public? %> - <%= l(:label_public)%> - <% else %> - <%= l(:label_private)%> - <% end %> -
      -
      - <%# 更新访问数,刷新的时候更新访问次数 %> - <% update_visiti_count @project %> - <%# over %> -
      - <% if @project.project_type == 0 %> - <% unless static_project_score(@project.project_score) == 0 %> - <%= l(:label_project_score)%> : - <%= link_to(format("%.2f" ,static_project_score(@project.project_score)).to_i, - {:controller => 'projects', - :action => 'show_projects_score', - :remote => true, - :id => @project.id}, :class => "c_orange f14" ) %> - <% end %> - <% end %> -
      - - -
      - <%= l(:label_member) %>(<%= link_to "#{@project.members.count}", project_member_path(@project), :class => 'info_foot_num c_blue', :id => 'project_members_number' %>) - - <%= l(:label_user_watcher) %>(<%= link_to "#{@project.watcher_users.count}", {:controller=>"projects", :action=>"watcherlist", :id => @project.id}, :class => 'info_foot_num c_blue' %>) - <% unless @project.enabled_modules.where("name = 'files'").empty? %> - - <%= l(:project_module_attachments) %>( - <% @project.project_score.attach_num %> - <%= link_to "#{@project.project_score.attach_num }", project_files_path(@project), :class => 'info_foot_num c_blue', :id=>'project_files_count_info' %>) - <% end %> -
      -
      -
      - +
      -
      @@ -155,7 +84,6 @@
      -
      访问计数 <%= @project.visits.to_i %> (自2016年5月)
      diff --git a/app/views/layouts/base_syllabus.html.erb b/app/views/layouts/base_syllabus.html.erb index 445af2a8b..3153741e0 100644 --- a/app/views/layouts/base_syllabus.html.erb +++ b/app/views/layouts/base_syllabus.html.erb @@ -60,11 +60,12 @@ <%= yield %>
    • + <% members = @syllabus.syllabus_members.order("rank asc") %>
      <%= render :partial => 'layouts/syllabus_base_info', :locals => {:syllabus => @syllabus} %>
      -
      - <%= render :partial => 'layouts/syllabus_teacher_list', :locals => {:syllabus => @syllabus} %> +
      + <%= render :partial => 'layouts/syllabus_teacher_list', :locals => {:syllabus => @syllabus, :members => members} %>
      @@ -123,16 +124,18 @@ } function g(o){return document.getElementById(o);} function HoverLi(n){ - for(var i=1;i<=2;i++){ + //for(var i=1;i<=2;i++){ //g('sy_tab_nav_'+i).className='sy_tab_nomal'; //g('sy_tab_con_'+i).className='undis'; - } + //} //g('sy_tab_con_'+n).className='dis'; //g('sy_tab_nav_'+n).className='sy_tab_hover'; if(n == 1) { window.location.href = '<%=syllabus_path(@syllabus) %>'; - } else { + } else if(n == 2) { window.location.href = '<%=syllabus_courselist_syllabus_path(@syllabus) %>'; + } else if(n == 3) { + window.location.href = '<%=members_syllabus_path(@syllabus) %>'; } } //侧导航栏配置设置 diff --git a/app/views/layouts/new_base_user.html.erb b/app/views/layouts/new_base_user.html.erb index f38b4d531..c192bd724 100644 --- a/app/views/layouts/new_base_user.html.erb +++ b/app/views/layouts/new_base_user.html.erb @@ -163,7 +163,7 @@
      • <%= link_to '班级',{:controller => "users", :action => "user_courselist", :id => @user.id}, :id => "user_course_list" %> - <%= link_to '全部',{:controller => "users", :action => "user_courselist", :id => @user.id}, :class => "linkGrey2" %> + <%= link_to '全部',{:controller => "users", :action => "user_courselist", :id => @user.id}, :style => "color:#aaa;" %> <% 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) %>
        <%=render :partial => 'layouts/homepage_left_course_list', :locals => {:courses => courses} %> @@ -191,7 +191,7 @@
        • <%= link_to '项目',{:controller => "users", :action => "user_projectlist", :id => @user.id}, :id => 'user_project_list'%> - <%= link_to '全部',{:controller => "users", :action => "user_projectlist", :id => @user.id}, :class => 'linkGrey2'%> + <%= link_to '全部',{:controller => "users", :action => "user_projectlist", :id => @user.id}, :style => "color:#aaa;" %> <% 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)%>
          <%=render :partial => 'layouts/homepage_left_project_list', :locals => {:projects => projects} %> diff --git a/app/views/messages/_course_show.html.erb b/app/views/messages/_course_show.html.erb index 95c9b7df1..abdeef255 100644 --- a/app/views/messages/_course_show.html.erb +++ b/app/views/messages/_course_show.html.erb @@ -93,10 +93,10 @@
        - <% all_comments = []%> - <% comments = get_all_children(all_comments, @topic) %> + <%# all_comments = []%> + <%# comments = get_all_children(all_comments, @topic) %>
        - <% comments.each_with_index do |reply,i| %> + <% @replies.each do |reply| %> + +<%= content_for(:header_tags) do %> + <%= import_ke(enable_at: false, prettify: false, init_activity: false) %> +<% end %> + +
        + <% reply_allow = JournalsForMessage.create_by_user? User.current %> +

        <%= l(:label_user_response) %>

        + <% if !User.current.logged?%> +
        + <%= l(:label_user_login_tips) %> + <%= link_to l(:label_user_login_new), signin_path %> +
        +
        + <% else %> + <%= form_for('new_form', :method => :post, :html => {:id => 'project_feedback_form', :multipart => true}, + :url => {:controller => 'words', :action => 'leave_project_message'}) do |f|%> + <%= f.text_area 'project_message', :rows => 3, :cols => 65, :style => "width:718px", + :placeholder => "#{l(:label_welcome_my_respond)}",:nhname=>'new_message_textarea' %> +

        +
        + <%#= submit_tag l(:button_leave_meassge), :name => nil , :class => "blue_btn fr mt10 mb10" %> + 留言 + <%#= link_to l(:button_leave_meassge), "javascript:void(0)", :onclick => 'submitProjectFeedback();', :onmouseover => 'submitFocus(this);', :class => 'blue_btn fr mt10 mb10' %> + <% end %> + + <% end %> +
        +
        +
        + <%= render :partial => 'history',:locals => { :journals => @jour, :state => false} %> +
        +
          <%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
        + +
        + diff --git a/app/views/projects/_project_member_list.html.erb b/app/views/projects/_project_member_list.html.erb index 71ea21322..7bdac2ba4 100644 --- a/app/views/projects/_project_member_list.html.erb +++ b/app/views/projects/_project_member_list.html.erb @@ -1,4 +1,4 @@ -
        +
        加入时间
        diff --git a/app/views/projects/_tools_expand.html.erb b/app/views/projects/_tools_expand.html.erb index 72f095609..414eb16fc 100644 --- a/app/views/projects/_tools_expand.html.erb +++ b/app/views/projects/_tools_expand.html.erb @@ -18,16 +18,16 @@ - - - - - - - - - - +
      • + <% unless @project.enabled_modules.where("name = 'calendar'").empty? %> + <%= link_to l(:project_module_calendar),project_calendar_path(@project) %> + <% end %> +
      • +
      • + <% unless @project.enabled_modules.where("name = 'gantt'").empty? %> + <%= link_to l(:project_module_gantt) ,project_gantt_path(@project) %> + <% end %> +
      • diff --git a/app/views/projects/feedback.html.erb b/app/views/projects/feedback.html.erb index fc474afaa..77f754567 100644 --- a/app/views/projects/feedback.html.erb +++ b/app/views/projects/feedback.html.erb @@ -1,4 +1,4 @@ -
        +

        <%= l(:label_project_tool_response)%>

        <% reply_allow = JournalsForMessage.create_by_user? User.current %> @@ -47,4 +47,8 @@ function checkMaxLength() { -<% html_title(l(:label_project_tool_response)) -%> \ No newline at end of file +<% html_title(l(:label_project_tool_response)) -%> + + \ No newline at end of file diff --git a/app/views/projects/member.html.erb b/app/views/projects/member.html.erb index 1f3f76ea3..eb46a41e6 100644 --- a/app/views/projects/member.html.erb +++ b/app/views/projects/member.html.erb @@ -1,4 +1,4 @@ -
        +

        <%= @subPage_title %>

        <% if is_project_manager?(User.current, @project) %> @@ -11,3 +11,7 @@ <%= render :partial => @render_file, :locals => {:members => @members} %>
        + + diff --git a/app/views/projects/settings.html.erb b/app/views/projects/settings.html.erb index fc9beae35..0d4a55ff9 100644 --- a/app/views/projects/settings.html.erb +++ b/app/views/projects/settings.html.erb @@ -16,15 +16,16 @@ <% end%> <% end%> $("div[nhname='pro_setting']").show(); + $("#RSide").css('width',"730px"); }); -
        +

        配置

        -
      diff --git a/app/views/users/_course_homework.html.erb b/app/views/users/_course_homework.html.erb index cf5f5881b..f234a383a 100644 --- a/app/views/users/_course_homework.html.erb +++ b/app/views/users/_course_homework.html.erb @@ -11,12 +11,20 @@ TO <%=link_to activity.course.syllabus.title, syllabus_path(activity.course.syllabus_id), :class => 'newsBlue ml15', :target => '_blank' %> - <%= link_to activity.course.name.to_s+" | 班级作业", homework_common_index_path(:course => activity.course.id, :host=> Setting.host_course), :class => "newsBlue"%> + <% if hw_status == 3 || hw_status == 5 %> + <%= link_to activity.course.name, course_path(activity.course_id), :class => "newsBlue"%> + <% else %> + <%= link_to activity.course.name.to_s+" | 班级作业", homework_common_index_path(:course => activity.course.id, :host=> Setting.host_course), :class => "newsBlue"%> + <% end %>
      - <%=get_hw_status(activity).html_safe %>
      @@ -26,56 +34,17 @@ 系统提示:该作业要求各组长提交作品,提交作品时请添加组成员。谢谢配合! <% end %>
      - <% if activity.homework_type == 3 && !is_teacher && activity.homework_detail_group.base_on_project == 1 && User.current.member_of_course?(activity.course)%> - <% projects = cur_user_projects_for_homework activity %> - <% works = cur_user_works_for_homework activity %> - <% if works.nil? && projects.nil? %> -
      - <%=link_to "关联项目",new_student_work_project_student_work_index_path(:homework => activity.id,:is_in_course=>-1,:user_activity_id=>user_activity_id,:course_activity=>course_activity),remote: true,:class=> 'c_blue', :title=> '请各组长关联作业项目' %> - <%#= relate_project(activity,is_teacher,-1,user_activity_id,course_activity) %> -
      - <% elsif works.nil? %> -
      - <%=link_to "取消关联",cancel_relate_project_student_work_index_path(:homework => activity.id,:is_in_course=>-1,:user_activity_id=>user_activity_id,:course_activity=>course_activity), :confirm => "您确定要取消关联吗?", remote: true,:class => "c_blue", :title=> '取消关联项目' %> -
      - <% end %> - <% end %> -
      - <% is_teacher = User.current.allowed_to?(:as_teacher,activity.course) %> - <%= user_for_homework_common activity,is_teacher %> -
      - <% work = cur_user_works_for_homework activity %> - <% if activity.end_time < Date.today && !is_teacher && !work.nil? && work.user == User.current %> -
      - <%=link_to "追加附件", student_work_index_url_in_org(activity.id, 1), :class => 'c_blue', :title => "可追加作品修订附件" %> -
      - <% end %> - <% if activity.homework_type == 2 && is_teacher%> -
      - <%= link_to "模拟答题", new_user_commit_homework_users_path(homework_id: activity.id, is_test: true), class: 'c_blue test-program-btn', title: '教师可以通过模拟答题设置作业的标准答案' %> -
      - <% if activity.homework_detail_manual.comment_status != 0 %> -
      - <%= link_to "代码查重", work_canrepeat_student_work_index_path(homework: activity.id, course_id: activity.course.id), class: 'c_blue test-program-btn',:remote => true %> -
      - <% end %> - <% end %> - <% if activity.homework_type == 2%> -
      - 语言: - <%= activity.language_name%> -
      - <% end %> - <% if activity.homework_type == 3 && activity.homework_detail_group%> -
      - 分组人数:<%=activity.homework_detail_group.min_num %>-<%=activity.homework_detail_group.max_num %> 人 -
      - <% end %> + <%= render :partial => 'users/homework_opr', :locals => {:activity => activity, :is_teacher => is_teacher, :hw_status => hw_status, :user_activity_id => user_activity_id} %> <% if activity.homework_detail_manual && activity.homework_detail_manual.comment_status < 2 %>
      提交截止时间:<%= activity.end_time.to_s %> 23:59
      <% elsif activity.homework_detail_manual && activity.homework_detail_manual.comment_status >= 2 && activity.anonymous_comment == 0%>
      匿评截止时间:<%= activity.homework_detail_manual.evaluation_end.to_s %> 23:59
      <% end %> + <% if activity.homework_detail_manual.comment_status == 0 && !activity.publish_time.nil? %> +
      + <%= l(:label_publish_time)%>:<%= activity.publish_time%> 00:00 +
      + <% end %>
      <%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>user_activity_id, :content=>activity.description} %> @@ -86,221 +55,13 @@
      <%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %>
      -
      -
      - 迟交扣分:<%= activity.late_penalty%>分 -
      - <% if activity.anonymous_comment == 0%> -
      - 匿评开启时间:<%= activity.homework_detail_manual.evaluation_start%> 00:00 -
      - <% end %> -
      -
      -
      - <% if activity.anonymous_comment == 0%> -
      - 缺评扣分:<%= activity.homework_detail_manual.absence_penalty%>分/作品 -
      - <% end %> - <% if activity.anonymous_comment == 0%> -
      - 匿评关闭时间:<%= activity.homework_detail_manual.evaluation_end%> 23:59 -
      - <% end %> -
      -
      - <% if activity.student_works.has_committed.count != 0 %> - <% sw = activity.student_works.has_committed.reorder("commit_time desc").first %> -
      - # <%=time_from_now sw.commit_time %><%= link_to sw.user.show_name, user_activities_path(sw.user_id), :class => "newsBlue ml5 mr5"%>提交了作品 -
      - <% end %> -
      - <% if activity.student_works.count != 0 %> - <% sw_id = "("+activity.student_works.map{|sw| sw.id}.join(",")+")" %> - <%# student_work_scores = StudentWorksScore.find_by_sql("select max(created_at) as created_at, student_work_id, user_id from student_works_scores where student_work_id in #{sw_id} group by student_work_id order by max(created_at) desc") %> - <% student_work_scores = StudentWorksScore.where("student_work_id in #{sw_id} and score is not null").reorder("created_at desc") %> - <% unless student_work_scores.empty? %> - <% last_score = student_work_scores.first %> -
      -

      # <%=time_from_now last_score.created_at %> - <%= link_to last_score.user.show_name, user_activities_path(last_score.user_id), :class => "newsBlue ml5 mr5"%>评阅了作品,优秀排行: -

      -
      - <% end %> -
      - <% if activity.homework_type != 2 %> - <% ids = student_work_scores.empty? ? "(-1)" : '('+student_work_scores.map{|sw|sw.student_work_id}.join(',')+')' %> - <% student_works = activity.student_works.has_committed.select("student_works.*,student_works.work_score as score").where("student_works.id in #{ids}").order("score desc") %> - <% else %> - <% student_works = activity.student_works.has_committed.select("student_works.*,student_works.work_score as score").order("score desc") %> - <% end %> - <% student_works.includes(:user).each_with_index do |sw, i| %> - - <% if i == 4 %> - <% break %> - <% end %> - <% end %> - <% if student_works.count > 5 %> - <%= link_to "更多>>", student_work_index_path(:homework => activity.id),:class=>'linkGrey2 fl ml50',:style=>'margin-top:60px;'%> - <% end %> -
      -
      - <% end %> -
      - <% if activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 1 %> - <% projects = activity.student_work_projects.where("is_leader = 1") %> - <% unless projects.empty? %> - <% sort_projects = project_sort_update projects %> -
      -
      - <%# first_pro = sort_projects.first %> - <% first_pro = Project.find sort_projects.first.project_id %> - <% commit_time = first_pro.project_score.commit_time %> - <% one_forge_time=ForgeActivity.where("project_id=?",first_pro.id).last.updated_at if ForgeActivity.where("project_id=?",first_pro.id).last %> - # <%=time_from_now !commit_time.nil? && format_time(commit_time) > format_time(one_forge_time) ? commit_time : one_forge_time %><%= link_to User.find(first_pro.user_id).show_name, user_activities_path(first_pro.user_id), :class => "newsBlue ml5 mr5"%>更新了项目,最近更新: -
      -
      - <% sort_projects.each_with_index do |pro, i| %> - <% project = Project.find pro.project_id %> - -
      - <% com_time = project.project_score.commit_time %> - <% forge_time=ForgeActivity.where("project_id=?",project.id).last.updated_at if ForgeActivity.where("project_id=?",project.id).last %> - <% if project.is_public || User.current.member_of?(project) || User.current.admin? %> - <%= link_to image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius relatePImage"),project_path(project.id,:host=>Setting.host_name),:id=>"project_img_"+project.id.to_s+"_"+activity.id.to_s,:alt =>"项目头像", :target => '_blank' %> - - <% update_time = time_from_now !com_time.nil? && format_time(com_time) > format_time(forge_time) ? com_time : forge_time %> - - <% else %> - <%= image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius relatePImage",:id=>"project_img_"+project.id.to_s+"_"+activity.id.to_s,:alt =>"项目头像",:title => "私有项目不可访问") %> - - - <% end %> -
      - 项目名称:<%=project.name %>
      - 创建者:<%=(User.find project.user_id).show_name %>(组长)
      - 更新时间:<%=time_from_now !com_time.nil? && format_time(com_time) > format_time(forge_time) ? com_time : forge_time %> -
      -
      - <% if i == 9 && projects.count > 10 %> - 更多>> - <% end %> - <% if i > 9 && i == (projects.count - 1) %> - 收回<< - <% end %> - <% end %> -
      - <% end %> - <% end %> -
      - <% if is_teacher%> - <% comment_status = activity.homework_detail_manual.comment_status %> -
      -
        -
      • -
          -
        • - <%= link_to l(:button_edit),edit_homework_common_path(activity,:is_in_course => -1,:course_activity=>course_activity), :class => "postOptionLink"%> -
        • -
        • - <%= link_to(l(:label_bid_respond_delete), homework_common_path(activity,:is_in_course => -1,:course_activity=>course_activity),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "postOptionLink") %> -
        • -
        • - <%= link_to("评分设置", score_rule_set_homework_common_path(activity,:user_activity_id => user_activity_id, :is_in_course => -1,:course_activity=>course_activity),:class => "postOptionLink", :remote => true) %> -
        • - <% if activity.anonymous_comment == 0 %> -
        • - <%= link_to("匿评设置", start_evaluation_set_homework_common_path(activity,:user_activity_id => user_activity_id, :is_in_course => -1,:course_activity=>course_activity),:class => "postOptionLink", :remote => true) if activity.homework_detail_manual.comment_status == 1%> -
        • -
        • - <%= homework_anonymous_comment activity,-1,user_activity_id,course_activity %> -
        • - <% end %> - <% if activity.anonymous_comment == 0 && (comment_status == 0 || comment_status == 1)%> -
        • - <%= link_to("禁用匿评", alert_forbidden_anonymous_comment_homework_common_path(activity,:user_activity_id => user_activity_id,:course_activity=>course_activity),:class => "postOptionLink", - :title => "匿评是同学之间的双盲互评过程:每个同学将评阅系统分配给他/她的若干个作品", :remote => true)%> -
        • - <% end %> - <% if (activity.anonymous_comment == 1 && activity.is_open == 0) || (activity.anonymous_comment == 0 && comment_status == 3 && activity.is_open == 0) %> -
        • - <%= link_to("公开作品", alert_open_student_works_homework_common_path(activity,:user_activity_id => user_activity_id, :is_in_course => -1,:course_activity=>course_activity),:class => "postOptionLink", :remote => true)%> -
        • - <% elsif activity.is_open == 1 %> -
        • - <%= link_to("取消公开", alert_open_student_works_homework_common_path(activity,:user_activity_id => user_activity_id, :is_in_course => -1,:course_activity=>course_activity),:class => "postOptionLink", :remote => true)%> -
        • - <% end %> -
        -
      • -
      -
      - <% end%> + <%= render :partial => "users/homework_base_info", :locals =>{:activity => activity, :user_activity_id =>user_activity_id, :is_teacher => is_teacher, :hw_status => hw_status} %>
      - <% count=activity.journals_for_messages.count %> -
      - <%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id, :is_in_course => -1,:course_activity=>course_activity} %> - - <% comments = activity.journals_for_messages.reorder("created_on desc").limit(3) %> - <% if count > 0 %> -
      - <%=render :partial => 'users/news_replies', :locals => {:comments => comments, :type => 'HomeworkCommon', :is_in_course => -1,:course_activity=>course_activity, :is_teacher => is_teacher, :user_activity_id => user_activity_id, :activity_id => activity.id} %> -
      - <% end %> - -
      -
      <%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), :alt => "用户头像" %>
      -
      - <% if User.current.logged? %> -
      - <%= form_for('new_form',:url => {:controller => 'words', :action => 'leave_homework_message', :id => activity.id},:method => "post", :remote => true) do |f|%> - <%= hidden_field_tag 'user_activity_id',params[:user_activity_id],:value =>user_activity_id %> - <%= hidden_field_tag 'course_activity',params[:course_activity],:value =>course_activity %> -
      - - -
      -

      - <% end%> -
      - <% else %> - <%= render :partial => "users/show_unlogged" %> - <% end %> -
      -
      -
      -
      -
      + <%= render :partial => 'users/homework_post_reply', :locals => {:activity => activity, :user_activity_id => user_activity_id, :hw_status => hw_status, :is_teacher => is_teacher} %>
      + +
      + <% com_time = project.project_score.commit_time %> + <% forge_time=ForgeActivity.where("project_id=?",project.id).last.updated_at if ForgeActivity.where("project_id=?",project.id).last %> + <% if project.is_public || User.current.member_of?(project) || User.current.admin? %> + <%= link_to image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius relatePImage"),project_path(project.id,:host=>Setting.host_name),:id=>"project_img_"+project.id.to_s+"_"+activity.id.to_s,:alt =>"项目头像", :target => '_blank' %> + + <% update_time = time_from_now !com_time.nil? && format_time(com_time) > format_time(forge_time) ? com_time : forge_time %> + + <% else %> + <%= image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius relatePImage",:id=>"project_img_"+project.id.to_s+"_"+activity.id.to_s,:alt =>"项目头像",:title => "私有项目不可访问") %> + + + <% end %> +
      + 项目名称:<%=project.name %>
      + 创建者:<%=(User.find project.user_id).show_name %>(组长)
      + 更新时间:<%=time_from_now !com_time.nil? && format_time(com_time) > format_time(forge_time) ? com_time : forge_time %> +
      +
      + <% if i == 9 && projects.count > 10 %> + 更多>> + <% end %> + <% if i > 9 && i == (projects.count - 1) %> + 收回<< + <% end %> + <% end %> +
      + <% end %> +<% end %> +
      + +<% if is_teacher%> + <% comment_status = activity.homework_detail_manual.comment_status %> +
      +
        +
      • +
          +
        • + <%= link_to l(:button_edit),edit_homework_common_path(activity, :hw_status => hw_status), :class => "postOptionLink"%> +
        • +
        • + <%= link_to(l(:label_bid_respond_delete), homework_common_path(activity, :hw_status => hw_status),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "postOptionLink") %> +
        • +
        • + <%= link_to("评分设置", score_rule_set_homework_common_path(activity,:user_activity_id => user_activity_id, :hw_status => hw_status),:class => "postOptionLink", :remote => true) %> +
        • + <% if activity.anonymous_comment == 0 %> +
        • + <%= link_to("匿评设置", start_evaluation_set_homework_common_path(activity,:user_activity_id => user_activity_id, :hw_status => hw_status),:class => "postOptionLink", :remote => true) if activity.homework_detail_manual.comment_status == 1%> +
        • +
        • + <%= homework_anonymous_comment activity,hw_status,user_activity_id %> +
        • + <% end %> + <% if activity.anonymous_comment == 0 && (comment_status == 0 || comment_status == 1)%> +
        • + <%= link_to("禁用匿评", alert_forbidden_anonymous_comment_homework_common_path(activity,:user_activity_id => user_activity_id),:class => "postOptionLink", + :title => "匿评是同学之间的双盲互评过程:每个同学将评阅系统分配给他/她的若干个作品", :remote => true)%> +
        • + <% end %> + <% if (activity.anonymous_comment == 1 && activity.is_open == 0) || (activity.anonymous_comment == 0 && comment_status == 3 && activity.is_open == 0) %> +
        • + <%= link_to("公开作品", alert_open_student_works_homework_common_path(activity,:user_activity_id => user_activity_id, :hw_status => hw_status),:class => "postOptionLink", :remote => true)%> +
        • + <% elsif activity.is_open == 1 %> +
        • + <%= link_to("取消公开", alert_open_student_works_homework_common_path(activity,:user_activity_id => user_activity_id, :hw_status => hw_status),:class => "postOptionLink", :remote => true)%> +
        • + <% end %> +
        +
      • +
      +
      +<% end%> \ No newline at end of file diff --git a/app/views/users/_homework_opr.html.erb b/app/views/users/_homework_opr.html.erb new file mode 100644 index 000000000..53d16b15d --- /dev/null +++ b/app/views/users/_homework_opr.html.erb @@ -0,0 +1,43 @@ +<% if activity.homework_type == 3 && !is_teacher && activity.homework_detail_group.base_on_project == 1 && User.current.member_of_course?(activity.course)%> + <% projects = cur_user_projects_for_homework activity %> + <% works = cur_user_works_for_homework activity %> + <% if works.nil? && projects.nil? %> +
      + <%=link_to "关联项目",new_student_work_project_student_work_index_path(:homework => activity.id,:hw_status=>hw_status,:user_activity_id=>user_activity_id),remote: true,:class=> 'c_blue', :title=> '请各组长关联作业项目' %> +
      + <% elsif works.nil? %> +
      + <%=link_to "取消关联",cancel_relate_project_student_work_index_path(:homework => activity.id,:hw_status=>hw_status,:user_activity_id=>user_activity_id), :confirm => "您确定要取消关联吗?", remote: true,:class => "c_blue", :title=> '取消关联项目' %> +
      + <% end %> +<% end %> +
      + <%= user_for_homework_common activity,is_teacher %> +
      +<% work = cur_user_works_for_homework activity %> +<% if activity.end_time < Date.today && !is_teacher && !work.nil? && work.user == User.current %> +
      + <%=link_to "追加附件", student_work_index_url_in_org(activity.id, 2, 1), :class => 'c_blue', :title => "可追加作品修订附件" %> +
      +<% end %> +<% if activity.homework_type == 2 && is_teacher%> +
      + <%= link_to "模拟答题", new_user_commit_homework_users_path(homework_id: activity.id, is_test: true), class: 'c_blue test-program-btn', title: '教师可以通过模拟答题设置作业的标准答案' %> +
      + <% if activity.homework_detail_manual.comment_status != 0 %> +
      + <%= link_to "代码查重", work_canrepeat_student_work_index_path(homework: activity.id, course_id: activity.course.id), class: 'c_blue test-program-btn',:remote => true %> +
      + <% end %> +<% end %> +<% if activity.homework_type == 2%> +
      + 语言: + <%= activity.language_name%> +
      +<% end %> +<% if activity.homework_type == 3 && activity.homework_detail_group%> +
      + 分组人数:<%=activity.homework_detail_group.min_num %>-<%=activity.homework_detail_group.max_num %> 人 +
      +<% end %> \ No newline at end of file diff --git a/app/views/users/_homework_post_reply.html.erb b/app/views/users/_homework_post_reply.html.erb new file mode 100644 index 000000000..0037e35ac --- /dev/null +++ b/app/views/users/_homework_post_reply.html.erb @@ -0,0 +1,34 @@ +<% count=activity.journals_for_messages.count %> +
      + <%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id, :hw_status => hw_status} %> + + <% comments = activity.journals_for_messages.reorder("created_on desc").limit(3) %> + <% if count > 0 %> +
      + <%=render :partial => 'users/news_replies', :locals => {:comments => comments, :type => 'HomeworkCommon', :hw_status => hw_status, :is_teacher => is_teacher, :user_activity_id => user_activity_id, :activity_id => activity.id} %> +
      + <% end %> + +
      +
      <%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), :alt => "用户头像" %>
      +
      + <% if User.current.logged? %> +
      + <%= form_for('new_form',:url => {:controller => 'words', :action => 'leave_homework_message', :id => activity.id},:method => "post", :remote => true) do |f|%> + <%= hidden_field_tag 'user_activity_id',params[:user_activity_id],:value =>user_activity_id %> + <%= hidden_field_tag 'hw_status',params[:hw_status],:value =>hw_status %> +
      + + +
      +

      + <% end%> +
      + <% else %> + <%= render :partial => "users/show_unlogged" %> + <% end %> +
      +
      +
      +
      +
      \ No newline at end of file diff --git a/app/views/users/_homework_repository_list.html.erb b/app/views/users/_homework_repository_list.html.erb index 5b0053a50..33de70c24 100644 --- a/app/views/users/_homework_repository_list.html.erb +++ b/app/views/users/_homework_repository_list.html.erb @@ -8,7 +8,7 @@

      <% if type == "1" %> - <%=link_to homework.name, student_work_index_path(:homework => homework), :class => 'hw_cgrey', :target => "_blank" %> + <%=link_to homework.name, student_work_index_path(:homework => homework), :class => 'linkGrey5', :target => "_blank" %> <% else %> <%=homework.name %> <% end %> diff --git a/app/views/users/_manage_homework_list.html.erb b/app/views/users/_manage_homework_list.html.erb index d9246f5ed..3b6890610 100644 --- a/app/views/users/_manage_homework_list.html.erb +++ b/app/views/users/_manage_homework_list.html.erb @@ -20,13 +20,13 @@ 类别:<%=homework.homework_type_ch %> 作品: - <%=homework.student_works.has_committed.count %> + <%=homework.student_works.has_committed.count %> / - <%= homework.homework_type == 3 ? '--' : homework.course.student.count %> + <%= homework.homework_type == 3 ? '--' : homework.course.student.count %> 待评阅: - <%= homework.student_works.has_committed.where("teacher_score is null and teaching_asistant_score is null").count %> + <%= homework.student_works.has_committed.where("teacher_score is null and teaching_asistant_score is null").count %> / - <%=homework.student_works.has_committed.count %> + <%=homework.student_works.has_committed.count %> 发布时间: <% if homework.publish_time %> <%= format_date(homework.publish_time) %> diff --git a/app/views/users/_message_replies.html.erb b/app/views/users/_message_replies.html.erb index 669aea26c..ce1e70887 100644 --- a/app/views/users/_message_replies.html.erb +++ b/app/views/users/_message_replies.html.erb @@ -24,6 +24,8 @@ <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> <% if type == 'Message' %> + <% topic = comment.root %> + <% if !topic.locked? && authorize_for('messages', 'reply') %> <%= link_to( l(:button_reply), @@ -33,6 +35,7 @@ :title => l(:button_reply)) %> + <% end %> <% if comment.course_destroyable_by?(User.current) || comment.destroyable_by?(User.current) %> <%= link_to( l(:button_delete), diff --git a/app/views/users/_news_replies.html.erb b/app/views/users/_news_replies.html.erb index 138efd16e..0b5464946 100644 --- a/app/views/users/_news_replies.html.erb +++ b/app/views/users/_news_replies.html.erb @@ -36,14 +36,14 @@ <%= link_to( l(:button_reply), - {:controller => 'users' ,:action => 'reply_to', :reply_id => comment.id, :type => 'HomeworkCommon', :is_in_course => is_in_course, :user_activity_id => user_activity_id, :course_activity => course_activity}, + {:controller => 'users' ,:action => 'reply_to', :reply_id => comment.id, :type => 'HomeworkCommon', :hw_status => hw_status, :user_activity_id => user_activity_id}, :remote => true, :method => 'get', :title => l(:button_reply)) %> <% if User.current.admin? ||is_teacher || comment.user == User.current%> - <%= link_to('删除', {:controller => 'words', :action => 'destroy', :object_id => comment, :user_id => comment.user,:is_in_course => is_in_course, :user_activity_id => user_activity_id, :course_activity => course_activity}, + <%= link_to('删除', {:controller => 'words', :action => 'destroy', :object_id => comment, :user_id => comment.user,:hw_status => hw_status, :user_activity_id => user_activity_id}, :id => "delete_reply_#{activity_id}_#{comment.id}",:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "fr mr20 undis", :title => l(:button_delete)) %> <% end %> <% elsif type == 'News' %> diff --git a/app/views/users/_project_issue.html.erb b/app/views/users/_project_issue.html.erb index 0ca706b68..5a0065f86 100644 --- a/app/views/users/_project_issue.html.erb +++ b/app/views/users/_project_issue.html.erb @@ -1,107 +1,108 @@ <% unless activity.author.nil? %> -
      -
      -
      - <%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id), :alt => "用户头像" %> - <%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %> -
      -
      -
      - <% if activity.try(:author).try(:realname) == ' ' %> - <%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %> - <% else %> - <%= link_to activity.try(:author).try(:realname), user_path(activity.author_id), :class => "newsBlue mr15" %> - <% end %> TO - <%= link_to activity.project.name.to_s+" | 项目问题", project_issues_path(activity.project), :class => "newsBlue ml15"%> -
      - <% if User.current.logged? %> -
      -
        -
      • -
          -
        • - <%= link_to l(:button_edit), issue_path(activity.id, :edit => 'true'), :class => 'postOptionLink', :accesskey => accesskey(:edit) if activity.editable? && User.current.allowed_to?(:edit_issues, activity.project) %> -
        • -
        • - <% if !defined?(project_id) && !defined?(user_id) %> - <%= link_to l(:button_delete), issue_path(activity.id), :data => {:confirm => issues_destroy_confirmation_message(activity)}, :method => :delete, :class => 'postOptionLink' if User.current.allowed_to?(:delete_issues, activity.project) %> - <% elsif defined?(project_id) %> - <%= link_to l(:button_delete), issue_path(activity.id, :page_classify => "project_page", :page_id => project_id), :data => {:confirm => issues_destroy_confirmation_message(activity)}, :method => :delete, :class => 'postOptionLink' if User.current.allowed_to?(:delete_issues, activity.project) %> - <% elsif defined?(user_id) %> - <%= link_to l(:button_delete), issue_path(activity.id, :page_classify => "user_page", :page_id => user_id), :data => {:confirm => issues_destroy_confirmation_message(activity)}, :method => :delete, :class => 'postOptionLink' if User.current.allowed_to?(:delete_issues, activity.project) %> - <% end %> -
        • -
        • - <%= link_to l(:button_copy), project_copy_issue_path(activity.project, activity), :class => 'postOptionLink' if User.current.allowed_to?(:add_issues, activity.project) %> +
          +
          +
          + <%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id), :alt => "用户头像" %> + <%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %> +
          +
          +
          + <% if activity.try(:author).try(:realname) == ' ' %> + <%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %> + <% else %> + <%= link_to activity.try(:author).try(:realname), user_path(activity.author_id), :class => "newsBlue mr15" %> + <% end %> TO + <%= link_to activity.project.name.to_s+" | 项目问题", project_issues_path(activity.project), :class => "newsBlue ml15"%> +
          + <% if User.current.logged? %> +
          +
            +
          • +
              +
            • + <%= link_to l(:button_edit), issue_path(activity.id, :edit => 'true'), :class => 'postOptionLink', :accesskey => accesskey(:edit) if activity.editable? && User.current.allowed_to?(:edit_issues, activity.project) %> +
            • +
            • + <% if !defined?(project_id) && !defined?(user_id) %> + <%= link_to l(:button_delete), issue_path(activity.id), :data => {:confirm => issues_destroy_confirmation_message(activity)}, :method => :delete, :class => 'postOptionLink' if User.current.allowed_to?(:delete_issues, activity.project) %> + <% elsif defined?(project_id) %> + <%= link_to l(:button_delete), issue_path(activity.id, :page_classify => "project_page", :page_id => project_id), :data => {:confirm => issues_destroy_confirmation_message(activity)}, :method => :delete, :class => 'postOptionLink' if User.current.allowed_to?(:delete_issues, activity.project) %> + <% elsif defined?(user_id) %> + <%= link_to l(:button_delete), issue_path(activity.id, :page_classify => "user_page", :page_id => user_id), :data => {:confirm => issues_destroy_confirmation_message(activity)}, :method => :delete, :class => 'postOptionLink' if User.current.allowed_to?(:delete_issues, activity.project) %> + <% end %> +
            • +
            • + <%= link_to l(:button_copy), project_copy_issue_path(activity.project, activity), :class => 'postOptionLink' if User.current.allowed_to?(:add_issues, activity.project) %> +
            • +
          -
        • -
        -
      - <% end %> -
      - <% case activity.tracker_id %> - <% when 1%> - 【缺陷】 - <% when 2%> - 【功能】 - <% when 3%> - 【支持】 - <% when 4%> - 【任务】 - <% when 5%> - 【周报】 - <% end %> - <%= link_to activity.subject.to_s, issue_path(activity), :class => "postGrey ml5", :target => "_blank" %> - +
      + <% end %> +
      + <% case activity.tracker_id %> + <% when 1%> + 【缺陷】 + <% when 2%> + 【功能】 + <% when 3%> + 【支持】 + <% when 4%> + 【任务】 + <% when 5%> + 【周报】 + <% end %> + <%= link_to activity.subject.to_s, issue_path(activity), :class => "postGrey ml5", :target => "_blank" %> + <%= get_issue_priority(activity.priority_id)[1] %> -
      -
      -
      指派给   - <% unless activity.assigned_to_id.nil? %> - <% if activity.try(:assigned_to).try(:realname) == ' ' %> - <%= link_to activity.try(:assigned_to), user_path(activity.assigned_to_id), :class => "newsBlue mr15" %> - <% else %> - <%= link_to activity.try(:assigned_to).try(:realname), user_path(activity.assigned_to_id), :class => "newsBlue mr15" %> +
      +
      +
      指派给   + <% unless activity.assigned_to_id.nil? %> + <% if activity.try(:assigned_to).try(:realname) == ' ' %> + <%= link_to activity.try(:assigned_to), user_path(activity.assigned_to_id), :class => "newsBlue mr15" %> + <% else %> + <%= link_to activity.try(:assigned_to).try(:realname), user_path(activity.assigned_to_id), :class => "newsBlue mr15" %> + <% end %> + <% end %> +
      +
      + 发布时间: + <%=format_time(activity.created_on) %> +
      +
      + 更新时间:<%= format_time(ForgeActivity.where("forge_act_type='#{activity.class}' and forge_act_id =#{activity.id}").first.updated_at) %> +
      +
      +
      + <%=render :partial =>"users/intro_content", :locals=>{:user_activity_id => user_activity_id, :content => activity.description} %> + + +
      + <%# 局部刷新:修改xissue属性 %> + <% if User.current.member_of?(activity.project) && !activity.nil? && !activity.status.nil? %> + <% unless params[:action] == "index" %> +
      + <%= render :partial => 'users/project_issue_detail', :locals => {:activity => activity} %> +
      <% end %> <% end %> -
      -
      - 发布时间: - <%=format_time(activity.created_on) %> -
      -
      - 更新时间:<%= format_time(ForgeActivity.where("forge_act_type='#{activity.class}' and forge_act_id =#{activity.id}").first.updated_at) %> +
      +
      + <%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %> +
      - <%=render :partial =>"users/intro_content", :locals=>{:user_activity_id => user_activity_id, :content => activity.description} %> - - -
      - <%# 局部刷新:修改xissue属性 %> - <% if User.current.member_of?(activity.project) && !activity.nil? && !activity.status.nil? %> - <% unless params[:action] == "index" %> -
      - <%= render :partial => 'users/project_issue_detail', :locals => {:activity => activity} %> -
      - <% end %> - <% end %> -
      -
      - <%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %> +
      + <%= render :partial => 'users/project_issue_reply', :locals => {:activity => activity, :user_activity_id => user_activity_id} %>
      -
      -
      -
      - <%= render :partial => 'users/project_issue_reply', :locals => {:activity => activity, :user_activity_id => user_activity_id} %> -
      -
      - -<% end %> \ No newline at end of file + +<% end %> + diff --git a/app/views/users/_project_issue_detail.html.erb b/app/views/users/_project_issue_detail.html.erb index 321ba663a..81df1500b 100644 --- a/app/views/users/_project_issue_detail.html.erb +++ b/app/views/users/_project_issue_detail.html.erb @@ -115,7 +115,7 @@ <%= format_date(activity.due_date)? format_date(activity.due_date) : "--" %>
    • -

       目标版本  : 

      +

       <%=l(:milestone)%>  : 

      <%= (activity.fixed_version ? link_to_user_version(activity.fixed_version) : "--") %>
    diff --git a/app/views/users/_reply_banner.html.erb b/app/views/users/_reply_banner.html.erb index 4f2094899..c611644c2 100644 --- a/app/views/users/_reply_banner.html.erb +++ b/app/views/users/_reply_banner.html.erb @@ -2,7 +2,7 @@
    回复 ︿ - <%= count>0 ? "(#{count})" : "" %> + <%= count>0 ? "(#{count})" : "" %> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%> @@ -10,12 +10,8 @@
    <%#= format_date(activity.updated_on) %>
    <%if count>3 %>
    - <% if activity.class.to_s == 'HomeworkCommon' && is_in_course == -1 %> - - 展开更多 - - <% elsif activity.class.to_s == 'HomeworkCommon' %> - + <% if activity.class.to_s == 'HomeworkCommon' %> + 展开更多 <% elsif activity.class.to_s == 'Message' %> diff --git a/app/views/users/_reply_to.html.erb b/app/views/users/_reply_to.html.erb index 8752de30b..b6689851b 100644 --- a/app/views/users/_reply_to.html.erb +++ b/app/views/users/_reply_to.html.erb @@ -5,9 +5,8 @@
    <% if @type == 'HomeworkCommon' %> <%= form_for('new_form',:url => {:controller => 'words', :action => 'reply_to_homework', :id => reply.id},:method => "post", :remote => true) do |f| %> - > + > > - >
    diff --git a/app/views/users/_resources_list.html.erb b/app/views/users/_resources_list.html.erb index d7f0dee7f..0190e60dc 100644 --- a/app/views/users/_resources_list.html.erb +++ b/app/views/users/_resources_list.html.erb @@ -267,4 +267,9 @@ } } + + $(".resource-list-from").each(function(){ + var titleContent = $(this).text(); + $(this).attr("title",titleContent); + }); diff --git a/app/views/users/_user_activities.html.erb b/app/views/users/_user_activities.html.erb index 5c6f07bb1..4770bf408 100644 --- a/app/views/users/_user_activities.html.erb +++ b/app/views/users/_user_activities.html.erb @@ -51,7 +51,7 @@ <% hidden_courses = Setting.find_by_name("hidden_courses") %> <% unvisiable = hidden_courses && hidden_courses.value == "1"%> <% if !unvisiable %> - <%= render :partial => 'course_homework', :locals => {:activity => act,:user_activity_id =>user_activity.id,:course_activity => 0} %> + <%= render :partial => 'course_homework', :locals => {:activity => act,:user_activity_id =>user_activity.id,:hw_status => 1} %> <% end %> <%# end %> <% when 'News' %> diff --git a/app/views/users/_user_homework_detail.html.erb b/app/views/users/_user_homework_detail.html.erb index 6f1fb7843..3351ae3f2 100644 --- a/app/views/users/_user_homework_detail.html.erb +++ b/app/views/users/_user_homework_detail.html.erb @@ -50,7 +50,7 @@ <% work = cur_user_works_for_homework homework_common %> <% if !is_teacher && !work.nil? && homework_common.end_time < Date.today && work.user == User.current %>
    - <%=link_to "追加附件", student_work_index_url_in_org(homework_common.id, 1), :class => 'c_blue', :title => "可追加作品修订附件" %> + <%=link_to "追加附件", student_work_index_url_in_org(homework_common.id, 2, 1), :class => 'c_blue', :title => "可追加作品修订附件" %>
    <% end %> <% if homework_common.homework_type == 2 && is_teacher%> diff --git a/app/views/users/_user_homework_list.html.erb b/app/views/users/_user_homework_list.html.erb index f7669047c..5f37f54ac 100644 --- a/app/views/users/_user_homework_list.html.erb +++ b/app/views/users/_user_homework_list.html.erb @@ -26,15 +26,10 @@ } } - <%= render :partial => 'users/user_homework_detail', :locals => {:homework_common => homework_common,:is_in_course => is_in_course} %> + <%= render :partial => 'users/course_homework', :locals => {:activity => homework_common, :user_activity_id =>homework_common.id, :hw_status => 3} %> <% end%> <% if homework_commons.count == 10%> - <% if is_in_course == 1%> - - <%#= link_to "点击展开更多",homework_common_index_path(:course => course_id,:page => page,:is_in_course => is_in_course),:id => "user_show_more_homework",:remote => "true",:class => "loadMore f_grey"%> - <% else%> - - <%= link_to "点击展开更多",student_homeworks_user_path(User.current.id,:page => page,:is_in_course => is_in_course),:id => "user_show_more_homework",:remote => "true",:class => "loadMore f_grey"%> - <% end%> + + <%#= link_to "点击展开更多",homework_common_index_path(:course => course_id,:page => page),:id => "user_show_more_homework",:remote => "true",:class => "loadMore f_grey"%> <% end%>
    diff --git a/app/views/users/_user_homeworks_old.html.erb b/app/views/users/_user_homeworks_old.html.erb deleted file mode 100644 index 59ec24ad3..000000000 --- a/app/views/users/_user_homeworks_old.html.erb +++ /dev/null @@ -1,47 +0,0 @@ - -
    -
    作业
    -
    -
    - -<% if @is_teacher%> - -
    - <% homework = HomeworkCommon.new %> - <% homework.homework_detail_manual = HomeworkDetailManual.new%> - <%= labelled_form_for homework,:url => user_new_homework_users_path,:method => "post" do |f| %> -
    - <%= render :partial => 'users/user_homework_form', :locals => { :homework => homework,:f => f,:edit_mode => false } %> -
    - <% end%> -
    -<% end%> - -<%= render :partial => 'users/user_homework_list', :locals => {:homework_commons => @homework_commons,:page => 0,:is_in_course => 0} %> diff --git a/app/views/users/all_journals.js.erb b/app/views/users/all_journals.js.erb index 5f60c754c..7060a7b1c 100644 --- a/app/views/users/all_journals.js.erb +++ b/app/views/users/all_journals.js.erb @@ -1,5 +1,5 @@ <% if params[:type] == 'HomeworkCommon' %> -$('#reply_div_<%= params[:div_id].to_i %>').html('<%=escape_javascript(render :partial => 'users/news_replies', :locals => {:comments => @journals, :type => @type, :is_in_course =>@is_in_course,:course_activity=>@course_activity, :is_teacher => @is_teacher, :user_activity_id => @user_activity_id, :activity_id => params[:id].to_i}) %>'); +$('#reply_div_<%= @user_activity_id %>').html('<%=escape_javascript(render :partial => 'users/news_replies', :locals => {:comments => @journals, :type => @type, :hw_status =>@hw_status, :is_teacher => @is_teacher, :user_activity_id => @user_activity_id, :activity_id => params[:id].to_i}) %>'); <% elsif params[:type] == 'JournalsForMessage' %> $('#reply_div_<%= @user_activity_id %>').html('<%=escape_javascript(render :partial => 'users/message_replies', :locals => {:comments => @journals,:user_activity_id => @user_activity_id, :type => @type, :activity_id =>params[:id].to_i}) %>'); <% elsif params[:type] == 'Message' %> diff --git a/app/views/versions/_overview.html.erb b/app/views/versions/_overview.html.erb index 6d9719c8c..6dd89607e 100644 --- a/app/views/versions/_overview.html.erb +++ b/app/views/versions/_overview.html.erb @@ -3,14 +3,20 @@

    »<%= l(:label_versions_progress)%>

    <%= progress_bar([version.closed_percent], :width => '648px;', :legend => ('%0.0f%' % version.completed_percent)) %>

    - <%= link_to(l(:label_x_issues, :count => version.issues_count), + <%#= link_to(l(:label_x_issues, :count => version.issues_count), project_issues_path(version.project, :status_id => '*', :fixed_version_id => version, :set_filter => 1), :class =>"c_dblue",) %> + <%=version.issues_count%> 问题   - (<%= link_to_if(version.closed_issues_count > 0, l(:label_x_closed_issues_abbr, :count => version.closed_issues_count), + (<%#= link_to_if(version.closed_issues_count > 0, l(:label_x_closed_issues_abbr, :count => version.closed_issues_count), project_issues_path(version.project, :status_id => 'c', :fixed_version_id => version, :set_filter => 1), :class =>"c_dblue") %> + <% if version.closed_issues_count > 0 %> + <%end%><%=version.closed_issues_count%> 已关闭 — - <%= link_to_if(version.open_issues_count > 0, l(:label_x_open_issues_abbr, :count => version.open_issues_count), - project_issues_path(version.project, :status_id => 'o', :fixed_version_id => version, :set_filter => 1), :class =>"c_dblue") %>) + <%#= link_to_if(version.open_issues_count > 0, l(:label_x_open_issues_abbr, :count => version.open_issues_count), + project_issues_path(version.project, :status_id => 'o', :fixed_version_id => version, :set_filter => 1), :class =>"c_dblue") %> + <% if version.open_issues_count > 0%> + <%end%><%=version.open_issues_count%> 打开 + )

    <% else %>
    <%= l(:label_roadmap_no_issues) %>
    diff --git a/app/views/versions/index.html.erb b/app/views/versions/index.html.erb index eec93c86c..6b42dc3d8 100644 --- a/app/views/versions/index.html.erb +++ b/app/views/versions/index.html.erb @@ -1,4 +1,4 @@ -
    +

    <%= l(:label_roadmap) %>

    @@ -9,7 +9,7 @@ <% end %> - + <% if @project.descendants.active.any? %> <%= hidden_field_tag 'with_subprojects', 0 %> @@ -24,9 +24,10 @@ <% else %> <% @versions.each do |version| %> -
    +

    - <%= link_to_version_show version, :name => version_anchor(version) %> + <%= version_anchor(version)%> + <%#= link_to_version_show version, :name => version_anchor(version) %> <% if version.completed? %> <%= format_date(version.effective_date) %> <% elsif version.effective_date %> @@ -57,10 +58,10 @@

    »<%= l(:label_versions_description)%>

    <%=h version.description %>

    +
    <% end %> -
      <%= pagination_links_full @versions_pages%>
    @@ -71,3 +72,7 @@ <% html_title(l(:label_roadmap)) %> <%= context_menu issues_context_menu_path %> + + diff --git a/app/views/words/_journal_reply_items.html.erb b/app/views/words/_journal_reply_items.html.erb index b589fae56..cdfee3e9f 100644 --- a/app/views/words/_journal_reply_items.html.erb +++ b/app/views/words/_journal_reply_items.html.erb @@ -11,7 +11,7 @@ <%= image_tag url_to_avatar(nil),:width => '30',:height => '30' %> <% end %>
    -
    +
    <% id = 'project_respond_form_'+ reply.id.to_s %> <%= link_to reply.user.show_name, user_path(reply.user) %> <%= l(:label_reply_to)%> diff --git a/app/views/words/destroy.js.erb b/app/views/words/destroy.js.erb index 00be899cc..ab41b1ae6 100644 --- a/app/views/words/destroy.js.erb +++ b/app/views/words/destroy.js.erb @@ -31,12 +31,11 @@ <% elsif @user && @jours_count%> $('#jour_count').html("<%= @jours_count %>"); <% elsif @homework%> - <% if @user_activity_id == -1 %> - $("#homework_common_<%= @homework.id %>").replaceWith("<%= escape_javascript(render :partial => "users/user_homework_detail",:locals => {:homework_common => @homework, :is_in_course => @is_in_course})%>"); - sd_create_editor_from_data(<%= @homework.id%>,"","100%"); + $("#homework_post_reply_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/homework_post_reply', :locals => {:activity => @homework, :user_activity_id => @user_activity_id, :hw_status => @hw_status, :is_teacher => @is_teacher}) %>"); + <% if @user_activity_id != @homework.id %> + sd_create_editor_from_data(<%= @user_activity_id%>,"","100%", "UserActivity"); <% else %> - $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_homework', :locals => {:activity => @homework,:user_activity_id =>@user_activity_id,:course_activity=>@course_activity}) %>"); - sd_create_editor_from_data(<%= @user_activity_id%>,"","100%"); + sd_create_editor_from_data(<%= @homework.id%>,"","100%", "<%=@homework.class.to_s%>"); <% end %> <% end %> var destroyedItem = $('#word_li_<%=@journal_destroyed.id%>') diff --git a/app/views/words/leave_homework_message.js.erb b/app/views/words/leave_homework_message.js.erb index acb16be50..f6a89323f 100644 --- a/app/views/words/leave_homework_message.js.erb +++ b/app/views/words/leave_homework_message.js.erb @@ -1,7 +1,6 @@ -<% if @user_activity_id %> - $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_homework', :locals => {:activity => @homework_common,:user_activity_id =>@user_activity_id,:course_activity => @course_activity}) %>"); - sd_create_editor_from_data(<%= @user_activity_id%>,"","100%", "UserActivity"); -<% elsif @homework_common_id && @is_in_course %> - $("#homework_common_<%= @homework_common_id %>").replaceWith("<%= escape_javascript(render :partial => 'users/user_homework_detail', :locals => {:homework_common => @homework_common,:is_in_course => @is_in_course}) %>"); - sd_create_editor_from_data(<%= @homework_common_id%>,"","100%", "HomeworkCommon"); -<% end %> +$("#homework_post_reply_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/homework_post_reply', :locals => {:activity => @homework_common, :user_activity_id => @user_activity_id, :hw_status => @hw_status, :is_teacher => @is_teacher}) %>"); +<% if @user_activity_id != @homework_common.id %> +sd_create_editor_from_data(<%= @user_activity_id%>,"","100%", "UserActivity"); +<% else %> +sd_create_editor_from_data(<%= @homework_common.id%>,"","100%", "<%=@homework_common.class.to_s%>"); +<% end %> \ No newline at end of file diff --git a/app/views/words/reply_to_homework.js.erb b/app/views/words/reply_to_homework.js.erb index 7da72fa54..f6a89323f 100644 --- a/app/views/words/reply_to_homework.js.erb +++ b/app/views/words/reply_to_homework.js.erb @@ -1,7 +1,6 @@ -<% if @user_activity_id != -1 %> -$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_homework', :locals => {:activity => @homework_common,:user_activity_id =>@user_activity_id,:course_activity => @course_activity}) %>"); +$("#homework_post_reply_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/homework_post_reply', :locals => {:activity => @homework_common, :user_activity_id => @user_activity_id, :hw_status => @hw_status, :is_teacher => @is_teacher}) %>"); +<% if @user_activity_id != @homework_common.id %> sd_create_editor_from_data(<%= @user_activity_id%>,"","100%", "UserActivity"); <% else %> -$("#homework_common_<%= @homework_common.id %>").replaceWith("<%= escape_javascript(render :partial => 'users/user_homework_detail', :locals => {:homework_common => @homework_common,:is_in_course => @is_in_course}) %>"); -sd_create_editor_from_data(<%= @homework_common.id%>,"","100%", "HomeworkCommon"); +sd_create_editor_from_data(<%= @homework_common.id%>,"","100%", "<%=@homework_common.class.to_s%>"); <% end %> \ No newline at end of file diff --git a/config/locales/projects/zh.yml b/config/locales/projects/zh.yml index 792ff35fd..98e13a865 100644 --- a/config/locales/projects/zh.yml +++ b/config/locales/projects/zh.yml @@ -48,10 +48,10 @@ zh: # 左边栏 # label_project_id: "项目ID:" - label_project_ivite_code: "邀请码:" + label_project_ivite_code: "邀请码" label_agree_join_project: 同意加入 - label_apply_project: "+申请加入" + label_apply_project: "+加入" label_button_following: "+添加关注" label_exit_project: 退出项目 label_apply_project_waiting: 已处理申请,请等待管理员审核 @@ -199,7 +199,36 @@ zh: lable_issues_undo: "未解决" label_issue_new: 新建问题 label_query: 自定义查询 - + label_issue_list_xls: Issue列表 + label_rep_xls: 版本库代码统计 + label_rep_branch: 分支 + + # Issue列表 excel导出参数 + issue_xls_id: ID + issue_xls_title: 标题 + issue_xls_description: 描述 + issue_xls_created_at: 创建时间 + issue_xls_tracker_id: 类型 + issue_xls_author: 作者 + issue_xls_assign: 指派给 + issue_xls_status: 状态 + issue_xls_priority: 优先级 + issue_xls_version: 目标版本 + issue_xls_start: 开始时间 + issue_xls_due: 截止时间 + issue_xls_ratio: 完成度 + + # 版本库excel导出 + rep_branch: 分支 + rep_author: 作者 + rep_author_mail: 邮箱 + rep_changeset: 提交次数 + rep_code_add: 添加行数 + rep_code_delete: 删除代码 + rep_code_modified: 总行数 + rep_sode_time: 导出时间 + rep_sode_cycle: 时间区间 + # 自定义查询 label_query_plural: 自定义查询 label_query_new: 新建查询 @@ -208,6 +237,7 @@ zh: # 自定义查询> 过滤器类别 field_status: 状态 field_fixed_version: 目标版本 + milestone: 里程碑 field_assigned_to_role: 角色的成员 field_category: 类别 field_created_on: 创建于 @@ -215,7 +245,7 @@ zh: field_closed_on: 已关闭 field_start_date: 开始日期 field_due_date: 计划完成日期 - field_estimated_hours: 预期时间 + field_estimated_hours: 预计工时 (H) field_assigned_to: 指派给 field_priority: 优先级 field_done_ratio: "% 完成" @@ -369,7 +399,7 @@ zh: label_input_email: 请输入邮箱地址 label_invite_trustie_user: "邀请Trustie注册用户" - label_invite_trustie_user_tips: "支持姓名、邮箱、登录名搜索!" + label_invite_trustie_user_tips: "支持姓名、邮箱、登录名搜索" label_user_role_null: 用户和角色不能留空! label_invite_project: 邀请您加入项目 label_mail_invite_success: 您已成功加入项目! @@ -462,3 +492,6 @@ zh: label_state_open: 待处理 label_state_closed: 关闭 label_state_merged: 已合并 + + label_done_ratio_endding: 已完成 + label_done_ratio_doing: 未完成 diff --git a/config/locales/zh.yml b/config/locales/zh.yml index d153ffe95..d57f29c39 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -623,7 +623,7 @@ zh: label_course_news_description: '课程必须是高校正式开设的课程,或是围绕特定主题定期发布课程资料的公共开放课程;
    如果您想创建一个协作研究空间,请您前往“我的项目”页面创建项目,谢谢!' label_course_board: 讨论区 label_version: 版本 - label_version_new: 新建版本 + label_version_new: 新建里程碑 label_close_versions: 关闭已完成的版本 label_confirmation: 确认 diff --git a/config/routes.rb b/config/routes.rb index afe30d4de..4ff75cbf9 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -982,6 +982,7 @@ RedmineApp::Application.routes.draw do get 'projects/:id/repository/changes(/*path(.:ext))', :to => 'repositories#changes' get 'projects/:id/repository/forked', :to => 'repositories#forked' + get 'projects/:id/repository/export_rep_static', :to => 'repositories#export_rep_static' get 'projects/:id/repository/project_archive', :to => 'repositories#project_archive', :as => 'project_archive' get 'projects/:id/repository/revisions', :to => 'repositories#revisions' get 'projects/:id/repository/revisions/:rev', :to => 'repositories#revision' @@ -1140,6 +1141,7 @@ RedmineApp::Application.routes.draw do post 'update_base_info' get 'delete_syllabus' get 'delete_des' + get 'members' end collection do @@ -1147,6 +1149,16 @@ RedmineApp::Application.routes.draw do end end + resources :syllabus_member do + member do + post 'update_rank' + end + + collection do + get 'syl_member_autocomplete' + end + end + # add by nwb # 课程路由设置 resources :courses do diff --git a/config/settings.yml b/config/settings.yml index bebf9ac94..dc89093f1 100644 --- a/config/settings.yml +++ b/config/settings.yml @@ -198,7 +198,7 @@ default_projects_modules: - calendar - gantt - course - - dts +# - dts default_projects_tracker_ids: serialized: true default: diff --git a/db/migrate/20160918033136_update_issue_author.rb b/db/migrate/20160918033136_update_issue_author.rb new file mode 100644 index 000000000..8cbc99d6d --- /dev/null +++ b/db/migrate/20160918033136_update_issue_author.rb @@ -0,0 +1,13 @@ +class UpdateIssueAuthor < ActiveRecord::Migration + def up + begin + issue = Issue.find(9377) + issue.update_column(:author_id, 15341) + rescue Exception => e + puts e + end + end + + def down + end +end diff --git a/db/migrate/20160918074635_update_attach_public_for_message.rb b/db/migrate/20160918074635_update_attach_public_for_message.rb new file mode 100644 index 000000000..5f9b51c5a --- /dev/null +++ b/db/migrate/20160918074635_update_attach_public_for_message.rb @@ -0,0 +1,13 @@ +class UpdateAttachPublicForMessage < ActiveRecord::Migration + def up + begin + attachments = Attachment.where(:container_type => "Message", :is_public => 0) + attachments.update_all(:is_public => 1) + rescue Exception => e + puts e + end + end + + def down + end +end diff --git a/db/migrate/20160921062340_create_syllabus_members.rb b/db/migrate/20160921062340_create_syllabus_members.rb new file mode 100644 index 000000000..c2e76ee3f --- /dev/null +++ b/db/migrate/20160921062340_create_syllabus_members.rb @@ -0,0 +1,23 @@ +class CreateSyllabusMembers < ActiveRecord::Migration + def change + create_table :syllabus_members do |t| + t.integer :rank + t.references :syllabus + t.references :user + + t.timestamps + end + add_index :syllabus_members, :syllabus_id + add_index :syllabus_members, :user_id + add_index :syllabus_members, :rank + + count = Syllabus.all.count / 30 + 2 + transaction do + for i in 1 ... count do i + Syllabus.page(i).per(30).each do |syllabus| + SyllabusMember.create(:user_id => syllabus.user_id, :syllabus_id => syllabus.id, :rank => 1) + end + end + end + end +end diff --git a/db/migrate/20160923024443_change_poroject_type.rb b/db/migrate/20160923024443_change_poroject_type.rb new file mode 100644 index 000000000..d092f87e6 --- /dev/null +++ b/db/migrate/20160923024443_change_poroject_type.rb @@ -0,0 +1,9 @@ +class ChangePorojectType < ActiveRecord::Migration + def up + projects = Project.where("project_new_type !=?", 1) + projects.update_all(:project_new_type => 1) + end + + def down + end +end diff --git a/db/schema.rb b/db/schema.rb index 443e8c426..d8a60c93f 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 => 20160907080621) do +ActiveRecord::Schema.define(:version => 20160921062340) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -56,10 +56,10 @@ ActiveRecord::Schema.define(:version => 20160907080621) do t.integer "user_id" t.integer "applied_id" t.string "applied_type" - t.integer "viewed" - t.integer "status" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.integer "viewed", :default => 0 + 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" @@ -157,13 +157,13 @@ ActiveRecord::Schema.define(:version => 20160907080621) do create_table "attachments", :force => true do |t| t.integer "container_id" t.string "container_type", :limit => 30 - t.string "filename", :default => "", :null => false - t.string "disk_filename", :default => "", :null => false - t.integer "filesize", :default => 0, :null => false + t.string "filename", :default => "", :null => false + t.string "disk_filename", :default => "", :null => false + t.integer "filesize", :default => 0, :null => false t.string "content_type", :default => "" - t.string "digest", :limit => 40, :default => "", :null => false - t.integer "downloads", :default => 0, :null => false - t.integer "author_id", :default => 0, :null => false + t.string "digest", :limit => 40, :default => "", :null => false + t.integer "downloads", :default => 0, :null => false + t.integer "author_id", :default => 0, :null => false t.datetime "created_on" t.string "description" t.string "disk_directory" @@ -173,7 +173,6 @@ ActiveRecord::Schema.define(:version => 20160907080621) do t.integer "quotes" t.integer "is_publish", :default => 1 t.date "publish_time" - t.boolean "init_file", :default => false end add_index "attachments", ["author_id"], :name => "index_attachments_on_author_id" @@ -311,16 +310,14 @@ ActiveRecord::Schema.define(:version => 20160907080621) 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" @@ -1881,6 +1878,9 @@ ActiveRecord::Schema.define(:version => 20160907080621) do t.datetime "updated_at", :null => false end + add_index "student_works_scores", ["student_work_id"], :name => "student_work_id" + add_index "student_works_scores", ["user_id"], :name => "user_id" + create_table "students_for_courses", :force => true do |t| t.integer "student_id" t.integer "course_id" @@ -1923,6 +1923,18 @@ ActiveRecord::Schema.define(:version => 20160907080621) do t.datetime "updated_at", :null => false end + create_table "syllabus_members", :force => true do |t| + t.integer "rank" + t.integer "syllabus_id" + t.integer "user_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "syllabus_members", ["rank"], :name => "index_syllabus_members_on_rank" + add_index "syllabus_members", ["syllabus_id"], :name => "index_syllabus_members_on_syllabus_id" + add_index "syllabus_members", ["user_id"], :name => "index_syllabus_members_on_user_id" + create_table "syllabuses", :force => true do |t| t.string "title" t.text "description" diff --git a/lib/gitlab-cli/lib/gitlab/client/repositories.rb b/lib/gitlab-cli/lib/gitlab/client/repositories.rb index 80d1058b5..daed2ee16 100644 --- a/lib/gitlab-cli/lib/gitlab/client/repositories.rb +++ b/lib/gitlab-cli/lib/gitlab/client/repositories.rb @@ -117,6 +117,16 @@ class Gitlab::Client end alias_method :repo_rep_stats, :rep_stats + def rep_stats_week(project, options={}) + get("/projects/#{project}/repository/rep_stats_week", :query => options) + end + alias_method :repo_rep_stats, :rep_stats + + def rep_stats_month(project, options={}) + get("/projects/#{project}/repository/rep_stats_month", :query => options) + end + alias_method :repo_rep_stats, :rep_stats + def rep_user_stats(project, options={}) get("/projects/#{project}/repository/rep_user_stats", :query => options) end diff --git a/lib/plugins/acts_as_attachable/lib/acts_as_attachable.rb b/lib/plugins/acts_as_attachable/lib/acts_as_attachable.rb index f5b48544d..acfc28c41 100644 --- a/lib/plugins/acts_as_attachable/lib/acts_as_attachable.rb +++ b/lib/plugins/acts_as_attachable/lib/acts_as_attachable.rb @@ -172,6 +172,72 @@ module Redmine {:files => saved_attachments, :unsaved => unsaved_attachments} end + # 扩展方法,因为类型太多,为了不影响其它的 + # 最终需要形成一个方法 + def save_attachments_containers(attachments, author, is_public) + # 清除临时文件 + if attachments + tempAttach = attachments[:dummy] + if tempAttach && tempAttach[:file] + attachments.delete(:dummy) + end + end + + if attachments.is_a?(Hash) + attachments = attachments.stringify_keys + attachments = attachments.to_a.sort {|a, b| + if a.first.to_i > 0 && b.first.to_i > 0 + a.first.to_i <=> b.first.to_i + elsif a.first.to_i > 0 + 1 + elsif b.first.to_i > 0 + -1 + else + a.first <=> b.first + end + } + attachments = attachments.map(&:last) + end + if attachments.is_a?(Array) + attachments.each do |attachment| + if attachment.is_a?(Hash) + a = nil + file = attachment['file'] + token = attachment['token'] + t = file && file.size > 0 + if file && file.size > 0 + a = Attachment.create(:file => file, :author => author) + elsif token + # 通过token值找到对应的attachment + a = Attachment.find_by_token_only(token) + if a + a.filename = attachment['filename'] unless attachment['filename'].blank? + a.content_type = attachment['content_type'] + end + end + end + + if a && !attachment['is_public_checkbox'] + # 考虑到更新操作,所以全部设置为公开,私有项目、课程是不能访问的 + a.is_public = true + elsif a && attachment['is_public_checkbox'] + a.is_public = true + end + set_attachment_public(a) if a + next unless a + a.description = attachment['description'].to_s.strip + a.attachtype = @curattachment_type + if a.new_record? + unsaved_attachments << a + else + saved_attachments << a + end + end + end + {:files => saved_attachments, :unsaved => unsaved_attachments} + end + + def attach_saved_attachments saved_attachments.each do |attachment| self.attachments << attachment diff --git a/lib/redmine.rb b/lib/redmine.rb index 29167d4a8..e2dc8da0a 100644 --- a/lib/redmine.rb +++ b/lib/redmine.rb @@ -187,13 +187,13 @@ Redmine::AccessControl.map do |map| map.permission :delete_issue_watchers, {:watchers => :destroy} end - map.project_module :time_tracking do |map| - map.permission :log_time, {:timelog => [:new, :create]}, :require => :loggedin - map.permission :view_time_entries, {:timelog => [:index, :report, :show]}, :read => true - map.permission :edit_time_entries, {:timelog => [:edit, :update, :destroy, :bulk_edit, :bulk_update]}, :require => :member - map.permission :edit_own_time_entries, {:timelog => [:edit, :update, :destroy,:bulk_edit, :bulk_update]}, :require => :loggedin - map.permission :manage_project_activities, {:project_enumerations => [:update, :destroy]}, :require => :member - end + # map.project_module :time_tracking do |map| + # map.permission :log_time, {:timelog => [:new, :create]}, :require => :loggedin + # map.permission :view_time_entries, {:timelog => [:index, :report, :show]}, :read => true + # map.permission :edit_time_entries, {:timelog => [:edit, :update, :destroy, :bulk_edit, :bulk_update]}, :require => :member + # map.permission :edit_own_time_entries, {:timelog => [:edit, :update, :destroy,:bulk_edit, :bulk_update]}, :require => :loggedin + # map.permission :manage_project_activities, {:project_enumerations => [:update, :destroy]}, :require => :member + # end map.project_module :news do |map| map.permission :manage_news, {:news => [:new, :create, :edit, :update, :destroy], :comments => [:destroy]}, :require => :member @@ -207,12 +207,12 @@ Redmine::AccessControl.map do |map| map.permission :notificationcomment_contestnotifications, {:notificationcomments => :create},:belong_to_contest => true end - map.project_module :documents do |map| - map.permission :add_documents, {:documents => [:new, :create, :add_attachment]}, :require => :loggedin - map.permission :edit_documents, {:documents => [:edit, :update, :add_attachment]}, :require => :loggedin - map.permission :delete_documents, {:documents => [:destroy]}, :require => :loggedin - map.permission :view_documents, {:documents => [:index, :show, :download]}, :read => true - end + # map.project_module :documents do |map| + # map.permission :add_documents, {:documents => [:new, :create, :add_attachment]}, :require => :loggedin + # map.permission :edit_documents, {:documents => [:edit, :update, :add_attachment]}, :require => :loggedin + # map.permission :delete_documents, {:documents => [:destroy]}, :require => :loggedin + # map.permission :view_documents, {:documents => [:index, :show, :download]}, :read => true + # end map.project_module :files do |map| map.permission :manage_files, {:files => [:new, :create]}, :require => :loggedin @@ -257,9 +257,9 @@ Redmine::AccessControl.map do |map| map.permission :view_gantt, {:gantts => [:show, :update]}, :read => true end - map.project_module :dts do |map| - map.permission :do_dts, {:dts => :show}, :read => true - end + # map.project_module :dts do |map| + # map.permission :do_dts, {:dts => :show}, :read => true + # end # map.project_module :journals do |map| # map.permission :view_journals_for_messages, {:gantts => [:show, :update]}, :read => true # end diff --git a/public/images/new_project/arrow.png b/public/images/new_project/arrow.png new file mode 100644 index 000000000..c4439b821 Binary files /dev/null and b/public/images/new_project/arrow.png differ diff --git a/public/images/new_project/icons_issue.png b/public/images/new_project/icons_issue.png new file mode 100644 index 000000000..8c09a9ece Binary files /dev/null and b/public/images/new_project/icons_issue.png differ diff --git a/public/images/new_project/logo_pro.jpg b/public/images/new_project/logo_pro.jpg new file mode 100644 index 000000000..d539de0f5 Binary files /dev/null and b/public/images/new_project/logo_pro.jpg differ diff --git a/public/images/sy/sy_icons02.png b/public/images/sy/sy_icons02.png new file mode 100644 index 000000000..7d29ef2a9 Binary files /dev/null and b/public/images/sy/sy_icons02.png differ diff --git a/public/images/user/icons_user_leftnav.png b/public/images/user/icons_user_leftnav.png index 7983c4dc6..61cd38904 100644 Binary files a/public/images/user/icons_user_leftnav.png and b/public/images/user/icons_user_leftnav.png differ diff --git a/public/images/user/user_navmore_icons.png b/public/images/user/user_navmore_icons.png index e4fb91b54..6ecd00566 100644 Binary files a/public/images/user/user_navmore_icons.png and b/public/images/user/user_navmore_icons.png differ diff --git a/public/javascripts/application.js b/public/javascripts/application.js index 5165a67bc..1053c8117 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -1461,7 +1461,7 @@ function expand_blog_comment_reply(container, btnid, id, type, div_id, homepage) } } -function expand_reply_homework(container, btnid, id, type, div_id, is_in_course, course_activity, user_activity_id) { +function expand_reply_homework(container, btnid, id, type, div_id, hw_status, user_activity_id) { var target = $(container); var btn = $(btnid); if (btn.data('init') == '0') { @@ -1472,8 +1472,7 @@ function expand_reply_homework(container, btnid, id, type, div_id, is_in_course, type: type, id: id, div_id: div_id, - is_in_course: is_in_course, - course_activity: course_activity, + hw_status: hw_status, user_activity_id: user_activity_id }, function(data) { diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index 8f6c56a4b..a2117bdf3 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -130,7 +130,7 @@ a.hworkSearchIcon:hover {background:url(../images/nav_icon.png) -49px -1px no-re /*作业信息*/ .mt-2 {margin-top:-2px;} -.homeworkInfo {background:#F6F6F6; padding:10px; margin-bottom:10px;} +.homeworkInfo {background:#F6F6F6; padding:10px;} .homeworkDetail {line-height:18px; font-size:12px; color:#484848; overflow:hidden;} .homeworkDetail p,.homeworkDetail div,.homeworkDetail em, .homeworkDetail span{text-align: justify; text-justify:inter-ideograph; word-break: normal !important; word-wrap: break-word !important; line-height: 18px !important;} .max_h54 {max-height:54px; } diff --git a/public/stylesheets/css/calendar.css b/public/stylesheets/css/calendar.css new file mode 100644 index 000000000..11cd99637 --- /dev/null +++ b/public/stylesheets/css/calendar.css @@ -0,0 +1,53 @@ +/***** Calendar *****/ +table#calender td{padding: 2px;} +table.cal {border-collapse: collapse; width: 100%; margin: 0px 0 6px 0;border: 1px solid #d7d7d7;} +table.cal thead th {width: 14%; background-color:#EEEEEE; padding: 4px; } +table.cal thead th.week-number {width: auto;} +table.cal tbody tr {height: 100px;} +table.cal td {border: 1px solid #d7d7d7; vertical-align: top; font-size: 0.9em;} +table.cal td.week-number { background-color:#EEEEEE; padding: 4px; border:none; font-size: 1em;} +table.cal td p.day-num {font-size: 1.1em; text-align:right;} +table.cal td.odd p.day-num {color: #bbb;} +table.cal td.today {background:#ffffdd;} +table.cal td.today p.day-num {font-weight: bold;} +table.cal .starting a, p.cal.legend .starting {background: url(/images/bullet_go.png) no-repeat -1px -2px; padding-left:16px;} +table.cal .ending a, p.cal.legend .ending {background: url(/images/bullet_end.png) no-repeat -1px -2px; padding-left:16px;} +table.cal .starting.ending a, p.cal.legend .starting.ending {background: url(/images/bullet_diamond.png) no-repeat -1px -2px; padding-left:16px;} +p.cal.legend span {display:block;} + +/***** Tooltips ******/ +.tooltip{position:relative;z-index:24;} +.tooltip:hover{z-index:25;color:#000;} +.tooltip span.tip{display: none; text-align:left;} + +div.tooltip:hover span.tip{ + display:block; + position:absolute; + top:12px; left:24px; width:270px; + border:1px solid #555; + background-color:#fff; + padding: 4px; + font-size: 0.8em; + color:#505050; +} + +img.ui-datepicker-trigger { + display: block; + background: url(/images/public_icon.png) -31px 0 no-repeat; + cursor: pointer; + vertical-align: middle; + margin-left: 5px; + margin-top: 5px; + width: 16px; + height: 15px; + float: left; +} + +div.issue {background:#FFFFEC; padding:6px; margin-bottom:6px;border: 1px solid #d7d7d7;} +.tooltip{position:relative;z-index:24;} +.tooltip:hover{z-index:25;color:#000;} +.tooltip span.tip{display: none; text-align:left;} +.task.parent.marker.starting { position: absolute; background: url(/images/task_parent_end.png) no-repeat 0 0; width: 8px; height: 16px; margin-left: -4px; left: 0px; top: -1px;} + +/*.icon*/ +.icon-package { background-image: url(/images/package.png); } \ No newline at end of file diff --git a/public/stylesheets/css/common.css b/public/stylesheets/css/common.css index 47313265a..a6cfc5894 100644 --- a/public/stylesheets/css/common.css +++ b/public/stylesheets/css/common.css @@ -429,7 +429,7 @@ a.linkGrey3:hover {color:#000000;} a.linkGrey4 {color:#484848;} a.linkGrey4:hover {color:#297fb8;} a.linkGrey5 {color:#484848;} -a.linkGrey5:hover {color:#3498db;} +a.linkGrey5:hover {color:#3498db !important;} a.linkGrey6 {color:#484848 !important;} a.linkGrey6:hover {color:#ffffff !important;} a.linkGrey7 {color:#888888;} @@ -452,27 +452,6 @@ a.submit_btn2:hover {background-color: #297fb8;} .wlist_select a { background-color:#48aac9; color:#fff;} /*add by Tim*/ -a.linkBlue {color:#269ac9;} -a.linkBlue:hover {color:#297fb8;} -a.buttonBlue {background-color:#269ac9;} -a.buttonBlue:hover {background-color:#297fb8;} -a.linkGrey {color:#484848;} -a.linkGrey:hover {color:#269ac9;} - -a.bBlue {background-color:#3498db;} -a.bBlue:hover {background-color:#297fb8;} -.fontGrey {color:#cecece;} -.fontGrey2 {color:#888888;} -a.linkBlue2 {color:#3498db;} -a.linkBlue2:hover {color:#297fb8;} -a.linkOrange {color:#ff7143;} -a.linkGrey2 {color:#888888;} -a.linkGrey2:hover {color:#484848;} -a.linkGrey4 {color:#484848;} -a.linkGrey5 {color:#484848;} -a.linkGrey5:hover {color:#3498db;} -a.submit_btn {border:1px solid #3498db; padding:3px 10px; border-radius:3px; color:#3498db;} -a.submit_btn:hover {background-color:#3498db; color:#ffffff;} input.submit_btn {border:1px solid #3498db; padding:3px 10px; border-radius:3px; color:#3498db;} input.submit_btn:hover {background-color:#3498db; color:#ffffff;} a.yellowBtn{ display:inline-block;color:#0d90c3; height:22px;} @@ -542,15 +521,13 @@ a:hover.bgreen_n_btn{background:#08a384;} .red-cir-btn{ background:#e74c3c; padding:1px 5px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;} .green-cir-btn{ background:#28be6c; padding:1px 5px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;} .button-rep { color: #888;display: inline-block;background: #eee;padding: 2px 5px;} -a.BlueCirBtnMini{ display:block;width:40px; height:22px; background-color:#ffffff; line-height:24px; vertical-align:middle; text-align:center; border:1px solid #269ac9; color:#269ac9; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px;} -a:hover.BlueCirBtnMini{ background:#269ac9; color:#fff;} .green_btn_share{ background:#28be6c; padding:2px 5px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;} .borderRadius {border-radius:5px;} a.Blue-btn{ display:block; margin-right:15px;width:65px; height:22px; background-color:#ffffff; line-height:24px; vertical-align:middle; text-align:center; border:1px solid #3598db; color:#3598db; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px;} a:hover.Blue-btn{ background:#3598db; color:#fff;} a.BlueCirBtn{ display:block;width:75px; height:28px; background-color:#fff; line-height:28px; vertical-align:middle; text-align:center; border:1px solid #3598db; color:#3598db; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px;} a:hover.BlueCirBtn{ background:#3598db; color:#fff;} -a.BlueCirBtnMini{ display:block;width:40px; height:22px; background-color:#ffffff; line-height:24px; vertical-align:middle; text-align:center; border:1px solid #3598db; color:#3598db; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px;} +a.BlueCirBtnMini{ display:block;width:40px; height:24px; background-color:#ffffff; line-height:24px; vertical-align:middle; text-align:center; border:1px solid #3598db; color:#3598db; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px;} a:hover.BlueCirBtnMini{ background:#3598db; color:#fff;} /*20160725 项目申请按钮*/ diff --git a/public/stylesheets/css/courses.css b/public/stylesheets/css/courses.css index 1841e0348..eccbcc9b1 100644 --- a/public/stylesheets/css/courses.css +++ b/public/stylesheets/css/courses.css @@ -249,7 +249,7 @@ a.hworkSearchIcon:hover {background:url(../images/nav_icon.png) -49px -1px no-re .StudentName{display: table-cell;width: 115px;vertical-align: middle;text-align: left;height: 40px;} /*作业信息*/ -.homeworkInfo {background:#F6F6F6; padding:10px; margin-bottom:10px;} +.homeworkInfo {background:#F6F6F6; padding:10px;} .homeworkDetail {line-height:18px; font-size:12px; color:#484848; overflow:hidden;} .homeworkDetail p,.homeworkDetail div,.homeworkDetail em, .homeworkDetail span{text-align: justify; text-justify:inter-ideograph; word-break: normal !important; word-wrap: break-word !important; line-height: 18px !important;} .homeworkState {padding:3px 5px; background-color:#28be6c; border-radius:3px; float:left; margin-left:15px; color:#ffffff;} diff --git a/public/stylesheets/css/gantt.css b/public/stylesheets/css/gantt.css new file mode 100644 index 000000000..d0ab0e4f2 --- /dev/null +++ b/public/stylesheets/css/gantt.css @@ -0,0 +1,177 @@ +fieldset.collapsible { border-width: 1px 0 0 0; font-size: 0.9em; } +fieldset.collapsible>legend { padding-left: 16px; background: url(/images/arrow_expanded.png) no-repeat 0% 40%; cursor:pointer; } +fieldset.collapsible.collapsed>legend { background-image: url(/images/arrow_collapsed.png); } + +/***** Gantt chart *****/ +.gantt_hdr { + position:absolute; + top:0; + height:16px; + border-top: 1px solid #c0c0c0; + border-bottom: 1px solid #c0c0c0; + border-right: 1px solid #c0c0c0; + text-align: center; + overflow: hidden; +} + +.gantt_hdr.nwday {background-color:#f1f1f1;} + +.gantt_subjects { font-size: 0.8em; } +.gantt_subjects div { line-height:16px;height:16px;overflow:hidden;white-space:nowrap;text-overflow: ellipsis; } + +.task { + position: absolute; + height:8px; + font-size:0.8em; + color:#888; + padding:0; + margin:0; + line-height:16px; + white-space:nowrap; +} + +.task.label {width:100%;} +.task.label.project, .task.label.version { font-weight: bold; } + +.task_late { background:#f66 url(/images/task_late.png); border: 1px solid #f66; } +.task_done { background:#00c600 url(/images/task_done.png); border: 1px solid #00c600; } +.task_todo { background:#aaa url(/images/task_todo.png); border: 1px solid #aaa; } + +.task_todo.parent { background: #888; border: 1px solid #888; height: 3px;} +.task_late.parent, .task_done.parent { height: 3px;} +.task.parent.marker.starting { position: absolute; background: url(/images/task_parent_end.png) no-repeat 0 0; width: 8px; height: 16px; margin-left: -4px; left: 0px; top: -1px;} +.task.parent.marker.ending { position: absolute; background: url(/images/task_parent_end.png) no-repeat 0 0; width: 8px; height: 16px; margin-left: -4px; right: 0px; top: -1px;} + +.version.task_late { background:#f66 url(/images/milestone_late.png); border: 1px solid #f66; height: 2px; margin-top: 3px;} +.version.task_done { background:#00c600 url(/images/milestone_done.png); border: 1px solid #00c600; height: 2px; margin-top: 3px;} +.version.task_todo { background:#fff url(/images/milestone_todo.png); border: 1px solid #fff; height: 2px; margin-top: 3px;} +.version.marker { background-image:url(/images/version_marker.png); background-repeat: no-repeat; border: 0; margin-left: -4px; margin-top: 1px; } + +.project.task_late { background:#f66 url(/images/milestone_late.png); border: 1px solid #f66; height: 2px; margin-top: 3px;} +.project.task_done { background:#00c600 url(/images/milestone_done.png); border: 1px solid #00c600; height: 2px; margin-top: 3px;} +.project.task_todo { background:#fff url(/images/milestone_todo.png); border: 1px solid #fff; height: 2px; margin-top: 3px;} +.project.marker { background-image:url(/images/project_marker.png); background-repeat: no-repeat; border: 0; margin-left: -4px; margin-top: 1px; } + +.version-behind-schedule a, .issue-behind-schedule a {color: #f66914;} +.version-overdue a, .issue-overdue a, .project-overdue a {color: #f00;} +/*end*/ + +dt.issue { background-image: url(/images/ticket.png); } +dt.issue-edit { background-image: url(/images/ticket_edit.png); } +dt.issue-closed { background-image: url(/images/ticket_checked.png); } +dt.issue-note { background-image: url(/images/ticket_note.png); } +dt.changeset { background-image: url(/images/changeset.png); } +dt.news { background-image: url(/images/news.png); } +dt.message { background-image: url(/images/message.png); } +dt.reply { background-image: url(/images/comments.png); } +dt.wiki-page { background-image: url(/images/wiki_edit.png); } +dt.attachment { background-image: url(/images/attachment.png); } +dt.document { background-image: url(/images/document.png); } +dt.project { background-image: url(/images/projects.png); } +dt.time-entry { background-image: url(/images/time.png); } + +/***** Icons *****/ +.icon { + background-position: 0% 50%; + background-repeat: no-repeat; + font-family: '微软雅黑'; /*modify by men*/ + padding-left: 20px; + padding-top: 2px; + padding-bottom: 3px; +} +.icon_enterprise { + background-position: 0% 50%; + background-repeat: no-repeat; + font-family: '微软雅黑'; /*modify by men*/ + padding-left: 20px; + padding-top: 2px; + padding-bottom: 3px; +} +.icon_enterprise-add { background-image: url(/images/add_enterprise.png); } +.icon-add { background-image: url(/images/add.png); } +.icon-edit { /*background-image: url(../images/edit.png);*/ } +.icon-copy { background-image: url(/images/copy.png); } +.icon-duplicate { background-image: url(/images/duplicate.png); } +.icon-del { /*background-image: url(../images/delete.png); */} +.icon-move { background-image: url(/images/move.png); } +.icon-save { background-image: url(/images/save.png); } +.icon-cancel { background-image: url(/images/cancel.png); } +.icon-multiple { background-image: url(/images/table_multiple.png); } +.icon-folder { background-image: url(/images/folder.png); } +.open .icon-folder { background-image: url(/images/folder_open.png); } +.icon-package { background-image: url(/images/package.png); } +.icon-user { background-image: url(/images/user.png); } +.icon-projects { background-image: url(/images/projects.png); } +.icon-help { background-image: url(/images/help.png); } +.icon-attachment { background-image: url(/images/attachment.png);padding-left: 20px !important; } +.icon-history { background-image: url(/images/history.png); } +.icon-time { background-image: url(/images/time.png); } +.icon-time-add { background-image: url(/images/time_add.png); } +.icon-stats { background-image: url(/images/stats.png); } +.icon-warning { background-image: url(/images/warning.png); } +.icon-fav { background-image: url(/images/fav.png); } +.icon-fav-off { background-image: url(/images/fav_off.png); } +.icon-reload { background-image: url(/images/reload.png); } +.icon-lock { background-image: url(/images/locked.png); } +.icon-unlock { background-image: url(/images/unlock.png); } +.icon-checked { background-image: url(/images/true.png); } +.icon-details { background-image: url(/images/zoom_in.png); } +.icon-report { background-image: url(/images/report.png); } +.icon-comment { /*background-image: url(../images/comment.png); */} +.icon-summary { background-image: url(/images/lightning.png); } +.icon-server-authentication { background-image: url(/images/server_key.png); } +.icon-issue { background-image: url(/images/ticket.png); } +.icon-zoom-in { background-image: url(/images/zoom_in.png); } +.icon-zoom-out { background-image: url(/images/zoom_out.png); } +.icon-passwd { background-image: url(/images/textfield_key.png); } +.icon-test { background-image: url(/images/bullet_go.png); } + +.icon-file { background-image: url(/images/files/default.png); } +.icon-file.text-plain { background-image: url(/images/files/text.png); } +.icon-file.text-x-c { background-image: url(/images/files/c.png); } +.icon-file.text-x-csharp { background-image: url(/images/files/csharp.png); } +.icon-file.text-x-java { background-image: url(/images/files/java.png); } +.icon-file.text-x-javascript { background-image: url(/images/files/js.png); } +.icon-file.text-x-php { background-image: url(/images/files/php.png); } +.icon-file.text-x-ruby { background-image: url(/images/files/ruby.png); } +.icon-file.text-xml { background-image: url(/images/files/xml.png); } +.icon-file.text-css { background-image: url(/images/files/css.png); } +.icon-file.text-html { background-image: url(/images/files/html.png); } +.icon-file.image-gif { background-image: url(/images/files/image.png); } +.icon-file.image-jpeg { background-image: url(/images/files/image.png); } +.icon-file.image-png { background-image: url(/images/files/image.png); } +.icon-file.image-tiff { background-image: url(/images/files/image.png); } +.icon-file.application-pdf { background-image: url(/images/files/pdf.png); } +.icon-file.application-zip { background-image: url(/images/files/zip.png); } +.icon-file.application-x-gzip { background-image: url(/images/files/zip.png); } + +img.gravatar { + padding: 2px; + border: solid 1px #d5d5d5; + background: #fff; + vertical-align: middle; +} + +div.issue img.gravatar { + float: left; + margin: 0 6px 0 0; + padding: 5px; +} + +div.issue table img.gravatar { + height: 14px; + width: 14px; + padding: 2px; + float: left; + margin: 0 0.5em 0 0; +} + +h2 img.gravatar {margin: -2px 4px -4px 0;} +h3 img.gravatar {margin: -4px 4px -4px 0;} +h4 img.gravatar {margin: -6px 4px -4px 0;} +td.username img.gravatar {margin: 0 0.5em 0 0; vertical-align: top;} +#activity dt img.gravatar {float: left; margin: 0 1em 1em 0;} +/* Used on 12px Gravatar img tags without the icon background */ +.icon-gravatar {float: left; margin-right: 4px;} + +.buttons { font-size: 0.9em; margin-bottom: 1.4em; margin-top: 1em; } \ No newline at end of file diff --git a/public/stylesheets/css/project.css b/public/stylesheets/css/project.css index d2be2e16c..7da1e671b 100644 --- a/public/stylesheets/css/project.css +++ b/public/stylesheets/css/project.css @@ -167,7 +167,7 @@ div.thumbnails div {background:#fff;display:inline-block;margin-right:2px;} /* 里程碑 */ .roadmap_box{ background:#f8f8f8; width:648px; padding:10px; margin-top:5px; border:1px solid #ddd; color:#555;} .progress{ width:648px; height:20px; margin-bottom:5px; background:#e9e9e9;} -.closed{ background:#bae0ba; height:20px;} +.closed{ background:#bae0ba;} .done{ background:#d3edd3; display:block;height:20px;float:left;} .roadmap_box{ margin-bottom:10px;} .roadmap_list_ul{border:1px solid #ddd; border-bottom:none; margin-bottom:10px;} @@ -555,3 +555,343 @@ a:hover.upload_btn_grey{background:#8a8a8a;} .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;} + +/*发布新样式*/ +.publish-icon {background:url("/images/new_project/icons_issue.png") 0px -82px no-repeat; width:18px; height:18px; display:block;} +.publish-icon:hover {background:url("/images/new_project/icons_issue.png") -25px -82px no-repeat;} + +/* 班级主页 */ +.sy_class_infobox{ + padding:15px; + background:#fff; + margin:12px auto 0; + width:968px; + border:1px solid #e5e5e5; + position: relative; +} +.homepagePostSetting { + position:absolute; + width:20px; + height:20px; + right:10px; + top:10px; +} +.homepagePostSetting ul li:hover ul { + display:block; +} + +.homepagePostSettiongText { + width:75px; + text-align: center; + line-height:2; + font-size:12px; + color:#616060; + background-color:#ffffff; + border:1px solid #eaeaea; + border-radius:3px; + position:absolute; + left:-60px; + top:20px; + padding:5px 0px; + display:none; + box-shadow: 0px 2px 8px rgba(146, 153, 169, 0.5); +} + +a.postOptionLink { + color:#616060; + display:block; + width:55px; + padding:0px 10px; +} +a.postOptionLink:hover { + color:#fff; + background-color:#3b94d6; +} + +.sy_class_logo{ + width:110px; + height:110px; +} +.sy_class_id{ + width:110px; + height:80px; + background:#fff; + border: 1px solid #f1f1f1; + text-align:center; + padding-top:30px; +} +.sy_class_id p{ + font-size:16px; + color:#333; +} +.sy_class_title{ + font-size: 18px; + font-weight: normal; + margin-bottom: 5px; + max-width:440px; + overflow:hidden; + white-space: nowrap; + text-overflow:ellipsis; +} + +.sy_class_titbox{margin-bottom:5px; padding-top:10px; } + +/*旧版课程大纲新建编辑*/ +.sy_tab_con{width:740px; padding:20px; position:relative;} +.syllabuscon_title{ + color:#000; text-align:center; +} +.syllabuscon_txt p{ + font-size:14px; + line-height:1.9; + color:#000; +} +.syllabuscon_txt_title{ + font-weight:bold; + margin:10px 0; +} +.syllabusbox_tishi{ + font-size:14px; + width:733px; + color:#cb7c01; + padding:10px 0 0 15px; + margin-bottom:10px; + background:#fff7d1; + border:1px solid #fcd9b4; + height:34px; +} +a.syllabusbox_a_blue{ + color:#3b94d6; +} +.syllabus_leftinfo p{ + line-height:25px; + width:150px; + overflow:hidden; + white-space: nowrap; + text-overflow:ellipsis; +} +.syllabus_info_tishi{ + font-size:16px; + width:400px; + margin:100px auto; +} +.syllabus_info_tishi a{ + color:#3b94d6; +} +.homepagePostSettingIcon {background:url(../images/homepage_icon.png) -93px -5px no-repeat; width:20px; height:20px; } +.homepagePostSettiongText {width:75px; line-height:2; font-size:12px; color:#616060; background-color:#ffffff; border:1px solid #eaeaea; border-radius:3px; position:absolute; left:-48px; top:20px; padding:5px 0px; display:none;} +.homepagePostSettingIcon:hover {background:url(../images/homepage_icon.png) -93px -44px no-repeat;} +a.AnnexBtn{ background: url(../images/homepage_icon.png) 0px -343px no-repeat !important; height:20px; display:block; padding-left:20px; color:#888888; -moz-transition :all 0s linear 0s; -webkit-transition :all 0s linear 0s; -o-transition:all 0s linear 0s; transition:all 0s linear 0s;} +a:hover.AnnexBtn{background: url(../images/homepage_icon.png) -90px -343px no-repeat !important; color:#3598db; -moz-transition :all 0s linear 0s; -webkit-transition :all 0s linear 0s; -o-transition:all 0s linear 0s; transition:all 0s linear 0s;} +a.BlueCirBtnMini{ display:block;width:40px; height:22px; background-color:#ffffff; line-height:24px; vertical-align:middle; text-align:center; border:1px solid #3b94d6; color:#3b94d6; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px;} +a:hover.BlueCirBtnMini{ background:#3b94d6; color:#fff;} + +/* 按钮 复制课程大纲*/ +a.btn_orange_big{ + border: 1px solid #ee4a1f; + color: #ee4a1f; + text-align: center; + font-size: 14px; + padding:0 10px; + height: 30px; + line-height: 30px; + -webkit-border-radius:3px; + -moz-border-radius:3px; + -o-border-radius:3px; + border-radius:3px; +} +a:hover.btn_orange_big{ + background: #ee4a1f; + color: #fff; +} +a.btn_green_big{ + border: 1px solid #60b25e; + color: #60b25e; + text-align: center; + font-size: 14px; + padding:0 10px; + height: 30px; + line-height: 30px; + -webkit-border-radius:3px; + -moz-border-radius:3px; + -o-border-radius:3px; + border-radius:3px; +} +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; + background: #e1e1e1; + 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_grey{ background: #c3c3c3;} +a.sy_btn_blue{ + color: #fff; + background: #3b94d6; + 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_blue{ background: #2788d0;} +a.hw_btn_blue{ + display: inline-block; + color: #3b94d6; + border:1px solid #3b94d6; + background:#fff; + 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.hw_btn_blue,a:active.hw_btn_blue{ background: #3b94d6; color:#fff;} + +/* 缺陷列表 */ +.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_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; } +.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/project/arrow.png") no-repeat scroll right center transparent;} +.issues_form_filter select:focus {outline:none; border:none;} +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; } +/* 缺陷Tab */ +.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;} +.issues_nav_hover{border-bottom:3px solid #3498db; font-weight:bold; } +.issues_nav_nomall {border-bottom:none; } +.issues_nav_tag{ background-color:#eaeaea; padding:2px 8px;-webkit-border-radius:15px;-moz-border-radius:15px;-o-border-radius:15px;border-radius:15px; font-size:12px;} +.undis {display:none;} +.dis {display:block;} +.issues_form_filter{ position: absolute; top:0; right: 0;} +.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; padding-right:10px;} +.issues_form_filter select.issues_filter_select_min{width:50px; } +.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;} +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") -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: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;} +.issues_ciricons_02{ width: 22px; height: 22px; display: inline-block; background: url("/images/new_project/icons_issue.png") 0 -30px no-repeat;} +.issues_icons_mes{width: 17px; height: 19px; display: inline-block; background: url("/images/new_project/icons_issue.png") 0 -56px no-repeat; } +.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: 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: 52px;} + + +/* 搜索 与课程相同 */ +.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;} \ No newline at end of file diff --git a/public/stylesheets/css/public.css b/public/stylesheets/css/public.css index d4cce2679..4937bd883 100644 --- a/public/stylesheets/css/public.css +++ b/public/stylesheets/css/public.css @@ -722,6 +722,7 @@ a.wzan_visited{background:url(../images/pic_zan.png) 0 0 no-repeat;} /* 学生列表*/ .st_list{ width:670px;} +.st_list2{ width:730px;} .st_search{ } .st_search span{ font-size:14px; font-weight:bold; color:#606060; margin-right:35px;} .st_search_input{ border:1px solid #1c9ec7; background:#fff; height:20px; color:#c4c4c4; width:220px; padding-left:5px; margin-bottom:5px;} diff --git a/public/stylesheets/css/structure.css b/public/stylesheets/css/structure.css index 5fc47ad81..4f7c2a91c 100644 --- a/public/stylesheets/css/structure.css +++ b/public/stylesheets/css/structure.css @@ -375,6 +375,7 @@ ul.subNavArrow:hover li ul {display:block;} /*左侧导航*/ .subNavBox{width:240px; background:#fff;margin:10px 10px 0 0;} +.subNavBoxProject{width:240px; background:#fff;} .subNav{border-bottom:solid 1px #e5e3da;cursor:pointer;font-weight:bold;font-size:14px;color:#3ca5c6; height:26px;padding-left:10px;background-color:#fff; padding-top:2px;} .subNav_jiantou{background:url(/images/jiantou1.jpg) no-repeat;background-position:95% 50%; background-color:#fff;} .subNav_jiantou:hover{color:#0781b4; } @@ -596,7 +597,7 @@ a.user_leftinfo_img { display:block; width:80px; height:80px; margin:15px auto;} .user_sub_menu li a:hover,.user_sub_menu li a:target { color:#3b94d6; background:#fff url(/images/user/user_navmore_icons.png) 0px 0px no-repeat;} .user_sub_menu li a:hover,.user_sub_menu li a:target{} .user_sub_menu li:last-child a { } -.user_sub_menu li p {padding:0 15px 0 25px; border:1px solid #e5e5e5; border-bottom:none; background:#f8f8f8;} +.user_sub_menu li p {padding:0 18px 0 25px; border:1px solid #e5e5e5; border-bottom:none; background:#f8f8f8;} .user_sub_menu li p:hover {background:#fff;} .user_sub_menu li p:hover a {background:#fff;} .user_sub_menu li p:hover,.user_sub_menu li p:target {color:#3b94d6; background:#fff url(/images/user/user_navmore_icons.png) 0px 0px no-repeat;} @@ -640,9 +641,12 @@ a.user_navmorebox .user_icons_closeclass{ background:url(/images/user/icons_user_leftnav.png) -25px -347px no-repeat; } .show-all-sub {position:absolute; top:18px; right:15px;} -.sub-menu-title {position:absolute; border:1px solid #ddd; background-color:#fff; padding:2px 5px; z-index:99; white-space:nowrap; left:25px; top:35px; display:none;} +.sub-menu-title {position:absolute; background-color:#fff; padding:5px 10px; z-index:99; white-space:nowrap; top:-2px; box-shadow: 0px 2px 8px rgba(146, 153, 169, 0.5); display:none; color:#aaa;} +.sub-menu-title div a {background-color:#fff; height:auto; line-height:1; font-size:12px; color:#aaa;} +.sub-menu-title em {display:block; border-width:8px; position:absolute;top:16px; right:-16px; border-style:dashed dashed dashed solid; border-color:transparent transparent transparent #fff; font-size:0; line-height:0; z-index:1;} +.sub-menu-title font {display:block; border-width:8px; position:absolute;top:17px; right:-17px; border-style:dashed dashed dashed solid; border-color:transparent transparent transparent rgba(146, 153, 169, 0.5); font-size:0; line-height:0;} /* 个人主页左侧导航更多功能 */ -.user_navmore_box {position:absolute; width:15px; height:15px; right:13px; top:17px; cursor:pointer;} +.user_navmore_box {position:absolute; width:15px; height:15px; right:12px; top:17px; cursor:pointer;} .user_navmore_box ul li:hover ul {display:block; } .user_navmore_icons {background:url(/images/user/icons_user_leftnav.png) -15px -34px no-repeat; width:19px; height:15px; } .user_navmore_icons:hover {background:url(/images/user/icons_user_leftnav.png) -30px -34px no-repeat;} diff --git a/public/stylesheets/nyan.css b/public/stylesheets/nyan.css index 75da9349d..d219a8efb 100644 --- a/public/stylesheets/nyan.css +++ b/public/stylesheets/nyan.css @@ -1447,7 +1447,7 @@ ul.contest-notification-list li span{ .xls { /*background: url('../images/icon_excel.gif') no-repeat scroll 1px 50% transparent;*/ /*padding: 2px 0px 3px 16px;*/ - font-family:微软雅黑 !important; + font-family:"微软雅黑" !important; font-size: 12px !important; color: #136b3b !important; font-weight:normal !important; diff --git a/public/stylesheets/sy_public.css b/public/stylesheets/sy_public.css index 454bdcb4a..adfce90bb 100644 --- a/public/stylesheets/sy_public.css +++ b/public/stylesheets/sy_public.css @@ -38,7 +38,7 @@ a.hw_btn_green2{ border:1px solid #60b25e; background:#fff; text-align: center; - font-size: 14px; + font-size: 12px; padding:0 10px; height: 30px; line-height: 30px; @@ -71,14 +71,14 @@ a:hover.hw_corange{ color: #e1412b;} .hw_cir_lorange{ background:#f79981;} .hw_cir_lgreen{ background:#7ecfa2;} .hw_w20{ width:20px; display:block; text-align:center;} -.hw_w20{ width:20px; display:block; text-align:center;} +.hw_w30{ width:30px; display:block; text-align:center;} /* 按钮*/ a.btn_orange_big{ display:inline-block; border: 1px solid #ee4a1f; color: #ee4a1f; text-align: center; - font-size: 14px; + font-size: 12px; padding:0 10px; height: 30px; line-height: 30px; diff --git a/public/stylesheets/syllabus.css b/public/stylesheets/syllabus.css index 9aac34eae..1a04c73a5 100644 --- a/public/stylesheets/syllabus.css +++ b/public/stylesheets/syllabus.css @@ -617,3 +617,20 @@ a:hover.sy_class_ltitle{ color:#333;} /* 我的作业 */ .hw_classname{ width:180px; overflow:hidden; display:block;overflow:hidden;white-space: nowrap; text-overflow:ellipsis;} .hw_tab_top{ height: 50px; line-height: 50px; padding-left: 15px; border-bottom:1px solid #ddd; border-left:3px solid #3b94d6; } + +/*20160918教师团队*/ +.sy_new_tablebox{ padding:15px; padding-bottom:none;} +.sy_new_table{ width:100%; background:#fff; border:1px solid #e5e5e5; padding-bottom:30px;} +.sy_new_table thead tr{ height:40px; line-height:40px;} +.sy_new_table thead tr th{ border-bottom:1px solid #e5e5e5;} +.sy_new_table tbody tr:hover{ background:#f5f5f5;} +.sy_new_table tbody tr td{ height:40px; line-height:40px; border-bottom:1px dashed #e5e5e5; font-weight:normal; color:#888; text-align: center} +.sy_new_table tbody tr:last-child{ height:40px;} +.sy_new_tchlist li{ height:30px; line-height:30px;} +.sy_new_search{-webkit-border-radius:3px;-moz-border-radius:3px;-o-border-radius:3px;border-radius:3px; border:1px solid #d3d3d3; background:#fff; padding-left:5px; color:#888; height:32px; width:370px;box-shadow: inset 0px 0px 3px #dcdcdc; } +.sy_new_tchbox{ background:#f5f5f5; padding:15px; margin:15px; margin-top:0px;} +.sy_new_orange{font-size: 12px;padding: 0 5px;border-radius: 3px;line-height: 14px;color: #ff4a1b;border: 1px solid #ff4a1b;} +.sy_new_namebox{ width:180px; overflow:hidden;} +.sy_new_name{ display:block;max-width:120px; overflow:hidden;white-space: nowrap; text-overflow:ellipsis;} +.sy_new_long_name{ display:block;width:180px; overflow:hidden;white-space: nowrap; text-overflow:ellipsis;} +.mt12{ margin-top:12px;} diff --git a/spec/controllers/syllabus_member_controller_spec.rb b/spec/controllers/syllabus_member_controller_spec.rb new file mode 100644 index 000000000..b56654f55 --- /dev/null +++ b/spec/controllers/syllabus_member_controller_spec.rb @@ -0,0 +1,5 @@ +require 'rails_helper' + +RSpec.describe SyllabusMemberController, :type => :controller do + +end diff --git a/spec/factories/syllabus_members.rb b/spec/factories/syllabus_members.rb new file mode 100644 index 000000000..ab1bd6701 --- /dev/null +++ b/spec/factories/syllabus_members.rb @@ -0,0 +1,9 @@ +# Read about factories at https://github.com/thoughtbot/factory_girl + +FactoryGirl.define do + factory :syllabus_member do + rank 1 + syllabus nil + user nil + end +end diff --git a/spec/models/syllabus_member_spec.rb b/spec/models/syllabus_member_spec.rb new file mode 100644 index 000000000..464c1e965 --- /dev/null +++ b/spec/models/syllabus_member_spec.rb @@ -0,0 +1,5 @@ +require 'rails_helper' + +RSpec.describe SyllabusMember, :type => :model do + pending "add some examples to (or delete) #{__FILE__}" +end