You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
educoder/app/views/shixuns/index.json.jbuilder

32 lines
1.0 KiB

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# if @fuzzy_searchs
# json.keyword @fuzzy_searchs
# json.total_count @fuzzy_searchs.blank? ? nil : @total_count
# end
json.total_count @total_count
json.pagination @total_count > 16 ? true : false
json.search_tags @search_tags
json.shixuns do
json.partial! 'shixun', locals: {shixuns: @shixuns}
end
s_s = '<p>
作业要求:
</p>
<p>
&nbsp;&nbsp;&nbsp;&nbsp; 1、本作业要求分组完成一个大型程序
</p>
<p>
&nbsp;&nbsp;&nbsp;&nbsp; 2、请按任课教师要求分组
</p>
<p>
&nbsp;&nbsp;&nbsp;&nbsp; 3、每组建议为1-2人
</p>
<p>
&nbsp;&nbsp;&nbsp;&nbsp; 4、每个人都需要完成必要的工作任务并及时提交个人的过程材料
</p>
<p>
&nbsp;&nbsp;&nbsp;&nbsp; 5、上传的单个文件大小不能超过2GB
</p>'
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(" ", " ")