educoder/app/views/challenges/index.html.erb

38 lines
1.6 KiB
Plaintext

<%= stylesheet_link_tag '/editormd/css/editormd','/editormd/css/editormd.min.css' %>
<%= javascript_include_tag '/editormd/lib/marked.min.js','/editormd/lib/prettify.min.js','/editormd/lib/raphael.min.js','/editormd/lib/underscore.min.js','/editormd/lib/sequence-diagram.min.js',
'/editormd/lib/flowchart.min.js','/editormd/lib/jquery.flowchart.min.js','/editormd/editormd.js'%>
<style>
.editormd-html-preview {
width: 96%;
}
</style>
<div class="task-pm-content">
<% if @shixun.status == 1 && (User.current.manager_of_shixun?(@shixun) || User.current.admin?) %>
<div class="alert alert-orange mb15 mt15">正在等待管理员的审核。如果需要编辑更新,请先撤销发布</div>
<% end %>
<div class="task-pm-box mt20">
<div class="panel-header">
<h3 class="shixun_title">简介</h3>
</div>
<div class="task-paner-con break_full_word new_li" id="challenge_editorMd_description">
<textarea style="display:none;"><%= @shixun.description %></textarea>
</div>
</div>
<div id="challenge_list">
<%= render :partial => "content_list" %>
</div>
</div>
<script type="text/javascript">
$(document).ready(function() {
/* -------------- 简介Md -------------------- */
var shixunDescr = editormd.markdownToHTML("challenge_editorMd_description", {
htmlDecode: "style,script,iframe", // you can filter tags decode
taskList: true,
tex: true, // 默认不解析
flowChart: true, // 默认不解析
sequenceDiagram: true // 默认不解析
});
});
</script>