mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2025-02-19 20:36:20 +00:00
Moves book suggestion markup to a snippet
This commit is contained in:
parent
68fa3def0c
commit
e8a95a217b
2 changed files with 45 additions and 41 deletions
43
bookwyrm/templates/book/suggestion_list/book_card.html
Normal file
43
bookwyrm/templates/book/suggestion_list/book_card.html
Normal file
|
@ -0,0 +1,43 @@
|
|||
{% load i18n %}
|
||||
{% load book_display_tags %}
|
||||
|
||||
<div class="card">
|
||||
<div class="card-content pb-3 columns">
|
||||
{% with item_book=item.book %}
|
||||
<div class="column is-one-third">
|
||||
<div class="is-cover">
|
||||
<a href="{{ item_book.local_path }}" aria-hidden="true">
|
||||
{% include 'snippets/book_cover.html' with cover_class='is-h-m-mobile is-h-m-tablet is-align-items-flex-start' size='medium' book=item_book %}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="column">
|
||||
<p class="mt-3">
|
||||
{% include 'snippets/book_titleby.html' with book=item_book %}
|
||||
</p>
|
||||
{% if item_book|book_description %}
|
||||
<blockquote>
|
||||
{% with full=item_book|book_description trim_length=20 %}
|
||||
{% include 'snippets/trimmed_text.html' with hide_more=True %}
|
||||
{% endwith %}
|
||||
{% endif %}
|
||||
{% include "lists/list_item_notes.html" with list=book.suggestion_list hide_edit=True %}
|
||||
</div>
|
||||
{% endwith %}
|
||||
</div>
|
||||
<div class="card-footer is-stacked-mobile has-background-tertiary is-align-items-stretch">
|
||||
<div class="card-footer-item">
|
||||
<p>
|
||||
{% blocktrans trimmed with username=item.user.display_name user_path=item.user.local_path %}
|
||||
Added by <a href="{{ user_path }}">{{ username }}</a>
|
||||
{% endblocktrans %}
|
||||
</p>
|
||||
</div>
|
||||
<div class="card-footer-item">
|
||||
<p>
|
||||
TODO :: endorsements
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1,5 +1,4 @@
|
|||
{% load i18n %}
|
||||
{% load book_display_tags %}
|
||||
|
||||
<h2 class="title is-3" id="suggestions-section">
|
||||
{% trans "Suggestions" %}
|
||||
|
@ -17,46 +16,8 @@
|
|||
{% else %}
|
||||
<ol class="columns is-multiline">
|
||||
{% for item in items %}
|
||||
<li class="mb-5 column is-half">
|
||||
<div class="card">
|
||||
<div class="card-content pb-3 columns">
|
||||
{% with item_book=item.book %}
|
||||
<div class="column is-one-quarter">
|
||||
<div class="is-cover">
|
||||
<a href="{{ item_book.local_path }}" aria-hidden="true">
|
||||
{% include 'snippets/book_cover.html' with cover_class='is-h-m-mobile is-h-m-tablet is-align-items-flex-start' size='medium' book=item_book %}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="column is-three-quarters">
|
||||
<p class="mt-3">
|
||||
{% include 'snippets/book_titleby.html' with book=item_book %}
|
||||
</p>
|
||||
{% if item_book|book_description %}
|
||||
<blockquote>
|
||||
{% with full=item_book|book_description trim_length=20 %}
|
||||
{% include 'snippets/trimmed_text.html' with hide_more=True %}
|
||||
{% endwith %}
|
||||
{% endif %}
|
||||
{% include "lists/list_item_notes.html" with list=book.suggestion_list hide_edit=True %}
|
||||
</div>
|
||||
{% endwith %}
|
||||
</div>
|
||||
<div class="card-footer is-stacked-mobile has-background-tertiary is-align-items-stretch">
|
||||
<div class="card-footer-item">
|
||||
<p>
|
||||
{% blocktrans trimmed with username=item.user.display_name user_path=item.user.local_path %}
|
||||
Added by <a href="{{ user_path }}">{{ username }}</a>
|
||||
{% endblocktrans %}
|
||||
</p>
|
||||
</div>
|
||||
<div class="card-footer-item">
|
||||
<p>
|
||||
TODO :: endorsements
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<li class="mb-5 column is-one-third">
|
||||
{% include "book/suggestion_list/book_card.html" %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
<li class="mb-5 column is-full">
|
||||
|
|
Loading…
Reference in a new issue