]>
Commit | Line | Data |
---|---|---|
541c952b MT |
1 | {% extends "base.html" %} |
2 | ||
3 | {% block title %}{% if post %}{{ _("Edit %s") % post.title }}{% else %}{{ _("Compose A New Article") }}{% end %}{% end block %} | |
4 | ||
5 | {% block main %} | |
6 | <div class="card"> | |
7 | <div class="card-body"> | |
8 | <form action="" method="POST"> | |
9 | {% raw xsrf_form_html() %} | |
10 | ||
11 | <div class="form-group"> | |
12 | <input type="text" class="form-control" name="title" placeholder="{{ _("Title") }}" | |
13 | {% if post %}value="{{ post.title }}"{% end %} required> | |
14 | </div> | |
15 | ||
16 | <div class="form-group"> | |
17 | <textarea class="form-control" rows="16" name="text" placeholder="{{ _("Text") }}" | |
18 | required>{% if post %}{{ post.text }}{% end %}</textarea> | |
19 | </div> | |
20 | ||
21 | <div class="form-group row"> | |
22 | <label class="col-sm-2 col-form-label">{{ _("Tags") }}</label> | |
23 | <div class="col-sm-10"> | |
93725180 MT |
24 | <input type="text" class="form-control" name="tags" |
25 | {% if post %}value="{{ " ".join(post.tags) }}"{% end %}> | |
541c952b MT |
26 | </div> |
27 | </div> | |
28 | ||
29 | <button type="submit" class="btn btn-primary btn-block"> | |
30 | {{ _("Save") }} | |
31 | </button> | |
9fa06206 MT |
32 | |
33 | {% if post %} | |
34 | <a class="btn btn-outline-primary btn-block" href="/post/{{ post.slug }}/delete"> | |
35 | {{ _("Delete") }} | |
36 | </a> | |
37 | {% end %} | |
541c952b MT |
38 | </form> |
39 | </div> | |
40 | </div> | |
41 | {% end block %} |