Merge branch 'dev_aliyun' of http://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_admin
cxt 6 years ago
commit d789c3c683

@ -47,13 +47,13 @@ module TidingDecorator
# ================ 各种类消息内容方法 ================ # ================ 各种类消息内容方法 ================
def apply_user_authentication_content def apply_user_authentication_content
return if trigger_user_id.zero? t_user = trigger_user || User.find(1)
if tiding_type == 'Apply' if tiding_type == 'Apply'
str1, str2 = if container.auth_type == 1 str1, str2 = if container.auth_type == 1
[trigger_user.show_real_name, trigger_user.ID_number] [t_user.show_real_name, t_user.ID_number]
elsif container.auth_type == 2 elsif container.auth_type == 2
ue = trigger_user.user_extension ue = t_user.user_extension
[[ue.school&.name, ue.department&.name].join('_'), ue.identity_text] [[ue.school&.name, ue.department&.name].join('_'), ue.identity_text]
end end
I18n.t(locale_format(tiding_type, container.auth_type)) % [str1, str2] I18n.t(locale_format(tiding_type, container.auth_type)) % [str1, str2]
@ -97,7 +97,7 @@ module TidingDecorator
elsif status == 2 elsif status == 2
I18n.t(locale_format(tiding_type, "#{status}_#{extra.nil?}"), reason: extra) % [name, second_name] I18n.t(locale_format(tiding_type, "#{status}_#{extra.nil?}"), reason: extra) % [name, second_name]
else else
I18n.t(locale_format(tiding_type, status)) % [name, second_name] I18n.t(locale_format(tiding_type, status), reason: extra) % [name, second_name]
end end
end end
@ -106,9 +106,9 @@ module TidingDecorator
if tiding_type == 'Apply' if tiding_type == 'Apply'
I18n.t(locale_format(tiding_type)) % name I18n.t(locale_format(tiding_type)) % name
elsif status == 2 elsif status == 2
I18n.t(locale_format(tiding_type, "#{status}_#{extra.nil?}"), reason: extra) % name I18n.t(locale_format(tiding_type, "#{status}_#{extra.nil?}"), name: name, reason: extra)
else else
I18n.t(locale_format(tiding_type, status)) % name I18n.t(locale_format(tiding_type, status), name: name, reason: extra)
end end
end end

@ -3,8 +3,18 @@
class ApplyUserAuthentication < ApplicationRecord class ApplyUserAuthentication < ApplicationRecord
belongs_to :user belongs_to :user
has_many :tidings, :as => :container, :dependent => :destroy
scope :real_name_auth, -> { where(auth_type: 1) } scope :real_name_auth, -> { where(auth_type: 1) }
scope :professional_auth, -> { where(auth_type: 2) } scope :professional_auth, -> { where(auth_type: 2) }
scope :processing, -> { where(status: 0) } scope :processing, -> { where(status: 0) }
scope :passed, -> { where(status: 1) } scope :passed, -> { where(status: 1) }
after_create :send_tiding
private
def send_tiding
self.tidings << Tiding.new(:user_id => '1', :status=> 0, :trigger_user_id => user_id, :belong_container_id => 1, :belong_container_type =>'User', :tiding_type => "Apply")
end
end end

@ -38,8 +38,8 @@
Apply_end: "申请添加单位:%s" Apply_end: "申请添加单位:%s"
System: System:
"1_end": "你提交的添加单位申请:%{name},审核已通过" "1_end": "你提交的添加单位申请:%{name},审核已通过"
"2_reason_end": "你提交的添加单位申请:%{name},审核未通过<br/><span>原因:%{reason}</span>" "2_false_end": "你提交的添加单位申请:%{name},审核未通过<br/><span>原因:%{reason}</span>"
"2_no_reason_end": "你提交的添加单位申请:%{name},审核未通过" "2_true_end": "你提交的添加单位申请:%{name},审核未通过"
"3_end": "你提交的添加单位申请:%{name},已被更改为:%{reason}" "3_end": "你提交的添加单位申请:%{name},已被更改为:%{reason}"
ApplyAction: ApplyAction:
ApplyShixun: ApplyShixun:

@ -212,15 +212,15 @@ class MessagSub extends Component{
return ''; return '';
case "HomeworkCommon" : case "HomeworkCommon" :
//学生作业页 homework = parent_container_id //学生作业页 homework = parent_container_id
if(item.homework_type===1){ if(item.homework_type==="normal"){
//普通作业 //普通作业
return window.open(`/courses/${item.belong_container_id}/common_homeworks/${item.parent_container_id}/list`) return window.open(`/courses/${item.belong_container_id}/common_homeworks/${item.parent_container_id}/list`)
} }
if(item.homework_type===3){ if(item.homework_type==="group"){
//分组作业 //分组作业
return window.open(`/courses/${item.belong_container_id}/group_homeworks/${item.parent_container_id}/list`) return window.open(`/courses/${item.belong_container_id}/group_homeworks/${item.parent_container_id}/list`)
} }
if(item.homework_type===4){ if(item.homework_type==="practice"){
//实训作业 //实训作业
return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=0`) return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=0`)
} }
@ -229,15 +229,15 @@ class MessagSub extends Component{
return window.open(`/courses/${item.belong_container_id}/graduation_topics/${item.parent_container_id}/detail`) return window.open(`/courses/${item.belong_container_id}/graduation_topics/${item.parent_container_id}/detail`)
case "StudentWorksScore" : case "StudentWorksScore" :
//学生作业页 //学生作业页
if(item.homework_type===1){ if(item.homework_type==="normal"){
//普通作业 //普通作业
return window.open(`/courses/${item.belong_container_id}/common_homeworks/${item.parent_container_id}/list`) return window.open(`/courses/${item.belong_container_id}/common_homeworks/${item.parent_container_id}/list`)
} }
if(item.homework_type===3){ if(item.homework_type==="group"){
//分组作业 //分组作业
return window.open(`/courses/${item.belong_container_id}/group_homeworks/${item.parent_container_id}/list`) return window.open(`/courses/${item.belong_container_id}/group_homeworks/${item.parent_container_id}/list`)
} }
if(item.homework_type===4){ if(item.homework_type==="practice"){
//实训作业 //实训作业
return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=0`) return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=0`)
} }
@ -308,100 +308,103 @@ class MessagSub extends Component{
switch (item.parent_container_type) { switch (item.parent_container_type) {
case "AnonymousCommentFail" : case "AnonymousCommentFail" :
// 课堂-作业列表 homework = container_id // 课堂-作业列表 homework = container_id
if(item.homework_type===1){ if(item.homework_type==="normal"){
//普通作业 //普通作业
return window.open(`/courses/${item.belong_container_id}/common_homeworks/${item.parent_container_id}/list`) return window.open(`/courses/${item.belong_container_id}/common_homeworks/${item.parent_container_id}/list`)
} }
if(item.homework_type===3){ if(item.homework_type==="group"){
//分组作业 //分组作业
return window.open(`/courses/${item.belong_container_id}/group_homeworks/${item.parent_container_id}/list`) return window.open(`/courses/${item.belong_container_id}/group_homeworks/${item.parent_container_id}/list`)
} }
if(item.homework_type===4){ if(item.homework_type==="practice"){
//实训作业 //实训作业
return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=0`) return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=0`)
} }
case "HomeworkPublish" : case "HomeworkPublish" :
if(item.homework_type===1){ if(item.homework_type==="normal"){
//普通作业 //普通作业
return window.open(`/courses/${item.belong_container_id}/common_homeworks/${item.parent_container_id}/list`) return window.open(`/courses/${item.belong_container_id}/common_homeworks/${item.parent_container_id}/list`)
} }
if(item.homework_type===3){ if(item.homework_type==="group"){
//分组作业 //分组作业
return window.open(`/courses/${item.belong_container_id}/group_homeworks/${item.parent_container_id}/list`) return window.open(`/courses/${item.belong_container_id}/group_homeworks/${item.parent_container_id}/list`)
} }
if(item.homework_type===4){ if(item.homework_type==="practice"){
//实训作业 //实训作业
return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=0`) return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=0`)
} }
case "AnonymousAppeal" : case "AnonymousAppeal" :
if(item.homework_type===1){ if(item.homework_type==="normal"){
//普通作业 //普通作业
return window.open(`/courses/${item.belong_container_id}/common_homeworks/${item.parent_container_id}/list`) return window.open(`/courses/${item.belong_container_id}/common_homeworks/${item.parent_container_id}/list`)
} }
if(item.homework_type===3){ if(item.homework_type==="group"){
//分组作业 //分组作业
return window.open(`/courses/${item.belong_container_id}/group_homeworks/${item.parent_container_id}/list`) return window.open(`/courses/${item.belong_container_id}/group_homeworks/${item.parent_container_id}/list`)
} }
if(item.homework_type===4){ if(item.homework_type==="practice"){
//实训作业 //实训作业
return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=0`) return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=0`)
} }
default : default :
// 课堂-作业列表 homework = container_id // 课堂-作业列表 homework = container_id
if(item.homework_type===1){ if(item.homework_type==="normal"){
//普通作业 //普通作业
return window.open(`/courses/${item.belong_container_id}/common_homeworks/${item.parent_container_id}/list`) return window.open(`/courses/${item.belong_container_id}/common_homeworks/${item.parent_container_id}/list`)
} }
if(item.homework_type===3){ if(item.homework_type==="group"){
//分组作业 //分组作业
return window.open(`/courses/${item.belong_container_id}/group_homeworks/${item.parent_container_id}/list`) return window.open(`/courses/${item.belong_container_id}/group_homeworks/${item.parent_container_id}/list`)
} }
if(item.homework_type===4){ if(item.homework_type==="practice"){
//实训作业 //实训作业
return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=0`) return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=0`)
} }
} }
case "StudentWork" : case "StudentWork" :
//课堂-作业 :id = container_id //课堂-作业 :id = container_id
if(item.homework_type===1){ if(item.homework_type==="normal"){
//普通作业 //普通作业
return window.open(`/courses/${item.belong_container_id}/common_homeworks/${item.container_id}/list`) return window.open(`/courses/${item.belong_container_id}/common_homeworks/${item.container_id}/list`)
} }
if(item.homework_type===3){ if(item.homework_type==="group"){
//分组作业 //分组作业
return window.open(`/courses/${item.belong_container_id}/group_homeworks/${item.container_id}/list`) return window.open(`/courses/${item.belong_container_id}/group_homeworks/${item.container_id}/list`)
} }
if(item.homework_type===4){ if(item.homework_type==="practice"){
//实训作业 //实训作业
return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.container_id}/list?tab=0`) return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.container_id}/list?tab=0`)
} }
case "StudentWorksScore" : case "StudentWorksScore" :
//课堂-作业 :id = parent_container_id //课堂-作业 :id = parent_container_id
if(item.homework_type===1){ // if(item.homework_type==="normal"){
//普通作业 // //普通作业
return window.open(`/courses/${item.belong_container_id}/common_homeworks/${item.parent_container_id}/list`) // return window.open(`/courses/${item.belong_container_id}/common_homeworks/${item.parent_container_id}/list`)
} // }
if(item.homework_type===3){ // if(item.homework_type==="group"){
//分组作业 // //分组作业
return window.open(`/courses/${item.belong_container_id}/group_homeworks/${item.parent_container_id}/list`) // return window.open(`/courses/${item.belong_container_id}/group_homeworks/${item.parent_container_id}/list`)
} // }
if(item.homework_type===4){ // if(item.homework_type==="practice"){
//实训作业 // //实训作业
return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=0`) // return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=0`)
} // }
return window.open(`/courses/${item.belong_container_id}/common_homeworks/${item.trigger_user.id}/${item.parent_container_id}/appraise`);
case "StudentWorksScoresAppeal" : case "StudentWorksScoresAppeal" :
if(item.homework_type===1){ // if(item.homework_type==="normal"){
//普通作业 // //普通作业
return window.open(`courses/${item.belong_container_id}/common_homeworks/${item.parent_container_id}/list`) // return window.open(`courses/${item.belong_container_id}/common_homeworks/${item.parent_container_id}/list`)
} // }
if(item.homework_type===3){ // if(item.homework_type==="group"){
//分组作业 // //分组作业
return window.open(`/courses/${item.belong_container_id}/group_homeworks/${item.parent_container_id}/list`) // return window.open(`/courses/${item.belong_container_id}/group_homeworks/${item.parent_container_id}/list`)
} // }
if(item.homework_type===4){ // if(item.homework_type==="practice"){
//实训作业 // //实训作业
return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=0`) // return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=0`)
} // }
return window.open(`/courses/${item.belong_container_id}/common_homeworks/${item.trigger_user.id}/${item.parent_container_id}/appraise`);
case "ChallengeWorkScore" : case "ChallengeWorkScore" :
return ''; return '';
case "SendMessage" : case "SendMessage" :
@ -412,7 +415,7 @@ class MessagSub extends Component{
return window.open(`/projects/${item.parent_container_id}/issues?remote=true`) return window.open(`/projects/${item.parent_container_id}/issues?remote=true`)
case "Issue" : case "Issue" :
//项目Issue页 :id = container_id //项目Issue页 :id = container_id
return window.open(`/projects/${item.container_id}/issues?remote=true`) return window.open(`/issues/${item.container_id}`)
case "PullRequest" : case "PullRequest" :
// 项目pull request页 :id = parent_container_id // 项目pull request页 :id = parent_container_id
return window.open(`/projects/${item.parent_container_id}/pull_requests`) return window.open(`/projects/${item.parent_container_id}/pull_requests`)
@ -441,6 +444,8 @@ class MessagSub extends Component{
return window.open(`/crowdsourcing/${item.container_id}`) return window.open(`/crowdsourcing/${item.container_id}`)
// } // }
} }
case "Discuss":
return window.open(`/shixuns/${item.identifier}/shixun_discuss`);
default : default :
return window.open("/") return window.open("/")
} }
@ -462,7 +467,7 @@ class MessagSub extends Component{
<li className={typeysl&&typeysl==="project_package"?"active":""}><a onClick={(s,i)=>this.getdata("project_package",1)}>众包提醒</a></li> <li className={typeysl&&typeysl==="project_package"?"active":""}><a onClick={(s,i)=>this.getdata("project_package",1)}>众包提醒</a></li>
<li className={typeysl&&typeysl==="interactive"?"active":""}><a onClick={(s,i)=>this.getdata("interactive",1)}>互动提醒</a></li> <li className={typeysl&&typeysl==="interaction"?"active":""}><a onClick={(s,i)=>this.getdata("interaction",1)}>互动提醒</a></li>
<li className={typeysl&&typeysl==="apply"?"active":""}><a onClick={(s,i)=>this.getdata("apply",1)}>审核</a></li> <li className={typeysl&&typeysl==="apply"?"active":""}><a onClick={(s,i)=>this.getdata("apply",1)}>审核</a></li>

Loading…
Cancel
Save