2021-01-20 00:16:22 +00:00
{% load bookwyrm_tags %}
2021-01-29 19:14:18 +00:00
< form class = "is-flex-grow-1" name = "{{ type }}" action = "/post/{% if type == 'direct' %}status{% else %}{{ type }}{% endif %}" method = "post" id = "tab-{{ type }}-{{ book.id }}{{ reply_parent.id }}" >
2020-11-06 21:33:26 +00:00
{% csrf_token %}
< input type = "hidden" name = "book" value = "{{ book.id }}" >
< input type = "hidden" name = "user" value = "{{ request.user.id }}" >
2021-01-17 03:57:20 +00:00
< input type = "hidden" name = "reply_parent" value = "{{ reply_parent.id }}" >
2020-11-06 21:33:26 +00:00
{% if type == 'review' %}
< div class = "control" >
< label class = "label" for = "id_name_{{ book.id }}_{{ type }}" > Title:< / label >
< input type = "text" name = "name" maxlength = "255" class = "input" required = "" id = "id_name_{{ book.id }}_{{ type }}" placeholder = "My {{ type }} of '{{ book.title }}'" >
< / div >
{% endif %}
< div class = "control" >
2021-01-29 19:14:18 +00:00
{% if type != 'reply' and type != 'direct' %}
2021-01-12 22:02:38 +00:00
< label class = "label" for = "id_{% if type == 'quotation' %}quote{% else %}content{% endif %}_{{ book.id }}_{{ type }}" > {{ type|title }}:< / label >
2021-01-17 03:57:20 +00:00
{% endif %}
2020-11-06 21:33:26 +00:00
{% if type == 'review' %}
2020-11-09 19:33:50 +00:00
< fieldset >
2020-11-09 19:40:19 +00:00
< legend class = "is-sr-only" > Rating< / legend >
2020-11-09 19:33:50 +00:00
< div class = "field is-grouped stars form-rate-stars" >
2020-11-10 05:26:22 +00:00
< label class = "is-sr-only" for = "no-rating-{{ book.id }}" > No rating< / label >
< input class = "is-sr-only" type = "radio" name = "rating" value = "" id = "no-rating-{{ book.id }}" checked >
2020-11-09 19:33:50 +00:00
{% for i in '12345'|make_list %}
2020-11-10 05:26:22 +00:00
< input class = "is-sr-only" id = "book{{book.id}}-star-{{ forloop.counter }}" type = "radio" name = "rating" value = "{{ forloop.counter }}" >
< label class = "icon icon-star-empty" for = "book{{book.id}}-star-{{ forloop.counter }}" >
< span class = "is-sr-only" > {{ forloop.counter }} star{{ forloop.counter | pluralize }}< / span >
< / label >
2020-11-09 19:33:50 +00:00
{% endfor %}
< / div >
< / fieldset >
2020-11-06 21:33:26 +00:00
{% endif %}
2020-12-17 04:10:50 +00:00
2021-01-12 22:02:38 +00:00
{% if type == 'quotation' %}
2020-11-09 19:40:19 +00:00
< textarea name = "quote" class = "textarea" id = "id_quote_{{ book.id }}_{{ type }}" placeholder = "{{ placeholder }}" required > < / textarea >
{% else %}
2021-01-17 03:57:20 +00:00
{% include 'snippets/content_warning_field.html' with parent_status=status %}
2021-01-29 19:44:04 +00:00
< textarea name = "content" class = "textarea" id = "id_content_{{ type }}-{{ book.id }}{{reply_parent.id}}" placeholder = "{{ placeholder }}" { % if type = = ' reply ' % } aria-label = "Reply" { % endif % } required > {% if reply_parent %}{{ reply_parent|mentions:request.user }}{% endif %}{% if mentions %}@{{ mentions|username }} {% endif %}< / textarea >
2020-11-09 19:40:19 +00:00
{% endif %}
2020-11-06 21:33:26 +00:00
< / div >
2021-01-12 22:02:38 +00:00
{% if type == 'quotation' %}
2020-11-06 21:33:26 +00:00
< div class = "control" >
2021-01-17 18:38:34 +00:00
< label class = "label" for = "id_content_quote-{{ book.id }}" > Comment:< / label >
2021-01-17 03:57:20 +00:00
{% include 'snippets/content_warning_field.html' with parent_status=status %}
2021-01-17 18:38:34 +00:00
< textarea name = "content" class = "textarea is-small" id = "id_content_quote-{{ book.id }}" > < / textarea >
2020-11-06 21:33:26 +00:00
< / div >
{% endif %}
2021-01-17 16:50:47 +00:00
< input type = "checkbox" class = "hidden" name = "sensitive" id = "id_show_spoilers-{{ uuid }}" { % if status . content_warning % } checked { % endif % } aria-hidden = "true" >
2021-01-17 03:57:20 +00:00
{# bottom bar #}
< div class = "columns pt-1" >
< div class = "field has-addons column" >
< div class = "control" >
2021-01-17 16:50:47 +00:00
{% include 'snippets/toggle/toggle_button.html' with text="Include spoiler alert" icon="warning is-size-4" controls_text="spoilers" controls_uid=uuid focus="id_content_warning" checkbox="id_show_spoilers" class="toggle-button" pressed=status.content_warning %}
2021-01-17 03:57:20 +00:00
< / div >
< div class = "control" >
2021-01-29 19:14:18 +00:00
{% if type == 'direct' %}
< input type = "hidden" name = "privacy" value = "direct" >
< button type = "button" class = "button" aria-label = "Privacy" disabled > Private< / button >
{% else %}
{% include 'snippets/privacy_select.html' with current=reply_parent.privacy %}
{% endif %}
2021-01-17 03:57:20 +00:00
< / div >
< / div >
< div class = "column is-narrow" >
2021-01-17 18:38:34 +00:00
< button class = "button is-link" type = "submit" > Post< / button >
2021-01-17 03:57:20 +00:00
< / div >
2020-11-06 21:33:26 +00:00
< / div >
< / form >