diff --git a/Gemfile b/Gemfile index 72bd03c7b..58ccbc011 100644 --- a/Gemfile +++ b/Gemfile @@ -50,10 +50,10 @@ gem 'elasticsearch-model' gem 'elasticsearch-rails' #rails 3.2.22.2 bug - # gem "test-unit", "~>3.0" + gem "test-unit", "~>3.0" ### profile - # gem 'oneapm_rpm' + gem 'oneapm_rpm' group :development do gem 'grape-swagger' diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index 1f8cdd275..d8fc9ce28 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -175,8 +175,10 @@ class AdminController < ApplicationController def courses @name = params[:name].to_s.strip.downcase if @name && @name != "" - @courses = Course.select{ |course| course.teacher && ((course.teacher.show_name).include?(@name) || course.name.include?(@name))} - @courses = @courses.sort{|x, y| y.created_at <=> x.created_at} + all_user_ids = Course.all.map{|course| course.tea_id} + user_str_ids = search_user_by_name all_user_ids, @name + user_ids = user_str_ids.empty? ? "(-1)" : "(" + user_str_ids.join(",") + ")" + @courses = Course.where("tea_id in #{user_ids} or name like '%#{@name}%'").reorder("created_at desc") else @courses = Course.order('created_at desc') end diff --git a/app/controllers/homework_common_controller.rb b/app/controllers/homework_common_controller.rb index b9a49dbcb..3234d15c0 100644 --- a/app/controllers/homework_common_controller.rb +++ b/app/controllers/homework_common_controller.rb @@ -6,7 +6,7 @@ class HomeworkCommonController < ApplicationController include StudentWorkHelper before_filter :find_course, :only => [:index,:new,:create] - before_filter :find_homework, :only => [:edit,:update,:alert_anonymous_comment,:start_anonymous_comment,:stop_anonymous_comment,:destroy,:start_evaluation_set,:set_evaluation_attr,:score_rule_set,:alert_forbidden_anonymous_comment,:alert_open_student_works,:open_student_works] + before_filter :find_homework, :only => [:edit,:update,:alert_anonymous_comment,:start_anonymous_comment,:stop_anonymous_comment,:destroy,:start_evaluation_set,:set_evaluation_attr,:score_rule_set,:alert_forbidden_anonymous_comment,:alert_open_student_works,:open_student_works,:set_score_open,:alert_score_open_modal] before_filter :teacher_of_course, :only => [:new, :create, :edit, :update, :destroy, :start_anonymous_comment, :stop_anonymous_comment, :alert_anonymous_comment,:start_evaluation_set,:set_evaluation_attr,:score_rule_set,:alert_forbidden_anonymous_comment,:alert_open_student_works,:open_student_works] before_filter :member_of_course, :only => [:index] @@ -198,6 +198,23 @@ class HomeworkCommonController < ApplicationController end end + # 成绩公开范围弹框 + def alert_score_open_modal + if params[:user_activity_id] + @user_activity_id = params[:user_activity_id] + else + @user_activity_id = -1 + end + @hw_status = params[:hw_status].to_i + end + + def set_score_open + @homework.update_attribute('score_open', params[:score_open].to_i) + @user_activity_id = params[:user_activity_id].to_i + @hw_status = params[:hw_status].to_i + @is_teacher = User.current.admin? || User.current.allowed_to?(:as_teacher, @course) + end + #开启匿评 #statue 1:启动成功,2:启动失败,作业总数大于等于2份时才能启动匿评,3:已开启匿评,请务重复开启,4:没有开启匿评的权限 def start_anonymous_comment @@ -257,26 +274,25 @@ class HomeworkCommonController < ApplicationController def stop_anonymous_comment @homework_detail_manual.update_column('comment_status', 3) @homework_detail_manual.update_column('evaluation_end', Date.today) - #计算缺评扣分 + # 计算缺评扣分 work_ids = "(" + @homework.student_works.has_committed.map(&:id).join(",") + ")" - if @homework.homework_type != 3 - @homework.student_works.has_committed.each do |student_work| - absence_penalty_count = student_work.user.student_works_evaluation_distributions.where("student_work_id IN #{work_ids}").count - student_work.user.student_works_scores.where("student_work_id IN #{work_ids} and reviewer_role = 3").count - student_work.absence_penalty = absence_penalty_count > 0 ? absence_penalty_count * @homework_detail_manual.absence_penalty : 0 - student_work.save - end - else - @homework.student_works.has_committed.each do |student_work| - absence_penalty_count = student_work.user.student_works_evaluation_distributions.where("student_work_id IN #{work_ids}").count - student_work.user.student_works_scores.where("student_work_id IN #{work_ids} and reviewer_role = 3").count - student_work.absence_penalty = absence_penalty_count > 0 ? absence_penalty_count * @homework_detail_manual.absence_penalty : 0 - student_work.save - pros = student_work.student_work_projects.where("is_leader = 0") - user_ids = pros.empty? ? "(-1)" : "(" + pros.map{|stu|stu.user_id}.join(",") + ")" - student_works = @homework.student_works.where("user_id in #{user_ids}") - student_works.each do |st_work| - absence_penalty_count = st_work.user.student_works_evaluation_distributions.where("student_work_id IN #{work_ids}").count - st_work.user.student_works_scores.where("student_work_id IN #{work_ids} and reviewer_role = 3").count - st_work.absence_penalty = absence_penalty_count > 0 ? absence_penalty_count * @homework_detail_manual.absence_penalty : 0 - st_work.save + + # 参与匿评的缺评计算 + @homework.student_works.where("work_status != 0").each do |student_work| + absence_penalty_count = student_work.user.student_works_evaluation_distributions.where("student_work_id IN #{work_ids}").count - student_work.user.student_works_scores.where("student_work_id IN #{work_ids} and reviewer_role = 3").count + student_work.absence_penalty = absence_penalty_count > 0 ? absence_penalty_count * @homework_detail_manual.absence_penalty : 0 + student_work.save + end + + # 未参与匿评的缺评计算 + if @homework_detail_manual.no_anon_penalty == 0 + all_dis_eva = StudentWorksEvaluationDistribution.where("student_work_id IN #{work_ids}") + has_sw_count = all_dis_eva.select("distinct user_id").count + anon_count = all_dis_eva.count / has_sw_count + @homework.student_works.where("work_status != 0").each do |student_work| + if student_work.user.student_works_evaluation_distributions.where("student_work_id IN #{work_ids}").count == 0 + student_work.absence_penalty = @homework_detail_manual.absence_penalty * anon_count + student_work.save end end end diff --git a/app/controllers/memos_controller.rb b/app/controllers/memos_controller.rb index a47ddf787..69a1b829c 100644 --- a/app/controllers/memos_controller.rb +++ b/app/controllers/memos_controller.rb @@ -14,17 +14,17 @@ class MemosController < ApplicationController # layout 'base_memos' def quote - @subject = @memo.subject - @subject = "RE: #{@subject}" unless @subject.starts_with?('RE:') - - @content = "#{ll(Setting.default_language, :text_user_wrote, @memo.author)}
  " - @content << @memo.content.to_s.strip.gsub(%r{
((.|\s)*?)
}m, '[...]').gsub(/(\r?\n|\r\n?)/, "\n") + "\n\n
" - @content = "
" << @content - #@content = "> #{ll(Setting.default_language, :text_user_wrote, @memo.author)}\n> " - #@content << @memo.content.to_s.strip.gsub(%r{
((.|\s)*?)
}m, '[...]').gsub(/(\r?\n|\r\n?)/, "\n> ") + "\n\n" - #@content_html = textilizable(@content) - @temp = Memo.new - @temp.content = @content + # @subject = @memo.subject + # @subject = "RE: #{@subject}" unless @subject.starts_with?('RE:') + # + # @content = "#{ll(Setting.default_language, :text_user_wrote, @memo.author)}
  " + # @content << @memo.content.to_s.strip.gsub(%r{
((.|\s)*?)
}m, '[...]').gsub(/(\r?\n|\r\n?)/, "\n") + "
\n\n
" + # @content = "
" << @content + # #@content = "> #{ll(Setting.default_language, :text_user_wrote, @memo.author)}\n> " + # #@content << @memo.content.to_s.strip.gsub(%r{
((.|\s)*?)
}m, '[...]').gsub(/(\r?\n|\r\n?)/, "\n> ") + "\n\n" + # #@content_html = textilizable(@content) + # @temp = Memo.new + # @temp.content = @content end def new @@ -47,6 +47,8 @@ class MemosController < ApplicationController @quote = params[:quote] end + + #unless params[:quote].nil? # @quote = params[:quote][:quote] #end @@ -55,6 +57,10 @@ class MemosController < ApplicationController @memo.forum_id = params[:forum_id] @memo.author_id = User.current.id + if params[:memo][:parent_id] + @memo.root_id = (Memo.find params[:memo][:parent_id]).root_id.nil? ? params[:memo][:parent_id].to_i : (Memo.find params[:memo][:parent_id]).root_id + end + @memo.save_attachments(params[:attachments] || (params[:memo] && params[:memo][:uploads])) @memo.content = @quote + @memo.content respond_to do |format| @@ -111,32 +117,37 @@ class MemosController < ApplicationController @memo = @memo.root # 取出楼主,防止输入帖子id让回复作为主贴显示 @memo.update_column(:viewed_count, (@memo.viewed_count.to_i + 1)) - page = params[:page] - if params[:r] && page.nil? - offset = @memo.children.where("#{Memo.table_name}.id < ?", params[:r].to_i).count - page = 1 + offset / pre_count - else - - end - @reply_count = @memo.children.count - @reply_pages = Paginator.new @reply_count, pre_count, page - @replies = @memo.children. - includes(:author, :attachments). - reorder("#{Memo.table_name}.created_at DESC"). - limit(@reply_pages.per_page). - offset(@reply_pages.offset). - all + # page = params[:page] + # if params[:r] && page.nil? + # offset = @memo.children.where("#{Memo.table_name}.id < ?", params[:r].to_i).count + # page = 1 + offset / pre_count + # else + # end + + # @reply_count = @memo.children.count + # @reply_pages = Paginator.new @reply_count, pre_count, page + # @replies = @memo.children. + # includes(:author, :attachments). + # reorder("#{Memo.table_name}.created_at DESC"). + # limit(@reply_pages.per_page). + # offset(@reply_pages.offset). + # all + + @replies = Memo.where("root_id = #{@memo.id}").reorder("created_at desc") + @reply_count = @replies.count + @replies = get_no_children_comments_all @replies + @limit_count = @replies.count + @page = params[:page] ? params[:page].to_i + 1 : 0 + @limit = 10 + @replies = @replies[@page * @limit..@page * @limit + 9] @memo_new = Memo.new @my_topic_count = Memo.where("forum_id = #{@memo.forum_id} and author_id = #{User.current.id} and parent_id is null").count @my_replies_count = Memo.where("forum_id = #{@memo.forum_id} and author_id = #{User.current.id} and parent_id is not null").count - # @memo = Memo.find_by_id(params[:id]) - # @forum = Forum.find(params[:forum_id]) - # @replies = @memo.replies - # @mome_new = Memo.new respond_to do |format| + format.js format.html {render :layout=> 'base_forums'}#:layout=> 'base_forums', format.json { render json: @memo } format.xml { render xml: @memo } diff --git a/app/controllers/poll_controller.rb b/app/controllers/poll_controller.rb index 08e221d5e..325517e4b 100644 --- a/app/controllers/poll_controller.rb +++ b/app/controllers/poll_controller.rb @@ -270,6 +270,7 @@ class PollController < ApplicationController #发布问卷 def publish_poll + @index = params[:index] @poll.polls_status = 2 @poll.published_at = Time.now @poll.show_result = params[:show_result].to_i if params[:show_result] @@ -508,6 +509,7 @@ class PollController < ApplicationController #重新发布问卷 def republish_poll + @index = params[:index] @poll.poll_questions.each do |poll_question| poll_question.poll_votes.destroy_all end @@ -530,6 +532,7 @@ class PollController < ApplicationController #关闭问卷 def close_poll + @index = params[:index] @poll.polls_status = 3 @poll.closed_at = Time.now if @poll.save diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index b9d61e61e..dcd337df2 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -543,12 +543,12 @@ class ProjectsController < ApplicationController @users -= watched.watcher_users if @watched end @watchers = @project.watcher_users - @limit = 20 + @limit = 32 @is_remote = true @watchers_count = @watchers.count @watcher_pages = Paginator.new @watchers_count, @limit, params['page'] || 1 @offset ||= @watcher_pages.offset - @watchers = paginateHelper @watchers, 20 + @watchers = paginateHelper @watchers, @limit end end @@ -611,14 +611,14 @@ class ProjectsController < ApplicationController @applied_members = appied_project_members(@project, @members) end end - @members = paginateHelper @members + @members = paginateHelper @members, 32 end def member_forked @forked_projects = Project.where(:forked_from_project_id => @project.id) - @limit = 20 + @limit = 32 @is_remote = true @forked_count = @forked_projects.count @forked_pages = Paginator.new @forked_count, @limit, params['page'] || 1 diff --git a/app/controllers/pull_requests_controller.rb b/app/controllers/pull_requests_controller.rb index 9dd6e6358..b6fdd1fee 100644 --- a/app/controllers/pull_requests_controller.rb +++ b/app/controllers/pull_requests_controller.rb @@ -38,12 +38,12 @@ class PullRequestsController < ApplicationController @requests_merged_count = merge_requests.select{|request| request.state == "merged"}.count @requests_closed_count = merge_requests.select{|request| request.state == "closed"}.count - @limit = 10 + @limit = 20 @is_remote = true @count = type_count(type, @requests_opened_count, @requests_merged_count, @requests_closed_count) @pages = Paginator.new @count, @limit, params['page'] || 1 @offset ||= @pages.offset - @requests = paginateHelper @requests, 10 + @requests = paginateHelper @requests, 20 respond_to do |format| format.html format.js @@ -101,16 +101,16 @@ class PullRequestsController < ApplicationController request = @g.create_merge_request(@project.gpid, title, User.current.gid, :description => description, :source_branch => source_branch, :target_branch => target_branch, :target_project_id => target_project_id) @fork_project_name = Project.find(params[:target_project_id]).try(:name) @fork_pr_message = true if @fork_project_name - # 发送消息 - #send_message(User.current.id, target_project_id, title) - # 创建Trustie数据 - #PullRequest.create(:pull_request_id => request.id, :user_id => User.current.id, :status => 1, :project_id => target_project_id) + # 向管理员发送消息 + send_message_to_manager(params[:target_project_id].to_i, request.id, 1) + PullRequest.create(:pull_request_id => request.id, :user_id => User.current.id, :status => 1, :project_id => target_project_id, :title => title) else + @project_member = Member.where(:project_id => @project.id) request = @g.create_merge_request(@project.gpid, title, User.current.gid, :description => description, :source_branch => source_branch, :target_branch => target_branch) # 发送消息 - #send_message(User.current.id, @project.id, title) + send_message_to_manager(@project.id, request.id, 1) # 创建Trustie数据 - #PullRequest.create(:pull_request_id => request.id, :user_id => User.current.id, :status => 1, :project_id => @project.id) + PullRequest.create(:pull_request_id => request.id, :user_id => User.current.id, :status => 1, :project_id => @project.id, :title => title) respond_to do |format| format.js{redirect_to project_pull_request_path(request.id, :project_id => @project.id)} end @@ -189,7 +189,9 @@ class PullRequestsController < ApplicationController def accept_pull_request begin status = @g.accept_merge_rquest(@project.gpid, params[:id], User.current.gid) - PullRequest.create(:pull_request_id => status.id, :user_id => User.current.id, :gpid => status.project_id) + # 接受后,给用户发消息 + send_message_to_author(@project.id, status.author.try(:username), params[:id], 2) + respond_to do |format| format.js{redirect_to project_pull_request_path(status.id, :project_id => @project.id)} end @@ -214,7 +216,13 @@ class PullRequestsController < ApplicationController # @return [Gitlab::ObjectifiedHash] Information about updated merge request. def update_pull_request begin - @g.update_merge_request(@project.gpid, params[:id], User.current.gid, :state_event => params[:state]) + request = @g.update_merge_request(@project.gpid, params[:id], User.current.gid, :state_event => params[:state]) + user = User.find_by_login(request.author.try(:username)) + status = params[:state] == "close" ? 4 : 3 + send_message_to_manager(@project.id, params[:id], status) + if is_project_manager?(User.current.id, @project.id) + send_message_to_author(@project.id, user.login, request.id, status) + end respond_to do |format| format.html{redirect_to project_pull_request_path(params[:id], :project_id => @project.id)} end @@ -320,8 +328,31 @@ class PullRequestsController < ApplicationController end end - def send_message user_id, project_id, title - self.forge_acts << ForgeMessage.new(:user_id => user_id, :project_id => project_id, :title => title) + def send_message_to_manager project_id, pull_request_id, status + project = Project.find(project_id) + project.members.each do |member| + if is_project_manager?(member.user_id, project_id) && User.current.id != member.user_id + add_message(member.user_id, project_id, pull_request_id, status) + end + end + end + + def send_message_to_author(project_id, user_login, request_id, status) + user = get_user_by_login_and(user_login) + if user.id != User.current.id + add_message(user.id, project_id, request_id, status) + end + end + + def add_message(user_id, project_id, pull_request_id, status) + ForgeMessage.create(:user_id => user_id, + :project_id => project_id, + :forge_message_id => pull_request_id, + :forge_message_type => "PullRequest", + :viewed => true, + :status => status, + :operate_user_id => User.current.id, + ) end def authorize_logged diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index f932748af..fc7ec3b48 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -430,29 +430,21 @@ update end + # 注:由于考虑到性能所以commits api每次返回20条记录 def changes # 顶部导航 @project_menu_type = 5 - @entry = @repository.entry(@path, @rev) (show_error_not_found; return) unless @entry g = Gitlab.client - limit = 20 - #每次页面的换回值从1开始,但是gitlab的页面查询是从0开始,所以先改变page的类型减一在改回来 + limit = 10 + # 每次页面的换回值从1开始,但是gitlab的页面查询是从0开始,所以先改变page的类型减一在改回来 @commits = g.commits(@project.gpid, page:(params[:page].to_i - 1).to_s, ref_name:@rev) + @commits_count = params[:commit_count].nil? ? @g.user_static(@project.gpid, :rev => @rev).count : params[:commit_count].to_i + @commits_pages = Paginator.new @commits_count, limit, params[:page] + # @offset ||= @commits_pages.offset + # @commits = paginateHelper @commits, limit - #add by hx - #rep_count = commit_count(@project) - - #页面传递必须要str类型,但是Paginator的初始化必须要num类型,需要类型转化 - @commits_count = params[:commit_count].to_i - @commits_pages = Redmine::Pagination::Paginator.new @commits_count,limit,params[:page] - - @commit = g.commit(@project.gpid,@rev) - # @changesets = g.get ("/projects/#{@project.gpid}/repository/commits?#{@rev}") - #@changesets = @repository.latest_changesets(@path, @rev, Setting.repository_log_display_limit.to_i) - @properties = @repository.properties(@path, @rev) - @changeset = @repository.find_changeset_by_name(@rev) render :layout => 'base_projects' end diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index fb99f6507..7119d7c9f 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -691,7 +691,11 @@ class StudentWorkController < ApplicationController def show @score = student_work_score @work,User.current @is_teacher = User.current.allowed_to?(:as_teacher,@course) || User.current.admin? - @student_work_scores = student_work_score_record(@work) + if @homework.homework_detail_manual.comment_status == 2 && !@is_teacher && @work.user != User.current + @student_work_scores = @work.student_works_scores.where("user_id = #{User.current.id} and reviewer_role = 3").order("updated_at desc") + else + @student_work_scores = student_work_score_record(@work) + end respond_to do |format| format.js end @@ -867,6 +871,7 @@ class StudentWorkController < ApplicationController @score = StudentWorksScore.find params[:score_id] @is_last = params[:is_last] == "true" @jour = @score.journals_for_messages.new(:user_id => User.current.id,:notes =>params[:message], :reply_id => 0) + @show_real_name = User.current.allowed_to?(:as_teacher, @score.student_work.homework_common.course) || User.current.admin? || @score.reviewer_role != 3 || @jour.user == User.current if @jour.save @status = 1 else @@ -982,33 +987,38 @@ class StudentWorkController < ApplicationController end end - if params[:absence_penalty] && homework_detail_manual.absence_penalty.to_s != params[:absence_penalty].to_s - homework_detail_manual.absence_penalty = params[:absence_penalty] + no_anon_penalty = params[:no_anon_penalty] ? 1 : 0 + if no_anon_penalty != homework_detail_manual.no_anon_penalty + homework_detail_manual.no_anon_penalty = no_anon_penalty if homework_detail_manual.comment_status == 3 #当前作业处于匿评结束状态,修改缺评扣分才会修改每个作品应扣分的值 work_ids = "(" + @homework.student_works.has_committed.map(&:id).join(",") + ")" - if @homework.homework_type != 3 - @homework.student_works.has_committed.each do |student_work| - absence_penalty_count = student_work.user.student_works_evaluation_distributions.where("student_work_id IN #{work_ids}").count - student_work.user.student_works_scores.where("student_work_id IN #{work_ids} and reviewer_role = 3").count - student_work.absence_penalty = absence_penalty_count > 0 ? absence_penalty_count * homework_detail_manual.absence_penalty : 0 - student_work.save - end - else - @homework.student_works.has_committed.each do |student_work| - absence_penalty_count = student_work.user.student_works_evaluation_distributions.where("student_work_id IN #{work_ids}").count - student_work.user.student_works_scores.where("student_work_id IN #{work_ids} and reviewer_role = 3").count - student_work.absence_penalty = absence_penalty_count > 0 ? absence_penalty_count * homework_detail_manual.absence_penalty : 0 - student_work.save - pros = student_work.student_work_projects.where("is_leader = 0") - user_ids = pros.empty? ? "(-1)" : "(" + pros.map{|stu|stu.user_id}.join(",") + ")" - student_works = @homework.student_works.where("user_id in #{user_ids}") - student_works.each do |st_work| - absence_penalty_count = st_work.user.student_works_evaluation_distributions.where("student_work_id IN #{work_ids}").count - st_work.user.student_works_scores.where("student_work_id IN #{work_ids} and reviewer_role = 3").count - st_work.absence_penalty = absence_penalty_count > 0 ? absence_penalty_count * homework_detail_manual.absence_penalty : 0 - st_work.save + all_dis_eva = StudentWorksEvaluationDistribution.where("student_work_id IN #{work_ids}") + has_sw_count = all_dis_eva.select("distinct user_id").count + anon_count = all_dis_eva.count / has_sw_count + @homework.student_works.where("work_status != 0").each do |student_work| + if student_work.user.student_works_evaluation_distributions.where("student_work_id IN #{work_ids}").count == 0 + if no_anon_penalty == 0 + student_work.absence_penalty = homework_detail_manual.absence_penalty * anon_count + else + student_work.absence_penalty = 0 end + student_work.save end end end + homework_detail_manual.save if homework_detail_manual + end + if (params[:absence_penalty] && homework_detail_manual.absence_penalty.to_s != params[:absence_penalty].to_s) + homework_detail_manual.absence_penalty = params[:absence_penalty] + if homework_detail_manual.comment_status == 3 #当前作业处于匿评结束状态,修改缺评扣分才会修改每个作品应扣分的值 + work_ids = "(" + @homework.student_works.has_committed.map(&:id).join(",") + ")" + @homework.student_works.where("work_status != 0").each do |student_work| + absence_penalty_count = student_work.user.student_works_evaluation_distributions.where("student_work_id IN #{work_ids}").count - student_work.user.student_works_scores.where("student_work_id IN #{work_ids} and reviewer_role = 3").count + student_work.absence_penalty = absence_penalty_count > 0 ? absence_penalty_count * homework_detail_manual.absence_penalty : 0 + student_work.save + end + end homework_detail_manual.save if homework_detail_manual end diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 86c04e9e4..da7cfd849 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -164,6 +164,8 @@ class UsersController < ApplicationController @comment = Comment.find params[:comment].to_i when 'Journal','is_project_issue' @comment = Journal.find params[:comment].to_i + when 'Memo' + @comment = Memo.find params[:comment].to_i end @user_activity_id = params[:user_activity_id] @parent_id = params[:parent_id] if params[:parent_id] @@ -308,6 +310,15 @@ class UsersController < ApplicationController @root.update_column('updated_at', Time.now) @count = @root.journals_for_messages.count @comments = @root.journals_for_messages.reorder("created_on desc").limit(3) + when 'Memo' + @root = reply.root + comment = Memo.new + comment.author = User.current + comment.forum = reply.forum + comment.content = params[:reply_message] + comment.subject = "#{@root.subject}" + comment.root_id = reply.root_id + reply.children << comment end update_course_activity(@root.class.to_s,@root.id) update_user_activity(@root.class.to_s,@root.id) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index e9bbcaafe..02bdde103 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -2855,18 +2855,18 @@ module ApplicationHelper #获取匿评相关连接代码 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 => "作业截止日期之前不可以启动匿评" + link = link_to "启动匿评","javascript:void(0)", :class => "wpostOptionLink", :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?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' + 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 => 'wpostOptionLink' when 2 - 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' + 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 => 'wpostOptionLink' when 3 # link = link_to "匿评结束","javascript:void(0)", :class => "postOptionLink", :title => "匿评结束" end else - link = link_to "启动匿评","javascript:void(0)", :class => "postOptionLink", :title => "学生提交作业数大于等于2时才可以启动匿评" + link = link_to "启动匿评","javascript:void(0)", :class => "wpostOptionLink", :title => "学生提交作业数大于等于2时才可以启动匿评" end link end @@ -3422,6 +3422,8 @@ def get_reply_by_type type, reply_id reply = Journal.find reply_id when 'Syllabus' reply = JournalsForMessage.find reply_id + when 'Memo' + reply = Memo.find reply_id end reply end diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb index 4dd3399a3..98024954d 100644 --- a/app/helpers/users_helper.rb +++ b/app/helpers/users_helper.rb @@ -90,6 +90,20 @@ module UsersHelper end end + # 获取pullrequest消息状态 + def pull_request_message_status ma + case ma.status + when 1 + "创建了PullRequest:" + when 2 + "接受了PullRequest:" + when 3 + "重新打开了PullRequest:" + when 4 + "关闭了PullRequest:" + end + + end # 判断当前用户能否对消息进行操作 def allow_to_show applied_message (User.current.id == applied_message.user_id && applied_message.status == 1) ? true : false diff --git a/app/models/forge_message.rb b/app/models/forge_message.rb index bc514025e..e131eb600 100644 --- a/app/models/forge_message.rb +++ b/app/models/forge_message.rb @@ -1,7 +1,7 @@ class ForgeMessage < ActiveRecord::Base # status在不同的类中,作用不同 # Isseu: satus nil:发布了缺陷;:1:缺陷计划完成日志到了提醒 - attr_accessible :forge_message_id, :forge_message_type, :project_id, :user_id, :viewed, :secret_key, :status + attr_accessible :forge_message_id, :forge_message_type, :project_id, :user_id, :viewed, :secret_key, :status, :operate_user_id belongs_to :forge_message ,:polymorphic => true belongs_to :project diff --git a/app/models/homework_detail_manual.rb b/app/models/homework_detail_manual.rb index e0c4dcdcb..6faa84d40 100644 --- a/app/models/homework_detail_manual.rb +++ b/app/models/homework_detail_manual.rb @@ -1,7 +1,7 @@ #手动评分作业表 #comment_status: 1:未开启匿评,2:开启匿评,3:匿评结束 class HomeworkDetailManual < ActiveRecord::Base - attr_accessible :ta_proportion, :comment_status, :evaluation_start, :evaluation_end, :evaluation_num, :absence_penalty, :homework_common_id + attr_accessible :ta_proportion, :comment_status, :evaluation_start, :evaluation_end, :evaluation_num, :absence_penalty, :homework_common_id, :no_anon_penalty belongs_to :homework_common end diff --git a/app/models/memo.rb b/app/models/memo.rb index f08e9afb2..e6701849f 100644 --- a/app/models/memo.rb +++ b/app/models/memo.rb @@ -79,7 +79,8 @@ class Memo < ActiveRecord::Base "lock", "sticky", "parent_id", - "replies_count" + "replies_count", + "root_id" after_create :add_author_as_watcher, :reset_counters!, :send_message,:create_memo_ealasticsearch_index after_update :update_memo_ealasticsearch_index @@ -126,6 +127,18 @@ class Memo < ActiveRecord::Base Mailer.run.forum_message_added(self) if Setting.notified_events.include?('forum_message_added') end + def creator_user + self.author + end + + def created_time + self.created_on + end + + def content_detail + self.content + end + # 公共贴吧消息记录 # 原则:贴吧创始人;发帖人,wanglingchun(特殊用户) def send_message diff --git a/app/models/professional_level.rb b/app/models/professional_level.rb new file mode 100644 index 000000000..b04741f91 --- /dev/null +++ b/app/models/professional_level.rb @@ -0,0 +1,3 @@ +class ProfessionalLevel < ActiveRecord::Base + attr_accessible :level +end diff --git a/app/models/pull_request.rb b/app/models/pull_request.rb index ec13ff16b..92f9b56a6 100644 --- a/app/models/pull_request.rb +++ b/app/models/pull_request.rb @@ -1,6 +1,6 @@ class PullRequest < ActiveRecord::Base # status 1:创建 2:接受 3:重新打开 4:关闭 - attr_accessible :gpid, :pull_request_id, :user_id, :status + attr_accessible :gpid, :pull_request_id, :user_id, :project_id, :title validates_uniqueness_of :pull_request_id has_many :forge_messages, :class_name => 'ForgeMessage', :as => :forge_message, :dependent => :destroy diff --git a/app/views/blog_comments/_blog_comment_show_replies.html.erb b/app/views/blog_comments/_blog_comment_show_replies.html.erb index 3a3e8ef81..23cabb67d 100644 --- a/app/views/blog_comments/_blog_comment_show_replies.html.erb +++ b/app/views/blog_comments/_blog_comment_show_replies.html.erb @@ -19,7 +19,7 @@
- + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> diff --git a/app/views/courses/_course_activity_users.html.erb b/app/views/courses/_course_activity_users.html.erb index 459f60f3d..cffd383e6 100644 --- a/app/views/courses/_course_activity_users.html.erb +++ b/app/views/courses/_course_activity_users.html.erb @@ -1,4 +1,5 @@ -<% unless contributor_course_scor(course.id).count == 0 %> +<% count = contributor_course_scor(course.id).select{|ccs| ccs.con_score != 0 && !ccs.con_score.nil?}.count %> +<% unless count == 0 %>

    diff --git a/app/views/courses/_history.html.erb b/app/views/courses/_history.html.erb index eb7ecff7a..a0b526eee 100644 --- a/app/views/courses/_history.html.erb +++ b/app/views/courses/_history.html.erb @@ -25,7 +25,7 @@
    <% ids = 'project_respond_form_'+ journal.id.to_s%> - + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>journal, :user_activity_id=>journal.id,:type=>"reply"}%> <% if reply_allow %> diff --git a/app/views/courses/delete_member.js.erb b/app/views/courses/delete_member.js.erb index 89588f4c1..4e31a87c1 100644 --- a/app/views/courses/delete_member.js.erb +++ b/app/views/courses/delete_member.js.erb @@ -1,5 +1,9 @@ hideModal(); -$("#member_li_<%=params[:member_id] %>").html(""); +var all_indexes = $("#member_li_<%=params[:member_id] %>").nextAll().find("td:first-child"); +for(var i = 0; i < all_indexes.length; i++){ + $(all_indexes[i]).html(parseInt($(all_indexes[i]).html()) - 1); +} +$("#member_li_<%=params[:member_id] %>").remove(); $("#st_groups").html("<%=escape_javascript(render :partial => 'new_groups_name', :locals => {:course_groups => @course_groups}) %>"); $("#group_children_list").html("<%= escape_javascript( render :partial => 'layouts/group_children_list', :locals => {:course => @course})%>"); $("#student_number").html("<%= studentCount(@course) %>"); diff --git a/app/views/courses/group_member.html.erb b/app/views/courses/group_member.html.erb index 73aed1487..3ad24f5c0 100644 --- a/app/views/courses/group_member.html.erb +++ b/app/views/courses/group_member.html.erb @@ -1,20 +1,8 @@
    -

    学生列表(<%=@group.name %>)

    -
    -
      -
    • -
        -
      • <%= link_to l(:label_export_excel), export_course_member_excel_course_path(@course,:group_id => @group.id ,:format => 'xls'), :class => 'hw_more_li'%>
      • - <% if @canShowCode %> -
      • - <%=link_to "成员管理", {:controller => 'courses', :action => 'settings', :id => @course.id, :tab => 'member'}, :class => 'hw_more_li' %> -
      • - <% end %> -
      -
    • -
    -
    +

    学生列表(<%=@group.name %>)

    + <%= link_to "导出成绩", export_course_member_excel_course_path(@course,:group_id => @group.id ,:format => 'xls'), :class => 'link-blue fr mt5'%> +
    diff --git a/app/views/courses/member.html.erb b/app/views/courses/member.html.erb index 606c0d67c..302e771ff 100644 --- a/app/views/courses/member.html.erb +++ b/app/views/courses/member.html.erb @@ -17,7 +17,7 @@ <% if User.current.allowed_to?(:as_teacher,@course) %> <%=link_to "成员管理", {:controller => 'courses', :action => 'settings', :id => @course.id, :tab => 'member'}, :class => 'link-blue ml10 fr mt5' %> <% end %> - <%= link_to l(:label_export_excel), export_course_member_excel_course_path(@course,:format => 'xls'), :class => 'link-blue fr mt5'%> + <%= link_to "导出成绩", export_course_member_excel_course_path(@course,:format => 'xls'), :class => 'link-blue fr mt5'%>
    <%= render :partial => 'course_student', :locals => {:members => @members} %> diff --git a/app/views/exercise/_exercise.html.erb b/app/views/exercise/_exercise.html.erb index a1dd20627..daa732fbe 100644 --- a/app/views/exercise/_exercise.html.erb +++ b/app/views/exercise/_exercise.html.erb @@ -36,7 +36,7 @@ 测试时长:<%= exercise.time.nil? || exercise.time == -1 ? '不限' : exercise.time.to_s + "分钟" %> 截止时间:<%= exercise.end_time.nil? ? '未设置' : format_time(exercise.end_time) %> 发布时间:<%= exercise.publish_time.nil? ? '未设置' : format_time(exercise.publish_time) %> - <% if @is_teacher && exercise.exercise_status > 1 %> + <% if exercise.exercise_status > 1 %> 已提交:<%= exercise.exercise_users.where("commit_status = 1").count %> 未提交:<%= exercise.course.student.count - exercise.exercise_users.where("commit_status = 1").count %> <% end %> diff --git a/app/views/files/_project_file.html.erb b/app/views/files/_project_file.html.erb index 27e9673a7..bd2c427f7 100644 --- a/app/views/files/_project_file.html.erb +++ b/app/views/files/_project_file.html.erb @@ -94,6 +94,7 @@ <%= render :partial => "files/tag_yun_project", :locals => {:tag_list => @tag_list,:project => @project, :tag_name => @tag_name}%>
    + <% if @tip_all_attachments > 0 %>

    <%= render :partial => "files/tip_attachment_count" %> @@ -124,5 +125,8 @@

    <%= render :partial => 'project_list',:locals => {project: @project, all_attachments: @all_attachments, sort:@sort, order:@order, project_attachments:@obj_attachments} %>
    + <% else %> + <%= render :partial => "projects/no_data" %> + <% end %>
    <%# html_title(l(:label_attachment_plural)) -%> \ No newline at end of file diff --git a/app/views/forums/_show_topics.html.erb b/app/views/forums/_show_topics.html.erb index c3b8b4dbe..80b77a79b 100644 --- a/app/views/forums/_show_topics.html.erb +++ b/app/views/forums/_show_topics.html.erb @@ -18,7 +18,8 @@
    - <%= link_to (topic.replies_count), forum_memo_path(topic.forum, topic),:target =>'_blank',:class=>'linkGrey2' %> + <% replies_count = Memo.where("root_id = #{topic.id}").count %> + <%= link_to (replies_count), forum_memo_path(topic.forum, topic),:target =>'_blank',:class=>'linkGrey2' %> <%= get_praise_num(topic)%>
    diff --git a/app/views/homework_common/_alert_score_open_modal.html.erb b/app/views/homework_common/_alert_score_open_modal.html.erb new file mode 100644 index 000000000..b5a0e5409 --- /dev/null +++ b/app/views/homework_common/_alert_score_open_modal.html.erb @@ -0,0 +1,42 @@ +
    +
    +

    成绩公开范围

    + +
    +
    + <%= form_for('new_form',:url =>{:controller => 'homework_common',:action => 'set_score_open',:id => @homework.id,:user_activity_id => @user_activity_id, :hw_status => @hw_status}, + :method => "post", :remote => true) do |f|%> +
    +
    +
      +
    • +
        +
      • + +
      • +
      • + value="1" name="score_open"/> + +
      • +
      • + value="0" name="score_open"/> + +
      • +
      +
    • +
    +
      + +
    +
    + 确定 + 取消 +
    + +
    + <% end%> +
    \ No newline at end of file diff --git a/app/views/homework_common/_set_score_rule_non_pro.html.erb b/app/views/homework_common/_set_score_rule_non_pro.html.erb index afa768838..98f995a60 100644 --- a/app/views/homework_common/_set_score_rule_non_pro.html.erb +++ b/app/views/homework_common/_set_score_rule_non_pro.html.erb @@ -17,6 +17,10 @@
  • + value="<%=homework.homework_detail_manual.no_anon_penalty%>"/> + +
  • +
  • @@ -38,7 +42,7 @@

-
    +
      +
    -
      +
    -
      +
        +
    -
      +
        -
        • @@ -309,9 +311,7 @@
        <% 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} %>
        diff --git a/app/views/layouts/_show_messages_list.html.erb b/app/views/layouts/_show_messages_list.html.erb index 2d6da0770..8e7be1fe1 100644 --- a/app/views/layouts/_show_messages_list.html.erb +++ b/app/views/layouts/_show_messages_list.html.erb @@ -147,7 +147,7 @@ <% end %> <% elsif ma.class == OrgMessage %> <% if ma.message_type == 'ApplySubdomain' && ma.organization %> -
      • 0 && Secdomain.where("sub_type=2 and pid=?", ma.organization.id).first.subname != ma.content)) ? "同意申请":"申请已批准"%>"><%=ma.organization.name %> 申请子域名:<%= (Secdomain.where("sub_type=2 and pid=?", ma.organization.id).count == 0 || (Secdomain.where("sub_type=2 and pid=?", ma.organization.id).count > 0 && Secdomain.where("sub_type=2 and pid=?", ma.organization.id).first.subname != ma.content)) ? "同意申请":"申请已批准"%>
      • +
      • <%=ma.organization.name %> 申请子域名:<%= ma.content%>
      • <% elsif ma.message_type == 'AgreeApplySubdomain' %>
      • 系统提示 管理员同意了您的子域名申请:<%= ma.content%>
      • <% end %> diff --git a/app/views/layouts/base_forums.html.erb b/app/views/layouts/base_forums.html.erb index b57feb5bd..f5509959b 100644 --- a/app/views/layouts/base_forums.html.erb +++ b/app/views/layouts/base_forums.html.erb @@ -7,13 +7,10 @@ <%= csrf_meta_tag %> <%= favicon %> - <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','application','prettify', 'nyan', :media => 'all' %> + <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','application','prettify', :media => 'all' %> <%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %> <%= javascript_include_tag('jquery-1.8.3-ui-1.9.2-ujs-2.0.3', 'application', 'jquery.colorbox-min') %> - <%= import_ke(enable_at: false, prettify: true, init_activity: false) %> - - <%= heads_for_theme %> <%= call_hook :view_layouts_base_html_head %> diff --git a/app/views/memos/_memo_all_replies.html.erb b/app/views/memos/_memo_all_replies.html.erb new file mode 100644 index 000000000..05ec1c1df --- /dev/null +++ b/app/views/memos/_memo_all_replies.html.erb @@ -0,0 +1,77 @@ +<% @replies.each do |reply| %> + + +
        +
        + <%= link_to image_tag(url_to_avatar(reply.author), :width => 33,:height => 33), user_path(reply.author) %> +
        +
        +
        + <%= render :partial => 'users/message_contents', :locals => {:comment => reply, :type => 'Memo', :user_activity_id => @memo.id}%> +
        +
        +

        <%= reply.content.gsub(/script/, "script ").html_safe %>

        +
        +
        +
        + + + <%= render :partial => "praise_tread/praise", :locals => {:activity => reply, :user_activity_id => reply.id, :type => "reply"} %> + + + <%= link_to( + l(:button_reply), + {:action => 'quote', :id => reply}, + :remote => true, + :method => 'get', + :title => l(:button_reply)) %> + + + <%= link_to( + l(:button_delete), + forum_memo_path(@memo.forum, reply), + :method => :delete, + :id => "delete_reply_#{reply.id}", + :class => 'fr mr20 undis', + :data => {:confirm => l(:text_are_you_sure)}, + :title => l(:button_delete) + ) if @memo.author.id == User.current.id || User.current.admin? %> + +
        +
        +
        +

        +
        +
        +
        +<% end %> +<% if @limit_count > @page * @limit + 10 %> +
        +
        + + + <%= link_to '点击展开更多回复', forum_memo_path(@memo.forum_id, @memo, :page => @page),:remote=>true %> +
        +
        +<% end %> \ No newline at end of file diff --git a/app/views/memos/_reply_message.html.erb b/app/views/memos/_reply_message.html.erb new file mode 100644 index 000000000..ff8436a84 --- /dev/null +++ b/app/views/memos/_reply_message.html.erb @@ -0,0 +1,31 @@ +
        +
        + <%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(User.current), :alt => "用户头像" %> +
        +
        + <% if User.current.logged? %> +
        + <%= form_for('memo',:url=>forum_memos_path,:method => "post") do |f|%> + <%= f.hidden_field :subject, :required => true, value: reply.subject %> + <%= f.hidden_field :forum_id, :required => true, value: reply.forum_id %> + <%= f.hidden_field :parent_id, :required => true, value: reply.id %> + <%= hidden_field_tag :quote,"",:required => false,:style => 'display:none' %> +
        + + +
        +

        + <% end%> +
        + <% else %> + <%= render :partial => "users/show_unlogged" %> + <% end %> +
        +
        +
        +
        + \ No newline at end of file diff --git a/app/views/memos/quote.js.erb b/app/views/memos/quote.js.erb index 3dbf9eb95..d757dc7f5 100644 --- a/app/views/memos/quote.js.erb +++ b/app/views/memos/quote.js.erb @@ -1,5 +1,5 @@ -//ckeditor.setData("<%= raw escape_javascript(@content) %>"); -$('#message_quote').html("<%= raw escape_javascript(@temp.content.html_safe) %>"); -$('#quote').val("<%= raw escape_javascript(@content) %>"); -showAndScrollTo("new_memo", "cke_editor01"); -$("img").removeAttr("align"); \ No newline at end of file +if($("#reply_message_<%= @memo.id%>").length > 0) { + $("#reply_message_<%= @memo.id%>").replaceWith("<%= escape_javascript(render :partial => 'memos/reply_message', :locals => {:reply => @memo}) %>"); +}else if($("#reply_to_message_<%= @memo.id%>").length >0) { + $("#reply_to_message_<%= @memo.id%>").replaceWith("

        "); +} \ No newline at end of file diff --git a/app/views/memos/show.html.erb b/app/views/memos/show.html.erb index 25732c36b..922afe740 100644 --- a/app/views/memos/show.html.erb +++ b/app/views/memos/show.html.erb @@ -4,22 +4,6 @@ <% end %> -
        -
- <% end %> +
+ <%= render :partial => 'memos/memo_all_replies' %>
diff --git a/app/views/memos/show.js.erb b/app/views/memos/show.js.erb new file mode 100644 index 000000000..8ac3f6194 --- /dev/null +++ b/app/views/memos/show.js.erb @@ -0,0 +1 @@ +$("#more_memo_replies").replaceWith("<%= escape_javascript(render :partial => 'memos/memo_all_replies')%>"); \ No newline at end of file diff --git a/app/views/messages/_course_show_replies.html.erb b/app/views/messages/_course_show_replies.html.erb index e56d19406..3ea86596f 100644 --- a/app/views/messages/_course_show_replies.html.erb +++ b/app/views/messages/_course_show_replies.html.erb @@ -18,7 +18,7 @@
- + <%= render :partial => "praise_tread/praise", :locals => {:activity => reply, :user_activity_id => reply.id, :type => "reply"} %> diff --git a/app/views/messages/_org_show_replies.html.erb b/app/views/messages/_org_show_replies.html.erb index df1b2c301..9b63c80ed 100644 --- a/app/views/messages/_org_show_replies.html.erb +++ b/app/views/messages/_org_show_replies.html.erb @@ -18,7 +18,7 @@
- + <%= render :partial => "praise_tread/praise", :locals => {:activity => reply, :user_activity_id => reply.id, :type => "reply"} %> diff --git a/app/views/messages/_project_show_replies.html.erb b/app/views/messages/_project_show_replies.html.erb index b2f22aecb..637fade8a 100644 --- a/app/views/messages/_project_show_replies.html.erb +++ b/app/views/messages/_project_show_replies.html.erb @@ -18,7 +18,7 @@
- + <%= render :partial => "praise_tread/praise", :locals => {:activity => reply, :user_activity_id => reply.id, :type => "reply"} %> diff --git a/app/views/news/_news_replies_detail.html.erb b/app/views/news/_news_replies_detail.html.erb index 924a6a329..0f4ede154 100644 --- a/app/views/news/_news_replies_detail.html.erb +++ b/app/views/news/_news_replies_detail.html.erb @@ -19,7 +19,7 @@
- + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> diff --git a/app/views/org_document_comments/_document_show_replies.html.erb b/app/views/org_document_comments/_document_show_replies.html.erb index c3faef645..8507a6272 100644 --- a/app/views/org_document_comments/_document_show_replies.html.erb +++ b/app/views/org_document_comments/_document_show_replies.html.erb @@ -20,7 +20,7 @@
- + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> diff --git a/app/views/organizations/_org_course_homework.html.erb b/app/views/organizations/_org_course_homework.html.erb index e6d94042d..f78a22e6f 100644 --- a/app/views/organizations/_org_course_homework.html.erb +++ b/app/views/organizations/_org_course_homework.html.erb @@ -356,7 +356,7 @@
- + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> diff --git a/app/views/organizations/_org_course_message.html.erb b/app/views/organizations/_org_course_message.html.erb index ea074344d..aa3237643 100644 --- a/app/views/organizations/_org_course_message.html.erb +++ b/app/views/organizations/_org_course_message.html.erb @@ -112,7 +112,7 @@ <%= link_to reply.try(:author).try(:realname), user_url_in_org(reply.author_id), :class => "newsBlue mr10 f14" %> <% end %> <%= format_time(reply.created_on) %> - + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
diff --git a/app/views/organizations/_org_course_news.html.erb b/app/views/organizations/_org_course_news.html.erb index 6b2146cb1..bbb7b84eb 100644 --- a/app/views/organizations/_org_course_news.html.erb +++ b/app/views/organizations/_org_course_news.html.erb @@ -81,7 +81,7 @@ <%= link_to comment.try(:author).try(:realname), user_url_in_org(comment.author_id), :class => "newsBlue mr10 f14" %> <% end %> <%= format_time(comment.created_on) %> - + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
diff --git a/app/views/organizations/_org_project_issue.html.erb b/app/views/organizations/_org_project_issue.html.erb index 42f725d12..48814eb23 100644 --- a/app/views/organizations/_org_project_issue.html.erb +++ b/app/views/organizations/_org_project_issue.html.erb @@ -92,7 +92,7 @@ <%= link_to reply.try(:user).try(:realname), user_url_in_org(reply.user_id), :class => "newsBlue mr10 f14" %> <% end %> <%= format_time(reply.created_on) %> - + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
diff --git a/app/views/organizations/_project_message.html.erb b/app/views/organizations/_project_message.html.erb index ae11b0042..fadb29c9e 100644 --- a/app/views/organizations/_project_message.html.erb +++ b/app/views/organizations/_project_message.html.erb @@ -91,7 +91,7 @@ <%= link_to reply.try(:author).try(:realname), user_url_in_org(reply.author_id), :class => "newsBlue mr10 f14" %> <% end %> <%= format_time(reply.created_on) %> - + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
diff --git a/app/views/poll/_poll.html.erb b/app/views/poll/_poll.html.erb index b04f96db5..d56af64f0 100644 --- a/app/views/poll/_poll.html.erb +++ b/app/views/poll/_poll.html.erb @@ -1,68 +1,93 @@ <% has_commit = has_commit_poll?(poll.id ,User.current)%> <% poll_name = poll.polls_name.empty? ? l(:label_poll_new) : poll.polls_name%> <% if @is_teacher%> -
  • -
    - <% if has_commit %> - <%= link_to poll_name, poll_result_poll_path(poll.id), :class => "polls_title polls_title_w fl c_dblue"%> - <% else %> - <%= link_to poll_name, poll_path(poll.id), :class => "polls_title polls_title_w fl c_dblue" %> - <% end %> +
    +
    +
    + <% if has_commit %> + <%= link_to (index.to_i+1).to_s+". "+poll_name, poll_result_poll_path(poll.id), :class => "polls_title polls_title_w fl c_dblue mw550", :title => "#{poll_name}" %> + <% else %> + <%= link_to (index.to_i+1).to_s+". "+poll_name, poll_path(poll.id), :class => "polls_title polls_title_w fl c_dblue mw550", :title => "#{poll_name}" %> + <% end %> + <% if poll.polls_status == 1 %> + + <% elsif poll.polls_status == 2 %> + + <% else %> + + <% end%> +
    +
    + +
    + + <% if poll.polls_status == 1 %> + <%= link_to '', edit_poll_path(poll.id), :title => "编辑试卷", :class => "ex_icon_edit mt0"%> + <% end%> +
    -
  • +
    - <% if poll.polls_status == 1%> -
  • 统计结果
  • - <% elsif poll.polls_status == 2 || poll.polls_status == 3 %> -
  • <%= link_to l(:label_statistical_results), statistics_result_poll_path(poll.id), :class => "pollsbtn fl ml10"%>
  • - <% end%> +
    + 创建时间:<%= format_time(poll.created_at) %> + <% if poll.polls_status > 1 %> + 发布时间:<%= poll.published_at.nil? ? '未设置' : format_time(poll.published_at) %> + <% end %> + <% if poll.polls_status > 1 %> + 答题:<%= poll.poll_users.count %> / <%=@course.student.count %> + <% end %> - <% if poll.polls_status == 1 %> -
  • 发布问卷
  • - <% elsif poll.polls_status == 2%> -
  • 取消发布
  • - <% else%> -
  • 发布问卷
  • - <% end%> + <% if poll.polls_status == 1 %> + + <% elsif poll.polls_status == 2%> + + <% else%> +
    发布问卷
    + <% end%> - <%= link_to(l(:button_delete), poll,:method => :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "polls_de fr ml5 mr10") %> + <% if poll.polls_status == 1%> +
    统计结果
    + <% elsif poll.polls_status == 2 || poll.polls_status == 3 %> +
    <%= link_to l(:label_statistical_results), statistics_result_poll_path(poll.id), :class => "pollsbtn fr ml10"%>
    + <% end%> - <% if poll.polls_status == 1 %> -
  • <%= link_to l(:button_edit), edit_poll_path(poll.id), :class => "polls_de fr ml5"%>
  • - <% else%> -
  • 编辑
  • - <% end%> + <% if poll.polls_status == 2 %> +
  • 关闭
  • + <% else %> +
  • 关闭
  • + <% end%> - <% if poll.polls_status == 2 %> -
  • 关闭
  • - <% else %> -
  • 关闭
  • - <% end%> - - <% if poll.polls_status == 1%> -
  • 导出
  • - <% elsif poll.polls_status == 2 || poll.polls_status == 3 %> -
  • <%= link_to "导出", export_poll_poll_path(poll.id,:format => "xls"), :class => "polls_de fr ml5"%>
  • - - <% end%> - - -
  • <%= format_date poll.created_at.to_date%>
  • + <% if poll.polls_status == 1%> +
  • 导出
  • + <% elsif poll.polls_status == 2 || poll.polls_status == 3 %> +
  • <%= link_to "导出", export_poll_poll_path(poll.id,:format => "xls"), :class => "pollsbtn fr ml10"%>
  • + <% end%> +
    +
    <% else%> <% if poll.polls_status == 2%> - <% if has_commit%> -
  • <%= link_to poll_name, poll_result_poll_path(poll.id), :class => "polls_title polls_title_st fl c_dblue" %>
  • -
  • 已答
  • - <%else%> - <%= link_to poll_name, poll_path(poll.id), :class => "polls_title polls_title_st fl c_dblue"%> - <%end%> +
    + <% if has_commit%> + <%= link_to (index.to_i+1).to_s+". "+poll_name, poll_result_poll_path(poll.id), :title => "#{poll_name}", :class => "polls_title polls_title_st fl c_dblue mw550"%> + + <%else%> + <%= link_to (index.to_i+1).to_s+". "+poll_name, poll_path(poll.id), :title => "#{poll_name}", :class => "polls_title polls_title_st fl c_dblue mw550"%> + + <%end%> +
    +
    +
    + 发布时间:<%= format_time(poll.published_at) %> + 答题:<%= poll.poll_users.count %> / <%=@course.student.count %> + + <% if poll.show_result == 1 %> + <% if has_commit%> +
  • <%= link_to l(:label_statistical_results), statistics_result_poll_path(poll.id), :class => "pollsbtn fr"%>
  • + <%else%> +
  • 统计结果
  • + <%end%> + <% end %> +
    +
    <% end%> -
  • <%= format_date poll.created_at.to_date%>
  • - <% if poll.show_result == 1 %> - <% if has_commit%> -
  • <%= link_to l(:label_statistical_results), statistics_result_poll_path(poll.id), :class => "pollsbtn fr mr10"%>
  • - <%else%> -
  • 统计结果
  • - <%end%> - <% end %> <% end%> \ No newline at end of file diff --git a/app/views/poll/_poll_list.html.erb b/app/views/poll/_poll_list.html.erb index fb8b765a3..be2d6919d 100644 --- a/app/views/poll/_poll_list.html.erb +++ b/app/views/poll/_poll_list.html.erb @@ -1,4 +1,4 @@ -
    +

    所有问卷 (<%= @obj_count%>)

    diff --git a/app/views/poll/_polls_list.html.erb b/app/views/poll/_polls_list.html.erb index c096f396d..a23af8e73 100644 --- a/app/views/poll/_polls_list.html.erb +++ b/app/views/poll/_polls_list.html.erb @@ -1,6 +1,6 @@ -<% polls.each do |poll|%> -
      - <%= render :partial => 'poll', :locals => {:poll => poll} %> +<% polls.each_with_index do |poll, i|%> +
        + <%= render :partial => 'poll', :locals => {:poll => poll, :index => i} %>
      <% end%> diff --git a/app/views/poll/close_poll.js.erb b/app/views/poll/close_poll.js.erb index 222ea7976..4cfe48f3f 100644 --- a/app/views/poll/close_poll.js.erb +++ b/app/views/poll/close_poll.js.erb @@ -1,2 +1,2 @@ -$("#polls_<%= @poll.id %>").html("<%= escape_javascript(render :partial => 'poll',:locals => {:poll => @poll}) %>"); +$("#polls_<%= @poll.id %>").html("<%= escape_javascript(render :partial => 'poll',:locals => {:poll => @poll, :index => @index}) %>"); alert("关闭成功"); \ No newline at end of file diff --git a/app/views/poll/destroy.js.erb b/app/views/poll/destroy.js.erb index 8bb67f20a..f7a31c9d2 100644 --- a/app/views/poll/destroy.js.erb +++ b/app/views/poll/destroy.js.erb @@ -1 +1,2 @@ +hideModal(); $("#polls").html("<%= escape_javascript(render :partial => 'poll_list') %>"); \ No newline at end of file diff --git a/app/views/poll/index.html.erb b/app/views/poll/index.html.erb index 8b87d737d..87477a537 100644 --- a/app/views/poll/index.html.erb +++ b/app/views/poll/index.html.erb @@ -1,13 +1,13 @@ <%= stylesheet_link_tag 'polls', :media => 'all' %>
      -
      +
      <%= render :partial => 'poll_list'%>
      \ No newline at end of file diff --git a/app/views/poll/publish_poll.js.erb b/app/views/poll/publish_poll.js.erb index 91dcdc882..6e24cbc0a 100644 --- a/app/views/poll/publish_poll.js.erb +++ b/app/views/poll/publish_poll.js.erb @@ -1,4 +1,4 @@ -$("#polls_<%= @poll.id %>").html("<%= escape_javascript(render :partial => 'poll',:locals => {:poll => @poll}) %>"); +$("#polls_<%= @poll.id %>").html("<%= escape_javascript(render :partial => 'poll',:locals => {:poll => @poll, :index => @index}) %>"); $('#ajax-modal').html("<%= escape_javascript(render :partial => 'alert', locals: { :message => l(:label_memo_create_succ)}) %>"); showModal('ajax-modal', '250px'); //$('#ajax-modal').css('height','111px'); diff --git a/app/views/poll/republish_poll.js.erb b/app/views/poll/republish_poll.js.erb index 1d025a5b2..27169a413 100644 --- a/app/views/poll/republish_poll.js.erb +++ b/app/views/poll/republish_poll.js.erb @@ -1,4 +1,4 @@ -$("#polls_<%= @poll.id %>").html("<%= escape_javascript(render :partial => 'poll',:locals => {:poll => @poll}) %>"); +$("#polls_<%= @poll.id %>").html("<%= escape_javascript(render :partial => 'poll',:locals => {:poll => @poll, :index => @index}) %>"); $('#ajax-modal').html("<%= escape_javascript(render :partial => 'alert', locals: { :message => l(:label_poll_republish_success)}) %>"); showModal('ajax-modal', '250px'); //$('#ajax-modal').css('height','80px'); diff --git a/app/views/praise_tread/praise_minus.js.erb b/app/views/praise_tread/praise_minus.js.erb index b55624930..057ecb8bd 100644 --- a/app/views/praise_tread/praise_minus.js.erb +++ b/app/views/praise_tread/praise_minus.js.erb @@ -2,7 +2,7 @@ <% if @type.to_s == 'activity' %> $('#praise_count_<%=@user_activity_id %>').html('<%= j(render :partial=> "praise_tread/praise", :locals => {:activity=>@obj, :user_activity_id=>@user_activity_id,:type=>"activity"})%>'); <% else @type.to_s == 'reply' %> - $('#reply_praise_count_<%=@user_activity_id %>').html('<%=j(render :partial=> "praise_tread/praise", :locals => {:activity=>@obj, :user_activity_id=>@user_activity_id,:type=>"reply"})%>'); + $('.reply_praise_count_<%=@user_activity_id %>').html('<%=j(render :partial=> "praise_tread/praise", :locals => {:activity=>@obj, :user_activity_id=>@user_activity_id,:type=>"reply"})%>'); <% end %> <% else %> $('#praise_tread').html('<%= j( diff --git a/app/views/praise_tread/praise_plus.js.erb b/app/views/praise_tread/praise_plus.js.erb index 29041cd57..5edc8c4cf 100644 --- a/app/views/praise_tread/praise_plus.js.erb +++ b/app/views/praise_tread/praise_plus.js.erb @@ -1,13 +1,13 @@ -<% if @obj_type == 'Memo'%> - $('#praise_tread_<%= @obj.id %>').html('<%= j( - render :partial => "/memos/praise_tread",:locals => {:obj => @obj,:user_id => User.current.id,:horizontal => @horizontal} - )%>'); -<% elsif @activity %> +<% if @activity %> <% if @type.to_s == 'activity' %> $('#praise_count_<%=@user_activity_id %>').html('<%=j(render :partial=> "praise_tread/praise", :locals => {:activity=>@obj, :user_activity_id=>@user_activity_id,:type=>"activity"})%>'); <% else @type.to_s == 'reply' %> - $('#reply_praise_count_<%=@user_activity_id %>').html('<%=j(render :partial=> "praise_tread/praise", :locals => {:activity=>@obj, :user_activity_id=>@user_activity_id,:type=>"reply"})%>'); + $('.reply_praise_count_<%=@user_activity_id %>').html('<%=j(render :partial=> "praise_tread/praise", :locals => {:activity=>@obj, :user_activity_id=>@user_activity_id,:type=>"reply"})%>'); <% end %> +<% elsif @obj_type == 'Memo'%> + $('#praise_tread_<%= @obj.id %>').html('<%= j( + render :partial => "/memos/praise_tread",:locals => {:obj => @obj,:user_id => User.current.id,:horizontal => @horizontal} + )%>'); <% else %> $('#praise_tread_<%= @obj.id %>').html('<%= j( render :partial => "/praise_tread/praise_tread",:locals => {:obj => @obj,:user_id => User.current.id,:horizontal => @horizontal} diff --git a/app/views/projects/_comment_reply_detail.html.erb b/app/views/projects/_comment_reply_detail.html.erb index f6e2b8fb3..9c29a8ae9 100644 --- a/app/views/projects/_comment_reply_detail.html.erb +++ b/app/views/projects/_comment_reply_detail.html.erb @@ -1,7 +1,7 @@
      <%= link_to image_tag(url_to_avatar(comment.creator_user), :width => "33", :height => "33"), user_path(comment.creator_user.id), :alt => "用户头像" %>
      -
      +
      <%= link_to comment.creator_user.show_name, user_path(comment.creator_user.id), :class => "content-username" %> <%= time_from_now(comment.respond_to?(:created_on) ? comment.created_on : comment.created_at) %>
      @@ -16,10 +16,10 @@ <%= comment.content_detail.html_safe %> <% end %>
      -
      +
      - - +
      + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> @@ -31,7 +31,7 @@ :title => l(:button_reply)) %> - +
      diff --git a/app/views/projects/_history.html.erb b/app/views/projects/_history.html.erb index d9abdf47b..4c9e48391 100644 --- a/app/views/projects/_history.html.erb +++ b/app/views/projects/_history.html.erb @@ -16,7 +16,7 @@
      <% ids = 'project_respond_form_'+ journal.id.to_s%> - + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>journal, :user_activity_id=>journal.id,:type=>"reply"}%> <% if journal.user == User.current|| User.current.admin? %> diff --git a/app/views/projects/_no_data.html.erb b/app/views/projects/_no_data.html.erb index 249a67af0..bc8b97547 100644 --- a/app/views/projects/_no_data.html.erb +++ b/app/views/projects/_no_data.html.erb @@ -1,4 +1,4 @@ -
      +

      没有数据可供显示!

      \ No newline at end of file diff --git a/app/views/projects/_project_issue_comments_reply_detail.html.erb b/app/views/projects/_project_issue_comments_reply_detail.html.erb index 58b9f941e..e3a675fc5 100644 --- a/app/views/projects/_project_issue_comments_reply_detail.html.erb +++ b/app/views/projects/_project_issue_comments_reply_detail.html.erb @@ -1,7 +1,7 @@
      <%= link_to image_tag(url_to_avatar(comment.creator_user), :width => "33", :height => "33"), user_path(comment.creator_user.id), :alt => "用户头像" %>
      -
      +
      <%= link_to comment.creator_user.show_name, user_path(comment.creator_user.id), :class => "content-username" %> <%= time_from_now(comment.respond_to?(:created_on) ? comment.created_on : comment.created_at) %>
      @@ -16,13 +16,13 @@ <%= comment.content_detail.html_safe %> <% end %>
      -
      +
      - - +
      + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> - + <%= link_to( l(:button_reply), {:controller => 'users' ,:action => 'reply_to_comment', :reply_id => comment.id, :type => 'Issue', :user_activity_id => user_activity_id, :parent_id => parent_id, :is_project => true}, @@ -31,7 +31,7 @@ :title => l(:button_reply)) %> - +
      diff --git a/app/views/projects/_project_issue_expand_show.html.erb b/app/views/projects/_project_issue_expand_show.html.erb index 6ea9442dc..2debb7789 100644 --- a/app/views/projects/_project_issue_expand_show.html.erb +++ b/app/views/projects/_project_issue_expand_show.html.erb @@ -29,7 +29,7 @@
      - + <%= render :partial => "praise_tread/praise", :locals => {:activity => comment, :user_activity_id => comment.id, :type => "reply"} %> diff --git a/app/views/projects/_project_message_replies.html.erb b/app/views/projects/_project_message_replies.html.erb index 91eec6cf5..1fefb172c 100644 --- a/app/views/projects/_project_message_replies.html.erb +++ b/app/views/projects/_project_message_replies.html.erb @@ -20,7 +20,7 @@
      - + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> diff --git a/app/views/projects/_project_news_replies.html.erb b/app/views/projects/_project_news_replies.html.erb index 6b6d9e1fc..2ca86b314 100644 --- a/app/views/projects/_project_news_replies.html.erb +++ b/app/views/projects/_project_news_replies.html.erb @@ -29,7 +29,7 @@
      - + <%= render :partial => "praise_tread/praise", :locals => {:activity => comment, :user_activity_id => comment.id, :type => "reply"} %> diff --git a/app/views/projects/member_forked.html.erb b/app/views/projects/member_forked.html.erb index 668feef98..d5dba7ae2 100644 --- a/app/views/projects/member_forked.html.erb +++ b/app/views/projects/member_forked.html.erb @@ -1,3 +1,4 @@ +<% if @forked_count > 0 %>

      成员本页面展示Fork了 <%= link_to @project.owner.try(:show_name), user_path(@project.owner) %>/<%= link_to @project.name, project_path(@project) %> 的用户

        @@ -24,4 +25,8 @@
      - +<% else %> +
      + <%= render :partial => "projects/no_data" %> +
      +<% end %> diff --git a/app/views/projects/project_watcherlist.html.erb b/app/views/projects/project_watcherlist.html.erb index 440975e68..1c97e2855 100644 --- a/app/views/projects/project_watcherlist.html.erb +++ b/app/views/projects/project_watcherlist.html.erb @@ -1,3 +1,4 @@ +<% if @watchers.count > 0 %>

      成员 本页面展示关注了 <%= link_to @project.owner.try(:show_name), user_path(@project.owner) %>/<%= link_to @project.name, project_path(@project) %> 的用户

        @@ -24,6 +25,11 @@
      +<% else %> +
      + <%= render :partial => "projects/no_data" %> +
      +<% end %> diff --git a/app/views/projects/settings/_new_repositories.html.erb b/app/views/projects/settings/_new_repositories.html.erb index edffbdd19..7dc2a68d0 100644 --- a/app/views/projects/settings/_new_repositories.html.erb +++ b/app/views/projects/settings/_new_repositories.html.erb @@ -22,7 +22,8 @@

      1.长度必须在1到254个字符之间
      2.仅限使用小写字母(a-z)、数字、破折号(-)和下划线(_)
      - 3.一旦保存,标识无法修改 + 3.一旦保存,标识无法修改
      + 4.版本库名不能是纯数字

    diff --git a/app/views/pull_requests/_pull_request_commits.html.erb b/app/views/pull_requests/_pull_request_commits.html.erb index 79db43a83..8691fcea9 100644 --- a/app/views/pull_requests/_pull_request_commits.html.erb +++ b/app/views/pull_requests/_pull_request_commits.html.erb @@ -16,6 +16,15 @@
    <% end %> +
    +
    +
      + <%= pagination_links_full @pages, @count, :per_page_links => false, :remote => true, :flag => true, :is_new => true %> +
    +
    +
    +
    +
    diff --git a/app/views/pull_requests/_pull_requests_list.html.erb b/app/views/pull_requests/_pull_requests_list.html.erb index c594a2e56..9600cb135 100644 --- a/app/views/pull_requests/_pull_requests_list.html.erb +++ b/app/views/pull_requests/_pull_requests_list.html.erb @@ -14,8 +14,17 @@

    由 <%= link_to get_user_by_login_and(request.author.try(:username)).try(:show_name), user_path(get_user_by_login_and(request.author.try(:username))), :class => "linkBlue2" %> 创建于<%= time_tag(request.created_at) %>前

    <%= time_tag(request.updated_at) %>前更新 -

    <%= find_gitlab_project(request.source_project_id)+"/"+request.source_branch %>合并到<%= find_gitlab_project(request.target_project_id)+"/"+request.target_branch %>

    +

    <%#= find_gitlab_project(request.source_project_id)+"/"+request.source_branch %>合并到<%#= find_gitlab_project(request.target_project_id)+"/"+request.target_branch %>

    <% end %> +
    +
    +
      + <%= pagination_links_full @pages, @count, :per_page_links => false, :remote => true, :flag => true, :is_new => true%> +
    +
    +
    +
    +
    <% end %> \ No newline at end of file diff --git a/app/views/pull_requests/_show.html.erb b/app/views/pull_requests/_show.html.erb index adf0ded0c..e09e1f6d3 100644 --- a/app/views/pull_requests/_show.html.erb +++ b/app/views/pull_requests/_show.html.erb @@ -21,7 +21,10 @@

    由 <%= link_to @request.author.try(:username), user_path(get_user_by_login_and(@request.author.try(:username))), :class => "linkBlue2" %>于 <%= format_time(@request.created_at) %> 创建

    最近更新:<%= format_time(@request.updated_at) %> -

    <%= @request.source_branch %>合并到<%= @request.target_branch %>

    +

    + <%= find_gitlab_project(@request.source_project_id)+"/"+@request.source_branch %>合并到<%= find_gitlab_project(@request.target_project_id)+"/"+@request.target_branch %> + +

    diff --git a/app/views/pull_requests/index.html.erb b/app/views/pull_requests/index.html.erb index f2591b6ea..749135a15 100644 --- a/app/views/pull_requests/index.html.erb +++ b/app/views/pull_requests/index.html.erb @@ -28,16 +28,6 @@
    <%= render "pull_requests/pull_requests_list" %> - -
    -
    -
      - <%= pagination_links_full @pages, @count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true%> -
    -
    -
    -
    -
    <% else %> +
    <%= render :partial => "projects/no_data" %> +
    <% end %> diff --git a/app/views/repositories/_commit_details.html.erb b/app/views/repositories/_commit_details.html.erb index 07620e48d..420cac846 100644 --- a/app/views/repositories/_commit_details.html.erb +++ b/app/views/repositories/_commit_details.html.erb @@ -12,4 +12,7 @@  
    <% end %> + <% if params[:action] == "commit_diff" %> + + <% end %>
    \ No newline at end of file diff --git a/app/views/repositories/_revisions.html.erb b/app/views/repositories/_revisions.html.erb index a27789dc1..79db43a83 100644 --- a/app/views/repositories/_revisions.html.erb +++ b/app/views/repositories/_revisions.html.erb @@ -1,48 +1,21 @@ -<%= form_tag( - {:controller => 'repositories', :action => 'diff', :id => project, - :repository_id => @repository.identifier_param, :path => to_path_param(path)}, - :method => :get - ) do %> - - - - - - - - - - - - <% show_diff = revisions.size > 1 %> - <% line_num = 1 %> - <% revisions.each do |changeset| %> -
    -
      -
    • - <%= render :partial => 'commit_details', :locals => {:changeset => changeset} %> -
      - - <%= textilizable(truncate_at_line_break(changeset.message)) %> - -
      - <%= link_to truncate(changeset.short_id.to_s, :length => 20), {:controller => 'repositories', :action => 'commit_diff', :id => project.id, :changeset => changeset.id} %> -
      -
      -
      -
      -
    • -
    -
    - <% end %> - -
    -

    - <%#= submit_tag(l(:label_view_diff), :name => nil, :class=>"c_blue") if show_diff %> -

    -
      - <%= pagination_links_full commits_pages, commits_count, :per_page_links => false, :remote => false, :flag => true %> -
    - +<% @commits.chunk { |c| format_date(c.created_at).to_date }.each do |day, commits| %> +
    +
    +

    <%= day %>

    +

    <%= commits.count %>个提交

    +
    +
      + <% commits.each do |commit| %> +
    • + <%= time_tag(commit.created_at) %>前 + <%= link_to get_user_by_mail(commit.author_email).show_name, user_path(get_user_by_mail(commit.author_email)), :target => "_blank", :class => "pullreques_pull_name fl ml10" %> +

      <%= commit.title %>

      + <%= link_to truncate(commit.short_id, :length => 20), {:controller => 'repositories', :action => 'commit_diff', :id => @project.id, :changeset => commit.id}, :target => "_blank", :class => "fr mr15 c_grey" %> +
    • + <% end %> +
    +
    <% end %> + + diff --git a/app/views/repositories/changes.html.erb b/app/views/repositories/changes.html.erb index f634a0285..a305b9ec5 100644 --- a/app/views/repositories/changes.html.erb +++ b/app/views/repositories/changes.html.erb @@ -1,26 +1,38 @@ -<%= call_hook(:view_repositories_show_contextual, { :repository => @repository, :project => @project }) %> -
    -
    - <%= render :partial => "top" %> +
    +
    +
      + <%= render :partial => 'navigation' %> +
    + <% @commits.chunk { |c| format_date(c.created_at).to_date }.each do |day, commits| %> +
    +
    +

    <%= day %>

    +

    <%= commits.count %>个提交

    +
    +
      + <% commits.each do |commit| %> +
    • + <%= time_tag(commit.created_at) %>前 + <%= link_to get_user_by_mail(commit.author_email).show_name, user_path(get_user_by_mail(commit.author_email)), :target => "_blank", :class => "pullreques_pull_name fl ml10" %> +

      <%= commit.title %>

      + <%= link_to truncate(commit.short_id, :length => 20), {:controller => 'repositories', :action => 'commit_diff', :id => @project.id, :changeset => commit.id}, :target => "_blank", :class => "fr mr15 c_grey" %> +
    • + <% end %> +
    +
    + <% end %> -
    - <%= render :partial => 'navigation' %> -
    -
    - - <%= render :partial => 'link_to_functions' %> - - <%= render_properties(@properties) %> - -
    - <%= render(:partial => 'revisions', :locals => {:project => @project, :path => @path , :revisions => @commits, :entry => @entry , :commits_pages => @commits_pages , :commits_count => @commits_count}) unless @commits.empty? %> +
    +
    +
      + <%= pagination_links_full @commits_pages, @commits_count, :per_page_links => false, :remote => false, :flag => true, :is_new => true %> +
    +
    +
    - <% content_for :header_tags do %> - <%= stylesheet_link_tag "scm" %> - <% end %> - + <%= call_hook(:view_repositories_show_contextual, { :repository => @repository, :project => @project }) %> <% html_title(l(:label_change_plural)) -%> -
    \ No newline at end of file +
    diff --git a/app/views/repositories/commit_diff.html.erb b/app/views/repositories/commit_diff.html.erb index 7693b385c..913561bc2 100644 --- a/app/views/repositories/commit_diff.html.erb +++ b/app/views/repositories/commit_diff.html.erb @@ -1,16 +1,27 @@
    -
    - <%= render :partial => "top" %> +
    +
    + <%= link_to "返回提交历史".html_safe, {:action => 'changes', :path => to_path_param(@path), :id => @project, :repository_id => @repository.identifier_param, :rev => @rev, :page => 1}, :class => "fl linkBlue2 mt3" %> + +
    +
    +
    +

    <%= @commit_details.message %>

    +
    + + + + + + +
  • + <%= render :partial => 'commit_details', :locals => {:changeset => @commit_details} %> +
  • +
    -
    Commit - <%= @commit_details.id %>
    -
  • - <%= render :partial => 'commit_details', :locals => {:changeset => @commit_details} %> -
  • -
    -
    <%= @commit_details.message %>
    + <% @commit_diff.each do |commit_diff| %> -
    +
    <%= commit_diff.new_path %> diff --git a/app/views/repositories/show.html.erb b/app/views/repositories/show.html.erb index 282df48c3..05b8d40d0 100644 --- a/app/views/repositories/show.html.erb +++ b/app/views/repositories/show.html.erb @@ -27,17 +27,17 @@ <% unless @entries.nil? %> ZIP下载 - <% if User.current.member_of?(@project) && @project.is_public? %> - <% if quality_analysis(User.current.try(:login), @repository.id).nil? %> - <%= link_to "质量分析", quality_analysis_path(:id => @project.id, :repository_id => @repository.identifier, :rev => @rev, :default_branch => @g_default_branch, :type => "1"), :remote => true, :class => "btn_zipdown fr" %> - <% else %> - <%= link_to "重新分析", quality_analysis_path(:id => @project.id, :repository_id => @repository.identifier, :rev => @rev, :default_branch => @g_default_branch, :type => "2"), :remote => true, :class => "btn_zipdown fr" %> - <% end %> - <% end %> - <% end %> - <% unless QualityAnalysis.where(:project_id => @project.id).first.nil? %> - <%= link_to "代码分析结果", project_quality_analysis_path(:project_id => @project.id), :class => "btn_zipdown fr" %> + <%# if User.current.member_of?(@project) && @project.is_public? %> + <%# if quality_analysis(User.current.try(:login), @repository.id).nil? %> + <%#= link_to "质量分析", quality_analysis_path(:id => @project.id, :repository_id => @repository.identifier, :rev => @rev, :default_branch => @g_default_branch, :type => "1"), :remote => true, :class => "btn_zipdown fr" %> + <%# else %> + <%#= link_to "重新分析", quality_analysis_path(:id => @project.id, :repository_id => @repository.identifier, :rev => @rev, :default_branch => @g_default_branch, :type => "2"), :remote => true, :class => "btn_zipdown fr" %> + <%# end %> + <%# end %> <% end %> + <%# unless QualityAnalysis.where(:project_id => @project.id).first.nil? %> + <%#= link_to "代码分析结果", project_quality_analysis_path(:project_id => @project.id), :class => "btn_zipdown fr" %> + <%# end %>
    <%=link_to "代码统计", stats_repository_project_path(:id => @project.id, :repository_id => @repository.identifier, :rev => @rev, :creator => @creator, :default_branch => @g_default_branch ), :class => "fl vl_zip" %> diff --git a/app/views/student_work/_evaluation_title.html.erb b/app/views/student_work/_evaluation_title.html.erb index 094df203e..57cccc51a 100644 --- a/app/views/student_work/_evaluation_title.html.erb +++ b/app/views/student_work/_evaluation_title.html.erb @@ -30,7 +30,8 @@ <% @stundet_works.each_with_index do |student_work, i|%> - <%= render :partial => "evaluation_work", :locals => {:student_work => student_work, :index => i}%> + <% score_open = @homework.score_open == 1 || student_work.user == User.current %> + <%= render :partial => "evaluation_work", :locals => {:student_work => student_work, :index => i, :score_open => score_open}%>
    diff --git a/app/views/student_work/_evaluation_un_group_member_work.html.erb b/app/views/student_work/_evaluation_un_group_member_work.html.erb index 347bea20e..257f1070c 100644 --- a/app/views/student_work/_evaluation_un_group_member_work.html.erb +++ b/app/views/student_work/_evaluation_un_group_member_work.html.erb @@ -21,20 +21,42 @@ <% end %>
    -
    <%= st.teacher_score.nil? ? "--" : format("%.1f",st.teacher_score)%>
    -
    <%= st.teaching_asistant_score.nil? ? "--" : format("%.1f",st.teaching_asistant_score)%>
    +
    + + <%= !score_open || st.teacher_score.nil? ? "--" : format("%.1f",st.teacher_score)%> + +
    +
    + + <%= !score_open || st.teaching_asistant_score.nil? ? "--" : format("%.1f",st.teaching_asistant_score)%> + +
    <% if @homework.anonymous_comment == 0 %>
    -
    - <% if st.student_score.nil? %> - 未参与 +
    + <% if !score_open || st.student_score.nil? %> + <% pro = @homework.student_work_projects.where("user_id = #{st.user_id}").first + if pro.nil? || pro.student_work_id == "" || pro.student_work_id.nil? + work = st + else + work = StudentWork.find pro.student_work_id + end %> + <% if !score_open %> + -- + <% elsif @homework.homework_detail_manual.comment_status < 2 %> + 未参与 + <% elsif @homework.homework_detail_manual.comment_status == 2 && work.student_works_evaluation_distributions.count != 0 %> + 待匿评 + <% elsif @homework.homework_detail_manual.comment_status == 3 && work.student_works_evaluation_distributions.count != 0 %> + 未评分 + <% else %> + 迟交 + <% end %> <% else %> <%= format("%.1f", st.student_score) %> - <% end %> - <% unless st.student_score.nil? %> - - (<%= anon_count %>) - + + (<%= anon_count %>) +
    现共有  <%= anon_count %>  @@ -47,9 +69,9 @@ <% end %>
    <% score = st.work_score %> -
    - <%= score.nil? ? "--" : format("%.1f",score<0 ? 0 : score)%> - <% unless score.nil?%> +
    + <%= !score_open || score.nil? ? "--" : format("%.1f",score<0 ? 0 : score)%> + <% unless !score_open || score.nil?%>
    diff --git a/app/views/student_work/_evaluation_un_title.html.erb b/app/views/student_work/_evaluation_un_title.html.erb index 902c8fa50..99c8d86eb 100644 --- a/app/views/student_work/_evaluation_un_title.html.erb +++ b/app/views/student_work/_evaluation_un_title.html.erb @@ -75,7 +75,8 @@ <%# end %> <% @stundet_works.each_with_index do |student_work, i| %> - <%= render :partial => "evaluation_un_work", :locals => {:student_work => student_work, :index => i} %> + <% score_open = @is_teacher || @homework.score_open == 1 || student_work.user == User.current %> + <%= render :partial => "evaluation_un_work", :locals => {:student_work => student_work, :index => i, :score_open => score_open} %>
    diff --git a/app/views/student_work/_evaluation_un_work.html.erb b/app/views/student_work/_evaluation_un_work.html.erb index 9b247f3d6..ef3f670af 100644 --- a/app/views/student_work/_evaluation_un_work.html.erb +++ b/app/views/student_work/_evaluation_un_work.html.erb @@ -52,28 +52,40 @@ <%=get_status student_work.work_status %> <% end %> - - <%= student_work.teacher_score.nil? ? "--" : format("%.1f",student_work.teacher_score)%> + + <%= !score_open || student_work.teacher_score.nil? ? "--" : format("%.1f",student_work.teacher_score)%> - - <%= student_work.teaching_asistant_score.nil? ? "--" : format("%.1f",student_work.teaching_asistant_score)%> + + <%= !score_open || student_work.teaching_asistant_score.nil? ? "--" : format("%.1f",student_work.teaching_asistant_score)%> <% if @homework.homework_type == 2%> - - <%= student_work.system_score.nil? ? "--" : format("%.1f",student_work.system_score)%> + + <%= !score_open || student_work.system_score.nil? ? "--" : format("%.1f",student_work.system_score)%> <% end%> <% if @homework.anonymous_comment == 0%> - - <% if student_work.student_score.nil? %> - 未参与 + + <% if !score_open || student_work.student_score.nil? %> + <% if !score_open %> + -- + <% elsif student_work.work_status != 0 %> + <% if @homework.homework_detail_manual.comment_status < 2 %> + 未参与 + <% elsif @homework.homework_detail_manual.comment_status >= 2 && student_work.student_works_evaluation_distributions.count == 0 %> + 迟交 + <% elsif @homework.homework_detail_manual.comment_status == 2 && student_work.student_works_evaluation_distributions.count != 0 %> + 待匿评 + <% elsif @homework.homework_detail_manual.comment_status == 3 && student_work.student_works_evaluation_distributions.count != 0 %> + 未评分 + <% end %> + <% else %> + -- + <% end %> <% else %> <%=format("%.1f",student_work.student_score) %> - <% end %> - <% unless student_work.student_score.nil?%> (<%= student_work.student_works_scores.where(:reviewer_role => 3).group_by(&:user_id).count%>) @@ -85,7 +97,7 @@ 名学生进行了匿评,平均分为  <%= format("%.1f",student_work.student_score)%> 分。
    - <% end%> + <% end %> <% end %> @@ -94,9 +106,9 @@ <% else %> <% score = student_work.respond_to?("score") ? student_work.score : (student_work.final_score || 0) - student_work.absence_penalty - student_work.late_penalty%> <% end %> - - <%= score.nil? ? "--" : format("%.1f",score<0 ? 0 : score)%> - <% unless score.nil?%> + + <%= !score_open || score.nil? ? "--" : format("%.1f",score<0 ? 0 : score)%> + <% unless !score_open || score.nil?%>
    diff --git a/app/views/student_work/_evaluation_work.html.erb b/app/views/student_work/_evaluation_work.html.erb index 80b9aafe7..0e270af9e 100644 --- a/app/views/student_work/_evaluation_work.html.erb +++ b/app/views/student_work/_evaluation_work.html.erb @@ -80,8 +80,8 @@ <% if @homework.homework_type == 2%> - - <%= student_work.system_score.nil? ? "--" : format("%.1f",student_work.system_score)%> + + <%= !score_open || student_work.system_score.nil? ? "--" : format("%.1f",student_work.system_score)%> <% end%> diff --git a/app/views/student_work/_group_member_work.html.erb b/app/views/student_work/_group_member_work.html.erb index 8ff10e513..d6751205b 100644 --- a/app/views/student_work/_group_member_work.html.erb +++ b/app/views/student_work/_group_member_work.html.erb @@ -2,8 +2,9 @@ <% student_work_groups = @homework.student_works.where("user_id in #{user_ids}").order("created_at asc") %> <% anon_count = student_work.student_works_scores.where(:reviewer_role => 3).group_by(&:user_id).count %> <% student_work_groups.each_with_index do |st, j| %> + <% score_open = @is_teacher || @homework.score_open == 1 || st.user == User.current %>
    - <%= render :partial => 'evaluation_un_group_member_work', :locals => {:st => st, :anon_count => anon_count} %> + <%= render :partial => 'evaluation_un_group_member_work', :locals => {:st => st, :anon_count => anon_count, :score_open => score_open} %>
    <% end %> \ No newline at end of file diff --git a/app/views/student_work/_jour_replay.html.erb b/app/views/student_work/_jour_replay.html.erb index 4b594d7f4..eba5b2c08 100644 --- a/app/views/student_work/_jour_replay.html.erb +++ b/app/views/student_work/_jour_replay.html.erb @@ -2,7 +2,7 @@ <%= link_to image_tag(url_to_avatar(jour.user), :width => "32", :height => "32"), user_path(jour.user),:class => "st_img fl" %>
    - <%= link_to jour.user.show_name, user_path(jour.user), :title => jour.user.show_name, :class => "c_blue fl" %> + <%= link_to show_real_name ? jour.user.show_name : "匿名", user_path(jour.user), :title => jour.user.show_name, :class => "c_blue fl" %> <% if jour.user==User.current || User.current.admin? %> <%= link_to(l(:label_bid_respond_delete), destroy_score_reply_student_work_index_path(:jour_id => jour.id), diff --git a/app/views/student_work/_relate_projects.html.erb b/app/views/student_work/_relate_projects.html.erb index b538d2aa6..c6a372a47 100644 --- a/app/views/student_work/_relate_projects.html.erb +++ b/app/views/student_work/_relate_projects.html.erb @@ -23,7 +23,7 @@

    <%= link_to project.members.count, allow_visit ? member_project_path(project) : 'javascript:void(0)', :class => "c_blue" %>成员  | <%= link_to project.project_score.issue_num, allow_visit ? project_issues_path(project) : 'javascript:void(0)', :class => "c_blue" %>问题  | - <%= link_to project.project_score.attach_num, allow_visit ? file_project_path(project) : 'javascript:void(0)', :class => "c_blue" %>资源 + <%= link_to project.project_score.changeset_num, visible_repository?(project) ? ({:controller => 'repositories', :action => 'show', :id => project, :repository_id => gitlab_repository(project).try(:identifier)}) : 'javascript:void(0)', :class => "c_blue" %>提交

    diff --git a/app/views/student_work/_student_work_score.html.erb b/app/views/student_work/_student_work_score.html.erb index 3730c99fb..e7c201736 100644 --- a/app/views/student_work/_student_work_score.html.erb +++ b/app/views/student_work/_student_work_score.html.erb @@ -1,6 +1,7 @@
      - <% show_real_name = @is_teacher || score.user == User.current || score.user.allowed_to?(:as_teacher,@course) || score.reviewer_role != 3 %> + <% show_real_name = @is_teacher || score.user == User.current || score.reviewer_role != 3 %> <%= link_to image_tag(url_to_avatar(show_real_name ? score.user : ""), :width => "34", :height => "34"), show_real_name ? user_path(score.user) : "javascript:void(0)",:class => "ping_pic fl" %> + <% show_real_score = @homework.score_open == 1 || @is_teacher || score.student_work.user == User.current %>
      <%= link_to show_real_name ? score.user.show_name : "匿名", show_real_name ? user_path(score.user) : "javascript:void(0)", :title => show_real_name ? score.user.show_name : "匿评用户", :class => "linkBlue fl" %> @@ -9,7 +10,7 @@ <% unless score.score.nil? %> 评分: - <%= score.score%>分 + <%= show_real_score ? score.score : "**" %>分 <% end %> 回复 @@ -33,7 +34,8 @@
      <% score.journals_for_messages.order("created_on desc").each do |jour|%> - <%= render :partial => 'jour_replay',:locals => {:jour => jour}%> + <% show_real_name = @is_teacher || score.reviewer_role != 3 %> + <%= render :partial => 'jour_replay',:locals => {:jour => jour, :show_real_name => show_real_name || jour.user == User.current}%> <% end%>
      diff --git a/app/views/student_work/add_score.js.erb b/app/views/student_work/add_score.js.erb index 03693bff4..9c974a57f 100644 --- a/app/views/student_work/add_score.js.erb +++ b/app/views/student_work/add_score.js.erb @@ -7,6 +7,7 @@ $('#score_<%= @work.id%>').peSlider({range: 'min'}); <%# else %> //$("#work_score_<%#= @score.id%>").html("<%#= escape_javascript(render :partial => 'student_work_score', :locals => {:score => @new_score,:is_last => @is_last}) %>"); <%# end%> +<% score_open = @is_teacher || @homework.score_open == 1 || @work.user == User.current %> $("#score_list_<%= @work.id%>").html("<%=escape_javascript(render :partial => 'student_work_score_records', :locals => {:student_work_scores => @student_work_scores, :is_member_work => is_member_work}) %>"); var num = $("#work_num_<%= @work.id%>").html(); @@ -19,14 +20,14 @@ $("#score_list_<%= @work.id%>").removeAttr("style"); $("#group_member_work_<%= @work.id%>").html("<%= escape_javascript(render :partial => 'group_member_work', :locals => {:student_work => @work}) %>"); <% else %> <% anon_count = @work.student_works_scores.where(:reviewer_role => 3).group_by(&:user_id).count %> - $("#student_work_<%= @work.id%>").html("<%= escape_javascript(render :partial => 'evaluation_un_group_member_work', :locals => {:st => @work, :anon_count => anon_count}) %>"); + $("#student_work_<%= @work.id%>").html("<%= escape_javascript(render :partial => 'evaluation_un_group_member_work', :locals => {:st => @work, :anon_count => anon_count, :score_open => score_open}) %>"); <% end %> <% else %> - $("tr[id='student_work_<%= @work.id%>']").replaceWith("<%= escape_javascript(render :partial => 'evaluation_un_work',:locals => {:student_work => @work, :index => 1}) %>"); + $("tr[id='student_work_<%= @work.id%>']").replaceWith("<%= escape_javascript(render :partial => 'evaluation_un_work',:locals => {:student_work => @work, :index => 1, :score_open => score_open}) %>"); $("#work_num_<%= @work.id%>").html(num); <% end %> <% else %> - $("tr[id='student_work_<%= @work.id%>']").replaceWith("<%= escape_javascript(render :partial => 'evaluation_work',:locals => {:student_work => @work, :index => 1}) %>"); + $("tr[id='student_work_<%= @work.id%>']").replaceWith("<%= escape_javascript(render :partial => 'evaluation_work',:locals => {:student_work => @work, :index => 1, :score_open => score_open}) %>"); $("#work_num_<%= @work.id%>").html(num); <% end%> diff --git a/app/views/student_work/add_score_reply.js.erb b/app/views/student_work/add_score_reply.js.erb index f21870cd5..e4c5f26e9 100644 --- a/app/views/student_work/add_score_reply.js.erb +++ b/app/views/student_work/add_score_reply.js.erb @@ -1,6 +1,6 @@ $("#add_score_reply_<%= @score.id%>").html("<%= escape_javascript(render :partial => 'add_score_reply', :locals => {:score => @score,:is_last => @is_last}) %>"); <% if @status && @status == 1%> - $("#replay_histroy_<%= @score.id%>").prepend("<%= escape_javascript(render :partial => 'jour_replay', :locals => {:jour => @jour}) %>"); + $("#replay_histroy_<%= @score.id%>").prepend("<%= escape_javascript(render :partial => 'jour_replay', :locals => {:jour => @jour, :show_real_name => @show_real_name}) %>"); $("#add_score_reply_<%= @score.id%>").hide(); <% else%> alert("回复内容不能为空"); diff --git a/app/views/student_work/index.html.erb b/app/views/student_work/index.html.erb index 8750a35a7..a88a41d97 100644 --- a/app/views/student_work/index.html.erb +++ b/app/views/student_work/index.html.erb @@ -51,37 +51,37 @@ // }); <%# end%> - function set_score_rule_submit() { - if($("#late_penalty_num").val() == ""){ - $("#late_penalty_num").val("0"); - } - if($("#absence_penalty_num").val() == ""){ - $("#absence_penalty_num").val("0"); - } - $('#muban_popup_box').find('form').submit(); - hideModal(); - } +// function set_score_rule_submit() { +// if($("#late_penalty_num").val() == ""){ +// $("#late_penalty_num").val("0"); +// } +// if($("#absence_penalty_num").val() == ""){ +// $("#absence_penalty_num").val("0"); +// } +// $('#muban_popup_box').find('form').submit(); +// hideModal(); +// } - //设置评分规则 - function set_score_rule(){ - <% if @homework.homework_type == 2 %> - <% if @homework.anonymous_comment == 0 %> - var htmlvalue = "<%= escape_javascript(render :partial => 'homework_common/set_score_rule_pro',:locals => {:homework => @homework, :student_path => true, :user_activity_id => -1,:hw_status => 5}) %>"; - pop_box_new(htmlvalue, 570, 355); - <% else %> - var htmlvalue = "<%= escape_javascript(render :partial => 'homework_common/set_score_rule_pro_anon',:locals => {:homework => @homework, :student_path => true, :user_activity_id => -1,:hw_status => 5}) %>"; - pop_box_new(htmlvalue, 500, 285); - <% end %> - <% else %> - <% if @homework.anonymous_comment == 0 %> - var htmlvalue = "<%= escape_javascript(render :partial => 'homework_common/set_score_rule_non_pro',:locals => {:homework => @homework, :student_path => true, :user_activity_id => -1,:hw_status => 5}) %>"; - pop_box_new(htmlvalue, 500, 325); - <% else %> - var htmlvalue = "<%= escape_javascript(render :partial => 'homework_common/set_score_rule_none_pro_anon',:locals => {:homework => @homework, :student_path => true, :user_activity_id => -1,:hw_status => 5}) %>"; - pop_box_new(htmlvalue, 500, 225); - <% end %> - <% end %> - } +// //设置评分规则 +// function set_score_rule(){ + + +// var htmlvalue = "<%#= escape_javascript(render :partial => 'homework_common/set_score_rule_pro',:locals => {:homework => @homework, :student_path => true, :user_activity_id => -1,:hw_status => 5}) %>"; +// pop_box_new(htmlvalue, 570, 355); + +// var htmlvalue = "<%#= escape_javascript(render :partial => 'homework_common/set_score_rule_pro_anon',:locals => {:homework => @homework, :student_path => true, :user_activity_id => -1,:hw_status => 5}) %>"; +// pop_box_new(htmlvalue, 500, 285); + + + +// var htmlvalue = "<%#= escape_javascript(render :partial => 'homework_common/set_score_rule_non_pro',:locals => {:homework => @homework, :student_path => true, :user_activity_id => -1,:hw_status => 5}) %>"; +// pop_box_new(htmlvalue, 500, 325); + +// var htmlvalue = "<%#= escape_javascript(render :partial => 'homework_common/set_score_rule_none_pro_anon',:locals => {:homework => @homework, :student_path => true, :user_activity_id => -1,:hw_status => 5}) %>"; +// pop_box_new(htmlvalue, 500, 225); + + +// }
      @@ -118,10 +118,10 @@ <% if @is_teacher%>
      -
        -
      • - -
          +
            +
          • + 导出 +
            • <%= link_to "导出作业成绩", student_work_index_path(:homework => @homework.id,:order => @order, :sort => @b_sort, :name => @name, :group => @group, :format => 'xls'),:class=>'hworkExport postTypeGrey', :id => "export_student_work"%>
            • @@ -141,9 +141,6 @@ <%= link_to("导出匿评情况", evaluation_list_student_work_index_path(:homework => @homework.id, :format => 'xls'),:class=>'hworkExport resourcesGrey')%> <% end %> -
            • - 评分设置 -
          diff --git a/app/views/users/_comment_reply_detail.html.erb b/app/views/users/_comment_reply_detail.html.erb index 23382d972..12cd6874a 100644 --- a/app/views/users/_comment_reply_detail.html.erb +++ b/app/views/users/_comment_reply_detail.html.erb @@ -1,7 +1,7 @@
          <%= link_to image_tag(url_to_avatar(comment.creator_user), :width => "33", :height => "33"), user_path(comment.creator_user), :alt => "用户头像" %>
          -
          +
          <%= link_to comment.creator_user.show_name, user_path(comment.creator_user), :class => "content-username" %> <%= time_from_now(comment.respond_to?(:created_on) ? comment.created_on : comment.created_at) %>
          @@ -16,16 +16,16 @@ <%= comment.content_detail.html_safe %> <% end %>
          -
          +
          - - +
          + <%=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), {:controller => 'users' ,:action => 'reply_to_comment', :reply_id => comment.id, :type => type, :user_activity_id => user_activity_id, :parent_id => parent_id}, @@ -36,7 +36,7 @@ <% end %> <% else %> - + <%= link_to( l(:button_reply), {:controller => 'users' ,:action => 'reply_to_comment', :reply_id => comment.id, :type => type, :user_activity_id => user_activity_id, :parent_id => parent_id}, @@ -46,7 +46,7 @@ <% end %> - +
          diff --git a/app/views/users/_homework_base_info.html.erb b/app/views/users/_homework_base_info.html.erb index 716a860ce..40381e686 100644 --- a/app/views/users/_homework_base_info.html.erb +++ b/app/views/users/_homework_base_info.html.erb @@ -88,19 +88,19 @@
          - <% else %> -

          <%= l(:label_no_data) %>

          - <% end %>
          + <% else %> + <%= render :partial => "projects/no_data" %> + <% end %>
          + + -
          -
          404
          -
          -

          ERROR PAGE
          - 页面不见了!建议您

          - +
          +
          + +

          + 非常抱歉,您访问的页面不存在或已删除。 + 返回上页>> + QQ反馈>> +

          -
          diff --git a/public/500.html b/public/500.html index 10fa81023..e33909450 100644 --- a/public/500.html +++ b/public/500.html @@ -9,7 +9,7 @@