Repository navigation
Expand file tree
/
Copy pathedit.html
More file actions
116 lines (112 loc) · 3.63 KB
/
Copy pathedit.html
File metadata and controls
116 lines (112 loc) · 3.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<div id='sidebar'>
<div class='panel'>
<div class='header'>
<span class='col_fade'>话题发布步骤</span>
</div>
<div class='inner'>
<ol>
<li>填写标题</li>
<li>填写内容</li>
<li>选择话题标签</li>
<li>确认后发布话题</li>
</ol>
</div>
</div>
<div class='panel'>
<div class='header'>
<span class='col_fade'>话题发布指南</span>
</div>
<div class='inner'>
<ol>
<li>尽量把话题要点浓缩到标题里</li>
<li>内容对标题做进一步说明,但不是必须的</li>
<li>给话题选择合适的标签能增加被阅读的机会</li>
</ol>
</div>
</div>
<div class='panel'>
<div class='header'>
<span class='col_fade'>markdown语法参考</span>
</div>
<div class='inner'>
<ol>
<li>换行:两个空格</li>
<li>分段:一个空行</li>
<li>斜体:*斜体*</li>
<li>粗体:**粗体**</li>
<li>代码:行首四个空格</li>
<li>链接:[文字](url)</li>
<li>图片:</li>
</ol>
<span>详见 <a href='http://www.ituring.com.cn/article/775' target='_blank'>Markdown Wiki</a></span>
</div>
</div>
</div>
<div id='content'>
<div class='panel'>
<div class='header'>
<ol class='breadcrumb'>
<li><a href='/'>主页</a><span class='divider'>/</span></li>
<% if(locals.action && action == 'edit'){ %>
<li class='active'>编辑话题</li>
<% }else{ %>
<li class='active'>发布话题</li>
<% } %>
</ol>
</div>
<div class='inner post'>
<% if(locals.edit_error){ %>
<div class="alert alert-error">
<a class="close" data-dismiss="alert" href="#">×</a>
<strong><%= edit_error %></strong>
</div>
<% } %>
<% if(locals.error){ %>
<div class="alert alert-error" >
<strong><%= error %></strong>
</div>
<% }else{ %>
<% if (locals.action && action === 'edit') { %>
<form id='create_topic_form' action='/topic/<%= topic_id %>/edit' method='post'>
<% } else { %>
<form id='create_topic_form' action='/topic/create' method='post'>
<% } %>
<fieldset>
<label class='bold' for='title'>标题</label>
<textarea class='span9' id='title' name='title' rows='1' placeholder="请在此输入标题,字数控制在10到100个之间"><%= locals.title || '' %></textarea>
<label class='bold' for='t_content'>内容</label>
<textarea class='editor' id='wmd-input' name='t_content' rows='20'><%= locals.content || '' %></textarea>
<input type='hidden' id='topic_tags' name='topic_tags' value=''></input>
<input type='hidden' name='_csrf' value='<%= csrf %>' />
<button id='submit_btn' type="submit" class='btn'>发布</button>
</fieldset>
</form>
</div>
<% } %>
</div>
</div>
<!-- ajaxupload -->
<!-- markdown editor -->
<%- Loader('/public/topic_edit.min.js')
.js('/public/libs/ajax-upload/ajaxupload.js')
.js('/public/libs/epiceditor/epiceditor.js')
.js('/public/javascripts/editor.js')
.done(assets, config.site_static_host, config.mini_assets)
%>
<script>
$(function () {
$('.tag_selectable').click(function(){
$(this).toggleClass('tag_select');
});
$('#submit_btn').click(function(){
var values=[];
$('.tag_selectable').each(function(){
if($(this).hasClass('tag_select')){
values.push($(this).attr('tag_id'));
}
});
$('#topic_tags').val(values);
$('#create_topic_form').submit();
});
});
</script>