Merge pull request #2947 from bookwyrm-social/small-ui-fixes

Small UI fixes
This commit is contained in:
Mouse Reeve 2023-08-19 15:09:12 -07:00 committed by GitHub
commit c6aaa80c62
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 44 additions and 18 deletions

View file

@ -4,11 +4,11 @@
{% block filter %} {% block filter %}
<legend class="label">{% trans "Community" %}</legend> <legend class="label">{% trans "Community" %}</legend>
<label class="is-block"> <label class="is-block">
<input type="radio" class="radio" name="scope" value="local" {% if request.GET.scope == "local" %}checked{% endif %}> <input type="radio" class="radio" name="scope" value="local" {% if scope == "local" %}checked{% endif %}>
{% trans "Local users" %} {% trans "Local users" %}
</label> </label>
<label class="is-block"> <label class="is-block">
<input type="radio" class="radio" name="scope" value="federated" {% if request.GET.scope == "federated" %}checked{% endif %}> <input type="radio" class="radio" name="scope" value="federated" {% if scope == "federated" %}checked{% endif %}>
{% trans "Federated community" %} {% trans "Federated community" %}
</label> </label>
{% endblock %} {% endblock %}

View file

@ -6,8 +6,8 @@
<div class="control"> <div class="control">
<div class="select"> <div class="select">
<select name="sort" id="id_sort"> <select name="sort" id="id_sort">
<option value="recent" {% if request.GET.sort == "recent" %}selected{% endif %}>{% trans "Recently active" %}</option> <option value="recent" {% if sort == "recent" %}selected{% endif %}>{% trans "Recently active" %}</option>
<option value="suggested" {% if request.GET.sort == "suggested" %}selected{% endif %}>{% trans "Suggested" %}</option> <option value="suggested" {% if sort == "suggested" %}selected{% endif %}>{% trans "Suggested" %}</option>
</select> </select>
</div> </div>
</div> </div>

View file

@ -31,5 +31,7 @@
</div> </div>
</div> </div>
</div> </div>
{% empty %}
<p class="column"><em>{% trans "No groups found." %}</em></p>
{% endfor %} {% endfor %}
</div> </div>

View file

@ -46,5 +46,7 @@
</div> </div>
</div> </div>
</div> </div>
{% empty %}
<p class="column"><em>{% trans "No lists found." %}</em></p>
{% endfor %} {% endfor %}
</div> </div>

View file

@ -43,7 +43,6 @@
</nav> </nav>
{% endif %} {% endif %}
{% if lists %}
<section class="block"> <section class="block">
{% include 'lists/list_items.html' with lists=lists %} {% include 'lists/list_items.html' with lists=lists %}
</section> </section>
@ -51,7 +50,6 @@
<div> <div>
{% include 'snippets/pagination.html' with page=lists path=path %} {% include 'snippets/pagination.html' with page=lists path=path %}
</div> </div>
{% endif %}
{% endblock %} {% endblock %}

View file

@ -1,6 +1,10 @@
{% extends 'user/layout.html' %} {% extends 'user/layout.html' %}
{% load i18n %}
{% load utilities %} {% load utilities %}
{% load i18n %}
{% block title %}
{% trans "Reading Goal" %} - {{ user|username }}
{% endblock %}
{% block header %} {% block header %}
<div class="columns is-mobile"> <div class="columns is-mobile">

View file

@ -1,6 +1,11 @@
{% extends 'user/layout.html' %} {% extends 'user/layout.html' %}
{% load utilities %}
{% load i18n %} {% load i18n %}
{% block title %}
{% trans "Groups" %} - {{ user|username }}
{% endblock %}
{% block header %} {% block header %}
<div class="columns is-mobile"> <div class="columns is-mobile">
<div class="column"> <div class="column">

View file

@ -1,6 +1,11 @@
{% extends 'user/layout.html' %} {% extends 'user/layout.html' %}
{% load utilities %}
{% load i18n %} {% load i18n %}
{% block title %}
{% trans "Lists" %} - {{ user|username }}
{% endblock %}
{% block header %} {% block header %}
<div class="columns is-mobile"> <div class="columns is-mobile">
<div class="column"> <div class="column">

View file

@ -2,7 +2,9 @@
{% load i18n %} {% load i18n %}
{% load utilities %} {% load utilities %}
{% block title %}{{ user.display_name }}{% endblock %} {% block title %}
{% trans "Reviews and Comments" %} - {{ user|username }}
{% endblock %}
{% block header %} {% block header %}
<div class="columns is-mobile"> <div class="columns is-mobile">
@ -21,7 +23,7 @@
{% endfor %} {% endfor %}
{% if not activities %} {% if not activities %}
<div class="block"> <div class="block">
<p>{% trans "No reviews or comments yet!" %}</p> <p><em>{% trans "No reviews or comments yet!" %}</em></p>
</div> </div>
{% endif %} {% endif %}

View file

@ -51,9 +51,15 @@
{% endfor %} {% endfor %}
</div> </div>
</div> </div>
{% empty %}
<p class="column">
<em>No books found.</em>
</p>
{% endfor %} {% endfor %}
</div> </div>
{% if shelves.exists %}
<small><a href="{% url 'user-shelves' user|username %}">{% trans "View all books" %}</a></small> <small><a href="{% url 'user-shelves' user|username %}">{% trans "View all books" %}</a></small>
{% endif %}
</div> </div>
{% endif %} {% endif %}
@ -119,16 +125,16 @@
</div> </div>
{% endif %} {% endif %}
</div> </div>
{% for activity in activities %} {% for activity in activities %}
<div class="block" id="feed_{{ activity.id }}"> <div class="block" id="feed_{{ activity.id }}">
{% include 'snippets/status/status.html' with status=activity %} {% include 'snippets/status/status.html' with status=activity %}
</div> </div>
{% endfor %} {% empty %}
{% if not activities %}
<div class="block"> <div class="block">
<p>{% trans "No activities yet!" %}</p> <p><em>{% trans "No activities yet!" %}</em></p>
</div> </div>
{% endif %} {% endfor %}
{% include 'snippets/pagination.html' with page=activities path=user.local_path anchor="#feed" mode="chronological" %} {% include 'snippets/pagination.html' with page=activities path=user.local_path anchor="#feed" mode="chronological" %}
</div> </div>

View file

@ -23,12 +23,12 @@
<p> <p>
{% if request.user.id == user.id or admin_mode %} {% if request.user.id == user.id or admin_mode %}
<a href="{% url 'user-relationships' user|username 'followers' %}">{% blocktrans trimmed count counter=user.followers.count %} <a href="{% url 'user-relationships' user|username 'followers' %}">{% blocktrans trimmed count counter=user.followers.count with display_count=user.followers.count|intcomma %}
{{ counter }} follower {{ display_count }} follower
{% plural %} {% plural %}
{{ counter }} followers {{ display_count }} followers
{% endblocktrans %}</a>, {% endblocktrans %}</a>,
<a href="{% url 'user-relationships' user|username 'following' %}">{% blocktrans trimmed with counter=user.following.count %} <a href="{% url 'user-relationships' user|username 'following' %}">{% blocktrans trimmed with counter=user.following.count|intcomma %}
{{ counter }} following {{ counter }} following
{% endblocktrans %}</a> {% endblocktrans %}</a>

View file

@ -19,7 +19,7 @@ class Directory(View):
software = request.GET.get("software") software = request.GET.get("software")
if not software or software == "bookwyrm": if not software or software == "bookwyrm":
filters["bookwyrm_user"] = True filters["bookwyrm_user"] = True
scope = request.GET.get("scope") scope = request.GET.get("scope", "federated")
if scope == "local": if scope == "local":
filters["local"] = True filters["local"] = True
@ -38,6 +38,8 @@ class Directory(View):
page.number, on_each_side=2, on_ends=1 page.number, on_each_side=2, on_ends=1
), ),
"users": page, "users": page,
"sort": sort,
"scope": scope,
} }
return TemplateResponse(request, "directory/directory.html", data) return TemplateResponse(request, "directory/directory.html", data)