Conflicts:
	db/schema.rb
This commit is contained in:
cxt 2016-12-06 14:12:40 +08:00
commit 5bbe9e71ba
80 changed files with 697 additions and 395 deletions

View File

@ -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'

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -0,0 +1,3 @@
class ProfessionalLevel < ActiveRecord::Base
attr_accessible :level
end

View File

@ -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

View File

@ -15,9 +15,15 @@
</div>
<% hero_homework_scores.each do |student_score| %>
<% if student_score.score.to_i != 0 %>
<li> <a href="javascript:void:(0);"><%=link_to image_tag(url_to_avatar(student_score.user), :width => "35", :height => "35", :class=> "rankPortrait"),user_path(student_score.user) %></a>
<p><a href="javascript:void:(0);"><%=link_to student_score.user.show_name, user_path(student_score.user), :title => student_score.user.show_name %></a></p>
<p><span class="c_red" style="cursor:pointer" ><%= student_score.score<0 ? 0 : student_score.score.to_i %></span></p>
<li> <a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(student_score.user), :width => "35", :height => "35", :class=> "rankPortrait"),user_path(student_score.user) %></a>
<p><a href="javascript:void(0);"><%=link_to student_score.user.show_name, user_path(student_score.user), :title => student_score.user.show_name %></a></p>
<p><span class="c_red" style="cursor:pointer" >
<% 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 %>
</span></p>
</li>
<% end %>
<% end %>

View File

@ -86,22 +86,32 @@
<span class="sy_class_users_st_num" title="<%= user.user_extensions.student_id %>"><%= user.user_extensions.student_id %></span>
</td>
<td>
<%= 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) %>
<a>**</a>
<% else %>
<%= link_to format("%0.2f", hw_score), {
:action => 'show_member_score',
:member_id => member.id,
:remote => true},
:class => "" %>
<% end %>
</td>
<td><%= ex_score %></td>
<td>
<%= 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 => '' %>
</td>
<td class="pr">
<span class="sum_score_tip"><%= format("%0.2f", sum) %></span>
<span class="sum_score_tip">
<% if !is_teacher && User.current.id != member.user_id && course_has_score_open_common_homework(@course) %>
<a>**</a>
<% else %>
<%= format("%0.2f", sum) %>
<% end %>
</span>
<div class="sy_tips_box_inner undis" style="left: <%=is_teacher ? '230px' : '215px' %>; top: -60px; text-align: left;">
<span style="top: 75px;"></span>
<p >

View File

@ -36,7 +36,7 @@
<span class="c_grey fl mr15">测试时长:<%= exercise.time.nil? || exercise.time == -1 ? '不限' : exercise.time.to_s + "分钟" %></span>
<span class="c_grey fl mr15">截止时间:<%= exercise.end_time.nil? ? '未设置' : format_time(exercise.end_time) %></span>
<span class="c_grey fl mr15">发布时间:<%= exercise.publish_time.nil? ? '未设置' : format_time(exercise.publish_time) %></span>
<% if @is_teacher && exercise.exercise_status > 1 %>
<% if exercise.exercise_status > 1 %>
<span class="c_grey fl mr15">已提交:<span class="c_blue"><%= exercise.exercise_users.where("commit_status = 1").count %></span></span>
<span class="c_grey fl mr15">未提交:<span class="c_blue"><%= exercise.course.student.count - exercise.exercise_users.where("commit_status = 1").count %></span></span>
<% end %>

View File

@ -94,6 +94,7 @@
<%= render :partial => "files/tag_yun_project", :locals => {:tag_list => @tag_list,:project => @project, :tag_name => @tag_name}%>
</div>
<div class="cl"></div>
<% if @tip_all_attachments > 0 %>
<div class="re_con_top">
<p class="f_l fontBlue f_b f_14" id="tip_attachment_count">
<%= render :partial => "files/tip_attachment_count" %>
@ -124,5 +125,8 @@
<div id="course_list">
<%= render :partial => 'project_list',:locals => {project: @project, all_attachments: @all_attachments, sort:@sort, order:@order, project_attachments:@obj_attachments} %>
</div>
<% else %>
<%= render :partial => "projects/no_data" %>
<% end %>
</div>
<%# html_title(l(:label_attachment_plural)) -%>

View File

@ -0,0 +1,42 @@
<div id="muban_popup_box" style="width:400px;">
<div class="muban_popup_top">
<h3 class="fl">成绩公开范围</h3>
<a href="javascript:void(0);" class="muban_icons_close fr"></a>
<div class="cl"></div>
</div>
<%= 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|%>
<div class="muban_popup_con clear">
<div class="clear mt15 ml20">
<ul class="pro_newsetting_con fl">
<li class="mb10 clear">
<ul class="fl">
<li class="clear">
<label class="fl ml5">请选择作品成绩的公开范围</label>
</li>
<li class="clear ml20">
<input type="radio" class="fl" id="open_to_all" <%= @homework.score_open == 1 ? "checked" : "" %> value="1" name="score_open"/>
<label for="open_to_all" class="fl ml5 fontGrey2">成绩对所有学生可见</label>
</li>
<li class="clear ml20">
<input type="radio" class="fl" id="open_to_me" <%= @homework.score_open == 0 ? "checked" : "" %> value="0" name="score_open"/>
<label for="open_to_me" class="fl ml5 fontGrey2">成绩仅对自己可见</label>
</li>
</ul>
</li>
</ul>
<ul class="fl ml20">
<div class="popup_tip_box fontGrey2">
<em></em>
<span></span>
<p>老师和助教始终能看到所有成绩</p>
</div>
</ul>
<div class="cl"></div>
<a href="javascript:void(0);" class="fr sy_btn_blue mr20" onclick="$(this).parent().parent().parent().submit();">确定</a>
<a href="javascript:void(0);" class="fr sy_btn_grey mr5" onclick="hideModal();">取消</a>
</div>
</div>
<% end%>
</div>

View File

@ -17,6 +17,10 @@
<input type="text" name="absence_penalty" id="absence_penalty_num" placeholder="0-50" class="fl issues_calendar_input" value="<%= homework.homework_detail_manual.absence_penalty%>" onkeyup="check_late_penalty('absence_penalty_num')"/>
</li>
<li class="mb10 clear">
<input type="checkbox" class="fl ml100" id="no_anon_penalty" name="no_anon_penalty" <%=homework.homework_detail_manual.no_anon_penalty == 0 ? 'checked' : '' %> value="<%=homework.homework_detail_manual.no_anon_penalty%>"/>
<label class="pop_box_label fl ml10" for="no_anon_penalty" style="text-align: left; width: 120px;">扣分(不参加匿评)</label>
</li>
<li class="mb10 clear mt30">
<label class="pop_box_label fl">最终得分&nbsp;&nbsp;:&nbsp;</label>
<input type="radio" class="fl" value="1" id="teacher_score" name="teacher_priority"/><label for="teacher_score" class=" fl ml5">教师评分</label>
</li>
@ -38,7 +42,7 @@
</ul>
</li>
</ul>
<ul class="fl mt5 ml20" >
<ul class="fl ml20">
<div class="popup_tip_box fontGrey2 mb10">
<em></em>
<span></span>
@ -49,6 +53,11 @@
<span></span>
<p >请输入数值0-50</p>
</div>
<div class="popup_tip_box fontGrey2 mb10">
<em></em>
<span></span>
<p>匿评开启后提交的作品,未能参加<br/>匿评,按照全部缺评扣分</p>
</div>
<div class="popup_tip_box fontGrey2 mb10">
<em></em>
<span></span>

View File

@ -23,7 +23,7 @@
<label for="other_score" class="fl ml5">助教评分</label>
</li>
</ul>
<ul class="fl mt5 ml20" >
<ul class="fl ml20" >
<div class="popup_tip_box fontGrey2 mb10">
<em></em>
<span></span>

View File

@ -17,6 +17,10 @@
<input type="text" name="absence_penalty" id="absence_penalty_num" placeholder="0-50" class="fl w180" value="<%= homework.homework_detail_manual.absence_penalty%>" onkeyup="check_late_penalty('absence_penalty_num')"/>
</li>
<li class="mb10 clear">
<input type="checkbox" class="fl ml100" id="no_anon_penalty" name="no_anon_penalty" <%=homework.homework_detail_manual.no_anon_penalty == 0 ? 'checked' : '' %> value="<%=homework.homework_detail_manual.no_anon_penalty%>"/>
<label class="pop_box_label fl ml10" for="no_anon_penalty" style="text-align: left; width: 120px;">扣分(不参加匿评)</label>
</li>
<li class="mb10 clear mt30">
<label class="pop_box_label fl">最终得分&nbsp;&nbsp;:&nbsp;</label>
<input type="radio" class="fl" value="1" id="teacher_score" name="teacher_priority"/><label for="teacher_score" class=" fl ml5">教师评分</label>
</li>
@ -42,7 +46,7 @@
</ul>
</li>
</ul>
<ul class="fl ml20 mt5">
<ul class="fl ml20">
<div class="popup_tip_box fontGrey2 mb10">
<em></em>
<span></span>
@ -53,6 +57,11 @@
<span></span>
<p id="absence_penalty_notice" class="">请输入数值0-50</p>
</div>
<div class="popup_tip_box fontGrey2 mb10">
<em></em>
<span></span>
<p>匿评开启后提交的作品,未能参加<br/>匿评,按照全部缺评扣分</p>
</div>
<div class="popup_tip_box fontGrey2 mb10">
<em></em>
<span></span>

View File

@ -34,7 +34,7 @@
</ul>
</li>
</ul>
<ul class="fl ml20 mt5">
<ul class="fl ml20">
<div class="popup_tip_box fontGrey2 mb10">
<em></em>
<span></span>

View File

@ -0,0 +1,2 @@
var htmlvalue = "<%= escape_javascript(render :partial => 'homework_common/alert_score_open_modal') %>";
pop_box_new(htmlvalue, 400, 200);

View File

@ -0,0 +1,11 @@
hideModal();
<% if @hw_status != 5 %>
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_homework', :locals => {:activity => @homework,:user_activity_id =>@user_activity_id,:hw_status=>@hw_status}) %>");
<% if @user_activity_id != @homework.id %>
sd_create_editor_from_data(<%= @user_activity_id%>,"","100%", "UserActivity");
<% else %>
sd_create_editor_from_data(<%= @homework.id%>,"","100%", "<%=@homework.class.to_s%>");
<% end %>
<% else %>
$("#homework_post_brief").html("<%= escape_javascript(render :partial => 'student_work/homework_post_brief', :locals => {:homework => @homework, :is_teacher => @is_teacher}) %>");
<% end %>

View File

@ -4,7 +4,7 @@
</div>
<div class="clear">
<div>
<ul class="new_roadmap_nav fl" >
<ul class="new_roadmap_nav fl" style="margin-left: 0px">
<li class="new_roadmap_nav_hover" id="new_roadmap_nav_1" onclick="HoverLi(1);">
<%= link_to "所有<span class='new_roadmap_nav_taghover ml5' id='new_roadmap_num_1'>#{@issues_filter.count}</span>".html_safe, "", :remote => true, :class => "new_roadmap_type_nomal", :id => "new_roadmap_type_1", :id => "new_roadmap_type_1" %>
</li>

View File

@ -214,6 +214,9 @@
</div><!--issues_statistics end-->
<a href="<%= new_project_issue_path(@project)%>" class="sy_btn_green fr " >新建</a>
</div>
<% if @issues.empty? %>
<%= render :partial => "projects/no_data" %>
<% else %>
<% unless @project.enabled_modules.where("name = 'issue_tracking'").empty? %>
<%= form_tag({:controller => 'issues', :action => 'index', :project_id => @project},:remote=>'xls', :method => :get,:id=>"issue_query_form", :class => 'query_form') do %>
<%= hidden_field_tag 'set_filter', '1' %>
@ -236,7 +239,6 @@
<%= calendar_for('issue_create_date_start_show')%>
</div>
</div>
<div class="issues_con_list" style="position: relative;">
<ul id="issues_list_nav" >
<li id="issues_list_nav_1" onclick="HoverLi(1);all_reset_form();" class="issues_nav_hover">
@ -309,9 +311,7 @@
</div><!--issues_filter end-->
<% end %>
<% end %>
<% if @issues.empty? %>
<p class="nodata mt10"><%= l(:label_no_data) %></p>
<% else %>
<div id="issue_list">
<%= render :partial => 'issues/all_list', :locals => {:issues => @issues, :query => @query,:issue_pages=>@issue_pages,:issue_count=>@issue_count,:project=>@project,:subject=>@subject} %>
</div>

View File

@ -31,7 +31,7 @@
<%= render :partial => 'users/message_contents', :locals => {:comment => reply, :type => 'Memo', :user_activity_id => @memo.id}%>
</div>
<div class="homepagePostReplyContent break_word" style="margin-bottom:15px;" id="activity_description_<%= reply.id %>">
<p><%= reply.content.gsub(/script/, "script&nbsp").html_safe %></p>
<p><%= reply.content.gsub(/\/script/, "script").gsub(/script/, "&nbsp;script").html_safe %></p>
</div>
<div class="orig_reply mb10 mt-10">
<div class="reply">

View File

@ -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%>
<li title="<%= poll.polls_name %>">
<div style="width: 310px;float: left;">
<% 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 %>
<div>
<div title="<%= poll_name %>">
<div style="width: 600px;float: left;">
<% 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 %>
<span class="exercise_status_nop fl mt3"></span>
<% elsif poll.polls_status == 2 %>
<span class="exercise_status_pub fl mt3"></span>
<% else %>
<span class="exercise_status_end fl mt3"></span>
<% end%>
</div>
</div>
<div id="exercise_opr_<%=poll.id %>" class="none fr">
<a href="javascript:void(0)" onClick="delete_exercise(<%=poll.id %>);" title="删除试卷" class="ex_icon_de mt0"></a>
<% if poll.polls_status == 1 %>
<%= link_to '', edit_poll_path(poll.id), :title => "编辑试卷", :class => "ex_icon_edit mt0"%>
<% end%>
</div>
</div>
</li>
<div class="cl"></div>
<% if poll.polls_status == 1%>
<li class="pollsbtn fl ml10 pollsbtn_grey">统计结果</li>
<% elsif poll.polls_status == 2 || poll.polls_status == 3 %>
<li><%= link_to l(:label_statistical_results), statistics_result_poll_path(poll.id), :class => "pollsbtn fl ml10"%></li>
<% end%>
<div class="mt10">
<span class="c_grey fl mr15">创建时间:<%= format_time(poll.created_at) %></span>
<% if poll.polls_status > 1 %>
<span class="c_grey fl mr15">发布时间:<%= poll.published_at.nil? ? '未设置' : format_time(poll.published_at) %></span>
<% end %>
<% if poll.polls_status > 1 %>
<span class="c_grey fl mr15">答题:<span class="c_blue" title="已答学生数/未答学生数"><%= poll.poll_users.count %> / <%=@course.student.count %></span></span>
<% end %>
<% if poll.polls_status == 1 %>
<li><a href="javascript:" class="pollsbtn btn_pu fl ml5" onclick="poll_submit(<%= poll.id%>,<%= poll.polls_name.length %>);">发布问卷</a></li>
<% elsif poll.polls_status == 2%>
<li><a href="javascript:" class="pollsbtn btn_de fl ml5" onclick="republish_poll(<%= poll.id%>);">取消发布</a></li>
<% else%>
<li class="pollsbtn fl ml10 pollsbtn_grey" style="margin-left: 5px;" >发布问卷</li>
<% end%>
<% if poll.polls_status == 1 %>
<div><a href="javascript:" class="pollsbtn btn_pu fr ml10" onclick="poll_submit(<%= poll.id%>,<%= poll.polls_name.length %>,<%= index%>);">发布问卷</a></div>
<% elsif poll.polls_status == 2%>
<div><a href="javascript:" class="pollsbtn btn_de fr ml10" onclick="republish_poll(<%= poll.id%>, <%=index %>);">取消发布</a></div>
<% else%>
<div class="pollsbtn fr ml10 pollsbtn_grey ml10">发布问卷</div>
<% 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%>
<div class="pollsbtn fr ml10 pollsbtn_grey">统计结果</div>
<% elsif poll.polls_status == 2 || poll.polls_status == 3 %>
<div><%= link_to l(:label_statistical_results), statistics_result_poll_path(poll.id), :class => "pollsbtn fr ml10"%></div>
<% end%>
<% if poll.polls_status == 1 %>
<li><%= link_to l(:button_edit), edit_poll_path(poll.id), :class => "polls_de fr ml5"%></li>
<% else%>
<li class="polls_de_grey fr ml5" title="未发布的问卷才能进行编辑">编辑</li>
<% end%>
<% if poll.polls_status == 2 %>
<li><a class="pollsbtn fr ml10" onclick="close_poll(<%= poll.id%>, <%=index %>);" href="javascript:">关闭</a></li>
<% else %>
<li class="pollsbtn fr ml10 pollsbtn_grey" title="发布的问卷才能进行关闭">关闭</li>
<% end%>
<% if poll.polls_status == 2 %>
<li><a class="polls_de fr ml5" onclick="close_poll(<%= poll.id%>);" href="javascript:">关闭</a></li>
<% else %>
<li class="polls_de_grey fr ml5" title="发布的问卷才能进行关闭">关闭</li>
<% end%>
<% if poll.polls_status == 1%>
<li class="polls_de_grey fr ml5">导出</li>
<% elsif poll.polls_status == 2 || poll.polls_status == 3 %>
<li><%= link_to "导出", export_poll_poll_path(poll.id,:format => "xls"), :class => "polls_de fr ml5"%></li>
<% end%>
<li class="polls_date fr"><%= format_date poll.created_at.to_date%></li>
<% if poll.polls_status == 1%>
<li class="pollsbtn fr ml10 pollsbtn_grey">导出</li>
<% elsif poll.polls_status == 2 || poll.polls_status == 3 %>
<li><%= link_to "导出", export_poll_poll_path(poll.id,:format => "xls"), :class => "pollsbtn fr ml10"%></li>
<% end%>
<div class="clear"></div>
</div>
<% else%>
<% if poll.polls_status == 2%>
<% if has_commit%>
<li><%= link_to poll_name, poll_result_poll_path(poll.id), :class => "polls_title polls_title_st fl c_dblue" %></li>
<li class="pollsbtn_tip fl ml5">已答</li>
<%else%>
<%= link_to poll_name, poll_path(poll.id), :class => "polls_title polls_title_st fl c_dblue"%>
<%end%>
<div>
<% 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"%>
<span class="exercise_status_com fl ml5"></span>
<%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"%>
<span class="exercise_status_nocom fl ml5"></span>
<%end%>
</div>
<div class="cl"></div>
<div class="mt10">
<span class="c_grey fl mr15">发布时间:<%= format_time(poll.published_at) %></span>
<span class="c_grey fl mr15">答题:<span class="c_blue" title="已答学生数/未答学生数"><%= poll.poll_users.count %> / <%=@course.student.count %></span></span>
<% if poll.show_result == 1 %>
<% if has_commit%>
<li><%= link_to l(:label_statistical_results), statistics_result_poll_path(poll.id), :class => "pollsbtn fr"%></li>
<%else%>
<li class="pollsbtn fr pollsbtn_grey" title="请先提交问卷再查看统计结果">统计结果</li>
<%end%>
<% end %>
<div class="clear"></div>
</div>
<% end%>
<li class="polls_date fr mr10"><%= format_date poll.created_at.to_date%></li>
<% if poll.show_result == 1 %>
<% if has_commit%>
<li><%= link_to l(:label_statistical_results), statistics_result_poll_path(poll.id), :class => "pollsbtn fr mr10"%></li>
<%else%>
<li class="pollsbtn fr mr10 pollsbtn_grey" title="请先提交问卷再查看统计结果">统计结果</li>
<%end%>
<% end %>
<% end%>

View File

@ -1,4 +1,4 @@
<div class="polls_head">
<div class="polls_head" style="width:730px;">
<h2>所有问卷
<span><%= @obj_count%></span>
</h2>

View File

@ -1,6 +1,6 @@
<% polls.each do |poll|%>
<ul id="polls_<%= poll.id %>" class="polls_list_ul">
<%= render :partial => 'poll', :locals => {:poll => poll} %>
<% polls.each_with_index do |poll, i|%>
<ul id="polls_<%= poll.id %>" class="exercise_list_div" onmouseover="$('#exercise_opr_<%=poll.id %>').show();" onmouseout="$('#exercise_opr_<%=poll.id %>').hide();">
<%= render :partial => 'poll', :locals => {:poll => poll, :index => i} %>
</ul>
<div class="cl"></div>
<% end%>

View File

@ -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("关闭成功");

View File

@ -1 +1,2 @@
hideModal();
$("#polls").html("<%= escape_javascript(render :partial => 'poll_list') %>");

View File

@ -1,13 +1,13 @@
<%= stylesheet_link_tag 'polls', :media => 'all' %>
<script type="text/javascript">
function republish_poll(poll_id)
function republish_poll(poll_id, index)
{
$('#ajax-modal').html("<div id='popbox02'>" +
"<div class='upload_con'>" +
"<div class='upload_box'>" +
"<p class='polls_box_p'>取消发布后问卷统计结果将会被清空<br />是否确定取消发布该问卷?</p>" +
"<div class='polls_btn_box'>" +
"<a href='/poll/"+ poll_id +"/republish_poll' class='upload_btn' onclick='clickCanel();' data-remote='true'>确&nbsp;&nbsp;定</a>" +
"<a href='/poll/"+ poll_id +"/republish_poll?index=" + index +"' class='upload_btn' onclick='clickCanel();' data-remote='true'>确&nbsp;&nbsp;定</a>" +
"<a class='upload_btn upload_btn_grey' onclick='clickCanel();'>取&nbsp;&nbsp;消</a>" +
"</div>" +
"<div class='cl'></div>" +
@ -26,7 +26,7 @@
function clickCanel(){hideModal("#popbox02");}
function poll_submit(poll_id,poll_name)
function poll_submit(poll_id,poll_name,index)
{
if(poll_name == 0)
{
@ -39,7 +39,7 @@
"<div class='upload_box'>" +
"<p class='polls_box_p'>问卷发布后将不能对问卷进行修改,<br />是否确定发布该问卷?</p>" +
"<div class='polls_btn_box'>" +
"<a href='/poll/"+ poll_id +"/publish_poll' class='upload_btn' onclick='clickCanel();' data-remote='true'>确&nbsp;&nbsp;定</a>" +
"<a href='/poll/"+ poll_id +"/publish_poll?index=" + index + "' class='upload_btn' onclick='clickCanel();' data-remote='true'>确&nbsp;&nbsp;定</a>" +
"<a class='upload_btn upload_btn_grey' onclick='clickCanel();'>取&nbsp;&nbsp;消</a>" +
"</div>" +
"<div class='cl'></div>" +
@ -57,14 +57,14 @@
}
}
function close_poll(poll_id)
function close_poll(poll_id, index)
{
$('#ajax-modal').html("<div id='popbox02'>" +
"<div class='upload_con'>" +
"<div class='upload_box'>" +
"<p class='polls_box_p'>问卷关闭后学生将不能继续提交问卷,<br />是否确定关闭该问卷?</p>" +
"<div class='polls_btn_box'>" +
"<a href='/poll/"+ poll_id +"/close_poll' class='upload_btn' onclick='clickCanel();' data-remote='true'>确&nbsp;&nbsp;定</a>" +
"<a href='/poll/"+ poll_id +"/close_poll?index=" + index +"' class='upload_btn' onclick='clickCanel();' data-remote='true'>确&nbsp;&nbsp;定</a>" +
"<a class='upload_btn upload_btn_grey' onclick='clickCanel();'>取&nbsp;&nbsp;消</a>" +
"</div>" +
"<div class='cl'></div>" +
@ -81,13 +81,20 @@
$('#ajax-modal').parent().addClass("popbox_polls");
}
function delete_exercise(id){
var htmlvalue = '<div id="muban_popup_box" style="width:300px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
'<div class="clear mt15"><p class="text_c f14">您是否确定删除</p><div class="cl"></div><a href="/poll/'+ id +'" class="fr sy_btn_blue mr90 mt10" data-method="delete" data-remote="true">确定</a>'+
'<a href="javascript:void(0);" class="fr sy_btn_grey mt10 mr10" onclick="hideModal();">取消</a></div></div>';
pop_box_new(htmlvalue, 300, 140);
}
function closeModal()
{
hideModal($("#popbox_upload"));
}
</script>
<div class="courseRSide fl">
<div class="polls_content02" id="polls">
<div id="polls">
<%= render :partial => 'poll_list'%>
</div><!--问卷内容end-->
</div>

View File

@ -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');

View File

@ -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');

View File

@ -1,4 +1,4 @@
<div class="pro_new_info mb10">
<div class="pro_new_info">
<div class="icons_tishi"><img src="/images/new_project/icons_smile.png" width="110" height="110" alt=""></div>
<p class="sy_tab_con_p ">没有数据可供显示!</p>
</div>

View File

@ -1,3 +1,4 @@
<% if @forked_count > 0 %>
<div class="pro_new_info mb10">
<h2 class="clear">成员<span class="fr pro_new_font mr15" >本页面展示Fork了 <%= link_to @project.owner.try(:show_name), user_path(@project.owner) %>/<%= link_to @project.name, project_path(@project) %> 的用户</span></h2>
<ul class="clear pro_new_users_box">
@ -24,4 +25,8 @@
</div>
<div class="cl"></div>
</div>
<% else %>
<div class="mb10">
<%= render :partial => "projects/no_data" %>
</div>
<% end %>

View File

@ -1,3 +1,4 @@
<% if @watchers.count > 0 %>
<div class="pro_new_info mb10">
<h2 class="clear">成员<span class="fr pro_new_font mr15" > 本页面展示关注了 <%= link_to @project.owner.try(:show_name), user_path(@project.owner) %>/<%= link_to @project.name, project_path(@project) %> 的用户</span></h2>
<ul class="clear pro_new_users_box">
@ -24,6 +25,11 @@
</div>
<div class="cl"></div>
</div>
<% else %>
<div class="mb10">
<%= render :partial => "projects/no_data" %>
</div>
<% end %>

View File

@ -22,7 +22,8 @@
<p class=" fl c_grey pro_new_grey">
1.长度必须在1到254个字符之间<br/>
2.仅限使用小写字母a-z、数字、破折号-和下划线_<br>
3.一旦保存,标识无法修改
3.一旦保存,标识无法修改<br>
4.版本库名不能是纯数字
</p>
</li>
</ul>

View File

@ -16,6 +16,15 @@
</ul>
</div>
<% end %>
<div style="text-align:center;">
<div class="pages" style="width:auto; display:inline-block;">
<ul id="homework_pository_ref_pages">
<%= pagination_links_full @pages, @count, :per_page_links => false, :remote => true, :flag => true, :is_new => true %>
</ul>
<div class="cl"></div>
</div>
</div>
<div class="cl"></div>

View File

@ -14,8 +14,17 @@
<div class="c_grey clear mt5">
<p class="fl">由 <%= 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) %>前</p>
<span class="fl ml10"><%= time_tag(request.updated_at) %>前更新</span>
<p class="fr"><%= find_gitlab_project(request.source_project_id)+"/"+request.source_branch %><span class="c_grey02 ml10 mr10">合并到</span><%= find_gitlab_project(request.target_project_id)+"/"+request.target_branch %></p>
<p class="fr"><%#= find_gitlab_project(request.source_project_id)+"/"+request.source_branch %><span class="c_grey02 ml10 mr10">合并到</span><%#= find_gitlab_project(request.target_project_id)+"/"+request.target_branch %></p>
</div>
</div>
<% end %>
<div style="text-align:center;">
<div class="pages" style="width:auto; display:inline-block;">
<ul id="homework_pository_ref_pages">
<%= pagination_links_full @pages, @count, :per_page_links => false, :remote => true, :flag => true, :is_new => true%>
</ul>
<div class="cl"></div>
</div>
</div>
<div class="cl"></div>
<% end %>

View File

@ -21,7 +21,10 @@
<div class="c_grey clear mt5">
<p class="fl">由 <%= link_to @request.author.try(:username), user_path(get_user_by_login_and(@request.author.try(:username))), :class => "linkBlue2" %>于 <%= format_time(@request.created_at) %> 创建</p>
<span class="fl ml10">最近更新:<%= format_time(@request.updated_at) %></span>
<p class="fr"><%= @request.source_branch %><span class="c_grey02 ml10 mr10">合并到</span><%= @request.target_branch %></p>
<p class="fr">
<%= find_gitlab_project(@request.source_project_id)+"/"+@request.source_branch %><span class="c_grey02 ml10 mr10">合并到</span><%= find_gitlab_project(@request.target_project_id)+"/"+@request.target_branch %>
</p>
</div>
</div>
</div>

View File

@ -28,16 +28,6 @@
<!--</div>-->
<div id="pull_requests_list">
<%= render "pull_requests/pull_requests_list" %>
<div style="text-align:center;">
<div class="pages" style="width:auto; display:inline-block;">
<ul id="homework_pository_ref_pages">
<%= pagination_links_full @pages, @count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true%>
</ul>
<div class="cl"></div>
</div>
</div>
<div class="cl"></div>
</div>
</div>
<script>
@ -62,6 +52,8 @@
</script>
<% else %>
<div class="mb10">
<%= render :partial => "projects/no_data" %>
</div>
<% end %>

View File

@ -12,4 +12,7 @@
<time class="time_ago js-timeago" title="<%= changeset.created_at %>"><%= time_tag(changeset.created_at) %> 前</time>&nbsp;
</div>
<% end %>
<% if params[:action] == "commit_diff" %>
<div class="fr">Commit<a class="ml5" style="color: #3498db"><%= changeset.id %></a></div>
<% end %>
</div>

View File

@ -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 %>
<table class="list changesets">
<!--<thead><tr>-->
<!--<th>#</th>-->
<!--<th></th>-->
<!--<th></th>-->
<!--<th><%= l(:label_date) %></th>-->
<!--<th><%= l(:field_author) %></th>-->
<!--<th><%= l(:field_comments) %></th>-->
<!--</tr></thead>-->
<tbody>
<% show_diff = revisions.size > 1 %>
<% line_num = 1 %>
<% revisions.each do |changeset| %>
<div class="col-md-10 col-sm-12">
<ul class="bordered-list">
<li class="commit js-toggle-container">
<%= render :partial => 'commit_details', :locals => {:changeset => changeset} %>
<div style="padding-left:30px;" class="commit-row-title">
<strong class="str-truncated">
<a class="commit-row-message"><%= textilizable(truncate_at_line_break(changeset.message)) %></a>
</strong>
<div class="pull-right" title="修订号">
<%= link_to truncate(changeset.short_id.to_s, :length => 20), {:controller => 'repositories', :action => 'commit_diff', :id => project.id, :changeset => changeset.id} %>
</div>
<div class="notes_count">
</div>
</div>
</li>
</ul>
</div>
<% end %>
</tbody>
</table>
<p style="padding-top: 10px;">
<%#= submit_tag(l(:label_view_diff), :name => nil, :class=>"c_blue") if show_diff %>
</p>
<ul class="wlist">
<%= pagination_links_full commits_pages, commits_count, :per_page_links => false, :remote => false, :flag => true %>
</ul>
<% @commits.chunk { |c| format_date(c.created_at).to_date }.each do |day, commits| %>
<div class="pullreques_pullbox">
<div class="pullreques_pull_top clear">
<p class="fl c_grey ml15"><%= day %></p>
<p class="fr c_green mr15"><%= commits.count %>个提交</p>
</div>
<ul class="pullreques_pull_list">
<% commits.each do |commit| %>
<li class="clear">
<span class="fl c_grey ml15 "><%= time_tag(commit.created_at) %>前</span>
<%= 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" %>
<p class="pullreques_pull_txt ml10 fl"><%= commit.title %></p>
<%= 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" %>
</li>
<% end %>
</ul>
</div>
<% end %>

View File

@ -1,26 +1,38 @@
<%= call_hook(:view_repositories_show_contextual, { :repository => @repository, :project => @project }) %>
<div class="wrap-big">
<div class="project_r_h">
<%= render :partial => "top" %>
<div class="new_roadmap_conbox mb10" >
<div class=" clear">
<ul class="reply-container-branch fl" >
<%= render :partial => 'navigation' %>
</ul>
</div>
<% @commits.chunk { |c| format_date(c.created_at).to_date }.each do |day, commits| %>
<div class="pullreques_pullbox">
<div class="pullreques_pull_top clear">
<p class="fl c_grey ml15"><%= day %></p>
<p class="fr c_green mr15"><%= commits.count %>个提交</p>
</div>
<ul class="pullreques_pull_list">
<% commits.each do |commit| %>
<li class="clear">
<span class="fl c_grey ml15 "><%= time_tag(commit.created_at) %>前</span>
<%= 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" %>
<p class="pullreques_pull_txt ml10 fl"><%= commit.title %></p>
<%= 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" %>
</li>
<% end %>
</ul>
</div>
<% end %>
<div class="repository_con " style="line-height:1.9;">
<%= render :partial => 'navigation' %>
<div class="cl"></div>
</div>
<%= render :partial => 'link_to_functions' %>
<%= render_properties(@properties) %>
<div class="mt10">
<%= render(:partial => 'revisions', :locals => {:project => @project, :path => @path , :revisions => @commits, :entry => @entry , :commits_pages => @commits_pages , :commits_count => @commits_count}) unless @commits.empty? %>
<div style="text-align:center;">
<div class="pages" style="width:auto; display:inline-block;">
<ul id="homework_pository_ref_pages">
<%= pagination_links_full @commits_pages, @commits_count, :per_page_links => false, :remote => false, :flag => true, :is_new => true %>
</ul>
<div class="cl"></div>
</div>
</div>
<div class="cl"></div>
<% 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)) -%>
</div>
</div>

View File

@ -1,16 +1,27 @@
<div class="container-big">
<div class="project_r_h">
<%= render :partial => "top" %>
<div class="new_roadmap_conbox mb10" >
<div class="new_roadmap_info_top clear ">
<%= link_to "<span class='new_roadmap_icons_back mr5'></span>返回提交历史".html_safe, {:action => 'changes', :path => to_path_param(@path), :id => @project, :repository_id => @repository.identifier_param, :rev => @rev, :page => 1}, :class => "fl linkBlue2 mt3" %>
<!--<a href="javascript:void(0);" class="fl linkBlue2 mt3" ><span class="new_roadmap_icons_back mr5"></span>返回提交历史</a>-->
</div>
<div class="clear new_roadmap_listbox_commit">
<div class="c_grey02 mb10">
<p><%= @commit_details.message %></p>
</div>
<!--<div class=" clear mb10">-->
<!--<p class="fb">关联Issue:</p>-->
<!--<a href="javascript:void(0);" class="btn-small fl mr10">#123</a>-->
<!--<a href="javascript:void(0);" class="btn-small fl mr10">#123</a>-->
<!--<a href="javascript:void(0);" class="btn-small fl mr10">#123</a>-->
<!--</div>-->
<li class="commit js-toggle-container">
<%= render :partial => 'commit_details', :locals => {:changeset => @commit_details} %>
</li>
</div>
</div>
<div class="showing-changes-info fontGrey2"> Commit <a href="javascript:void(0);" class="linkGrey3">
<%= @commit_details.id %></a><br />
<li class="commit js-toggle-container">
<%= render :partial => 'commit_details', :locals => {:changeset => @commit_details} %>
</li>
</div>
<div class="showing-changes-project f14"><%= @commit_details.message %></div>
<% @commit_diff.each do |commit_diff| %>
<div class="showing-changes-row fontGrey2">
<div class="showing-changes-row-commit fontGrey2">
<a href="javascript:void(0);" class="linkGrey3" id="changed-files">
<img src="/images/vlicon/file.png" width="18" height="20" style="vertical-align:middle;" class="mr5" /><%= commit_diff.new_path %>
</a>

View File

@ -30,7 +30,8 @@
</th>
</tr>
<% @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}%>
<tr>
<td colspan="12">
<div id="about_hwork_<%= student_work.id%>" class="about_hwork">

View File

@ -21,49 +21,59 @@
</span>
<% end %>
<div class="flex-container fl" style="width:340px;">
<div class="flex-cell student_work_<%= st.id%>"><span class="<%= score_color st.teacher_score%>"><%= st.teacher_score.nil? ? "--" : format("%.1f",st.teacher_score)%></span></div>
<div class="flex-cell student_work_<%= st.id%>"><span class="<%= score_color st.teaching_asistant_score%>"><%= st.teaching_asistant_score.nil? ? "--" : format("%.1f",st.teaching_asistant_score)%></span></div>
<div class="flex-cell student_work_<%= st.id%>">
<span class="<%= score_color (!score_open || st.teacher_score.nil? ? nil : st.teacher_score) %>">
<%= st.teacher_score.nil? ? "--" : (!score_open ? "**" : format("%.1f",st.teacher_score))%>
</span>
</div>
<div class="flex-cell student_work_<%= st.id%>">
<span class="<%= score_color (!score_open || st.teaching_asistant_score.nil? ? nil : st.teaching_asistant_score) %>">
<%= st.teaching_asistant_score.nil? ? "--" : (!score_open ? "**" : format("%.1f",st.teaching_asistant_score))%>
</span>
</div>
<% if @homework.anonymous_comment == 0 %>
<div class="flex-cell student_work_<%= st.id%>">
<div class="<%= score_color st.student_score%> student_score_info pr">
<div class="<%= score_color (!score_open || st.student_score.nil? ? nil : st.student_score)%> student_score_info pr">
<% 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 %>
<span title="尚未开启匿评">未参与</span>
<% elsif @homework.homework_detail_manual.comment_status == 2 && work.student_works_evaluation_distributions.count != 0 %>
<span title="匿评期间,尚未获得他人匿评">待匿评</span>
<% elsif @homework.homework_detail_manual.comment_status == 3 && work.student_works_evaluation_distributions.count != 0 %>
<span title="匿评已截止,未获得他人匿评">评分</span>
<span title="匿评已截止,未获得他人匿评">评分</span>
<% else %>
<span title="匿评开启后提交的作品,不参加匿评">迟交</span>
<% end %>
<% else %>
<%= format("%.1f", st.student_score) %>
<% end %>
<% unless st.student_score.nil? %>
<span class="linkBlue">
(<%= anon_count %>)
</span>
<div class="g_infoNi none">
现共有
<span class="c_red">&nbsp;<%= anon_count %>&nbsp;</span>
名学生进行了匿评,平均分为
<span class="c_red">&nbsp;<%= format("%.1f", st.student_score) %>&nbsp;</span>分。
</div>
<% if !score_open %>
<span title="">**</span>
<% else %>
<%= format("%.1f", st.student_score) %>
<span class="linkBlue">
(<%= anon_count %>)
</span>
<div class="g_infoNi none">
现共有
<span class="c_red">&nbsp;<%= anon_count %>&nbsp;</span>
名学生进行了匿评,平均分为
<span class="c_red">&nbsp;<%= format("%.1f", st.student_score) %>&nbsp;</span>分。
</div>
<% end %>
<% end %>
</div>
</div>
<% end %>
<div class="flex-cell">
<% score = st.work_score %>
<div class="<%= score_color score%> student_final_scor_info pr" style="display: inline">
<%= score.nil? ? "--" : format("%.1f",score<0 ? 0 : score)%>
<% unless score.nil?%>
<div class="<%= score_color (!score_open || score.nil? ? nil : score)%> student_final_scor_info pr" style="display: inline">
<%= score.nil? ? "--" : (!score_open ? "**" : format("%.1f",score<0 ? 0 : score))%>
<% unless !score_open || score.nil?%>
<div class="score-tip none tl" style="line-height: 18px; top:-32px; right:-273px;">
<em></em>
<font></font>

View File

@ -75,7 +75,8 @@
</tr>
<%# 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} %>
<tr>
<td colspan="12">
<div id="about_hwork_<%= student_work.id %>" class="about_hwork">

View File

@ -52,23 +52,23 @@
<%=get_status student_work.work_status %>
<% end %>
</td>
<td class="hworkList70 <%= score_color student_work.teacher_score%>">
<%= student_work.teacher_score.nil? ? "--" : format("%.1f",student_work.teacher_score)%>
<td class="hworkList70 <%= score_color (!score_open || student_work.teacher_score.nil? ? nil : student_work.teacher_score)%>">
<%= student_work.teacher_score.nil? ? "--" : (!score_open ? "**" : format("%.1f",student_work.teacher_score))%>
</td>
<td class="hworkList70 <%= score_color student_work.teaching_asistant_score%>">
<%= student_work.teaching_asistant_score.nil? ? "--" : format("%.1f",student_work.teaching_asistant_score)%>
<td class="hworkList70 <%= score_color (!score_open || student_work.teaching_asistant_score.nil? ? nil : student_work.teaching_asistant_score)%>">
<%= student_work.teaching_asistant_score.nil? ? "--" : (!score_open ? "**" : format("%.1f",student_work.teaching_asistant_score)) %>
</td>
<% if @homework.homework_type == 2%>
<!-- 系统评分 -->
<td class="hworkList70 <%= score_color student_work.system_score%>">
<%= student_work.system_score.nil? ? "--" : format("%.1f",student_work.system_score)%>
<td class="hworkList70 <%= score_color (!score_open || student_work.system_score.nil? ? nil : student_work.system_score)%>">
<%= student_work.system_score.nil? ? "--" : (!score_open ? "**" : format("%.1f",student_work.system_score))%>
</td>
<% end%>
<% if @homework.anonymous_comment == 0%>
<td class="hworkList70 <%= score_color student_work.student_score%> student_score_info pr">
<% if student_work.student_score.nil? %>
<td class="hworkList70 <%= score_color (!score_open || student_work.student_score.nil? ? nil : student_work.student_score)%> student_score_info pr">
<% if student_work.student_score.nil? %>
<% if student_work.work_status != 0 %>
<% if @homework.homework_detail_manual.comment_status < 2 %>
<span title="尚未开启匿评">未参与</span>
@ -77,27 +77,29 @@
<% elsif @homework.homework_detail_manual.comment_status == 2 && student_work.student_works_evaluation_distributions.count != 0 %>
<span title="匿评期间,尚未获得他人匿评">待匿评</span>
<% elsif @homework.homework_detail_manual.comment_status == 3 && student_work.student_works_evaluation_distributions.count != 0 %>
<span title="匿评已截止,未获得他人匿评">评分</span>
<span title="匿评已截止,未获得他人匿评">评分</span>
<% end %>
<% else %>
<span title="">--</span>
<% end %>
<% else %>
<%=format("%.1f",student_work.student_score) %>
<% if !score_open %>
<span title="">**</span>
<% else %>
<%=format("%.1f",student_work.student_score) %>
<span class="linkBlue">
(<%= student_work.student_works_scores.where(:reviewer_role => 3).group_by(&:user_id).count%>)
</span>
<div class="anonymous-tip none">
<em></em>
<font></font>
现共有
<span class="c_red">&nbsp;<%= student_work.student_works_scores.where(:reviewer_role => 3).group_by(&:user_id).count%>&nbsp;</span>
名学生进行了匿评,平均分为
<span class="c_red">&nbsp;<%= format("%.1f",student_work.student_score)%>&nbsp;</span>分。
</div>
<% end %>
<% end %>
<% unless student_work.student_score.nil?%>
<span class="linkBlue">
(<%= student_work.student_works_scores.where(:reviewer_role => 3).group_by(&:user_id).count%>)
</span>
<div class="anonymous-tip none">
<em></em>
<font></font>
现共有
<span class="c_red">&nbsp;<%= student_work.student_works_scores.where(:reviewer_role => 3).group_by(&:user_id).count%>&nbsp;</span>
名学生进行了匿评,平均分为
<span class="c_red">&nbsp;<%= format("%.1f",student_work.student_score)%>&nbsp;</span>分。
</div>
<% end%>
</td>
<% 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 %>
<td class="hworkList70 <%= score_color score%> student_final_scor_info pr">
<%= score.nil? ? "--" : format("%.1f",score<0 ? 0 : score)%>
<% unless score.nil?%>
<td class="hworkList70 <%= score_color (!score_open || score.nil? ? nil : score)%> student_final_scor_info pr">
<%= score.nil? ? "--" : (!score_open ? "**" : format("%.1f",score<0 ? 0 : score))%>
<% unless !score_open || score.nil?%>
<div class="score-tip none tl" style="line-height: 18px;">
<em></em>
<font></font>

View File

@ -80,8 +80,8 @@
<!-- 成绩 -->
<% if @homework.homework_type == 2%>
<!-- 系统评分 -->
<td class="hworkList70 <%= score_color student_work.system_score%>">
<%= student_work.system_score.nil? ? "--" : format("%.1f",student_work.system_score)%>
<td class="hworkList70 <%= score_color (!score_open || student_work.system_score.nil? ? nil : student_work.system_score)%>">
<%= student_work.system_score.nil? ? "--" : (!score_open ? "**" : format("%.1f",student_work.system_score))%>
</td>
<% end%>

View File

@ -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 %>
<div class="syllabus_class_box" id="student_work_<%= st.id%>" style="background-color:#fff;">
<%= 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} %>
</div>
<div id="about_hwork_<%= st.id %>" class="about_hwork"></div>
<% end %>

View File

@ -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" %>
<div class="ping_back_tit">
<a href="javascript:void(0);" class="c_blue 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" %>
</a>
<% 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),

View File

@ -1,6 +1,7 @@
<ul class="ping_box_ul <%= is_last ? '' : 'ping_line'%> fl">
<% 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 %>
<div class="pingBoxTit">
<%= 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" %>
<span class="ml5 fl">
@ -9,7 +10,7 @@
<% unless score.score.nil? %>
<span class="ml20 fl">评分:</span>
<a href="javascript:void(0);" class="c_orange fl" >
<%= score.score%>分
<%= show_real_score ? score.score : "**" %>分
</a>
<% end %>
<a href="javascript:void(0);" class="fr linkBlue mr5" onclick="$('#add_score_reply_<%= score.id%>').slideToggle();">回复</a>
@ -33,7 +34,8 @@
<div id="replay_histroy_<%= score.id%>">
<% 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%>
</div>
<div class="cl"></div>

View File

@ -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%>

View File

@ -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("回复内容不能为空");

View File

@ -88,19 +88,19 @@
<div class="homepagePostSetting">
<ul>
<li class="homepagePostSettingIcon">
<ul class="homepagePostSettiongText">
<ul class="whomepagePostSettiongText">
<li>
<%= 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"%>
</li>
<li>
<%= 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") %>
</li>
<li>
<%= 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) %>
</li>
<% if activity.anonymous_comment == 0 %>
<li>
<%= 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%>
</li>
<li>
<%= 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)%>
<li>
<%= 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)%>
</li>
<% end %>
<% if (activity.anonymous_comment == 1 && activity.is_open == 0) || (activity.anonymous_comment == 0 && comment_status == 3 && activity.is_open == 0) %>
<li>
<%= 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)%>
</li>
<% elsif activity.is_open == 1 %>
<li>
<%= 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)%>
</li>
<% end %>
<li>
<%= link_to("成绩公开范围", alert_score_open_modal_homework_common_path(activity,:user_activity_id => user_activity_id, :hw_status => hw_status),:class => "wpostOptionLink", :remote => true) %>
</li>
</ul>
</li>
</ul>

View File

@ -1,11 +1,11 @@
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><div class="navHomepageLogo fl"><%= image_tag("/images/trustie_logo1.png", width: "30px", height: "30px", class: "mt3") %></div></a></li>
<li class="homepageNewsPubType fl">
<span class="newsBlue homepageNewsPublisher">系统提示</span>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">您有了新的课程成员申请:</span>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">您有了新的班级成员申请:</span>
</li>
<li class="<%=(ma.status == 0 || ma.status.nil?) ? 'homepageHomeworkContent2' : 'homepageHomeworkContent' %> fl">
<a href="javascript:void(0);" class="newsGrey">
<% 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}" %>
<!--:onmouseover => "message_titile_show($(this),event)",-->
@ -14,12 +14,13 @@
</li>
<div style="display: none" class="message_title_red system_message_style">
<p>
<%= User.current.lastname + User.current.firstname %>老师您好!您有了新的课程成员申请,信息如下:
<%= User.current.lastname + User.current.firstname %>老师您好!您有了新的班级成员申请,信息如下:
</p>
<p>真实姓名:<%= User.find(ma.course_message_id).realname %></p>
<p>申请课程:<%= Course.find(ma.course_id).name%></p>
<div class="fl">课程描述:</div>
<div class="ml60"><%= Course.find(ma.course_id).description.html_safe if Course.find(ma.course_id).description %></div> <p>申请职位:<%=ma.content && ma.content.include?('9') ? "教师" : "教辅"%></p>
<p>申请班级:<%= Course.find(ma.course_id).name%></p>
<div class="fl">班级描述:</div>
<div class="ml60"><%= Course.find(ma.course_id).description.html_safe if Course.find(ma.course_id).description %></div>
<p>申请职位:<%=ma.content && ma.content.include?('9') ? "教师" : "助教"%></p>
</div>
<li class="<%=(ma.status == 0 || ma.status.nil?) ? 'homepageHomeworkContentWarn2' : 'homepageHomeworkContentWarn' %> fl">
<span id="deal_info_<%=ma.id%>">

View File

@ -9,7 +9,7 @@
</div>
<div class=" fl ml5">
<div class="issues_list_titlebox clear">
<a href="<%= issue_path(activity) %>" class="issues_list_title fl" target="_blank" title="<%= activity.subject.to_s %>"><%= activity.subject.to_s %></a>
<a href="<%= issue_path(activity) %>" class="issues_list_title fl" style="width: 320px" target="_blank" title="<%= activity.subject.to_s %>"><%= activity.subject.to_s %></a>
<div class="cl"></div>
</div>
<div class="issues_list_small">

View File

@ -2,6 +2,7 @@
<div id="project-boardlist">
<div class="container-big mt10" >
<p class="list-h2">讨论区列表</p>
<% if topics.any? %>
<div class="category">
<span class="grayTxt ">排序:</span>
<%= link_to "时间", {:controller => 'boards', :action => 'index', :type => @type, :sort => @b_sort, :order => 1 }, :class => "sortTxt", :remote => true %>
@ -15,7 +16,6 @@
<div class="cl"></div>
</div>
<div class="bloglistbox">
<% if topics.any? %>
<% topics.each do |activity| %>
<div class="list-file">
<div><span class="item_list fl"></span>
@ -59,11 +59,11 @@
</ul>
<div class="cl"></div>
</div>
<% else %>
<p class="nodata"><%= l(:label_no_data) %></p>
<% end %>
</div>
</div>
<% else %>
<%= render :partial => "projects/no_data" %>
<% end %>
</div>
<script type="text/javascript">
//如果右边的博客列表比左边的高度低则将右边的高度设为与左边对齐

View File

@ -194,24 +194,29 @@
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
</ul>
<% end %>
<!--
<%# if ma.forge_message_type == "PullRequest" %>
<% if ma.forge_message_type == "PullRequest" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl">
<a href="javascript:void(0);">
<%#=link_to image_tag(url_to_avatar(ma.forge_message.author), :width => "30", :height => "30"), user_path(ma.forge_message.author), :target => '_blank' %>
<% send_message_user = PullRequest.where(:pull_request_id => ma.forge_message_id) %>
<% author = User.find(ma.operate_user_id.nil? ? 2 : ma.operate_user_id) %>
<%= link_to image_tag(url_to_avatar(author), :width => "30", :height => "30"), user_path(author), :target => '_blank' %>
</a>
</li>
<li class="homepageNewsPubType fl">
<%#=link_to User.find(ma.forge_message.author).show_name, user_path(ma.forge_message.author),
:class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
<span class="<%#= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">创建了PullRequest</span>
<%= link_to User.find(author.id).show_name, user_path(author),
:class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">
<%= pull_request_message_status(ma) %>
</span>
</li>
<li class="homepageNewsContent fl">
<%#= link_to "#{ma.forge_message.commented.title}",
{:controller => 'news', :action => 'show', :id => ma.forge_message.commented.id },:class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", :target => '_blank' %>
<%= link_to "#{send_message_user[0].title}", project_pull_requests_path(ma.project_id),
:class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", :target => '_blank' %>
</li>
<li class="homepageNewsTime fl"><%#= time_tag(ma.created_at).html_safe %> </li>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
</ul>
<%# end %>-->
<% end %>
<% end %>

View File

@ -5,14 +5,14 @@
<div class="postContainer mb10">
<div class="postBanner" style="padding-bottom:5px;">
<span class="linkGrey2 f16">组织列表</span>
<a href="<%= new_organization_path %>" class="sy_btn_green fr" style="margin-top: -5px">新建组织</a>
<%#= form_tag url_for(:controller => 'users', :action => 'search_user_orgs', :id => User.current.id), :method => 'get', :id => "search_org_form", :class=>"resourcesSearchloadBox", :style=>"float:right; margin-top:-5px;" do %>
<!--<input type="text" name="search_orgs" placeholder="输入关键词进行搜索" class="searchResource" />-->
<!--&lt;!&ndash;<a href="javascript:void(0);" class="homepageSearchIcon" onclick="$('#search_org_form').submit();"></a>&ndash;&gt;-->
<!--<a href="javascript:void(0);" class="problem_search_btn fl" onclick="$('#search_org_form').submit();">搜索</a>-->
<!--<%# end %>-->
<div class="cl"></div>
</div>
<div id="org_list">
<% @orgs.each do |org| %>

View File

@ -19,9 +19,13 @@
<!-- <a href="javascript:void(0);" class="btn btn-green fr mr15 mt10"> 新建 </a>-->
<%= link_to "新建", new_project_version_path(@project, :is_create => true), :class => 'btn btn-green fr mr15 mt10', :remote => true %>
</div>
<div id="version_list">
<%= render :partial => "versions/list" %>
</div>
<% if @versions_count > 0 %>
<div id="version_list">
<%= render :partial => "versions/list" %>
</div>
<% else %>
<%= render :partial => "projects/no_data" %>
<% end %>
</div><!--new_roadmap end-->
<!--里程碑列表结束-->

View File

@ -39,7 +39,8 @@
</div>
</div>
</div>
<div class="new_roadmap_conbox mb10" >
<% if @version.issues_count > 0 %>
<div class="new_roadmap_conbox mb10" >
<div class=" clear">
<ul class="new_roadmap_nav fl" >
<li id="new_roadmap_nav_1" class="new_roadmap_nav_hover " onclick="HoverLi(1);">
@ -103,7 +104,13 @@
<!--缺陷列表结束-->
</div><!--new_roadmap_content_2 end-->
</div><!--new_roadmap end-->
<% else %>
<div class="mb10">
<%= render :partial => "projects/no_data" %>
</div>
<% end %>
<!--里程碑详情结束-->

View File

@ -313,6 +313,8 @@ RedmineApp::Application.routes.draw do
get 'start_evaluation_set'
get 'score_rule_set'
post 'set_evaluation_attr'
get 'alert_score_open_modal'
post 'set_score_open'
end
collection do

View File

@ -1,5 +0,0 @@
class AddStatusToPullRequests < ActiveRecord::Migration
def change
add_column :pull_requests, :status, :integer, :default => false
end
end

View File

@ -0,0 +1,5 @@
class AddTitilToPullRequsts < ActiveRecord::Migration
def change
add_column :pull_requests, :title, :string
end
end

View File

@ -0,0 +1,9 @@
class CreateProfessionalLevels < ActiveRecord::Migration
def change
create_table :professional_levels do |t|
t.string :level
t.timestamps
end
end
end

View File

@ -0,0 +1,5 @@
class AddNoAnonPenaltyToHomeworkManual < ActiveRecord::Migration
def change
add_column :homework_detail_manuals, :no_anon_penalty, :integer, :default => 1
end
end

View File

@ -0,0 +1,5 @@
class AddScoreOpenToHomework < ActiveRecord::Migration
def change
add_column :homework_commons, :score_open, :integer, :default => 1
end
end

View File

@ -0,0 +1,5 @@
class AddAperateIdtoForgeMessage < ActiveRecord::Migration
def change
add_column :forge_messages, :operate_user_id, :integer
end
end

View File

@ -80,31 +80,28 @@ namespace :homework_evaluation do
homework_detail_manuals.each do |homework_detail_manual|
homework_common = homework_detail_manual.homework_common
if homework_common.anonymous_comment == 0 && homework_detail_manual.comment_status == 2 #开启匿评状态才可关闭匿评
#计算缺评扣分
#计算缺评扣分 参与匿评
work_ids = "(" + homework_common.student_works.has_committed.map(&:id).join(",") + ")"
if homework_common.homework_type != 3
homework_common.student_works.has_committed.each do |student_work|
absence_penalty_count = student_work.user.student_works_evaluation_distributions.where("student_work_id IN #{work_ids}").count - student_work.user.student_works_scores.where("student_work_id IN #{work_ids} and reviewer_role = 3").count
student_work.absence_penalty = absence_penalty_count > 0 ? absence_penalty_count * homework_detail_manual.absence_penalty : 0
student_work.save
end
else
homework_common.student_works.has_committed.each do |student_work|
absence_penalty_count = student_work.user.student_works_evaluation_distributions.where("student_work_id IN #{work_ids}").count - student_work.user.student_works_scores.where("student_work_id IN #{work_ids} and reviewer_role = 3").count
student_work.absence_penalty = absence_penalty_count > 0 ? absence_penalty_count * homework_detail_manual.absence_penalty : 0
student_work.save
if student_work.absence_penalty != 0
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_common.student_works.where("user_id in #{user_ids}")
student_works.each do |st_work|
absence_penalty_count = st_work.user.student_works_evaluation_distributions.where("student_work_id IN #{work_ids}").count - st_work.user.student_works_scores.where("student_work_id IN #{work_ids} and reviewer_role = 3").count
st_work.absence_penalty = absence_penalty_count > 0 ? absence_penalty_count * @homework_detail_manual.absence_penalty : 0
st_work.save
end
homework_common.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_common.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_common.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
homework_detail_manual.update_column('comment_status', 3)
# 匿评关闭消息通知 给所有人发
course = homework_common.course

View File

@ -183,6 +183,7 @@ h4{ font-size:14px;}/*color:#3b3b3b;*/
.mw380 {max-width: 380px !important;}
.mw400 {max-width: 400px !important;}
.mw450 {max-width: 450px !important;}
.mw550 {max-width: 550px !important;}
.mt-20 {margin-top:-20px;}
.mt-10 {margin-top:-10px;}
.mt-4 {margin-top:-4px;}

View File

@ -594,9 +594,9 @@ a:hover.blueCir{ background:#3598db; color:#fff;}
.exercise_status_end{ display:block; width:33px; height:22px; background:url(/images/sy/icons_sy.png) 0 -659px no-repeat; color:#fff; font-size:12px; padding-left:10px; line-height: 22px;}
.exercise_status_com{ display:block; width:33px; height:22px; background:url(/images/sy/icons_sy.png) 0 -681px no-repeat; color:#fff; font-size:12px; padding-left:10px; line-height: 22px;}
.exercise_status_nocom{ display:block; width:33px; height:22px; background:url(/images/sy/icons_sy.png) 0 -705px no-repeat; color:#fff; font-size:12px; padding-left:10px; line-height: 22px;}
a.ex_icon_de{ background:url(/images/course/icons.png) 0px -342px no-repeat; width:16px; height:27px; display:block;float:right;}
a.ex_icon_de{ background:url(/images/course/icons.png) 0px -342px no-repeat; width:16px; height:25px; display:block;float:right;}
a:hover.ex_icon_de{ background:url(/images/course/icons.png) -20px -342px no-repeat;}
.ex_icon_edit{ background:url(/images/course/icons.png) 0px -276px no-repeat; width:16px; height:27px; display:block;float:right; margin-right:10px;}
.ex_icon_edit{ background:url(/images/course/icons.png) 0px -276px no-repeat; width:16px; height:25px; display:block;float:right; margin-right:10px;}
a:hover.ex_icon_edit{ background:url(/images/course/icons.png) -21px -276px no-repeat;}
/*首页课程列表归档按钮提示*/
@ -610,4 +610,4 @@ a:hover.ex_icon_edit{ background:url(/images/course/icons.png) -21px -276px no-
.grey_select{ background: #c3c3c3; font-size: 12px; color: #fff; padding: 5px 10px;}
a.question_choice_white{ background: #fff; color: #000000; width: 34px; height: 30px; border: 1px solid #ddd; text-align: center; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px;}
a.question_choice_blue{ background: #3b94d6; color: #fff; width: 34px; height: 30px; border: 1px solid #ddd; text-align: center; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px;}
.question_choice_dash{ background: #fff; color: #000000; width: 34px; height: 30px; border: 1px dashed #ddd; text-align: center; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px;}
.question_choice_dash{ background: #fff; color: #000000; width: 34px; height: 30px; border: 1px dashed #ddd; text-align: center; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px;}

View File

@ -399,6 +399,7 @@ tr.open span.expander {background-image: url(/images/bullet_toggle_minus.png);}
.showing-changes-info {width:710px; padding:10px; padding-top: 0px; background-color:#ffffff; line-height:2;}
.showing-changes-project {padding:10px; border-top:1px solid #dce0e6; border-bottom:1px solid #dce0e6; background-color:#f1f1f1;}
.showing-changes-row {padding:10px; border-bottom:1px solid #dce0e6; background-color:#f1f1f1;}
.showing-changes-row-commit {padding:10px; border:1px solid #dbdbdb; background-color:#f1f1f1;border-bottom: none}
#changed-files-detail {display:none;}
#changed-files-detail li {list-style-type:disc; margin-left:15px;}
.showing-changes-detail {width:670px; border-bottom:1px solid #dce0e6; background-color:#f1f1f1;}
@ -771,7 +772,7 @@ input.issues_calendar_input{ padding-left:5px; color:#444; border-right:none;}
.issues_list_box{ padding:15px; padding-right: 0px; border-bottom:1px dashed #c8c8c8;}
.issues_list_titlebox{ font-size:14px; font-weight:bold; margin-bottom:8px;}
a.issues_list_title{ color:#444; max-width:260px; overflow:hidden; text-overflow:ellipsis; -o-text-overflow:ellipsis; white-space:nowrap; }
a.issues_list_title{ color:#444; max-width:380px; overflow:hidden; text-overflow:ellipsis; -o-text-overflow:ellipsis; white-space:nowrap; }
a:hover.issues_list_title{color:#3b94d6;}
.issues_list_titlebox span{ font-size: 12px;color: #888; font-weight: normal; }
.issues_ciricons_01{ width: 22px; height: 22px; display: inline-block; background: url("/images/new_project/icons_issue.png") 0 0 no-repeat;}
@ -787,7 +788,7 @@ a:hover.issues_list_title{color:#3b94d6;}
.hw_search_box{ position:relative; }
.hw_search_box input.hw_search-input{ width:293px; height:28px; border:none; border:1px solid #e7e7e7; background:#fff; padding-left:5px;padding-right: 25px;}
.hw_search_box a.hw_btn_search{display:block; width:20px; height:20px; background:url(/images/hw/icons_hw.png) 0 -57px no-repeat; position:absolute; right:5px; top:5px; cursor:pointer;}
.hw_search_box a:hover.hw_btn_search{background:url(../images/hw/icons_hw.png) -40px -57px no-repeat;}
.hw_search_box a:hover.hw_btn_search{background:url(/images/hw/icons_hw.png) -40px -57px no-repeat;}
.hw_files_icon{display:block; width:17px; height:14px; background:url(../images/hw/icons_hw.png) 0 -135px no-repeat;}
/* 编辑删除 与课程相同 */
.sy_icons_edit{ display: inline-block; padding:9px;background:url(/images/sy/sy_icons02.png) 0 1px no-repeat; }
@ -887,7 +888,7 @@ a:hover.btn_newpro_grey,a:active.btn_newpro_grey{ background: #eaeaea;}
.table-td-w180{display:inline-block;with:180px; overflow:hidden; text-overflow:ellipsis; -o-text-overflow:ellipsis; white-space:nowrap;}
.table-td-w380{display:inline-block;with:380px; overflow:hidden; text-overflow:ellipsis; -o-text-overflow:ellipsis; white-space:nowrap;}
/*项目简介*/
.pro_new_info{ border:1px solid #ddd; background-color:#fff; width: 998px;}
.pro_new_info{ border:1px solid #ddd; background-color:#fff; width: 100%;}
.pro_new_info h2{ background: #fff; font-size: 14px; color: #333; height: 40px; line-height: 40px; padding-left: 15px; border-bottom:1px solid #e5e5e5;}
/*.pro_new_info p{ padding-bottom:2px; padding-left: 15px; color: #666; padding-right: 5px}*/
.pro_new_info_weight{ font-size: 16px; font-weight: bold;}
@ -931,6 +932,7 @@ p.pro_new_grey{ line-height: 1.9; }
.container-big-grey {width:970px; background-color:#f1f1f1;}
.reply-banner {width:968px; height:33px; border:1px solid #e4e4e4; line-height:33px; vertical-align:middle; font-size:12px; color:#888888; position: relative;}
.reply-container {border-bottom:1px solid #e3e3e3; width:940px; margin-top:15px; min-height:50px;}
.reply-container-branch {width:940px; margin-top:6px; min-height:35px; padding-left: 10px;}
.reply-content {float:left; width:892px;}
/* 新版里程碑 20161019byLB */
@ -950,6 +952,7 @@ p.pro_new_grey{ line-height: 1.9; }
.undis {display:none;}
.dis {display:block;}
.new_roadmap_listbox{ padding:15px;border-bottom:1px solid #dbdbdb;}
.new_roadmap_listbox_commit{ padding:15px;}
.new_roadmap_listtitle a{ color: #333;display:block;max-width:800px; overflow:hidden;white-space: nowrap; text-overflow:ellipsis;}
.new_roadmap_listtitle a:hover{ color:#3498db;}
.new_roadmap_list_txt{ color: #666;}
@ -997,7 +1000,7 @@ a.sortdownbtn{background: url(/images/sy/liststyle.png) 0 -12px no-repeat; width
a.pullreques_reply_name{ font-weight: bold; color: #333;}
.pullreques_reply_txt{ width: 900px;color: #666;}
.pullreques_pull_top { width: 100%; height: 40px; line-height: 40px; background: #f4f4f4; border-top:1px solid #e1e1e1;border-bottom:1px solid #e1e1e1;}
a.pullreques_pull_name{display: block; margin-left: 10px;max-width:80px; color:#3b94d6 !important; overflow:hidden;white-space: nowrap; text-overflow:ellipsis;}
a.pullreques_pull_name{display: block; margin-left: 5px;max-width:80px; color:#3b94d6 !important; overflow:hidden;white-space: nowrap; text-overflow:ellipsis;}
.pullreques_pull_list li{ height: 30px; line-height: 30px; }
.pullreques_pull_txt{display: block; margin-left: 10px;max-width:740px; overflow:hidden;white-space: nowrap; text-overflow:ellipsis;}
.pullreques_change_list li{height: 40px; line-height: 40px;border-bottom:1px solid #e1e1e1; }

View File

@ -236,12 +236,14 @@ a.postReplyCancel:hover {color:#ffffff;}
.homepagePostSetting ul li:hover ul {display:block;}
.homepagePostSettingIcon {background:url(../images/homepage_icon.png) -93px -5px no-repeat; width:20px; height:20px;}
.homepagePostSettiongText {width:85px; text-align:center; line-height:2; font-size:12px; color:#616060; background-color:#ffffff; border:1px solid #eaeaea; border-radius:3px; position:absolute; left:-68px; top:20px; padding:5px 0px; display:none;z-index:999; box-shadow: 0px 2px 8px rgba(146, 153, 169, 0.5);}
.whomepagePostSettiongText {width:100px; text-align:center; line-height:2; font-size:12px; color:#616060; background-color:#ffffff; border:1px solid #eaeaea; border-radius:3px; position:absolute; left:-80px; top:20px; padding:5px 0px; display:none;z-index:999; box-shadow: 0px 2px 8px rgba(146, 153, 169, 0.5);}
.homepagePostSettingIcon:hover {background:url(../images/homepage_icon.png) -93px -44px no-repeat; cursor: pointer;}
.whiteSettingIcon {background:url(/images/hwork_icon.png) -5px -302px no-repeat; width:20px; height:20px;}
.whiteSettingIcon:hover {background:url(/images/homepage_icon.png) -93px -44px no-repeat;}
a.postOptionLink {color:#616060; display:block; width:55px; padding:0px 15px;text-align:center;}
a.postOptionLink:hover {color:#ffffff; background-color:#3b94d6;}
a.postOptionLink2 {color:#616060; display:block; width:35px; padding:0px 15px;}
a.wpostOptionLink {color:#616060; display:block; width:80px; padding:0px 10px;text-align:center;}
a.wpostOptionLink:hover {color:#ffffff; background-color:#3b94d6;}a.postOptionLink2 {color:#616060; display:block; width:35px; padding:0px 15px;}
a.postOptionLink2:hover {color:#ffffff; background-color:#3b94d6;}
.homepagePostReplyPortrait {float:left; width:33px;}
.imageFuzzy {filter:alpha(opacity=50); -moz-opacity:0.5; -khtml-opacity:0.5;opacity: 0.5;}

View File

@ -15,7 +15,7 @@ a.newbtn{ float:right; display:block; width:80px; height:27px; padding-top:3px;
a:hover.newbtn{ background:#55a1b9; text-decoration:none;}
.polls_list_ul{ padding-left:10px; border-bottom:1px dashed #c9c9c9; height:32px; padding-top:8px;}
a.polls_title{ font-weight:bold; color:#3e6d8e; margin-top:3px;}
a.pollsbtn{ display:block; width:66px; height:20px; padding-top:2px; text-align:center; border:1px solid #64bdd9; color:#64bdd9;}
a.pollsbtn{ display:block; height:20px; padding:0 9px; text-align:center; border:1px solid #64bdd9; color:#64bdd9;}
a:hover.pollsbtn{ background:#64bdd9; color:#fff; text-decoration:none;}
.polls_date{ color:#666666;margin-top:3px; }
.polls_de{ color:#6883b6; margin-top:3px;}
@ -129,7 +129,7 @@ a.btn_de{ border:1px solid #ff5d31; color:#ff5d31; }
a:hover.btn_de{ background:#ff5d31;}
a.btn_pu{ border:1px solid #3cb761; color:#3cb761; }
a:hover.btn_pu{ background:#3cb761;}
.pollsbtn_grey{ border:1px solid #b1b1b1; color:#b1b1b1; padding:0px 9px; height:19px; padding-top:3px; }
.pollsbtn_grey{ border:1px solid #b1b1b1; color:#b1b1b1; padding:0px 9px; height:20px;}
.polls_title_w { max-width:280px; overflow: hidden;white-space: nowrap;text-overflow: ellipsis;}
.polls_title_st { max-width:450px; overflow: hidden;white-space: nowrap;text-overflow: ellipsis;}
.polls_de_grey{ color:#b1b1b1; margin-top:3px;}

View File

@ -0,0 +1,6 @@
FactoryGirl.define do
factory :professional_level do
level "MyString"
end
end

View File

@ -0,0 +1,5 @@
require 'rails_helper'
RSpec.describe ProfessionalLevel, :type => :model do
pending "add some examples to (or delete) #{__FILE__}"
end