1 {% extends
"../base.html" %}
3 {% block title %}{{ _(
"Publish %s") % post.title }}{% end block %}
6 <section class=
"hero is-primary">
7 <div class=
"hero-body">
8 <div class=
"container">
9 <nav class=
"breadcrumb" aria-label=
"breadcrumbs">
15 <a href=
"/blog">Blog
</a>
18 <a href=
"/blog/">{{ post.title }}
</a>
20 <li class=
"is-active">
21 <a href=
"#" aria-current=
"page">{{ _(
"Publish %s") % post.title }}
</a>
25 <h3 class=
"title is-3">{{ _(
"Publish Post") }}
</h3>
26 <h4 class=
"title is-4">{{ post.title }}
</h4>
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>
37 <form action=
"" method=
"POST">
38 {% raw xsrf_form_html() %}
42 <input type=
"hidden" name=
"when">
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
>
58 <div class=
"level-left">
59 <button type=
"submit" class=
"button is-success has-text-weight-bold is-halfwidth">{{ _(
"Publish") }}
</button>
61 <div class=
"level-right">
62 <a class=
"button is-danger has-text-weight-bold is-halfwidth" href=
"/post/{{ post.slug }}">{{ _(
"Cancel") }}
</a>
74 {% block javascript %}
75 <script type=
"text/javascript">
76 $(document).ready(function() {
77 var when = $(
"input[name='when']");
79 $(
"input[type='datetime-local']").on(
"change keyup", function(event) {
80 var value = $(this).val();
82 // Parse date and format with timezone
84 var date = new Date(value);
85 value = date.toISOString();