Skip to content

Commit 1e07354

Browse files
committed
Merge pull request #100 from mozillazg/markdown-editor
widgets/markdown_editor.html use jinja2
2 parents ca2c075 + 7f59a54 commit 1e07354

File tree

2 files changed

+47
-45
lines changed

2 files changed

+47
-45
lines changed

firefly/templates/index.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{% extends "base.html" %}
2+
{% import 'widgets/markdown_editor.html' as markdown_editor %}
23

34
{% block title %}
45
首页
@@ -97,6 +98,10 @@
9798
<link href="{{url_for('static', filename='stylesheets/index.css')}}" rel="stylesheet" media="all"/>
9899
{% endblock %}
99100

101+
{% block others %}
102+
{{ markdown_editor.index() }}
103+
{% endblock %}
104+
100105
{% block footer_script %}
101106
<script>
102107
require(['../static/javascripts/common'], function (common) {
Lines changed: 42 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,45 @@
1-
- def index()
2-
div#reply-control.open.edit-title.hide
3-
div.contents
4-
div.edit-control
5-
a.toggler href="" class="toggler" title="hide or show the composer panel"
6-
div.control-row.reply-area
7-
div.composer-fields
8-
div.reply-to
9-
创建新主题:
10-
div.form-element.clearfix
11-
div.title-input
12-
input#reply-title placeholder="What is this discussion about in one brief sentence?" tabindex="2" type="text" maxlength="255"
13-
div.category-input
14-
select#reply-category.combobox.category-combobox tabindex="-1" title=""
15-
16-
div.wmd-controls style="top: 100px; bottom: 89px;"
17-
div.textarea-wrapper
18-
textarea#wmd-input tabindex="4"
19-
20-
div.preview-wrapper.regular
21-
div#wmd-preview.cooked
22-
div.composer-bottom-right
23-
a.toggle-preview href="#"
24-
« 关闭预览
25-
div#file-uploading.hidden
26-
div.spinner.small
27-
Uploading %
28-
a#cancel-file-upload
29-
cancel
30-
31-
div.submit-panel
32-
div.composer-fields-below-outlet.add-tags
33-
div.select2-container.select2-container-multi.ember-text-field.tag-chooser
34-
ul.select2-choices
35-
li.select2-search-field
36-
label.select2-offscreen for="s2id_autogen1"
37-
input type="text" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" class="select2-input select2-default" id="s2id_autogen1" tabindex="4" maxlength="20" placeholder="" style="width: 481px;"
38-
div.select2-drop.select2-drop-multi.select2-display-none
39-
ul.select2-results
40-
input.tag-chooser type="text" tabindex="-1" style="display: none;"
41-
button.btn.btn-primary.create tabindex="5" title="Or press Ctrl+Enter"
42-
i.fa.fa-plus
43-
创建主题
44-
a.cancel href="#" tabindex="6"
45-
取消
1+
{% macro index() -%}
2+
<div id="reply-control" class="open edit-title hide">
3+
<div class="contents">
4+
<div class="edit-control">
5+
<a href="" title="hide or show the composer panel" class="toggler toggler"></a>
6+
<div class="control-row reply-area">
7+
<div class="composer-fields">
8+
<div class="reply-to">创建新主题:</div>
9+
<div class="form-element clearfix">
10+
<div class="title-input"><input placeholder="What is this discussion about in one brief sentence?" tabindex="2" type="text" maxlength="255" id="reply-title"/></div>
11+
<div class="category-input"><select tabindex="-1" title="" id="reply-category" class="combobox category-combobox"></select></div>
12+
</div>
13+
</div>
14+
<div style="top: 100px; bottom: 89px;" class="wmd-controls">
15+
<div class="textarea-wrapper"><textarea tabindex="4" id="wmd-input"></textarea></div>
16+
<div class="preview-wrapper regular">
17+
<div id="wmd-preview" class="cooked"></div>
18+
</div>
19+
<div class="composer-bottom-right">
20+
<a href="#" class="toggle-preview">« 关闭预览</a>
21+
<div id="file-uploading" class="hidden">
22+
<div class="spinner small"></div>
23+
Uploading %
24+
<a id="cancel-file-upload">
25+
<cancel></cancel>
26+
</a>
27+
</div>
28+
</div>
29+
</div>
30+
<div class="submit-panel">
31+
<div class="composer-fields-below-outlet add-tags">
32+
<input type="text" tabindex="-1" style="display: none;" class="tag-chooser"/>
33+
</div>
34+
<button tabindex="5" title="Or press Ctrl+Enter" class="btn btn-primary create"><i class="fa fa-plus"></i>创建主题</button><a href="#" tabindex="6" class="cancel">取消</a>
35+
</div>
36+
</div>
37+
</div>
38+
</div>
39+
</div>
40+
{%- endmacro %}
4641

42+
{#
4743
- def topic()
4844
div#reply-control.open.hide
4945
div.grippie
@@ -79,3 +75,4 @@
7975
发布评论
8076
a.cancel href="#" tabindex="6"
8177
取消
78+
#}

0 commit comments

Comments
 (0)