moviewyrm/bookwyrm/templates/snippets/create_status/content_warning_toggle.html

18 lines
819 B
HTML
Raw Normal View History

{% load i18n %}
<div class="control">
<input
type="checkbox"
class="is-hidden"
name="sensitive"
2021-09-18 21:05:17 +00:00
id="id_show_spoilers_{{ uuid }}{{ local_uuid }}"
{% if draft.content_warning or status.content_warning %}checked{% endif %}
aria-hidden="true"
data-cache-draft="id_sensitive_{{ book.id }}_{{ type }}{{ reply_parent.id }}"
>
{% trans "Include spoiler alert" as button_text %}
{% firstof draft.content_warning status.content_warning as pressed %}
2021-09-18 21:05:17 +00:00
{% firstof local_uuid '' as local_uuid %}
{% include 'snippets/toggle/toggle_button.html' with text=button_text icon="warning is-size-4" controls_text="spoilers" controls_uid=uuid|add:local_uuid focus="id_content_warning" checkbox="id_show_spoilers" class="toggle-button" pressed=pressed %}
</div>