Snippets for book previews, username links, avatars
This commit is contained in:
parent
3ba76a8b13
commit
f9cb9f939a
7 changed files with 15 additions and 14 deletions
2
fedireads/templates/snippets/avatar.html
Normal file
2
fedireads/templates/snippets/avatar.html
Normal file
|
@ -0,0 +1,2 @@
|
|||
<img class="user-pic" src="{% if user.avatar %}/images/{{ user.avatar }}{% else %}/static/images/default_avi.jpg{% endif %}">
|
||||
|
14
fedireads/templates/snippets/book.html
Normal file
14
fedireads/templates/snippets/book.html
Normal file
|
@ -0,0 +1,14 @@
|
|||
{% load fr_display %}
|
||||
<img class="book-cover {{ size }}" src="{% if book.cover %}/images/{{ book.cover }}{% else %}/static/images/no_cover.jpg{% endif %}">
|
||||
<p class="title">
|
||||
<a href="/book/{{ book.openlibrary_key }}">{{ book.data.title }}</a>
|
||||
</p>
|
||||
<p>by <a href="/author/{{ book.author.id }}" class="author">{{ book.authors.first.data.name }}</a></p>
|
||||
|
||||
{% if rating %}
|
||||
{{ rating | stars }} {{ rating }}
|
||||
{% endif %}
|
||||
|
||||
{% if description %}
|
||||
<blockquote>{{ book.data.description | description }}</blockquote>
|
||||
{% endif %}
|
2
fedireads/templates/snippets/username.html
Normal file
2
fedireads/templates/snippets/username.html
Normal file
|
@ -0,0 +1,2 @@
|
|||
<a href="/user/{% if user.localname %}{{ user.localname }}{% else %}{{ user.username }}{% endif %}" class="user">{% if user.localname %}{{ user.localname }}{% else %}{{ user.username }}{% endif %}</a>
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue