Merge branch 'main' into images-django-imagekit
This commit is contained in:
@ -1,9 +1,16 @@
|
||||
{% spaceless %}
|
||||
{% load i18n %}
|
||||
{% load humanize %}
|
||||
{% comment %}
|
||||
@todo The author property needs to be an Organization or a Person. We’ll be using Thing which is the more generic ancestor.
|
||||
@see https://schema.org/Author
|
||||
{% endcomment %}
|
||||
{% for author in book.authors.all %}
|
||||
{% firstof limit None as limit %}
|
||||
{% with subtraction_value='-'|add:limit %}
|
||||
{% with remainder_count=book.authors.count|add:subtraction_value %}
|
||||
{% with remainder_count_display=remainder_count|intcomma %}
|
||||
|
||||
{% for author in book.authors.all|slice:limit %}
|
||||
<a
|
||||
href="{{ author.local_path }}"
|
||||
class="author"
|
||||
@ -12,6 +19,14 @@
|
||||
itemtype="https://schema.org/Thing"
|
||||
><span
|
||||
itemprop="name"
|
||||
>{{ author.name }}<span></a>{% if not forloop.last %}, {% endif %}
|
||||
>{{ author.name }}<span></a>{% if not forloop.last %}, {% elif remainder_count > 0 %}, {% blocktrans trimmed count counter=remainder_count %}
|
||||
and {{ remainder_count_display }} other
|
||||
{% plural %}
|
||||
and {{ remainder_count_display }} others
|
||||
{% endblocktrans %}{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
{% endwith %}
|
||||
{% endwith %}
|
||||
{% endwith %}
|
||||
{% endspaceless %}
|
||||
|
@ -1,8 +1,15 @@
|
||||
{% load i18n %}
|
||||
{% load utilities %}
|
||||
{% spaceless %}
|
||||
|
||||
{% if book.authors %}
|
||||
{% blocktrans with path=book.local_path title=book|book_title %}<a href="{{ path }}">{{ title }}</a> by {% endblocktrans %}{% include 'snippets/authors.html' with book=book %}
|
||||
{% blocktrans trimmed with path=book.local_path title=book|book_title %}
|
||||
<a href="{{ path }}">{{ title }}</a> by
|
||||
{% endblocktrans %}
|
||||
{% include 'snippets/authors.html' with book=book limit=3 %}
|
||||
|
||||
{% else %}
|
||||
<a href="{{ book.local_path }}">{{ book|book_title }}</a>
|
||||
{% endif %}
|
||||
|
||||
{% endspaceless %}
|
||||
|
@ -5,17 +5,18 @@
|
||||
{% if not no_label %}
|
||||
<label class="is-sr-only" for="privacy-{{ uuid }}">{% trans "Post privacy" %}</label>
|
||||
{% endif %}
|
||||
{% firstof current user.default_post_privacy "public" as privacy %}
|
||||
<select name="privacy" id="privacy-{{ uuid }}">
|
||||
<option value="public" {% if not current or current == 'public' %}selected{% endif %}>
|
||||
<option value="public" {% if privacy == 'public' %}selected{% endif %}>
|
||||
{% trans "Public" %}
|
||||
</option>
|
||||
<option value="unlisted" {% if current == 'unlisted' %}selected{% endif %}>
|
||||
<option value="unlisted" {% if privacy == 'unlisted' %}selected{% endif %}>
|
||||
{% trans "Unlisted" %}
|
||||
</option>
|
||||
<option value="followers" {% if current == 'followers' %}selected{% endif %}>
|
||||
<option value="followers" {% if privacy == 'followers' %}selected{% endif %}>
|
||||
{% trans "Followers" %}
|
||||
</option>
|
||||
<option value="direct" {% if current == 'direct' %}selected{% endif %}>
|
||||
<option value="direct" {% if privacy == 'direct' %}selected{% endif %}>
|
||||
{% trans "Private" %}
|
||||
</option>
|
||||
</select>
|
||||
|
38
bookwyrm/templates/snippets/suggested_users.html
Normal file
38
bookwyrm/templates/snippets/suggested_users.html
Normal file
@ -0,0 +1,38 @@
|
||||
{% load i18n %}
|
||||
{% load utilities %}
|
||||
{% load humanize %}
|
||||
<div class="columns is-mobile scroll-x mb-0">
|
||||
{% for user in suggested_users %}
|
||||
<div class="column is-flex is-flex-grow-0">
|
||||
<div class="box has-text-centered is-shadowless has-background-white-bis m-0">
|
||||
<a href="{{ user.local_path }}" class="has-text-black">
|
||||
{% include 'snippets/avatar.html' with user=user large=True %}
|
||||
<span title="{{ user.display_name }}" class="is-block is-6 has-text-weight-bold">{{ user.display_name|truncatechars:10 }}</span>
|
||||
<span title="@{{ user|username }}" class="is-block pb-3">@{{ user|username|truncatechars:8 }}</span>
|
||||
</a>
|
||||
{% include 'snippets/follow_button.html' with user=user minimal=True %}
|
||||
{% if user.mutuals %}
|
||||
<p class="help">
|
||||
{% blocktrans trimmed with mutuals=user.mutuals|intcomma count counter=user.mutuals %}
|
||||
{{ mutuals }} follower you follow
|
||||
{% plural %}
|
||||
{{ mutuals }} followers you follow{% endblocktrans %}
|
||||
</p>
|
||||
{% elif user.shared_books %}
|
||||
<p class="help">
|
||||
{% blocktrans trimmed with shared_books=user.shared_books|intcomma count counter=user.shared_books %}
|
||||
{{ shared_books }} book on your shelves
|
||||
{% plural %}
|
||||
{{ shared_books }} books on your shelves
|
||||
{% endblocktrans %}
|
||||
</p>
|
||||
{% elif request.user in user.following.all %}
|
||||
<p class="help">
|
||||
{% trans "Follows you" %}
|
||||
</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user