mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-27 12:01:14 +00:00
Cards on list page
This commit is contained in:
parent
fd9b98d443
commit
6e0d258c97
3 changed files with 27 additions and 16 deletions
|
@ -1,2 +0,0 @@
|
|||
<h4><a href="{{ list.local_path }}">{{ list.name }}</a> <span class="subtitle">{% include 'snippets/privacy-icons.html' with item=list %}</span></h4>
|
||||
{% include 'snippets/trimmed_text.html' with full=list.description %}
|
23
bookwyrm/templates/lists/list_items.html
Normal file
23
bookwyrm/templates/lists/list_items.html
Normal file
|
@ -0,0 +1,23 @@
|
|||
{% load bookwyrm_tags %}
|
||||
<div class="columns is-multiline">
|
||||
{% for list in lists %}
|
||||
<div class="column is-one-quarter">
|
||||
<div class="card">
|
||||
<header class="card-header">
|
||||
<h4 class="card-header-title">
|
||||
<a href="{{ list.local_path }}">{{ list.name }}</a> <span class="subtitle">{% include 'snippets/privacy-icons.html' with item=list %}</span>
|
||||
</h4>
|
||||
</header>
|
||||
<div class="card-image is-flex">
|
||||
{% for book in list.books.all|slice:5 %}
|
||||
{% include 'snippets/book_cover.html' with book=book size="small" %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div class="card-content is-flex-grow-0">
|
||||
{% if list.description %}{{ list.description | to_markdown | safe | truncatewords_html:20 }}{% endif %}
|
||||
<p class="subtitle help">Created {% if list.curation != 'open' %} and curated{% endif %} by {% include 'snippets/username.html' with user=list.user %}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
|
@ -27,13 +27,7 @@
|
|||
</form>
|
||||
|
||||
{% if request.user.list_set.exists %}
|
||||
<ul>
|
||||
{% for list in request.user.list_set.all %}
|
||||
<li class="block">
|
||||
{% include 'lists/list-item.html' with list=list %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% include 'lists/list_items.html' with lists=request.user.list_set.all %}
|
||||
{% endif %}
|
||||
</section>
|
||||
{% endif %}
|
||||
|
@ -41,13 +35,9 @@
|
|||
{% if lists.exists %}
|
||||
<section class="block content">
|
||||
<h2 class="title">Recent Lists</h2>
|
||||
<ul>
|
||||
{% for list in lists %}
|
||||
<li class="block">
|
||||
{% include 'lists/list-item.html' with list=list %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% if request.user.list_set.exists %}
|
||||
{% include 'lists/list_items.html' with lists=lists %}
|
||||
{% endif %}
|
||||
</section>
|
||||
{% endif %}
|
||||
|
||||
|
|
Loading…
Reference in a new issue