diff --git a/app/views/challenges/index.html.erb b/app/views/challenges/index.html.erb index 15c892faa..6bf85991f 100644 --- a/app/views/challenges/index.html.erb +++ b/app/views/challenges/index.html.erb @@ -1,21 +1,35 @@ -<%= content_for(:header_tags) do %> - <%= import_ke(enable_at: true,init_activity: true) %> -<% end %> - +<%= stylesheet_link_tag '/editormd/css/editormd','/editormd/css/editormd.min' %> +<%= 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'%> +
-
+

简介

-
-

- <%= h @shixun.description.html_safe %> -

+ +
+
-
<%= render :partial => "content_list" %>
+ \ No newline at end of file diff --git a/app/views/shixuns/_settings_edit.html.erb b/app/views/shixuns/_settings_edit.html.erb index 3046d12cc..1e8178fea 100644 --- a/app/views/shixuns/_settings_edit.html.erb +++ b/app/views/shixuns/_settings_edit.html.erb @@ -1,6 +1,3 @@ -<%= content_for(:header_tags) do %> - <%= import_ke(enable_at: false, prettify: false, init_activity: false) %> -<% end %>
    <%= labelled_form_for @shixun do |f| %> @@ -11,27 +8,19 @@
  • - <%= f.kindeditor :description, :editor_id => 'shixun_setting_editor', - :owner_id => @shixun.nil? ? 0: @shixun.id, - :owner_type => OwnerTypeHelper::PROJECT, - :width => '89.7%', - :height => 300, - :minHeight=> 300, - :class => 'fl ml5 w690', - :input_html => { :id => 'project_description', - :class => 'courses_text fl', - :maxlength => 5000 } - %> +
    + +
  • <%= select_tag :language, options_for_select(["Java","C","C++","Python","Ruby","Mysql-Java"], @shixun.language), :id => 'shixun[language]', :style => "height:40px;" %>
  • -
  • +
  • 保存
  • @@ -54,9 +43,30 @@ //配置-信息提交 function submit_edit_shixun(id) { - shixun_setting_editor.sync(); if (regex_shixun_name()) { $("#edit_shixun_" + id).submit(); } } + /* ------------------------------- 简介md ------------------------------ */ + setting_editormd = editormd("setting_introduction", { + width : "89.7%", + height : 300, + syncScrolling : "single", + //你的lib目录的路径,我这边用JSP做测试的 + path : "/editormd/lib/", + toolbarIcons : function() { + // Or return editormd.toolbarModes[name]; // full, simple, mini + // Using "||" set icons align right. + return ["bold", "italic", "|", "list-ul", "list-ol", "|", "image", "code", "code-block", "|", "table", "watch", "clear"] + }, + //这个配置在simple.html中并没有,但是为了能够提交表单,使用这个配置可以让构造出来的HTML代码直接在第二个隐藏的textarea域中,方便post提交表单。 + saveHTMLToTextarea : true, + autoFocus: false, + // 用于增加自定义工具栏的功能,可以直接插入HTML标签,不使用默认的元素创建图标 + dialogMaskOpacity : 0.6, + placeholder: "请输入完成当前任务依赖的知识点或者其它相关信息", + imageUpload : true, + imageFormats : ["jpg", "jpeg", "gif", "png", "bmp", "webp", "JPG", "JPEG", "GIF", "PNG", "BMP", "WEBP"], + imageUploadURL : "<%= upload_with_markdown_path(:container_id => @shixun.id, :container_type => @shixun.class) %>" //url + }); diff --git a/app/views/shixuns/new.html.erb b/app/views/shixuns/new.html.erb index 02848ad9a..0517123f2 100644 --- a/app/views/shixuns/new.html.erb +++ b/app/views/shixuns/new.html.erb @@ -5,7 +5,7 @@

    <%= User.current.show_name %> > 项目实训 > 新建实训

    -
    +

    新建实训

    <%= render :partial => 'form' %> diff --git a/app/views/shixuns/settings.html.erb b/app/views/shixuns/settings.html.erb index 611d91334..71867c05b 100644 --- a/app/views/shixuns/settings.html.erb +++ b/app/views/shixuns/settings.html.erb @@ -1,3 +1,5 @@ +<%= stylesheet_link_tag '/editormd/css/editormd','/editormd/css/editormd.min.css' %> +<%= javascript_include_tag '/editormd/editormd.min.js' %>
    @@ -25,32 +27,7 @@
    -<% if false %> -
    -
    -
      - <% show_memu = show_project_memu User.current %> -
    • 信息
    • - -
    • 版本库
    • - -
    -
    -
    -
    - <%= render :partial=> "shixuns/settings_edit" %> -
    -
    - <%= render :partial=>"shixuns/settings_repository" %> -
    - - - - -
    -
    -<% end %>