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

dev_hjm
jingquan huang 6 years ago
commit 9bda5e732c

@ -7,10 +7,4 @@ json.pagination @total_count > 16 ? true : false
json.search_tags @search_tags
json.shixuns do
json.partial! 'shixun', locals: {shixuns: @shixuns}
end
s_s = ''
json.html_contents sanitize(s_s, tags: %w(img a table tr td tbody pre), attributes: %w(src href target style)).gsub(">\n<", "><")
.gsub(/^\n/, "").gsub("    ", "").gsub(/(\n)+/, "<br />").gsub("\t", " ").gsub("\n", "").gsub(" ", " ")
.gsub(/(<br\s?\/?>)+/, "<br />")
end

@ -1,48 +0,0 @@
class ModifyKeContentsForMarkdown < ActiveRecord::Migration[5.2]
include ActionView::Helpers::SanitizeHelper
def change
def ke_transform_to_md content
return content if content.blank?
s_contents = sanitize(content, tags: %w(img a span table td tr tbody pre), attributes: %w(src href target style))
s_contents.gsub(">\n<", "><").gsub(/^\n/, "").gsub("    ", "").gsub(/(\n)+/, "<br />")
.gsub("\t", " ").gsub("\n", "").gsub(" ", " ").gsub(/(<br\s?\/?>)+/, "<br />")
end
# 课程讨论区
MessageDetail.find_each do |m|
content = ke_transform_to_md m.content
m.update_column(:content, content)
end
# 试卷的标题
ExerciseQuestion.find_each do |eq|
question_title = ke_transform_to_md eq.question_title
eq.update_column(:question_title, question_title)
end
# 试卷的答案
ExerciseStandardAnswer.find_each do |esa|
answer_text = ke_transform_to_md esa.answer_text
esa.update_column(:answer_text, answer_text)
end
# 试卷题库的问题标题
ExerciseBankQuestion.find_each do |ebq|
question_title = ke_transform_to_md ebq.question_title
ebq.update_column(:question_title, question_title)
end
# 试卷答案
ExerciseBankStandardAnswer.find_each do |ebsa|
answer_text = ke_transform_to_md ebsa.answer_text
ebsa.update_column(:answer_text, answer_text)
end
# 问卷的标题
PollQuestion.find_each do |pq|
question_title = ke_transform_to_md pq.question_title
pq.update_column(:question_title, question_title)
end
end
end

@ -0,0 +1,48 @@
class ModifyKeContentsForMarkdown < ActiveRecord::Migration[5.2]
include ActionView::Helpers::SanitizeHelper
def change
def ke_transform_to_md content
return content if content.blank?
s_contents = sanitize(content, tags: %w(img a span table td tr tbody pre), attributes: %w(src href target style))
s_contents.gsub(">\n<", "><").gsub(/^\n/, "").gsub(" ", "").gsub(/(\n)+/, "<br />")
.gsub("\t", "").gsub("\n", "").gsub(" ", "&nbsp;&nbsp;&nbsp;&nbsp;").gsub(/(<br\s?\/?>)+/, "<br />")
end
#
# # 课程讨论区
# MessageDetail.find_each do |m|
# content = ke_transform_to_md m.content
# m.update_column(:content, content)
# end
#试卷的标题
# ExerciseQuestion.find_each do |eq|
# question_title = ke_transform_to_md eq.question_title
# eq.update_column(:question_title, question_title)
# end
# # 试卷的答案
# ExerciseStandardAnswer.find_each do |esa|
# answer_text = ke_transform_to_md esa.answer_text
# esa.update_column(:answer_text, answer_text)
# end
#
# 试卷题库的问题标题
ExerciseBankQuestion.find_each do |ebq|
question_title = ke_transform_to_md ebq.question_title
ebq.update_column(:question_title, question_title)
end
#
# # 试卷答案
# ExerciseBankStandardAnswer.find_each do |ebsa|
# answer_text = ke_transform_to_md ebsa.answer_text
# ebsa.update_column(:answer_text, answer_text)
# end
# # 问卷的标题
# PollQuestion.find_each do |pq|
# question_title = ke_transform_to_md pq.question_title
# pq.update_column(:question_title, question_title)
# end
end
end

@ -4,8 +4,8 @@ class SecondMofidyKeContentsForMd < ActiveRecord::Migration[5.2]
def ke_transform_to_md content
return content if content.blank?
s_contents = sanitize(content, tags: %w(img a span table td tr tbody pre), attributes: %w(src href target style))
s_contents.gsub(">\n<", "><").gsub(/^\n/, "").gsub("    ", "").gsub(/(\n)+/, "<br />")
.gsub("\t", " ").gsub("\n", "").gsub(" ", " ").gsub(/(<br\s?\/?>)+/, "<br />")
s_contents.gsub(">\n<", "><").gsub(/^\n/, "").gsub(" ", "&nbsp;").gsub(/(\n)+/, "<br />")
.gsub("\t", "&nbsp;&nbsp;&nbsp;&nbsp;").gsub("\n", "").gsub(" ", "&nbsp;").gsub(/(<br\s?\/?>)+/, "<br />")
end

@ -4,8 +4,8 @@ class ThirdModifyKeForStudentWork < ActiveRecord::Migration[5.2]
def ke_transform_to_md content
return content if content.blank?
s_contents = sanitize(content, tags: %w(img a span table td tr tbody pre), attributes: %w(src href target style))
s_contents.gsub(">\n<", "><").gsub(/^\n/, "").gsub(" ", "").gsub(/(\n)+/, "<br />")
.gsub("\t", " ").gsub("\n", "").gsub(" ", " ").gsub(/(<br\s?\/?>)+/, "<br />")
s_contents.gsub(">\n<", "><").gsub(/^\n/, "").gsub(" ", "&nbsp;").gsub(/(\n)+/, "<br />")
.gsub("\t", "&nbsp;&nbsp;&nbsp;&nbsp;").gsub("\n", "").gsub(" ", "&nbsp;").gsub(/(<br\s?\/?>)+/, "<br />")
end
# 学生的作品 过滤掉一些描述的ke图片的作品

@ -17,6 +17,7 @@ function locationurl(list){
window.location.replace(list)
}
}
let hashTimeout
// TODO 开发期多个身份切换
let debugType =""
@ -137,6 +138,18 @@ export function initAxiosInterceptors(props) {
}
throw new axios.Cancel('Operation canceled by the user.');
} else {
// hash跳转
var hash = window.location.hash;
if (hash) {
hashTimeout && window.clearTimeout(hashTimeout)
hashTimeout = setTimeout(() => {
var element = document.querySelector(hash);
if (element) {
element.scrollIntoView();
}
}, 400)
}
}
// if(response.data.status === 401){
// console.log("401401401")

@ -372,7 +372,7 @@ class PathDetailIndex extends Component{
<span className="font-16">课程须知</span>
{detailInfoList===undefined?"":detailInfoList.allow_statistics===true?
<Tooltip placement="bottom" title={"编辑"}>
<Link to={"/paths/"+this.props.match.params.pathId+"/edit"} className="fr mtf5">
<Link to={"/paths/"+this.props.match.params.pathId+"/edit#learning_notes"} className="fr mtf5">
<i className="iconfont icon-bianjidaibeijing font-20 color-green"></i>
</Link>
</Tooltip>

@ -213,13 +213,15 @@ class PathNew extends Component{
}
render(){
let pathId = this.props.match.params.pathId;
let {pathName,description,point,flag_name}=this.state;
return(
<div className="newContainer">
<div className="newMain clearfix">
<div className="educontent mt10 mb50">
<div className="mb10 edu-back-white">
<p className="padding20 bor-bottom-greyE font-18 color-grey-3">创建实践课程</p>
<p className="padding20 bor-bottom-greyE font-18 color-grey-3">{pathId ? '编辑' : '创建'}实践课程</p>
<div className="padding30-20" id="part_Name">
<p className="color-grey-6 font-16 mb15">实践课程名称</p>
<div className="df">
@ -251,7 +253,7 @@ class PathNew extends Component{
</div>
<div className="mb10 edu-back-white padding30-20" id="part_point">
<p className="color-grey-6 font-16 mb15">学习须知</p>
<p className="color-grey-6 font-16 mb15" id="learning_notes">学习须知</p>
<div className="df">
<span className="mr30 color-orange pt10">*</span>
<div className="flex1 mr20">

Loading…
Cancel
Save