Moves status templates into dir
This commit is contained in:
11
bookwyrm/templates/snippets/status/status.html
Normal file
11
bookwyrm/templates/snippets/status/status.html
Normal file
@ -0,0 +1,11 @@
|
||||
{% load bookwyrm_tags %}
|
||||
{% if not status.deleted %}
|
||||
{% if status.status_type == 'Boost' %}
|
||||
{% include 'snippets/avatar.html' with user=status.user %}
|
||||
{% include 'snippets/username.html' with user=status.user %}
|
||||
boosted
|
||||
{% include 'snippets/status/status_body.html' with status=status|boosted_status %}
|
||||
{% else %}
|
||||
{% include 'snippets/status/status_body.html' with status=status %}
|
||||
{% endif %}
|
||||
{% endif %}
|
75
bookwyrm/templates/snippets/status/status_body.html
Normal file
75
bookwyrm/templates/snippets/status/status_body.html
Normal file
@ -0,0 +1,75 @@
|
||||
{% extends 'components/card.html' %}
|
||||
|
||||
{% load bookwyrm_tags %}
|
||||
{% load humanize %}
|
||||
|
||||
{% block card-header %}
|
||||
<h3 class="card-header-title has-background-white-ter is-block">
|
||||
{% include 'snippets/status/status_header.html' with status=status %}
|
||||
</h3>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block card-content %}
|
||||
{% include 'snippets/status/status_content.html' with status=status %}
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block card-footer %}
|
||||
<div class="card-footer-item">
|
||||
{% if request.user.is_authenticated %}
|
||||
<div class="field has-addons">
|
||||
<div class="control">
|
||||
{% include 'snippets/toggle/toggle_button.html' with controls_text="show-comment" controls_uid=status.id text="Reply" icon="comment" class="is-small toggle-button" focus="id_content_reply" %}
|
||||
</div>
|
||||
<div class="control">
|
||||
{% include 'snippets/boost_button.html' with status=status %}
|
||||
</div>
|
||||
<div class="control">
|
||||
{% include 'snippets/fav_button.html' with status=status %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% else %}
|
||||
<a href="/login">
|
||||
<span class="icon icon-comment" title="Reply">
|
||||
<span class="is-sr-only">Reply</span>
|
||||
</span>
|
||||
|
||||
<span class="icon icon-boost" title="Boost status">
|
||||
<span class="is-sr-only">Boost status</span>
|
||||
</span>
|
||||
|
||||
<span class="icon icon-heart" title="Like status">
|
||||
<span class="is-sr-only">Like status</span>
|
||||
</span>
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="card-footer-item">
|
||||
{% include 'snippets/privacy-icons.html' with item=status %}
|
||||
</div>
|
||||
|
||||
<div class="card-footer-item">
|
||||
<a href="{{ status.remote_id }}">{{ status.published_date | post_date }}</a>
|
||||
</div>
|
||||
<div class="card-footer-item">
|
||||
{% include 'snippets/status/status_options.html' with class="is-small" right=True %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block card-bonus %}
|
||||
{% if request.user.is_authenticated %}
|
||||
{% with status.id|uuid as uuid %}
|
||||
<section class="hidden" id="show-comment-{{ status.id }}">
|
||||
<div class="card-footer">
|
||||
<div class="card-footer-item">
|
||||
{% include 'snippets/create_status_form.html' with reply_parent=status type="reply" %}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
{% endwith %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
63
bookwyrm/templates/snippets/status/status_content.html
Normal file
63
bookwyrm/templates/snippets/status/status_content.html
Normal file
@ -0,0 +1,63 @@
|
||||
{% load bookwyrm_tags %}
|
||||
<div class="block">
|
||||
{% if status.status_type == 'Review' %}
|
||||
<div>
|
||||
<h3 class="title is-5 has-subtitle">
|
||||
{% if status.name %}<span dir="auto">{{ status.name }}</span><br>{% endif %}
|
||||
</h3>
|
||||
<p class="subtitle">{% include 'snippets/stars.html' with rating=status.rating %}</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if status.content_warning %}
|
||||
<div>
|
||||
<p>{{ status.content_warning }}</p>
|
||||
{% include 'snippets/toggle/open_button.html' with text="show more" class="is-small" controls_text="show-status-cw" controls_uid=status.id %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div{% if status.content_warning %} class="hidden" id="show-status-cw-{{ status.id }}"{% endif %}>
|
||||
{% if status.content_warning %}
|
||||
{% include 'snippets/toggle/close_button.html' with text="show less" class="is-small" controls_text="show-status-cw" controls_uid=status.id %}
|
||||
{% endif %}
|
||||
|
||||
{% if status.quote %}
|
||||
<div class="quote block">
|
||||
<blockquote dir="auto">{{ status.quote | safe }}</blockquote>
|
||||
|
||||
<p> — {% include 'snippets/book_titleby.html' with book=status.book %}</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if status.content and status.status_type != 'GeneratedNote' and status.status_type != 'Boost' %}
|
||||
{% include 'snippets/trimmed_text.html' with full=status.content|safe %}
|
||||
{% endif %}
|
||||
{% if status.attachments %}
|
||||
<div class="block">
|
||||
<div class="columns">
|
||||
{% for attachment in status.attachments.all %}
|
||||
<div class="column is-narrow">
|
||||
<figure class="image is-128x128">
|
||||
<a href="/images/{{ attachment.image }}" target="_blank" aria-label="open image in new window">
|
||||
<img src="/images/{{ attachment.image }}"{% if attachment.caption %} alt="{{ attachment.caption }}" title="{{ attachment.caption }}"{% endif %}>
|
||||
</a>
|
||||
</figure>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if not hide_book %}
|
||||
{% if status.book or status.mention_books.count %}
|
||||
<div class="{% if status.status_type != 'GeneratedNote' %}box has-background-white-bis{% endif %}">
|
||||
{% if status.book %}
|
||||
{% include 'snippets/book_preview.html' with book=status.book %}
|
||||
{% elif status.mention_books.count %}
|
||||
{% include 'snippets/book_preview.html' with book=status.mention_books.first %}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
24
bookwyrm/templates/snippets/status/status_header.html
Normal file
24
bookwyrm/templates/snippets/status/status_header.html
Normal file
@ -0,0 +1,24 @@
|
||||
{% load bookwyrm_tags %}
|
||||
{% include 'snippets/avatar.html' with user=status.user %}
|
||||
{% include 'snippets/username.html' with user=status.user %}
|
||||
|
||||
{% if status.status_type == 'GeneratedNote' %}
|
||||
{{ status.content | safe }}
|
||||
{% elif status.status_type == 'Review' and not status.name and not status.content%}
|
||||
rated
|
||||
{% elif status.status_type == 'Review' %}
|
||||
reviewed
|
||||
{% elif status.status_type == 'Comment' %}
|
||||
commented on
|
||||
{% elif status.status_type == 'Quotation' %}
|
||||
quoted
|
||||
{% elif status.reply_parent %}
|
||||
{% with parent_status=status|parent %}
|
||||
replied to {% include 'snippets/username.html' with user=parent_status.user possessive=True %} <a href="{{parent_status.remote_id }}">{% if parent_status.status_type == 'GeneratedNote' %}update{% else %}{{ parent_status.status_type | lower }}{% endif %}</a>
|
||||
{% endwith %}
|
||||
{% endif %}
|
||||
{% if status.book %}
|
||||
<a href="/book/{{ status.book.id }}">{{ status.book.title }}</a>
|
||||
{% elif status.mention_books %}
|
||||
<a href="/book/{{ status.mention_books.first.id }}">{{ status.mention_books.first.title }}</a>
|
||||
{% endif %}
|
28
bookwyrm/templates/snippets/status/status_options.html
Normal file
28
bookwyrm/templates/snippets/status/status_options.html
Normal file
@ -0,0 +1,28 @@
|
||||
{% extends 'components/dropdown.html' %}
|
||||
{% load bookwyrm_tags %}
|
||||
|
||||
{% block dropdown-trigger %}
|
||||
<span class="icon icon-dots-three">
|
||||
<span class="is-sr-only">More options</span>
|
||||
</span>
|
||||
{% endblock %}
|
||||
|
||||
{% block dropdown-list %}
|
||||
{% if status.user == request.user %}
|
||||
<li role="menuitem">
|
||||
<form class="dropdown-item pt-0 pb-0" name="delete-{{status.id}}" action="/delete-status/{{ status.id }}" method="post">
|
||||
{% csrf_token %}
|
||||
<button class="button is-danger is-light is-fullwidth is-small" type="submit">
|
||||
Delete post
|
||||
</button>
|
||||
</form>
|
||||
</li>
|
||||
{% else %}
|
||||
<li role="menuitem">
|
||||
<a href="/direct-messages/{{ status.user|username }}" class="button is-fullwidth is-small">Send direct message</a>
|
||||
</li>
|
||||
<li role="menuitem">
|
||||
{% include 'snippets/block_button.html' with user=status.user class="is-fullwidth" %}
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endblock %}
|
Reference in New Issue
Block a user