bookwyrm/bookwyrm/templates/snippets/create_status/content_warning_field.html
2022-07-10 13:16:28 +10:00

34 lines
1.2 KiB
HTML

{% load i18n %}
<div class="field is-relative tour-spoiler-alert">
<details
{% if reply_parent.content_warning or draft.content_warning %}open{% endif %}
>
<summary class="is-flex">
<span class="icon icon-warning is-size-5 mr-1" aria-hidden="true"></span>
<span>
{% trans "Include spoiler alert" %}
</span>
<span class="details-close icon icon-x" aria-hidden="true"></span>
</summary>
<label
class="label"
for="id_content_warning_{{ uuid }}{{ local_uuid }}"
>
{% trans "Spoilers/content warnings:" %}
</label>
<div class="control">
<input
type="text"
name="content_warning"
maxlength="255"
class="input"
id="id_content_warning_{{ uuid }}{{ local_uuid }}"
placeholder="{% trans 'Spoilers ahead!' %}"
value="{% firstof draft.content_warning reply_parent.content_warning '' %}"
{% if not draft %}data-cache-draft="id_content_warning_{{ book.id }}_{{ type }}"{% endif %}
>
</div>
</details>
</div>