Skip to content

Commit

Permalink
Merge pull request #2947 from bookwyrm-social/small-ui-fixes
Browse files Browse the repository at this point in the history
Small UI fixes
  • Loading branch information
mouse-reeve authored Aug 19, 2023
2 parents 53c8085 + 63b60ad commit c6aaa80
Show file tree
Hide file tree
Showing 12 changed files with 44 additions and 18 deletions.
4 changes: 2 additions & 2 deletions bookwyrm/templates/directory/community_filter.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
{% block filter %}
<legend class="label">{% trans "Community" %}</legend>
<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" %}
</label>
<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" %}
</label>
{% endblock %}
4 changes: 2 additions & 2 deletions bookwyrm/templates/directory/sort_filter.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<div class="control">
<div class="select">
<select name="sort" id="id_sort">
<option value="recent" {% if request.GET.sort == "recent" %}selected{% endif %}>{% trans "Recently active" %}</option>
<option value="suggested" {% if request.GET.sort == "suggested" %}selected{% endif %}>{% trans "Suggested" %}</option>
<option value="recent" {% if sort == "recent" %}selected{% endif %}>{% trans "Recently active" %}</option>
<option value="suggested" {% if sort == "suggested" %}selected{% endif %}>{% trans "Suggested" %}</option>
</select>
</div>
</div>
Expand Down
2 changes: 2 additions & 0 deletions bookwyrm/templates/groups/user_groups.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,7 @@ <h4 class="card-header-title">
</div>
</div>
</div>
{% empty %}
<p class="column"><em>{% trans "No groups found." %}</em></p>
{% endfor %}
</div>
2 changes: 2 additions & 0 deletions bookwyrm/templates/lists/list_items.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,7 @@ <h4 class="card-header-title is-clipped">
</div>
</div>
</div>
{% empty %}
<p class="column"><em>{% trans "No lists found." %}</em></p>
{% endfor %}
</div>
2 changes: 0 additions & 2 deletions bookwyrm/templates/lists/lists.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,13 @@ <h1 class="title">
</nav>
{% endif %}

{% if lists %}
<section class="block">
{% include 'lists/list_items.html' with lists=lists %}
</section>

<div>
{% include 'snippets/pagination.html' with page=lists path=path %}
</div>
{% endif %}

{% endblock %}

Expand Down
6 changes: 5 additions & 1 deletion bookwyrm/templates/user/goal.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{% extends 'user/layout.html' %}
{% load i18n %}
{% load utilities %}
{% load i18n %}

{% block title %}
{% trans "Reading Goal" %} - {{ user|username }}
{% endblock %}

{% block header %}
<div class="columns is-mobile">
Expand Down
5 changes: 5 additions & 0 deletions bookwyrm/templates/user/groups.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
{% extends 'user/layout.html' %}
{% load utilities %}
{% load i18n %}

{% block title %}
{% trans "Groups" %} - {{ user|username }}
{% endblock %}

{% block header %}
<div class="columns is-mobile">
<div class="column">
Expand Down
5 changes: 5 additions & 0 deletions bookwyrm/templates/user/lists.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
{% extends 'user/layout.html' %}
{% load utilities %}
{% load i18n %}

{% block title %}
{% trans "Lists" %} - {{ user|username }}
{% endblock %}

{% block header %}
<div class="columns is-mobile">
<div class="column">
Expand Down
6 changes: 4 additions & 2 deletions bookwyrm/templates/user/reviews_comments.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
{% load i18n %}
{% load utilities %}

{% block title %}{{ user.display_name }}{% endblock %}
{% block title %}
{% trans "Reviews and Comments" %} - {{ user|username }}
{% endblock %}

{% block header %}
<div class="columns is-mobile">
Expand All @@ -21,7 +23,7 @@ <h1 class="title">{% trans "Reviews and Comments" %}</h1>
{% endfor %}
{% if not activities %}
<div class="block">
<p>{% trans "No reviews or comments yet!" %}</p>
<p><em>{% trans "No reviews or comments yet!" %}</em></p>
</div>
{% endif %}

Expand Down
14 changes: 10 additions & 4 deletions bookwyrm/templates/user/user.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,15 @@ <h3>
{% endfor %}
</div>
</div>
{% empty %}
<p class="column">
<em>No books found.</em>
</p>
{% endfor %}
</div>
{% if shelves.exists %}
<small><a href="{% url 'user-shelves' user|username %}">{% trans "View all books" %}</a></small>
{% endif %}
</div>
{% endif %}

Expand Down Expand Up @@ -119,16 +125,16 @@ <h2 class="title column">{% trans "User Activity" %}</h2>
</div>
{% endif %}
</div>

{% for activity in activities %}
<div class="block" id="feed_{{ activity.id }}">
{% include 'snippets/status/status.html' with status=activity %}
</div>
{% endfor %}
{% if not activities %}
{% empty %}
<div class="block">
<p>{% trans "No activities yet!" %}</p>
<p><em>{% trans "No activities yet!" %}</em></p>
</div>
{% endif %}
{% endfor %}

{% include 'snippets/pagination.html' with page=activities path=user.local_path anchor="#feed" mode="chronological" %}
</div>
Expand Down
8 changes: 4 additions & 4 deletions bookwyrm/templates/user/user_preview.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
<p>
{% if request.user.id == user.id or admin_mode %}

<a href="{% url 'user-relationships' user|username 'followers' %}">{% blocktrans trimmed count counter=user.followers.count %}
{{ counter }} follower
<a href="{% url 'user-relationships' user|username 'followers' %}">{% blocktrans trimmed count counter=user.followers.count with display_count=user.followers.count|intcomma %}
{{ display_count }} follower
{% plural %}
{{ counter }} followers
{{ display_count }} followers
{% 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
{% endblocktrans %}</a>

Expand Down
4 changes: 3 additions & 1 deletion bookwyrm/views/directory.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def get(self, request):
software = request.GET.get("software")
if not software or software == "bookwyrm":
filters["bookwyrm_user"] = True
scope = request.GET.get("scope")
scope = request.GET.get("scope", "federated")
if scope == "local":
filters["local"] = True

Expand All @@ -38,6 +38,8 @@ def get(self, request):
page.number, on_each_side=2, on_ends=1
),
"users": page,
"sort": sort,
"scope": scope,
}
return TemplateResponse(request, "directory/directory.html", data)

Expand Down

0 comments on commit c6aaa80

Please sign in to comment.