1 {% extends
"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=
"form-group">
16 <label class=
"control-label col-sm-2" for=
"inputTitle">{{ _(
"Title") }}
</label>
17 <div class=
"col-sm-10">
18 <input class=
"form-control" type=
"text" name=
"title" id=
"inputTitle"
19 {% if entry %}
value=
"{{ entry.title }}"{% end %}
placeholder=
"{{ _("Title
") }}">
23 <div class=
"form-group">
24 <div class=
"col-sm-10 col-sm-offset-2">
25 <textarea class=
"form-control" name=
"markdown" rows=
"12" id=
"inputMarkdown"
26 placeholder=
"{{ _("Content
") }}">{% if entry %}{{ entry.markdown }}{% end %}
</textarea>
32 <div class=
"form-group">
33 <label class=
"control-label col-sm-2">{{ _(
"Status") }}
</label>
34 <div class=
"col-sm-10">
35 <label class=
"radio inline">
36 <input type=
"radio" name=
"status" value=
"draft" {% if not entry or not entry.is_published() %}checked{% end %}
>
39 <label class=
"radio inline">
40 <input type=
"radio" name=
"status" value=
"published" {% if entry and entry.is_published() %}checked{% end %}
>
48 <div class=
"col-sm-10 col-sm-offset-2">
49 <button type=
"submit" class=
"btn btn-primary">{{ _(
"Save") }}
</button>
50 <a class=
"btn btn-default" href=
"javascript:preview();">{{ _(
"Preview") }}
</a>
51 <a class=
"btn btn-default" href=
"/planet">{{ _(
"Cancel") }}
</a>
55 <br class=
"separator">
57 <div id=
"preview"></div>
59 <script type=
"text/javascript">
60 preview = function() {
61 $.postJSON(
"/api/planet/render", { text : $(
"#inputMarkdown").val() },
63 $(
"#preview").html(data.html);