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 {% if entry %}
value=
"{{ entry.title }}"{% end %}
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
") }}">{% if entry %}{{ entry.markdown }}{% end %}
</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" {% if entry %}
value=
"{{ " ".join(entry.tags) }}"{% end %}
37 placeholder=
"{{ _("Tags
") }}" autocomplete=
"off">
43 <div class=
"control-group">
44 <label class=
"control-label">{{ _(
"Status") }}
</label>
45 <div class=
"controls">
46 <label class=
"radio inline">
47 <input type=
"radio" name=
"status" value=
"draft" {% if not entry or not entry.is_published() %}checked{% end %}
>
50 <label class=
"radio inline">
51 <input type=
"radio" name=
"status" value=
"published" {% if entry and entry.is_published() %}checked{% end %}
>
57 <div class=
"form-actions">
58 <button type=
"submit" class=
"btn btn-primary">{{ _(
"Save") }}
</button>
59 <a class=
"btn" href=
"javascript:preview();">{{ _(
"Preview") }}
</a>
60 <a class=
"btn" href=
"/planet">{{ _(
"Cancel") }}
</a>
64 <div id=
"preview"></div>
66 <script type=
"text/javascript">
67 preview = function() {
68 $.postJSON(
"/api/planet/render", { text : $(
"#inputMarkdown").val() },
70 $(
"#preview").html(data.html);