mirror of
https://github.com/jointakahe/takahe.git
synced 2024-11-22 07:10:59 +00:00
Fix inbound/outbound links
This commit is contained in:
parent
00795f119e
commit
be377653fe
2 changed files with 14 additions and 6 deletions
|
@ -53,4 +53,12 @@ class Follows(ListView):
|
|||
target=self.request.identity, source_id__in=identity_ids
|
||||
).values_list("source_id", flat=True)
|
||||
context["inbound"] = self.inbound
|
||||
context["num_inbound"] = Follow.objects.filter(
|
||||
target=self.request.identity,
|
||||
state__in=FollowStates.group_active(),
|
||||
).count()
|
||||
context["num_outbound"] = Follow.objects.filter(
|
||||
source=self.request.identity,
|
||||
state__in=FollowStates.group_active(),
|
||||
).count()
|
||||
return context
|
||||
|
|
|
@ -5,11 +5,11 @@
|
|||
{% block content %}
|
||||
<div class="view-options">
|
||||
{% if inbound %}
|
||||
<a href=".?outbound=true">Your Follows</a>
|
||||
<a href=".?outbound=true" class="selected">Follows You</a>
|
||||
<a href=".">Your Follows ({{ num_outbound }})</a>
|
||||
<a href="." class="selected">Follows You ({{ num_inbound }})</a>
|
||||
{% else %}
|
||||
<a href=".?inbound=true" class="selected">Your Follows</a>
|
||||
<a href=".?inbound=true">Follows You</a>
|
||||
<a href=".?inbound=true" class="selected">Your Follows ({{ num_outbound }})</a>
|
||||
<a href=".?inbound=true">Follows You ({{ num_inbound }})</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
|
@ -35,11 +35,11 @@
|
|||
|
||||
<div class="pagination">
|
||||
{% if page_obj.has_previous %}
|
||||
<a class="button" href=".?page={{ page_obj.previous_page_number }}">Previous Page</a>
|
||||
<a class="button" href=".?page={{ page_obj.previous_page_number }}{% if inbound %}&inbound=true{% endif %}">Previous Page</a>
|
||||
{% endif %}
|
||||
|
||||
{% if page_obj.has_next %}
|
||||
<a class="button" href=".?page={{ page_obj.next_page_number }}">Next Page</a>
|
||||
<a class="button" href=".?page={{ page_obj.next_page_number }}{% if inbound %}&inbound=true{% endif %}">Next Page</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
Loading…
Reference in a new issue