Merge branch 'develop' into dev_cxt

dev_ec
cxt 6 years ago
commit cde399f97e

@ -541,7 +541,7 @@ class StudentWorksController < ApplicationController
def destroy_score
score = @work.student_works_scores.find_by(id: params[:score_id])
tip_exception("该评阅记录不存在") unless score.present?
tip_exception("该评阅记录不能删除") unless score.allow_delete(current_user, @user_course_identity)
tip_exception("该评阅记录不能删除") unless score.allow_delete(current_user)
begin
score.destroy
normal_status(0,"删除成功")

@ -13,9 +13,8 @@ belongs_to :student_work
identity < Course::STUDENT || self.user == user || self.reviewer_role != 3
end
def allow_delete current_user, identity
self.is_invalid && (current_user == self.user || identity < Course::STUDENT) ||
(self.score.nil? && current_user == self.user)
def allow_delete current_user
(self.is_invalid || self.score.nil?) && (current_user == self.user || current_user.admin?)
end
# 匿评分

@ -15,7 +15,7 @@ json.comment_scores @comment_scores do |score|
json.score score.score
json.content score.comment
json.is_invalid score.is_invalid
json.delete @current_user == score.user && (score.is_invalid || score.score.nil?)
json.delete (@current_user == score.user || @current_user.admin?) && (score.is_invalid || score.score.nil?)
json.attachments score.attachments do |atta|
json.partial! "attachments/attachment_simple", locals: {attachment: atta, delete: false}
end

@ -23,7 +23,7 @@ json.comment_scores @comment_scores do |score|
json.content score.comment
json.appeal_status score.appeal_status
json.is_invalid score.is_invalid
json.delete score.allow_delete(@current_user, @user_course_identity)
json.delete score.allow_delete(@current_user)
json.attachments score.attachments do |atta|
json.partial! "attachments/attachment_simple", locals: {attachment: atta, delete: false}
end

@ -471,6 +471,9 @@ export function TPMIndexHOC(WrappedComponent) {
.indexHOC > .ant-spin-nested-loading {
background: #000;
}
.indexHOC > .ant-spin-nested-loading > div > .ant-spin .ant-spin-dot {
top: 50% !important;
}
.globalSpin .ant-spin-text {
text-shadow: none !important;

Loading…
Cancel
Save