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/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/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..596775045 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] ? 0 : 1
+ 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/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 678d3ed50..75a0eb3f1 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -42,6 +42,11 @@ module ApplicationHelper
number > 10000 ? (number.to_f / 1000).round.to_s + "k" : number
end
+ # 判断某个课程是否包含仅对自己可见的作业
+ def course_has_score_open_common_homework course
+ course.homework_commons.select{|hc| hc.score_open == 0}.count > 0 ? true : false
+ end
+
# 隐藏项目以外的信息
# return: true 显示,false 不显示
def hidden_unproject_infos
@@ -2855,18 +2860,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
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/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/courses/_course_heroes.html.erb b/app/views/courses/_course_heroes.html.erb
index bd285f9b0..b6bf0daa0 100644
--- a/app/views/courses/_course_heroes.html.erb
+++ b/app/views/courses/_course_heroes.html.erb
@@ -15,9 +15,15 @@
<% hero_homework_scores.each do |student_score| %>
<% if student_score.score.to_i != 0 %>
-
<%=link_to image_tag(url_to_avatar(student_score.user), :width => "35", :height => "35", :class=> "rankPortrait"),user_path(student_score.user) %>
- <%=link_to student_score.user.show_name, user_path(student_score.user), :title => student_score.user.show_name %>
- <%= student_score.score<0 ? 0 : student_score.score.to_i %>
+ <%=link_to image_tag(url_to_avatar(student_score.user), :width => "35", :height => "35", :class=> "rankPortrait"),user_path(student_score.user) %>
+ <%=link_to student_score.user.show_name, user_path(student_score.user), :title => student_score.user.show_name %>
+
+ <% if !(User.current.allowed_to?(:as_teacher, @course) || User.current.admin?) && User.current.id != student_score.user.id && course_has_score_open_common_homework(@course) %>
+ <%= "**" %>
+ <% else %>
+ <%= student_score.score<0 ? 0 : student_score.score.to_i %>
+ <% end %>
+
<% end %>
<% end %>
diff --git a/app/views/courses/_new_member_list.html.erb b/app/views/courses/_new_member_list.html.erb
index ac3c847a9..0e21eeb5d 100644
--- a/app/views/courses/_new_member_list.html.erb
+++ b/app/views/courses/_new_member_list.html.erb
@@ -86,22 +86,32 @@
<%= user.user_extensions.student_id %>
- <%= link_to format("%0.2f", hw_score), {
- :action => 'show_member_score',
- :member_id => member.id,
- :remote => true},
- :class => "" %>
+ <% if !is_teacher && User.current.id != member.user_id && course_has_score_open_common_homework(@course) %>
+ **
+ <% else %>
+ <%= link_to format("%0.2f", hw_score), {
+ :action => 'show_member_score',
+ :member_id => member.id,
+ :remote => true},
+ :class => "" %>
+ <% end %>
<%= ex_score %>
<%= link_to act_score, {
- :action => 'show_member_act_score',
- :member_id => member.id,
- :remote => true},
- :class => '' %>
+ :action => 'show_member_act_score',
+ :member_id => member.id,
+ :remote => true},
+ :class => '' %>
- <%= format("%0.2f", sum) %>
+
+ <% if !is_teacher && User.current.id != member.user_id && course_has_score_open_common_homework(@course) %>
+ **
+ <% else %>
+ <%= format("%0.2f", sum) %>
+ <% end %>
+
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/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 @@
+
\ 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..6afd5f1ee 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 @@
-
+
+
-
<%= reply.content.gsub(/script/, "script ").html_safe %>
+
<%= reply.content.gsub(/\/script/, "script").gsub(/script/, " script").html_safe %>
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/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/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) %> 的用户
-
+<% 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) %> 的用户
+<% 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 @@
<%= time_tag(changeset.created_at) %> 前
<% 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} %>
-
-
-
-
- <% 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_details.message %>
+
<% @commit_diff.each do |commit_diff| %>
-
+
<%= commit_diff.new_path %>
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 23bef1cb0..709c7749b 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,49 +21,59 @@
<% end %>
-
<%= st.teacher_score.nil? ? "--" : format("%.1f",st.teacher_score)%>
-
<%= st.teaching_asistant_score.nil? ? "--" : format("%.1f",st.teaching_asistant_score)%>
+
+
+ <%= st.teacher_score.nil? ? "--" : (!score_open ? "**" : format("%.1f",st.teacher_score))%>
+
+
+
+
+ <%= st.teaching_asistant_score.nil? ? "--" : (!score_open ? "**" : format("%.1f",st.teaching_asistant_score))%>
+
+
<% if @homework.anonymous_comment == 0 %>
-
+
<% if 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 %>
+ end %>
<% if @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 %>
- 名学生进行了匿评,平均分为
- <%= format("%.1f", st.student_score) %> 分。
-
+ <% if !score_open %>
+
**
+ <% else %>
+ <%= format("%.1f", st.student_score) %>
+
+ (<%= anon_count %>)
+
+
+ 现共有
+ <%= anon_count %>
+ 名学生进行了匿评,平均分为
+ <%= format("%.1f", st.student_score) %> 分。
+
+ <% end %>
<% end %>
<% end %>
<% score = st.work_score %>
-
- <%= score.nil? ? "--" : format("%.1f",score<0 ? 0 : score)%>
- <% unless score.nil?%>
+
+ <%= score.nil? ? "--" : (!score_open ? "**" : 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 42985806c..b060e2ddd 100644
--- a/app/views/student_work/_evaluation_un_work.html.erb
+++ b/app/views/student_work/_evaluation_un_work.html.erb
@@ -52,23 +52,23 @@
<%=get_status student_work.work_status %>
<% end %>
-
- <%= student_work.teacher_score.nil? ? "--" : format("%.1f",student_work.teacher_score)%>
+
+ <%= student_work.teacher_score.nil? ? "--" : (!score_open ? "**" : format("%.1f",student_work.teacher_score))%>
-
- <%= student_work.teaching_asistant_score.nil? ? "--" : format("%.1f",student_work.teaching_asistant_score)%>
+
+ <%= student_work.teaching_asistant_score.nil? ? "--" : (!score_open ? "**" : format("%.1f",student_work.teaching_asistant_score)) %>
<% if @homework.homework_type == 2%>
-
- <%= student_work.system_score.nil? ? "--" : format("%.1f",student_work.system_score)%>
+
+ <%= student_work.system_score.nil? ? "--" : (!score_open ? "**" : format("%.1f",student_work.system_score))%>
<% end%>
<% if @homework.anonymous_comment == 0%>
-
- <% if student_work.student_score.nil? %>
+
+ <% if student_work.student_score.nil? %>
<% if student_work.work_status != 0 %>
<% if @homework.homework_detail_manual.comment_status < 2 %>
未参与
@@ -77,27 +77,29 @@
<% 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) %>
+ <% if !score_open %>
+ **
+ <% else %>
+ <%=format("%.1f",student_work.student_score) %>
+
+ (<%= student_work.student_works_scores.where(:reviewer_role => 3).group_by(&:user_id).count%>)
+
+
+
+
+ 现共有
+ <%= student_work.student_works_scores.where(:reviewer_role => 3).group_by(&:user_id).count%>
+ 名学生进行了匿评,平均分为
+ <%= format("%.1f",student_work.student_score)%> 分。
+
+ <% end %>
<% end %>
- <% unless student_work.student_score.nil?%>
-
- (<%= student_work.student_works_scores.where(:reviewer_role => 3).group_by(&:user_id).count%>)
-
-
-
-
- 现共有
- <%= student_work.student_works_scores.where(:reviewer_role => 3).group_by(&:user_id).count%>
- 名学生进行了匿评,平均分为
- <%= format("%.1f",student_work.student_score)%> 分。
-
- <% end%>
<% end %>
@@ -106,9 +108,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.nil? ? "--" : (!score_open ? "**" : 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..43742bf8d 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)%>
+
+ <%= student_work.system_score.nil? ? "--" : (!score_open ? "**" : 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/_student_work_score.html.erb b/app/views/student_work/_student_work_score.html.erb
index 3730c99fb..a8facff30 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 || @homework.homework_detail_manual.comment_status != 2 %>
+ <%= 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/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 @@
-
+
- <%= link_to l(:button_edit),edit_homework_common_path(activity, :hw_status => hw_status), :class => "postOptionLink"%>
+ <%= link_to l(:button_edit),edit_homework_common_path(activity, :hw_status => hw_status), :class => "wpostOptionLink"%>
- <%= link_to(l(:label_bid_respond_delete), homework_common_path(activity, :hw_status => hw_status),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "postOptionLink") %>
+ <%= link_to(l(:label_bid_respond_delete), homework_common_path(activity, :hw_status => hw_status),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "wpostOptionLink") %>
- <%= link_to("评分设置", score_rule_set_homework_common_path(activity,:user_activity_id => user_activity_id, :hw_status => hw_status),:class => "postOptionLink", :remote => true) %>
+ <%= link_to("评分设置", score_rule_set_homework_common_path(activity,:user_activity_id => user_activity_id, :hw_status => hw_status),:class => "wpostOptionLink", :remote => true) %>
<% if activity.anonymous_comment == 0 %>
- <%= link_to("匿评设置", start_evaluation_set_homework_common_path(activity,:user_activity_id => user_activity_id, :hw_status => hw_status),:class => "postOptionLink", :remote => true) if activity.homework_detail_manual.comment_status < 2%>
+ <%= link_to("匿评设置", start_evaluation_set_homework_common_path(activity,:user_activity_id => user_activity_id, :hw_status => hw_status),:class => "wpostOptionLink", :remote => true) if activity.homework_detail_manual.comment_status < 2%>
<%= homework_anonymous_comment activity,hw_status,user_activity_id %>
@@ -108,19 +108,22 @@
<% end %>
<% if activity.anonymous_comment == 0 && (comment_status == 0 || comment_status == 1)%>
- <%= link_to("禁用匿评", alert_forbidden_anonymous_comment_homework_common_path(activity,:user_activity_id => user_activity_id),:class => "postOptionLink",
+ <%= link_to("禁用匿评", alert_forbidden_anonymous_comment_homework_common_path(activity,:user_activity_id => user_activity_id),:class => "wpostOptionLink",
:title => "匿评是同学之间的双盲互评过程:每个同学将评阅系统分配给他/她的若干个作品", :remote => true)%>
<% end %>
<% if (activity.anonymous_comment == 1 && activity.is_open == 0) || (activity.anonymous_comment == 0 && comment_status == 3 && activity.is_open == 0) %>
- <%= link_to("公开作品", alert_open_student_works_homework_common_path(activity,:user_activity_id => user_activity_id, :hw_status => hw_status),:class => "postOptionLink", :remote => true)%>
+ <%= link_to("公开作品", alert_open_student_works_homework_common_path(activity,:user_activity_id => user_activity_id, :hw_status => hw_status),:class => "wpostOptionLink", :remote => true)%>
<% elsif activity.is_open == 1 %>
- <%= link_to("取消公开", alert_open_student_works_homework_common_path(activity,:user_activity_id => user_activity_id, :hw_status => hw_status),:class => "postOptionLink", :remote => true)%>
+ <%= link_to("取消公开", alert_open_student_works_homework_common_path(activity,:user_activity_id => user_activity_id, :hw_status => hw_status),:class => "wpostOptionLink", :remote => true)%>
<% end %>
+
+ <%= link_to("成绩公开范围", alert_score_open_modal_homework_common_path(activity,:user_activity_id => user_activity_id, :hw_status => hw_status),:class => "wpostOptionLink", :remote => true) %>
+
diff --git a/app/views/users/_join_course_course_message.html.erb b/app/views/users/_join_course_course_message.html.erb
index c69d66ad0..78a6f2ecd 100644
--- a/app/views/users/_join_course_course_message.html.erb
+++ b/app/views/users/_join_course_course_message.html.erb
@@ -1,11 +1,11 @@
<%= image_tag("/images/trustie_logo1.png", width: "30px", height: "30px", class: "mt3") %>
系统提示
- ">您有了新的课程成员申请:
+ ">您有了新的班级成员申请:
- <% content = User.find(ma.course_message_id).name+"申请成为课程\""+"#{Course.find(ma.course_id).name}"+"\"的"+"#{ma.content && ma.content.include?('9') ? "教师" : "教辅"}" %>
+ <% content = User.find(ma.course_message_id).name+"申请成为班级\""+"#{Course.find(ma.course_id).name}"+"\"的"+"#{ma.content && ma.content.include?('9') ? "教师" : "助教"}" %>
<%= link_to content, user_path(User.find(ma.course_message_id), :course_id => ma.course_id),
:class => "#{ma.viewed==0 ? "newsBlack" : "newsGrey"}", :target => '_blank', :title => "#{content}" %>
@@ -14,12 +14,13 @@
- <%= User.current.lastname + User.current.firstname %>老师您好!您有了新的课程成员申请,信息如下:
+ <%= User.current.lastname + User.current.firstname %>老师您好!您有了新的班级成员申请,信息如下:
真实姓名:<%= User.find(ma.course_message_id).realname %>
-
申请课程:<%= Course.find(ma.course_id).name%>
-
课程描述:
-
<%= Course.find(ma.course_id).description.html_safe if Course.find(ma.course_id).description %>
申请职位:<%=ma.content && ma.content.include?('9') ? "教师" : "教辅"%>
+
申请班级:<%= Course.find(ma.course_id).name%>
+
班级描述:
+
<%= Course.find(ma.course_id).description.html_safe if Course.find(ma.course_id).description %>
+
申请职位:<%=ma.content && ma.content.include?('9') ? "教师" : "助教"%>
diff --git a/app/views/users/_my_issue_list.html.erb b/app/views/users/_my_issue_list.html.erb
index e214a27ed..29e4c9264 100644
--- a/app/views/users/_my_issue_list.html.erb
+++ b/app/views/users/_my_issue_list.html.erb
@@ -9,7 +9,7 @@
diff --git a/app/views/users/_project_boardlist.html.erb b/app/views/users/_project_boardlist.html.erb
index dbc0b3992..c18b003d2 100644
--- a/app/views/users/_project_boardlist.html.erb
+++ b/app/views/users/_project_boardlist.html.erb
@@ -2,6 +2,7 @@
讨论区列表
+ <% if topics.any? %>
排序:
<%= link_to "时间", {:controller => 'boards', :action => 'index', :type => @type, :sort => @b_sort, :order => 1 }, :class => "sortTxt", :remote => true %>
@@ -15,7 +16,6 @@
- <% if topics.any? %>
<% topics.each do |activity| %>
- <% else %>
-
<%= l(:label_no_data) %>
- <% end %>
+ <% else %>
+ <%= render :partial => "projects/no_data" %>
+ <% end %>