Populate redraft form

This commit is contained in:
Mouse Reeve
2021-04-03 15:47:47 -07:00
parent 6ed74e6f60
commit ffb7f8f7ce
6 changed files with 46 additions and 37 deletions

View File

@ -1,5 +1,12 @@
{% load i18n %}
<div class="control{% if not parent_status.content_warning %} hidden{% endif %}" id="spoilers-{{ uuid }}">
<div class="control{% if not parent_status.content_warning and not draft.content_warning %} hidden{% endif %}" id="spoilers-{{ uuid }}">
<label class="is-sr-only" for="id_content_warning-{{ uuid }}">{% trans "Spoiler alert:" %}</label>
<input type="text" name="content_warning" maxlength="255" class="input" id="id_content_warning-{{ uuid }}" placeholder="{% trans 'Spoilers ahead!' %}"{% if parent_status.content_warning %} value="{{ parent_status.content_warning }}"{% endif %}>
<input
type="text"
name="content_warning"
maxlength="255"
class="input"
id="id_content_warning-{{ uuid }}"
placeholder="{% trans 'Spoilers ahead!' %}"
value="{% firstof draft.content_warning parent_status.content_warning '' %}">
</div>