rename main code directory
This commit is contained in:
1
bookwyrm/templates/snippets/authors.html
Normal file
1
bookwyrm/templates/snippets/authors.html
Normal file
@ -0,0 +1 @@
|
||||
<a href="/author/{{ book.authors.first.id }}" class="author">{{ book.authors.first.display_name }}</a>
|
2
bookwyrm/templates/snippets/avatar.html
Normal file
2
bookwyrm/templates/snippets/avatar.html
Normal file
@ -0,0 +1,2 @@
|
||||
<img class="user-pic{% if large %} large{% endif %}" src="{% if user.avatar %}/images/{{ user.avatar }}{% else %}/static/images/default_avi.jpg{% endif %}">
|
||||
|
12
bookwyrm/templates/snippets/book_cover.html
Normal file
12
bookwyrm/templates/snippets/book_cover.html
Normal file
@ -0,0 +1,12 @@
|
||||
{% load fr_display %}
|
||||
{% if book.cover %}
|
||||
<img class="book-cover {{ size }}" src="/images/{{ book.cover }}" alt="{% include 'snippets/cover_alt.html' with book=book %}">
|
||||
{% else %}
|
||||
<div class="no-cover book-cover {{ size }}">
|
||||
<img class="book-cover {{ size }}" src="/static/images/no_cover.jpg" alt="No cover">
|
||||
<div>
|
||||
<p class="title">{{ book.title }}</p>
|
||||
<p>({{ book|edition_info }})</p>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
7
bookwyrm/templates/snippets/book_description.html
Normal file
7
bookwyrm/templates/snippets/book_description.html
Normal file
@ -0,0 +1,7 @@
|
||||
{% load fr_display %}
|
||||
{% if book.description %}
|
||||
<blockquote>{{ book.description | description }}</blockquote>
|
||||
{% elif book.parent_work.description %}
|
||||
<blockquote>{{ book.parent_work.description | description }}</blockquote>
|
||||
{% endif %}
|
||||
|
9
bookwyrm/templates/snippets/book_titleby.html
Normal file
9
bookwyrm/templates/snippets/book_titleby.html
Normal file
@ -0,0 +1,9 @@
|
||||
<span class="title">
|
||||
<a href="/book/{{ book.id }}">{{ book.title }}</a>
|
||||
</span>
|
||||
{% if book.authors %}
|
||||
<span class="author">
|
||||
by {% include 'snippets/authors.html' with book=book %}
|
||||
</span>
|
||||
{% endif %}
|
||||
|
2
bookwyrm/templates/snippets/cover_alt.html
Normal file
2
bookwyrm/templates/snippets/cover_alt.html
Normal file
@ -0,0 +1,2 @@
|
||||
{% load fr_display %}
|
||||
'{{ book.title }}' Cover ({{ book|edition_info }})
|
49
bookwyrm/templates/snippets/covers_shelf.html
Normal file
49
bookwyrm/templates/snippets/covers_shelf.html
Normal file
@ -0,0 +1,49 @@
|
||||
{% load fr_display %}
|
||||
|
||||
<div class="all-shelves content-container">
|
||||
{% for shelf in shelves %}
|
||||
{% if shelf.books %}
|
||||
<div>
|
||||
<h2>{{ shelf.name }}
|
||||
{% if shelf.size > shelf.books|length %}
|
||||
<small>(<a href="/shelf/{{ user | username }}/{{ shelf.identifier }}">See all {{ shelf.size }}</a>)</small>
|
||||
{% endif %}
|
||||
</h2>
|
||||
<div class="covers-shelf {{ shelf.identifier }} ">
|
||||
{% for book in shelf.books %}
|
||||
<div class="cover-container">
|
||||
<label for="book-{{ book.id }}-radio">
|
||||
{% include 'snippets/book_cover.html' with book=book %}
|
||||
</label>
|
||||
{% include 'snippets/shelve_button.html' with book=book hide_pulldown=True %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
{% for shelf in shelves %}
|
||||
{% for book in shelf.books %}
|
||||
<div class="compose-popout">
|
||||
<input name="book-popout" type="radio" id="book-{{ book.id }}-radio">
|
||||
<div class="compose compose-suggestion" id="compose-book-{{ book.id }}">
|
||||
<label class="close icon icon-close" for="book-{{ book.id }}-radio-close" onclick="hide_element(this)">
|
||||
<span class="hidden-text">Close</span>
|
||||
</label>
|
||||
<input name="book-popout" type="radio" id="book-{{ book.id }}-radio-close">
|
||||
<div class="content-container">
|
||||
<h2>
|
||||
{% include 'snippets/avatar.html' with user=user %}
|
||||
Your thoughts on
|
||||
a <a href="/book/{{ book.id }}">{{ book.title }}</a>
|
||||
by {% include 'snippets/authors.html' with book=book %}
|
||||
</h2>
|
||||
|
||||
{% include 'snippets/create_status.html' with book=book user=request.user %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endfor %}
|
43
bookwyrm/templates/snippets/create_status.html
Normal file
43
bookwyrm/templates/snippets/create_status.html
Normal file
@ -0,0 +1,43 @@
|
||||
{% load humanize %}
|
||||
{% load fr_display %}
|
||||
|
||||
<div class="tabs secondary">
|
||||
<div class="tab active" data-id="tab-review-{{ book.id }}" data-category="tab-option-{{ book.id }}">
|
||||
<a href="/book/{{ book.id }}/review" onclick="tabChange(event)">Review</a>
|
||||
</div>
|
||||
<div class="tab" data-id="tab-comment-{{ book.id }}" data-category="tab-option-{{ book.id }}">
|
||||
<a href="/book/{{ book.id }}/comment" onclick="tabChange(event)">Comment</a>
|
||||
</div>
|
||||
<div class="tab" data-id="tab-quotation-{{ book.id }}" data-category="tab-option-{{ book.id }}">
|
||||
<a href="/book/{{ book.id }}/quotation" onclick="tabChange(event)">Quote</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="book-preview row">
|
||||
{% if not hide_cover %}
|
||||
<div class="cover-container">
|
||||
{% include 'snippets/book_cover.html' with book=book %}
|
||||
</div>
|
||||
{% endif %}
|
||||
<form class="tab-option-{{ book.id }} review-form" name="review" action="/review/" method="post" id="tab-review-{{ book.id }}">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="book" value="{{ book.id }}">
|
||||
{% include 'snippets/rate_form.html' with book=book %}
|
||||
{{ review_form.as_p }}
|
||||
<button type="submit">post review</button>
|
||||
</form>
|
||||
|
||||
<form class="hidden tab-option-{{ book.id }} review-form" name="comment" action="/comment/" method="post" id="tab-comment-{{ book.id }}">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="book" value="{{ book.id }}">
|
||||
{{ comment_form.as_p }}
|
||||
<button type="submit">post comment</button>
|
||||
</form>
|
||||
|
||||
<form class="hidden tab-option-{{ book.id }} review-form quote-form" name="quotation" action="/quotate/" method="post" id="tab-quotation-{{ book.id }}">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="book" value="{{ book.id }}">
|
||||
{{ quotation_form.as_p }}
|
||||
<button typr="submit">post quote</button>
|
||||
</form>
|
||||
</div>
|
24
bookwyrm/templates/snippets/follow_button.html
Normal file
24
bookwyrm/templates/snippets/follow_button.html
Normal file
@ -0,0 +1,24 @@
|
||||
{% if request.user == user or not request.user.is_authenticated %}
|
||||
{% elif request.user in user.follower_requests.all %}
|
||||
|
||||
<div>
|
||||
Follow request already sent.
|
||||
</div>
|
||||
|
||||
{% else %}
|
||||
|
||||
<form action="/follow/" method="POST" onsubmit="interact(event)" class="follow-{{ user.id }} {% if request.user in user.followers.all %}hidden{%endif %}" data-id="follow-{{ user.id }}">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="user" value="{{ user.username }}">
|
||||
{% if user.manually_approves_followers %}
|
||||
<button type="submit">Send follow request</button>
|
||||
{% else %}
|
||||
<button type="submit">Follow</button>
|
||||
{% endif %}
|
||||
</form>
|
||||
<form action="/unfollow/" method="POST" onsubmit="interact(event)" class="follow-{{ user.id }} {% if not request.user in user.followers.all %}hidden{%endif %}" data-id="follow-{{ user.id }}">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="user" value="{{ user.username }}">
|
||||
<button type="submit">Unfollow</button>
|
||||
</form>
|
||||
{% endif %}
|
13
bookwyrm/templates/snippets/follow_request_buttons.html
Normal file
13
bookwyrm/templates/snippets/follow_request_buttons.html
Normal file
@ -0,0 +1,13 @@
|
||||
{% load fr_display %}
|
||||
{% if request.user|follow_request_exists:user %}
|
||||
<form action="/accept_follow_request/" method="POST">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="user" value="{{ user.username }}">
|
||||
<button type="submit">Accept</button>
|
||||
</form>
|
||||
<form action="/delete_follow_request/" method="POST">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="user" value="{{ user.username }}">
|
||||
<button type="submit" class="warning">Delete</button>
|
||||
</form>
|
||||
{% endif %}
|
64
bookwyrm/templates/snippets/interaction.html
Normal file
64
bookwyrm/templates/snippets/interaction.html
Normal file
@ -0,0 +1,64 @@
|
||||
{% load fr_display %}
|
||||
<div class="interaction">
|
||||
{% if request.user.is_authenticated %}
|
||||
<form name="reply" action="/reply" method="post" onsubmit="return reply(event)">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="parent" value="{{ activity.id }}">
|
||||
<textarea name="content" placeholder="Leave a comment..." id="id_content" required="true"></textarea>
|
||||
<button type="submit">
|
||||
<span class="icon icon-comment">
|
||||
<span class="hidden-text">Comment</span>
|
||||
</span>
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<form name="boost" action="/boost/{{ activity.id }}" method="post" onsubmit="return interact(event)" class="boost-{{ status.id }} {% if request.user|boosted:status %}hidden{% endif %}" data-id="boost-{{ status.id }}">
|
||||
{% csrf_token %}
|
||||
<button type="submit">
|
||||
<span class="icon icon-boost">
|
||||
<span class="hidden-text">Boost status</span>
|
||||
</span>
|
||||
</button>
|
||||
</form>
|
||||
<form name="unboost" action="/unboost/{{ activity.id }}" method="post" onsubmit="return interact(event)" class="boost-{{ status.id }} active {% if not request.user|boosted:status %}hidden{% endif %}" data-id="boost-{{ status.id }}">
|
||||
{% csrf_token %}
|
||||
<button type="submit">
|
||||
<span class="icon icon-boost">
|
||||
<span class="hidden-text">Un-boost status</span>
|
||||
</span>
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<form name="favorite" action="/favorite/{{ activity.id }}" method="POST" onsubmit="return interact(event)" class="fav-{{ status.id }} {% if request.user|liked:status %}hidden{% endif %}" data-id="fav-{{ status.id }}">
|
||||
{% csrf_token %}
|
||||
<button type="submit">
|
||||
<span class="icon icon-heart">
|
||||
<span class="hidden-text">Like status</span>
|
||||
</span>
|
||||
</button>
|
||||
</form>
|
||||
<form name="unfavorite" action="/unfavorite/{{ activity.id }}" method="POST" onsubmit="return interact(event)" class="fav-{{ status.id }} active {% if not request.user|liked:status %}hidden{% endif %}" data-id="fav-{{ status.id }}">
|
||||
{% csrf_token %}
|
||||
<button type="submit">
|
||||
<span class="icon icon-heart">
|
||||
<span class="hidden-text">Un-like status</span>
|
||||
</span>
|
||||
</button>
|
||||
</form>
|
||||
{% else %}
|
||||
<a href="/login">
|
||||
<span class="icon icon-comment">
|
||||
<span class="hidden-text">Comment</span>
|
||||
</span>
|
||||
|
||||
<span class="icon icon-boost">
|
||||
<span class="hidden-text">Boost status</span>
|
||||
</span>
|
||||
|
||||
<span class="icon icon-heart">
|
||||
<span class="hidden-text">Like status</span>
|
||||
</span>
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
14
bookwyrm/templates/snippets/rate_action.html
Normal file
14
bookwyrm/templates/snippets/rate_action.html
Normal file
@ -0,0 +1,14 @@
|
||||
{% load fr_display %}
|
||||
<span class="hidden-text">Leave a rating</span>
|
||||
<div class="stars rate-stars">
|
||||
{% for i in '12345'|make_list %}
|
||||
<form name="rate" action="/rate/" method="POST" onsubmit="return rate_stars(event)">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="book" value="{{ book.id }}">
|
||||
<input type="hidden" name="rating" value="{{ forloop.counter }}">
|
||||
<button type="submit" class="icon icon-star-{% if book|rating:user < forloop.counter %}empty{% else %}full{% endif %}">
|
||||
<span class="hidden-text">{{ forloop.counter }} star{{ forloop.counter | pluralize }}</span>
|
||||
</button>
|
||||
</form>
|
||||
{% endfor %}
|
||||
</div>
|
12
bookwyrm/templates/snippets/rate_form.html
Normal file
12
bookwyrm/templates/snippets/rate_form.html
Normal file
@ -0,0 +1,12 @@
|
||||
{% load fr_display %}
|
||||
<span class="hidden-text">Rating</span>
|
||||
<div class="stars rate-stars">
|
||||
<input type="radio" name="rating" value="" checked>
|
||||
{% for i in '12345'|make_list %}
|
||||
<input 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="hidden-text">{{ forloop.counter }} star{{ forloop.counter | pluralize }}</span>
|
||||
</label>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
74
bookwyrm/templates/snippets/shelf.html
Normal file
74
bookwyrm/templates/snippets/shelf.html
Normal file
@ -0,0 +1,74 @@
|
||||
{% load humanize %}
|
||||
{% load fr_display %}
|
||||
{% if shelf.books %}
|
||||
<table>
|
||||
<tr class="book-preview">
|
||||
<th>
|
||||
Cover
|
||||
</th>
|
||||
<th>
|
||||
Title
|
||||
</th>
|
||||
<th>
|
||||
Author
|
||||
</th>
|
||||
<th>
|
||||
Published
|
||||
</th>
|
||||
<th>
|
||||
Shelved
|
||||
</th>
|
||||
<th>
|
||||
Started
|
||||
</th>
|
||||
<th>
|
||||
Finished
|
||||
</th>
|
||||
<th>
|
||||
External links
|
||||
</th>
|
||||
{% if ratings %}
|
||||
<th>
|
||||
Rating
|
||||
</th>
|
||||
{% endif %}
|
||||
</tr>
|
||||
{% for book in shelf.books.all %}
|
||||
<tr class="book-preview">
|
||||
<td>
|
||||
{% include 'snippets/book_cover.html' with book=book size="small" %}
|
||||
</td>
|
||||
<td>
|
||||
<a href="/book/{{ book.id }}">{{ book.title }}</a>
|
||||
</td>
|
||||
<td>
|
||||
{{ book.authors.first.display_name }}
|
||||
</td>
|
||||
<td>
|
||||
{% if book.first_published_date %}{{ book.first_published_date }}{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
{{ book.created_date | naturalday }}
|
||||
</td>
|
||||
{% latest_read_through book user as read_through %}
|
||||
<td>
|
||||
{{ read_through.start_date | naturalday |default_if_none:""}}
|
||||
</td>
|
||||
<td>
|
||||
{{ read_through.finish_date | naturalday |default_if_none:""}}
|
||||
</td>
|
||||
<td>
|
||||
<a href="https://openlibrary.org/book/{{ book.openlibrary_key }}" target="_blank">OpenLibrary</a>
|
||||
</td>
|
||||
{% if ratings %}
|
||||
<td>
|
||||
{% include 'snippets/stars.html' with rating=ratings|dict_key:book.id %}
|
||||
</td>
|
||||
{% endif %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% else %}
|
||||
<p>This shelf is empty.</p>
|
||||
{% endif %}
|
||||
|
31
bookwyrm/templates/snippets/shelve_button.html
Normal file
31
bookwyrm/templates/snippets/shelve_button.html
Normal file
@ -0,0 +1,31 @@
|
||||
{% load fr_display %}
|
||||
{% if request.user.is_authenticated %}
|
||||
|
||||
<div class="pulldown-button">
|
||||
<form name="shelve" action="/shelve/" method="post">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="book" value="{{ book.id }}">
|
||||
<input type="hidden" name="shelf" value="{% shelve_button_identifier book %}">
|
||||
<button type="submit" style="">{% shelve_button_text book %}</button>
|
||||
</form>
|
||||
{% if not hide_pulldown %}
|
||||
<div class="pulldown-container">
|
||||
<button class="pulldown-toggle">
|
||||
<span class="icon icon-arrow-down"><span class="hidden-text">More shelves</span></span>
|
||||
</button>
|
||||
<ul class="pulldown">
|
||||
<form name="shelve" action="/shelve/" method="post">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="book" value="{{ book.id }}">
|
||||
{% for shelf in request.user.shelf_set.all %}
|
||||
<li>
|
||||
<button name="shelf" type="submit" value="{{ shelf.identifier }}" {% if shelf in book.shelf_set.all %} disabled {% endif %}>{{ shelf.name }} {% if shelf in book.shelf_set.all %} ✓ {% endif %}</button>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</form>
|
||||
</ul>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% endif %}
|
8
bookwyrm/templates/snippets/stars.html
Normal file
8
bookwyrm/templates/snippets/stars.html
Normal file
@ -0,0 +1,8 @@
|
||||
<div class="stars">
|
||||
<span class="hidden-text">{{ rating|floatformat }} star{{ rating|floatformat | pluralize }}</span>
|
||||
{% for i in '12345'|make_list %}
|
||||
<span class="icon icon-star-{% if rating >= forloop.counter %}full{% elif rating|floatformat:0 >= forloop.counter|floatformat:0 %}half{% else %}empty{% endif %}">
|
||||
</span>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
24
bookwyrm/templates/snippets/status.html
Normal file
24
bookwyrm/templates/snippets/status.html
Normal file
@ -0,0 +1,24 @@
|
||||
{% load fr_display %}
|
||||
|
||||
<div class="post {{ status.status_type | lower }} depth-{{ depth }} {% if main %}main{% else %}reply{% endif %}">
|
||||
|
||||
<h2>
|
||||
{% if status.boosted_status %}
|
||||
{% include 'snippets/status_header.html' with status=status.boosted_status %}
|
||||
<small class="subhead">{% include 'snippets/status_header.html' with status=status %}</small>
|
||||
{% else %}
|
||||
{% include 'snippets/status_header.html' with status=status %}
|
||||
{% endif %}
|
||||
</h2>
|
||||
|
||||
<div class="status-content">
|
||||
{% include 'snippets/status_content.html' with status=status %}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
{% if status.status_type == 'Boost' %}
|
||||
{% include 'snippets/interaction.html' with activity=status|boosted_status %}
|
||||
{% else %}
|
||||
{% include 'snippets/interaction.html' with activity=status %}
|
||||
{% endif %}
|
||||
|
66
bookwyrm/templates/snippets/status_content.html
Normal file
66
bookwyrm/templates/snippets/status_content.html
Normal file
@ -0,0 +1,66 @@
|
||||
{% load fr_display %}
|
||||
|
||||
{% if not hide_book and status.mention_books.count %}
|
||||
<div class="row">
|
||||
{% for book in status.mention_books.all|slice:"0:4" %}
|
||||
<div class="row">
|
||||
<div class="cover-container">
|
||||
{% include 'snippets/book_cover.html' with book=book %}
|
||||
{% if status.mention_books.count > 1 %}
|
||||
<p>{% include 'snippets/book_titleby.html' with book=book %}</p>
|
||||
{% endif %}
|
||||
{% include 'snippets/rate_action.html' with book=book user=request.user %}
|
||||
{% include 'snippets/shelve_button.html' with book=book %}
|
||||
</div>
|
||||
{% if status.mention_books.count == 1 %}
|
||||
<div>
|
||||
<p>{% include 'snippets/book_titleby.html' with book=book %}</p>
|
||||
{% include 'snippets/book_description.html' with book=book %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="row">
|
||||
{% if not hide_book and status.book %}
|
||||
<div class="cover-container">
|
||||
{% include 'snippets/book_cover.html' with book=status.book %}
|
||||
{% include 'snippets/rate_action.html' with book=status.book user=request.user %}
|
||||
{% include 'snippets/shelve_button.html' with book=status.book %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div>
|
||||
{% if status.status_type == 'Review' %}
|
||||
<h3>
|
||||
{% if status.name %}{{ status.name }}<br>{% endif %}
|
||||
{% include 'snippets/stars.html' with rating=status.rating %}
|
||||
</h3>
|
||||
{% endif %}
|
||||
|
||||
{% if status.quote %}
|
||||
<div class="quote">
|
||||
<blockquote>{{ status.quote }}</blockquote>
|
||||
|
||||
<p> — {% include 'snippets/book_titleby.html' with book=status.book %}</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if status.content and status.status_type != 'Update' and status.status_type != 'Boost' %}
|
||||
<blockquote>{{ status.content | safe }}</blockquote>
|
||||
{% endif %}
|
||||
|
||||
{% if not status.content and status.book and not hide_book and status.status_type != 'Boost' %}
|
||||
{% include 'snippets/book_description.html' with book=status.book %}
|
||||
{% endif %}
|
||||
|
||||
{% if status.status_type == 'Boost' %}
|
||||
{% include 'snippets/status_content.html' with status=status|boosted_status %}
|
||||
{% endif %}
|
||||
|
||||
{% if not max_depth and status.reply_parent or status|replies %}<p><a href="{{ status.remote_id }}">Thread</a>{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
25
bookwyrm/templates/snippets/status_header.html
Normal file
25
bookwyrm/templates/snippets/status_header.html
Normal file
@ -0,0 +1,25 @@
|
||||
{% load humanize %}
|
||||
{% load fr_display %}
|
||||
{% include 'snippets/avatar.html' with user=status.user %}
|
||||
{% include 'snippets/username.html' with user=status.user %}
|
||||
|
||||
{% if status.status_type == 'Update' %}
|
||||
{{ status.content | safe }}
|
||||
{% elif status.status_type == 'Review' and not status.name and not status.content%}
|
||||
rated <a href="/book/{{ status.book.id }}">{{ status.book.title }}</a>
|
||||
{% elif status.status_type == 'Review' %}
|
||||
reviewed <a href="/book/{{ status.book.id }}">{{ status.book.title }}</a>
|
||||
{% elif status.status_type == 'Comment' %}
|
||||
commented on <a href="/book/{{ status.book.id }}">{{ status.book.title }}</a>
|
||||
{% elif status.status_type == 'Quotation' %}
|
||||
quoted <a href="/book/{{ status.book.id }}">{{ status.book.title }}</a>
|
||||
{% elif status.status_type == 'Boost' %}
|
||||
boosted
|
||||
{% 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 }}">{{ parent_status.status_type | lower }}</a>
|
||||
{% endwith %}
|
||||
{% endif %}
|
||||
<span class="time-ago">
|
||||
<a href="{{ status.remote_id }}">{{ status.published_date | naturaltime }}</a>
|
||||
</span>
|
6
bookwyrm/templates/snippets/tabs.html
Normal file
6
bookwyrm/templates/snippets/tabs.html
Normal file
@ -0,0 +1,6 @@
|
||||
{% for tab in tabs %}
|
||||
<div class="tab {% if tab.id == active_tab %}active{% endif %}">
|
||||
<a href="{{ path }}/{{ tab.id }}">{{ tab.display }}</a>
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
20
bookwyrm/templates/snippets/tag.html
Normal file
20
bookwyrm/templates/snippets/tag.html
Normal file
@ -0,0 +1,20 @@
|
||||
<div class="tag">
|
||||
<a href="/tag/{{ tag.identifier|urlencode }}">{{ tag.name }}</a>
|
||||
{% if tag.identifier in user_tags %}
|
||||
<form class="tag-form" name="tag" action="/untag/" method="post">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="book" value="{{ book.id }}">
|
||||
<input type="hidden" name="name" value="{{ tag.name }}">
|
||||
<button type="submit">x</button>
|
||||
</form>
|
||||
{% else %}
|
||||
<form class="tag-form" name="tag" action="/tag/" method="post">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="book" value="{{ book.id }}">
|
||||
<input type="hidden" name="name" value="{{ tag.name }}">
|
||||
<button type="submit">+</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
|
18
bookwyrm/templates/snippets/thread.html
Normal file
18
bookwyrm/templates/snippets/thread.html
Normal file
@ -0,0 +1,18 @@
|
||||
{% load fr_display %}
|
||||
{% with depth=depth|add:1 %}
|
||||
{% if depth <= max_depth and status.reply_parent and direction <= 0 %}
|
||||
{% with direction=-1 %}
|
||||
{% include 'snippets/thread.html' with status=status|parent is_root=False %}
|
||||
{% endwith %}
|
||||
{% endif %}
|
||||
|
||||
{% include 'snippets/status.html' with status=status main=is_root %}
|
||||
|
||||
{% if depth <= max_depth and direction >= 0 %}
|
||||
{% for reply in status|replies %}
|
||||
{% with direction=1 %}
|
||||
{% include 'snippets/thread.html' with status=reply is_root=False %}
|
||||
{% endwith %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endwith %}
|
11
bookwyrm/templates/snippets/user_preview.html
Normal file
11
bookwyrm/templates/snippets/user_preview.html
Normal file
@ -0,0 +1,11 @@
|
||||
<div>
|
||||
<div>
|
||||
{% include 'snippets/avatar.html' with user=user %}
|
||||
{% include 'snippets/username.html' with user=user %}
|
||||
<small>{{ user.username }}</small>
|
||||
</div>
|
||||
{% if not is_self %}
|
||||
{% include 'snippets/follow_button.html' with user=user %}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
2
bookwyrm/templates/snippets/username.html
Normal file
2
bookwyrm/templates/snippets/username.html
Normal file
@ -0,0 +1,2 @@
|
||||
{% load fr_display %}
|
||||
<a href="/user/{{ user | username }}" class="user">{% if user.name %}{{ user.name }}{% else %}{{ user | username }}{% endif %}</a>{% if possessive %}'s{% endif %}{% if show_full and user.name or show_full and user.localname %} ({{ user.username }}){% endif %}
|
Reference in New Issue
Block a user