1 {% extends
"admin-base.html" %}
4 <div class=
"page-header">
5 <h2>{{ _(
"Compose new entry") }}
</h2>
8 <form class=
"form-horizontal" action=
"" method=
"POST" name=
"entry">
9 {% raw xsrf_form_html() %}
12 <input type=
"hidden" name=
"id" value=
"{{ entry.id }}">
15 <div class=
"control-group">
16 <label class=
"control-label" for=
"inputTitle">{{ _(
"Title") }}
</label>
17 <div class=
"controls">
18 <input class=
"input-block-level" type=
"text" name=
"title" id=
"inputTitle"
19 value=
"{{ entry.title }}" placeholder=
"{{ _("Title
") }}">
23 <div class=
"control-group">
24 <div class=
"controls">
25 <textarea class=
"input-block-level" name=
"markdown" rows=
"12" id=
"inputMarkdown"
26 placeholder=
"{{ _("Content
") }}">{{ entry.markdown }}
</textarea>
32 <div class=
"control-group">
33 <label class=
"control-label" for=
"inputTags">{{ _(
"Tags") }}
</label>
34 <div class=
"controls">
35 <input class=
"input-block-level planet-search-autocomplete" type=
"text"
36 name=
"tags" id=
"inputTags" value=
"{{ " ".join(entry.tags) }}"
37 placeholder=
"{{ _("Tags
") }}" autocomplete=
"off">
40 <div class=
"form-actions">
41 <button type=
"submit" class=
"btn btn-primary">{{ _(
"Save") }}
</button>
42 <a class=
"btn" href=
"javascript:preview();">{{ _(
"Preview") }}
</a>
43 <a class=
"btn" href=
"/planet">{{ _(
"Cancel") }}
</a>
47 <div id=
"preview"></div>
49 <script type=
"text/javascript">
50 preview = function() {
51 $.postJSON(
"/api/planet/render", { text : $(
"#inputMarkdown").val() },
53 $(
"#preview").html(data.html);