Uses layout for followers/following page
This commit is contained in:
parent
e4cecf2874
commit
418e656aea
|
@ -7,7 +7,11 @@
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<header class="block">
|
<header class="block">
|
||||||
{% block header %}{% endblock %}
|
{% block header %}
|
||||||
|
<h1 class="title">
|
||||||
|
{% trans "User Profile" %}
|
||||||
|
</h1>
|
||||||
|
{% endblock %}
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
{# user bio #}
|
{# user bio #}
|
||||||
|
|
|
@ -1,34 +1,14 @@
|
||||||
{% extends 'user/layout.html' %}
|
{% extends 'user/relationships/layout.html' %}
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
{% load bookwyrm_tags %}
|
|
||||||
|
|
||||||
{% block header %}
|
{% block header %}
|
||||||
<h1 class="title">
|
<h1 class="title">
|
||||||
{% trans "User Profile" %}
|
{% trans "Followers" %}
|
||||||
</h1>
|
</h1>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block panel %}
|
{% block nullstate %}
|
||||||
<div class="block">
|
<div>
|
||||||
<h2 class="title">{% trans "Followers" %}</h2>
|
{% blocktrans with username=user.display_name %}{{ username }} has no followers{% endblocktrans %}
|
||||||
{% for follower in followers %}
|
|
||||||
<div class="block columns">
|
|
||||||
<div class="column">
|
|
||||||
<a href="{{ follower.local_path }}">
|
|
||||||
{% include 'snippets/avatar.html' with user=follower %}
|
|
||||||
{{ follower.display_name }}
|
|
||||||
</a>
|
|
||||||
({{ follower.username }})
|
|
||||||
</div>
|
|
||||||
<div class="column is-narrow">
|
|
||||||
{% include 'snippets/follow_button.html' with user=follower %}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{% endfor %}
|
|
||||||
{% if not followers %}
|
|
||||||
<div>{% blocktrans with username=user.display_name %}{{ username }} has no followers{% endblocktrans %}</div>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% include 'snippets/pagination.html' with page=followers path=request.path %}
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
@ -1,34 +1,14 @@
|
||||||
{% extends 'user/layout.html' %}
|
{% extends 'user/relationships/layout.html' %}
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
{% load bookwyrm_tags %}
|
|
||||||
|
|
||||||
{% block header %}
|
{% block header %}
|
||||||
<h1 class="title">
|
<h1 class="title">
|
||||||
{% trans "User Profile" %}
|
{% trans "Following" %}
|
||||||
</h1>
|
</h1>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block panel %}
|
{% block nullstate %}
|
||||||
<div class="block">
|
<div>
|
||||||
<h2 class="title">{% trans "Following" %}</h2>
|
{% blocktrans with username=user.display_name %}{{ username }} isn't following any users{% endblocktrans %}
|
||||||
{% for follower in user.following.all %}
|
|
||||||
<div class="block columns">
|
|
||||||
<div class="column">
|
|
||||||
<a href="{{ follower.local_path }}">
|
|
||||||
{% include 'snippets/avatar.html' with user=follower %}
|
|
||||||
{{ follower.display_name }}
|
|
||||||
</a>
|
|
||||||
({{ follower.username }})
|
|
||||||
</div>
|
|
||||||
<div class="column is-narrow">
|
|
||||||
{% include 'snippets/follow_button.html' with user=follower %}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{% endfor %}
|
|
||||||
{% if not following %}
|
|
||||||
<div>{% blocktrans with username=user|username %}{{ username }} isn't following any users{% endblocktrans %}</div>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% include 'snippets/pagination.html' with page=following path=request.path %}
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
@ -0,0 +1,29 @@
|
||||||
|
{% extends 'user/layout.html' %}
|
||||||
|
{% load i18n %}
|
||||||
|
{% load bookwyrm_tags %}
|
||||||
|
|
||||||
|
{% block panel %}
|
||||||
|
<div class="block">
|
||||||
|
{% for follow in follow_list %}
|
||||||
|
<div class="block columns">
|
||||||
|
<div class="column">
|
||||||
|
<a href="{{ follower.local_path }}">
|
||||||
|
{% include 'snippets/avatar.html' with user=follow %}
|
||||||
|
{{ follow.display_name }}
|
||||||
|
</a>
|
||||||
|
({{ follow.username }})
|
||||||
|
</div>
|
||||||
|
<div class="column is-narrow">
|
||||||
|
{% include 'snippets/follow_button.html' with user=follow %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
{% if not follow_list %}
|
||||||
|
{% block nullstate %}
|
||||||
|
{% endblock %}
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% include 'snippets/pagination.html' with page=follow_list path=request.path %}
|
||||||
|
{% endblock %}
|
|
@ -110,7 +110,7 @@ class Followers(View):
|
||||||
data = {
|
data = {
|
||||||
"user": user,
|
"user": user,
|
||||||
"is_self": request.user.id == user.id,
|
"is_self": request.user.id == user.id,
|
||||||
"followers": paginated.page(request.GET.get("page", 1)),
|
"follow_list": paginated.page(request.GET.get("page", 1)),
|
||||||
}
|
}
|
||||||
return TemplateResponse(request, "user/relationships/followers.html", data)
|
return TemplateResponse(request, "user/relationships/followers.html", data)
|
||||||
|
|
||||||
|
@ -132,11 +132,11 @@ class Following(View):
|
||||||
if is_api_request(request):
|
if is_api_request(request):
|
||||||
return ActivitypubResponse(user.to_following_activity(**request.GET))
|
return ActivitypubResponse(user.to_following_activity(**request.GET))
|
||||||
|
|
||||||
paginated = Paginator(user.followers.all(), PAGE_LENGTH)
|
paginated = Paginator(user.following.all(), PAGE_LENGTH)
|
||||||
data = {
|
data = {
|
||||||
"user": user,
|
"user": user,
|
||||||
"is_self": request.user.id == user.id,
|
"is_self": request.user.id == user.id,
|
||||||
"following": paginated.page(request.GET.get("page", 1)),
|
"follow_list": paginated.page(request.GET.get("page", 1)),
|
||||||
}
|
}
|
||||||
return TemplateResponse(request, "user/relationships/following.html", data)
|
return TemplateResponse(request, "user/relationships/following.html", data)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue