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

dev_cs
hjm 5 years ago
commit 7dce307449

@ -33,10 +33,11 @@ class CoursesController < ApplicationController
before_action :teacher_allowed, only: [:update, :destroy, :settings, :search_teacher_candidate, before_action :teacher_allowed, only: [:update, :destroy, :settings, :search_teacher_candidate,
:transfer_to_course_group, :delete_from_course, :export_member_scores_excel, :transfer_to_course_group, :delete_from_course, :export_member_scores_excel,
:search_users, :add_students_by_search, :get_historical_courses, :add_teacher_popup, :search_users, :add_students_by_search, :get_historical_courses, :add_teacher_popup,
:add_teacher, :export_couser_info, :export_member_act_score] :add_teacher, :export_couser_info, :export_member_act_score,
:update_informs, :new_informs, :delete_informs]
before_action :admin_allowed, only: [:set_invite_code_halt, :set_public_or_private, :change_course_admin, before_action :admin_allowed, only: [:set_invite_code_halt, :set_public_or_private, :change_course_admin,
:set_course_group, :create_group_by_importing_file, :update_informs, :new_informs, :set_course_group, :create_group_by_importing_file,
:update_task_position, :tasks_list, :delete_informs] :update_task_position, :tasks_list]
before_action :teacher_or_admin_allowed, only: [:graduation_group_list, :create_graduation_group, :join_graduation_group, before_action :teacher_or_admin_allowed, only: [:graduation_group_list, :create_graduation_group, :join_graduation_group,
:change_course_teacher, :course_group_list, :change_course_teacher, :course_group_list,
:teacher_application_review, :apply_teachers, :delete_course_teacher] :teacher_application_review, :apply_teachers, :delete_course_teacher]

@ -109,8 +109,8 @@ class GraduationTopicsController < ApplicationController
@attachments = @graduation_topic.attachments @attachments = @graduation_topic.attachments
left_banner_content = @course.course_modules.search_by_module_type("graduation") left_banner_content = @course.course_modules.search_by_module_type("graduation")
if left_banner_content.present? if left_banner_content.present?
@left_banner_id = left_banner_content.first.course_second_categories.first.id @left_banner_id = left_banner_content.first.id
@left_banner_name = left_banner_content.first.course_second_categories.first.name @left_banner_name = "毕设选题"
end end
end end

@ -6,6 +6,12 @@ json.results do
json.title highlights.delete(:name)&.join('...') || obj.searchable_title json.title highlights.delete(:name)&.join('...') || obj.searchable_title
# json.description highlights.values[0,5].each { |arr| arr.is_a?(Array) ? arr.join('...') : arr }.join('<br/>') # json.description highlights.values[0,5].each { |arr| arr.is_a?(Array) ? arr.join('...') : arr }.join('<br/>')
# 去除开头标点符号
reg = /^[,。?:;‘’!“”—……、]/
highlights[:description]&.first&.sub!(reg, '')
highlights[:content]&.first&.sub!(reg, '')
json.content highlights json.content highlights
end end
end end

@ -72,9 +72,8 @@ class AppraiseModal extends Component{
challenge_id:challenge_id challenge_id:challenge_id
}).then((response) => { }).then((response) => {
if(response.data.status===0){ if(response.data.status===0){
debugger
this.props.showNotification(response.data.message)
this.props.showCancel(comment,hidden_comment,challenge_id,response.data.comment_id) this.props.showCancel(comment,hidden_comment,challenge_id,response.data.comment_id)
this.props.showNotification(response.data.message)
}else{ }else{
this.props.showNotification(response.data.message) this.props.showNotification(response.data.message)
} }

@ -0,0 +1,49 @@
.maxnamewidth100{
max-width: 100px;
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap;
cursor: default;
}
.maxnamewidth110{
max-width: 100px;
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap;
cursor: default;
}
.maxnamewidth200{
max-width: 200px;
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap;
cursor: default;
}
.maxnamewidth145{
max-width: 145px;
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap;
cursor: default;
}
.maxnamewidth215{
max-width: 215px;
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap;
cursor: default;
}
.maxnamewidth255{
max-width: 255px;
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap;
cursor: default;
}
.maxnamewidth175{
max-width: 175px;
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap;
cursor: default;
}

@ -241,7 +241,7 @@ class Bullsubdirectory extends Component{
<div> <div>
<span className="fr yslbianji" style={{marginRight:"17px"}}> <span className="fr yslbianji" style={{marginRight:"17px"}}>
{ {
this.props.isClassManagement() === true ? this.props.isAdmin() === true ?
(this.props.yslbool===false? (this.props.yslbool===false?
<Tooltip placement="bottom" title={<div> <Tooltip placement="bottom" title={<div>
编辑 编辑
@ -256,7 +256,7 @@ class Bullsubdirectory extends Component{
</span> </span>
<span className="fr yslbianji" style={{marginRight:"22px"}}> <span className="fr yslbianji" style={{marginRight:"22px"}}>
{ {
this.props.isClassManagement() === true ? this.props.isAdmin() === true ?
(this.props.yslbool===false? (this.props.yslbool===false?
<Tooltip placement="bottom" title={<div> <Tooltip placement="bottom" title={<div>
删除 删除

@ -231,7 +231,7 @@ class Eduinforms extends Component{
<p style={{height: '20px'}}> <p style={{height: '20px'}}>
<span className="font-18 fl color-dark-21">公告栏</span> <span className="font-18 fl color-dark-21">公告栏</span>
{ {
this.props.isClassManagement()===true? this.props.isAdmin()===true?
(this.state.yslbool===false? (this.state.yslbool===false?
<li className="btn colorblue font-16 fr bluebkbk pointer" <li className="btn colorblue font-16 fr bluebkbk pointer"
onClick={() => this.bianji(true)}> onClick={() => this.bianji(true)}>

@ -157,7 +157,7 @@ class ShixunWorkReport extends Component {
showAppraiseModal=(type,id,show,hidden)=>{ showAppraiseModal=(type,id,show,hidden)=>{
let{data}=this.state; let{data}=this.state;
debugger
if(type==="child"){ if(type==="child"){
data.stage_list.forEach((item,key)=>{ data.stage_list.forEach((item,key)=>{
if(item.challenge_id===id){ if(item.challenge_id===id){
@ -192,7 +192,6 @@ class ShixunWorkReport extends Component {
let{data,showAppraisetype}=this.state; let{data,showAppraisetype}=this.state;
debugger
if(showAppraisetype==="child"){ if(showAppraisetype==="child"){
data.stage_list.forEach((item,key)=>{ data.stage_list.forEach((item,key)=>{
if(item.challenge_id===id){ if(item.challenge_id===id){
@ -217,10 +216,13 @@ class ShixunWorkReport extends Component {
} }
isdeleteModal=(comment_id,visible_comment,type)=>{ isdeleteModal=(comment_id,visible_comment,type)=>{
let newcomment_id=comment_id;
let newvisible_comment=visible_comment;
let newtype=type;
this.setState({ this.setState({
modalsType: true, modalsType: true,
modalsTopval:"是否确认删除?", modalsTopval:"是否确认删除?",
modalSave: ()=>this.isdeleteModals(comment_id,visible_comment,type), modalSave: ()=>this.isdeleteModals(newcomment_id,newvisible_comment,newtype),
modalCancel:()=>this.hideisdeleteModals(), modalCancel:()=>this.hideisdeleteModals(),
}) })
} }
@ -279,22 +281,24 @@ class ShixunWorkReport extends Component {
let newcomment_id=comment_id; let newcomment_id=comment_id;
let newvisible_comment=visible_comment; let newvisible_comment=visible_comment;
let newtype=type; let newtype=type;
if(comment_id!=null){
let url =`/student_works/${this.props.match.params.homeworkid}/destroy_work_comment.json`
axios.delete(url, { data: {
comment_id:comment_id,
}}).then((response) => {
// const { status } = response.data;
if(response.data.status===0){
this.props.showNotification(response.data.message)
this.hideisdeleteModal(newcomment_id,newvisible_comment,newtype)
}else{
this.props.showNotification(response.data.message)
}
})
.catch(function (error) {
console.log(error);
});
}
let url =`/student_works/${this.props.match.params.homeworkid}/destroy_work_comment.json`
axios.delete(url, { data: {
comment_id:comment_id,
}}).then((response) => {
// const { status } = response.data;
if(response.data.status===0){
this.props.showNotification(response.data.message)
this.hideisdeleteModal(newcomment_id,newvisible_comment,newtype)
}else{
this.props.showNotification(response.data.message)
}
})
.catch(function (error) {
console.log(error);
});
} }
render() { render() {
let{data,showAppraiseModaltype,work_comment_hidden,work_comment} =this.state; let{data,showAppraiseModaltype,work_comment_hidden,work_comment} =this.state;

@ -2,6 +2,7 @@ import React,{ Component } from "react";
import { Modal,Checkbox,Upload,Button,Icon,message,Input,Radio} from "antd"; import { Modal,Checkbox,Upload,Button,Icon,message,Input,Radio} from "antd";
import { WordNumberTextarea,markdownToHTML } from 'educoder'; import { WordNumberTextarea,markdownToHTML } from 'educoder';
import axios from 'axios'; import axios from 'axios';
import './style.css';
class ShowAppraiseList extends Component{ class ShowAppraiseList extends Component{
constructor(props){ constructor(props){
@ -34,14 +35,15 @@ class ShowAppraiseList extends Component{
text-align: center; text-align: center;
line-height: 22px; line-height: 22px;
} }
.666w{
color: #666; .markdown-body{
font-size:14px; padding-bottom: 10px;
} }
.000w{ .borderbom{
color: #000; margin-bottom: 15px;
font-size:15px; border-bottom: 2px solid #fafafa;
} }
` `
} }
</style> </style>
@ -52,39 +54,41 @@ class ShowAppraiseList extends Component{
<div className="font-16 color-dark-21 shixunreporttitleboxtop pd20 color333"> <div className="font-16 color-dark-21 shixunreporttitleboxtop pd20 color333">
<span className={"appraisebox"}>总体评阅</span> <span className={"appraisebox"}>总体评阅</span>
{this.props&&this.props.isAdminOrTeacher()===true?<a className="color-blue font-14 fr ml20" {this.props&&this.props.isAdmin()===true?<a className="color-blue font-14 fr ml20"
onClick={()=>this.props.isdeleteModal(data.comment_id,true,"main")} onClick={()=>this.props.isdeleteModal(data.comment_id,true,"main")}
>删除</a>:""} >删除</a>:""}
{this.props&&this.props.isAdminOrTeacher()===true?<a className="color-blue font-14 fr" {this.props&&this.props.isAdmin()===true?<a className="color-blue font-14 fr"
onClick={()=>this.props.showAppraiseModal("main",undefined,work_comment,work_comment_hidden)} onClick={()=>this.props.showAppraiseModal("main",undefined,work_comment,work_comment_hidden)}
>编辑</a>:""} >编辑</a>:""}
</div> </div>
{this.props&&this.props.isAdminOrTeacher()===true? {this.props&&this.props.isAdmin()===true?
<div className="font-16 color-dark-21 shixunreporttitleboxbom pd30"> <div className="font-16 color-dark-21 shixunreporttitleboxbom pd30bt">
<div>
<span className={"z000"}>学生可见<span className={"z666"}>学生可查看老师的评阅内容</span></span>
</div>
<div className={"borderbom"} style={{minHeight:'40px'}}>
{work_comment===true?"":<div className={"personalsummary"}>
<div className={"markdown-body"}
dangerouslySetInnerHTML={{__html: markdownToHTML(work_comment).replace(/▁/g, "▁▁▁")}}></div>
</div>}
</div>
<div> <div>
<span className={"000w"}>学生不可见<span className={"666w"}>仅对课堂老师可见</span></span> <span className={"z000"}>学生不可见<span className={"z666"}>仅对课堂老师可见</span></span>
</div> </div>
<div style={{minHeight:'50px'}}> <div style={{minHeight:'40px'}}>
{work_comment_hidden===true?"":<div className={"personalsummary"}> {work_comment_hidden===true?"":<div className={"personalsummary"}>
<div className={"markdown-body"} <div className={"markdown-body"}
dangerouslySetInnerHTML={{__html: markdownToHTML(work_comment_hidden).replace(/▁/g, "▁▁▁")}}></div> dangerouslySetInnerHTML={{__html: markdownToHTML(work_comment_hidden).replace(/▁/g, "▁▁▁")}}></div>
</div>} </div>}
</div> </div>
<div>
<span className={"000w"}>学生可见<span className={"666w"}>学生可查看老师的评阅内容</span></span>
</div>
<div style={{minHeight:'50px'}}>
{work_comment===true?"":<div className={"personalsummary"}>
<div className={"markdown-body"}
dangerouslySetInnerHTML={{__html: markdownToHTML(work_comment).replace(/▁/g, "▁▁▁")}}></div>
</div>}
</div>
</div>:<div className="font-16 color-dark-21 shixunreporttitleboxbom pd30"> </div>:<div className="font-16 color-dark-21 shixunreporttitleboxbom pd30">
<div style={{minHeight:'50px'}}> <div style={{minHeight:'40px'}}>
<div className={"personalsummary"}> <div className={"personalsummary"}>
<div className={"markdown-body"} <div className={"markdown-body"}
dangerouslySetInnerHTML={{__html: markdownToHTML(work_comment).replace(/▁/g, "▁▁▁")}}></div> dangerouslySetInnerHTML={{__html: markdownToHTML(work_comment).replace(/▁/g, "▁▁▁")}}></div>
@ -110,38 +114,39 @@ class ShowAppraiseList extends Component{
<div className="font-16 color-dark-21 shixunreporttitleboxtop pd20 color333"> <div className="font-16 color-dark-21 shixunreporttitleboxtop pd20 color333">
<span className={"appraisebox"}>{key+1}</span>{item.name} <span className={"appraisebox"}>{key+1}</span>{item.name}
{this.props&&this.props.isAdminOrTeacher()===true?<a className="color-blue font-14 fr ml20" {this.props&&this.props.isAdmin()===true?<a className="color-blue font-14 fr ml20"
onClick={()=>this.props.isdeleteModal(item.comment_id,true,"child")} onClick={()=>this.props.isdeleteModal(item.comment_id,true,"child")}
>删除</a>:""} >删除</a>:""}
{this.props&&this.props.isAdminOrTeacher()===true?<a className="color-blue font-14 fr" {this.props&&this.props.isAdmin()===true?<a className="color-blue font-14 fr"
onClick={()=>this.props.showAppraiseModal("child",item.challenge_id,item.challenge_comment,item.challenge_comment_hidden)} onClick={()=>this.props.showAppraiseModal("child",item.challenge_id,item.challenge_comment,item.challenge_comment_hidden)}
>编辑</a>:""} >编辑</a>:""}
</div> </div>
{this.props&&this.props.isAdminOrTeacher()===true? {this.props&&this.props.isAdmin()===true?
<div className="font-16 color-dark-21 shixunreporttitleboxbom pd30"> <div className="font-16 color-dark-21 shixunreporttitleboxbom pd30bt">
<div> <div>
<span className={"000w"}>学生可见<span className={"666w"}>仅对课堂老师可见</span></span> <span className={"z000"}>学生可见<span className={"z666"}>学生可查看老师的评阅内容</span></span>
</div> </div>
<div style={{minHeight:'50px'}}> <div className={"borderbom"} style={{minHeight:'40px'}}>
{challenge_comment_hidden===true?"":<div className={"personalsummary"}> {challenge_comment===true?"":<div className={"personalsummary"}>
<div className={"markdown-body"} <div className={"markdown-body"}
dangerouslySetInnerHTML={{__html: markdownToHTML(item.challenge_comment_hidden).replace(/▁/g, "▁▁▁")}}></div> dangerouslySetInnerHTML={{__html: markdownToHTML(item.challenge_comment).replace(/▁/g, "▁▁▁")}}></div>
</div>} </div>}
</div> </div>
<div> <div>
<span className={"000w"}>学生可见<span className={"666w"}>学生可查看老师的评阅内容</span></span> <span className={"z000"}>学生可见<span className={"z666"}>仅对课堂老师可见</span></span>
</div> </div>
<div style={{minHeight:'50px'}}> <div style={{minHeight:'40px'}}>
{challenge_comment===true?"":<div className={"personalsummary"}> {challenge_comment_hidden===true?"":<div className={"personalsummary"}>
<div className={"markdown-body"} <div className={"markdown-body"}
dangerouslySetInnerHTML={{__html: markdownToHTML(item.challenge_comment).replace(/▁/g, "▁▁▁")}}></div> dangerouslySetInnerHTML={{__html: markdownToHTML(item.challenge_comment_hidden).replace(/▁/g, "▁▁▁")}}></div>
</div>} </div>}
</div> </div>
</div>: <div className="font-16 color-dark-21 shixunreporttitleboxbom pd30"> </div>: <div className="font-16 color-dark-21 shixunreporttitleboxbom pd30">
<div style={{minHeight:'50px'}}> <div style={{minHeight:'40px'}}>
<div className={"personalsummary"}> <div className={"personalsummary"}>
<div className={"markdown-body"} <div className={"markdown-body"}
dangerouslySetInnerHTML={{__html: markdownToHTML(item.challenge_comment).replace(/▁/g, "▁▁▁")}}></div> dangerouslySetInnerHTML={{__html: markdownToHTML(item.challenge_comment).replace(/▁/g, "▁▁▁")}}></div>

@ -38,13 +38,34 @@
.TopicDetailTable .bottomBody li:last-child{border-bottom: none;} .TopicDetailTable .bottomBody li:last-child{border-bottom: none;}
.maxnamewidth100{ .maxnamewidth100{
max-width: 145px; max-width: 100px;
overflow:hidden; overflow:hidden;
text-overflow:ellipsis; text-overflow:ellipsis;
white-space:nowrap; white-space:nowrap;
cursor: default; cursor: default;
} }
.maxnamewidth110{ .maxnamewidth110{
max-width: 100px;
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap;
cursor: default;
}
.maxnamewidth200{
max-width: 200px;
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap;
cursor: default;
}
.maxnamewidth145{
max-width: 145px;
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap;
cursor: default;
}
.maxnamewidth145{
max-width: 145px; max-width: 145px;
overflow:hidden; overflow:hidden;
text-overflow:ellipsis; text-overflow:ellipsis;
@ -53,4 +74,17 @@
} }
.ysyslxh{ .ysyslxh{
background: #fafafa; background: #fafafa;
}
.z666{
color: #666;
font-size:14px;
}
.z000{
color: #000;
font-size:16px;
}
.pd30bt{
padding: 10px 30px 0px 30px;
} }
Loading…
Cancel
Save