2021-05-19 21:55:01 +00:00
|
|
|
{% extends 'components/inline_form.html' %}
|
|
|
|
{% load i18n %}
|
|
|
|
|
|
|
|
{% block header %}
|
2021-05-21 03:21:04 +00:00
|
|
|
{% if announcement %}
|
|
|
|
{% trans "Edit Announcement" %}
|
|
|
|
{% else %}
|
2021-05-19 21:55:01 +00:00
|
|
|
{% trans "Create Announcement" %}
|
2021-05-21 03:21:04 +00:00
|
|
|
{% endif %}
|
2021-05-19 21:55:01 +00:00
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
{% block form %}
|
2021-05-20 15:56:17 +00:00
|
|
|
{% csrf_token %}
|
|
|
|
<input type="hidden" name="user" value="{{ request.user.id }}">
|
|
|
|
<p>
|
|
|
|
<label class="label" for="id_preview">Preview:</label>
|
|
|
|
{{ form.preview }}
|
|
|
|
{% for error in form.preview.errors %}
|
|
|
|
<p class="help is-danger">{{ error | escape }}</p>
|
|
|
|
{% endfor %}
|
|
|
|
</p>
|
|
|
|
<p>
|
|
|
|
<label class="label" for="id_content">Content:</label>
|
|
|
|
{{ form.content }}
|
|
|
|
{% for error in form.content.errors %}
|
|
|
|
<p class="help is-danger">{{ error | escape }}</p>
|
|
|
|
{% endfor %}
|
|
|
|
</p>
|
|
|
|
<p>
|
|
|
|
<label class="label" for="id_event_date">Event date:</label>
|
2021-05-21 03:21:04 +00:00
|
|
|
<input type="date" name="event_date" value="{{ form.event_date.value|date:'Y-m-d' }}" class="input" id="id_event_date">
|
2021-05-20 15:56:17 +00:00
|
|
|
{% for error in form.event_date.errors %}
|
|
|
|
<p class="help is-danger">{{ error | escape }}</p>
|
|
|
|
{% endfor %}
|
|
|
|
</p>
|
|
|
|
<hr aria-hidden="true">
|
|
|
|
<div class="columns">
|
|
|
|
<div class="column">
|
|
|
|
<p>
|
|
|
|
<label class="label" for="id_start_date">Start date:</label>
|
2021-05-21 03:21:04 +00:00
|
|
|
<input type="date" name="start_date" class="input" value="{{ form.start_date.value|date:'Y-m-d' }}" id="id_start_date">
|
2021-05-20 15:56:17 +00:00
|
|
|
{% for error in form.start_date.errors %}
|
|
|
|
<p class="help is-danger">{{ error | escape }}</p>
|
|
|
|
{% endfor %}
|
|
|
|
</p>
|
2021-05-19 21:55:01 +00:00
|
|
|
</div>
|
2021-05-20 15:56:17 +00:00
|
|
|
<div class="column">
|
|
|
|
<p>
|
|
|
|
<label class="label" for="id_end_date">End date:</label>
|
2021-05-21 03:21:04 +00:00
|
|
|
<input type="date" name="end_date" class="input" id="id_end_date" value="{{ form.end_date.value|date:'Y-m-d' }}">
|
2021-05-20 15:56:17 +00:00
|
|
|
{% for error in form.end_date.errors %}
|
|
|
|
<p class="help is-danger">{{ error | escape }}</p>
|
|
|
|
{% endfor %}
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
<div class="column is-narrow">
|
|
|
|
<p>
|
|
|
|
<label class="label" for="id_active">Active:</label>
|
|
|
|
{{ form.active }}
|
|
|
|
{% for error in form.active.errors %}
|
|
|
|
<p class="help is-danger">{{ error | escape }}</p>
|
|
|
|
{% endfor %}
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
2021-05-19 21:55:01 +00:00
|
|
|
|
2021-05-20 15:56:17 +00:00
|
|
|
<div class="field has-addons">
|
|
|
|
<div class="control">
|
|
|
|
<button type="submit" class="button is-primary">{% trans "Save" %}</button>
|
2021-05-19 21:55:01 +00:00
|
|
|
</div>
|
2021-05-20 15:56:17 +00:00
|
|
|
</div>
|
2021-05-19 21:55:01 +00:00
|
|
|
{% endblock %}
|