]> git.ipfire.org Git - ipfire.org.git/blob - src/templates/blog/publish.html
wiki: Only match usernames when a word starts with @
[ipfire.org.git] / src / templates / blog / publish.html
1 {% extends "../base.html" %}
2
3 {% block title %}{{ _("Publish %s") % post.title }}{% end block %}
4
5 {% block container %}
6 <section class="hero is-primary">
7 <div class="hero-body">
8 <div class="container">
9 <nav class="breadcrumb" aria-label="breadcrumbs">
10 <ul>
11 <li>
12 <a href="/">Home</a>
13 </li>
14 <li>
15 <a href="/blog">Blog</a>
16 </li>
17 <li>
18 <a href="/blog/">{{ post.title }}</a>
19 </li>
20 <li class="is-active">
21 <a href="#" aria-current="page">{{ _("Publish %s") % post.title }}</a>
22 </li>
23 </ul>
24 </nav>
25 <h3 class="title is-3">{{ _("Publish Post") }}</h3>
26 <h4 class="title is-4">{{ post.title }}</h4>
27 </div>
28 </div>
29 </section>
30
31 <div class="container">
32 <section class="section has-text-centered">
33 <div class="columns is-centered">
34 <div class="column is-one-fifth">
35 <h5 class="title is-5">When to Publish</h5>
36
37 <form action="" method="POST">
38 {% raw xsrf_form_html() %}
39
40 <div class="block">
41 <div class="field">
42 <input type="hidden" name="when">
43 </div>
44 </div>
45
46 <div class="block">
47 <div class="field">
48 <p class="control">
49 <input type="datetime-local" class="input"
50 pattern="[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}" required>
51 </p>
52 </div>
53 </div>
54
55 <div class="block">
56 <div class="field">
57 <div class="level">
58 <div class="level-left">
59 <button type="submit" class="button is-success has-text-weight-bold is-halfwidth">{{ _("Publish") }}</button>
60 </div>
61 <div class="level-right">
62 <a class="button is-danger has-text-weight-bold is-halfwidth" href="/post/{{ post.slug }}">{{ _("Cancel") }}</a>
63 </div>
64 </div>
65 </div>
66 </div>
67 </div>
68 </div>
69 </form>
70 </section>
71 </div>
72 {% end block %}
73
74 {% block javascript %}
75 <script type="text/javascript">
76 $(document).ready(function() {
77 var when = $("input[name='when']");
78
79 $("input[type='datetime-local']").on("change keyup", function(event) {
80 var value = $(this).val();
81
82 // Parse date and format with timezone
83 if (value) {
84 var date = new Date(value);
85 value = date.toISOString();
86 }
87
88 when.val(value);
89 }).change();
90 });
91 </script>
92 {% end %}