28 lines
2.8 KiB
HTML
28 lines
2.8 KiB
HTML
{% load slx_community slx_brand %}<section id="discussion" class="fan-panel" aria-labelledby="fan-heading">
|
|
<div class="section-head"><h2 id="fan-heading">Fan discussion</h2><span>{{ "SLUMP X LAND"|slx_brand }}</span></div>
|
|
{% for message in messages %}{% if 'review-status' not in message.tags %}<p class="fan-message" role="status">{{ message }}</p>{% endif %}{% endfor %}
|
|
{% include 'reaction-strip.html' with group=fan.reactions reaction_for='React to this chapter or post' %}
|
|
<div class="fan-toolbar">
|
|
{% if user.is_authenticated %}
|
|
{% if fan.target_kind == 'chapter' %}
|
|
<form method="post" action="{% url 'fan-action' fan.target_kind fan.target_id %}">{% csrf_token %}<button class="fan-button" name="action" value="{% if fan.shelf.saved %}unsave{% else %}save{% endif %}">{% if fan.shelf.saved %}Saved · remove{% else %}Save chapter{% endif %}</button> <button class="fan-button" name="action" value="{% if fan.shelf.favorite %}unfavorite{% else %}favorite{% endif %}" title="Favorites appear on your reader profile">{% if fan.shelf.favorite %}★ Remove favorite{% else %}☆ Favorite publicly{% endif %}</button> <button class="fan-button" name="action" value="{% if fan.shelf.finished %}unfinish{% else %}finish{% endif %}">{% if fan.shelf.finished %}✓ Marked read{% else %}Mark read{% endif %}</button></form>
|
|
<form method="post" action="{% url 'fan-action' fan.target_kind fan.target_id %}">{% csrf_token %}<label>Rating <select name="score" aria-label="Rating out of five" required><option value="">—</option>{% for n in '12345' %}<option value="{{ n }}"{% if fan.my_rating|stringformat:'s' == n %} selected{% endif %}>{{ n }} / 5</option>{% endfor %}</select></label> <button class="fan-button" name="action" value="rate">Save rating</button></form>
|
|
{% endif %}
|
|
{% else %}
|
|
<a href="{% url 'fan-login' %}?next={{ request.path|urlencode }}%23discussion">Sign in to join in</a>
|
|
{% endif %}
|
|
{% if fan.rating.count %}<span>★ {{ fan.rating.average|floatformat:1 }} / 5 · {{ fan.rating.count }} rating{{ fan.rating.count|pluralize }}</span>{% endif %}
|
|
</div>
|
|
{% if fan.can_comment %}
|
|
{% if user.is_authenticated %}
|
|
<form class="fan-compose" method="post" action="{% url 'fan-action' fan.target_kind fan.target_id %}">
|
|
{% csrf_token %}<label for="id_body">Leave a comment</label>{{ fan.comment_form.body }}<button class="cta" name="action" value="comment">Post comment</button><small>New fan comments appear after moderation.</small>
|
|
</form>
|
|
{% endif %}
|
|
{% prime_ranks fan.threads True %}{% for comment in fan.threads %}
|
|
{% include 'fan-comment.html' %}
|
|
{% for comment in comment.thread %}{% include 'fan-comment.html' with reply=True %}{% endfor %}
|
|
{% empty %}<p>No public comments yet. Start the conversation.</p>{% endfor %}
|
|
{% else %}<p>Comments are closed for this post.</p>{% endif %}
|
|
</section>
|