数据描述使用editorMD

This commit is contained in:
daiao 2018-02-09 10:35:28 +08:00
parent a54226a5e7
commit 691b59d856
1 changed files with 35 additions and 38 deletions

View File

@ -2,55 +2,52 @@
<%= 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', <%= 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' %> '/editormd/lib/flowchart.min.js','/editormd/lib/jquery.flowchart.min.js','/editormd/editormd.js' %>
<div class="data_showdetail"> <div class="data_showdetail">
<!--<p id="notice"><%#= notice %></p>--> <div class="detail_part">
<label>数据类别名称:</label>
<%= @statistic.name %>
</div>
<div class="detail_part"> <div class="cl detail_part">
<label>数据类别名称:</label> <label>描述:</label>
<%= @statistic.name %> <div id="statistic_description" style="width: 80%;">
<textarea class="detail_des fl" style="display: none;width: 85%"><%= @statistic.description %></textarea>
</div> </div>
</div>
<div class="cl detail_part"> <div class="detail_part">
<label>描述:</label> <label>添加时间:</label>
<textarea readonly="readonly" class="detail_des"><%= @statistic.description %></textarea> <%= format_time @statistic.created_at %>
</div> </div>
<div class="detail_part"> <div class="detail_part">
<label>添加时间:</label> <label>用户id</label>
<%= format_time @statistic.created_at %> <%= @statistic.user_id %>
</div> </div>
<div class="detail_part"> <div class="detail_part">
<label>用户id</label> <label>状态:</label>
<%= @statistic.user_id %> <%= @statistic.status %>
</div> </div>
<div class="detail_part"> <%# 附件局部刷新 %>
<label>状态:</label> <% if @attachments.present? %>
<%= @statistic.status %>
</div>
<%# 附件局部刷新 %>
<% if @attachments.present? %>
<div class="detail_part cl"> <div class="detail_part cl">
<label>附件:</label> <label>附件:</label>
<div class="fl"> <div class="fl">
<%= render :partial => 'attachments',:locals => {:attachments => @attachments} %> <%= render :partial => 'attachments',:locals => {:attachments => @attachments} %>
</div> </div>
</div> </div>
<% end %> <% end %>
<div class="detail_part"> <div class="detail_part">
<label>&nbsp;</label> <label>&nbsp;</label>
<%= link_to '编辑', edit_statistic_path(@statistic) ,:class => "submit_btn" %> <%= link_to '编辑', edit_statistic_path(@statistic) ,:class => "submit_btn" %>
<%= link_to '返回', statistics_path ,:class=>"grey_btn" %> <%= link_to '返回', statistics_path ,:class=>"grey_btn" %>
</div> </div>
</div> </div>
<script> <script>
$(document).ready(function() { $(document).ready(function() {
editormd.loadKaTeX(function() { var taskPassMD = editormd.markdownToHTML("statistic_description", {
var taskPassMD = editormd.markdownToHTML("challenge_task_pass_show", { htmlDecode: "style,script,iframe", // you can filter tags decode
htmlDecode: "style,script,iframe", // you can filter tags decode taskList: true,
taskList: true, tex: true, // 默认不解析
tex: true, // 默认不解析 flowChart: true, // 默认不解析
flowChart: true, // 默认不解析 sequenceDiagram: true // 默认不解析
sequenceDiagram: true // 默认不解析
});
}); });
}); });
</script> </script>