mirror of
https://github.com/jointakahe/takahe.git
synced 2024-11-22 07:10:59 +00:00
Show a post button and fix selected logic for following/followers (#320)
This commit is contained in:
parent
9cea7bc124
commit
6a1caae79b
2 changed files with 5 additions and 2 deletions
|
@ -80,8 +80,9 @@
|
|||
|
||||
{% if identity.local and identity.config_identity.visible_follows %}
|
||||
<div class="view-options follows">
|
||||
<a href="{{ identity.urls.following }}" {% if not inbound or not follows_page %}class="selected"{% endif %}><strong>{{ following_count }}</strong> following</a>
|
||||
<a href="{{ identity.urls.followers }}" {% if inbound or not follows_page %}class="selected"{% endif %}><strong>{{ followers_count }}</strong> follower{{ followers_count|pluralize }}</a>
|
||||
<a href="{{ identity.urls.view }}" {% if not follows_page %}class="selected"{% endif %}><strong>{{ post_count }}</strong> posts</a>
|
||||
<a href="{{ identity.urls.following }}" {% if not inbound and follows_page %}class="selected"{% endif %}><strong>{{ following_count }}</strong> following</a>
|
||||
<a href="{{ identity.urls.followers }}" {% if inbound and follows_page %}class="selected"{% endif %}><strong>{{ followers_count }}</strong> follower{{ followers_count|pluralize }}</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
|
|
|
@ -74,6 +74,7 @@ class ViewIdentity(ListView):
|
|||
context["page_obj"],
|
||||
self.request.identity,
|
||||
)
|
||||
context["post_count"] = self.identity.posts.count()
|
||||
if self.identity.config_identity.visible_follows:
|
||||
context["followers_count"] = self.identity.inbound_follows.filter(
|
||||
state__in=FollowStates.group_active()
|
||||
|
@ -164,6 +165,7 @@ class IdentityFollows(ListView):
|
|||
context["following_count"] = self.identity.outbound_follows.filter(
|
||||
state__in=FollowStates.group_active()
|
||||
).count()
|
||||
context["post_count"] = self.identity.posts.count()
|
||||
return context
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue