Implement user and channel tags for intersections

This commit is contained in:
Mark Veidemanis 2022-07-21 13:51:52 +01:00
parent f0c548db6f
commit a56042376c
Signed by: m
GPG Key ID: 5ACFCEED46C0904F
2 changed files with 12 additions and 1 deletions

View File

@ -101,6 +101,11 @@
<i class="fa-solid fa-user" aria-hidden="true"></i>
</span>
{{ user }}
{% if channel in num_users %}
<span class="tag">
{{ num_chans|index:user }}
</span>
{% endif %}
</a>
{% endfor %}
</div>
@ -112,6 +117,11 @@
<i class="fa-solid fa-hashtag" aria-hidden="true"></i>
</span>
{{ channel }}
{% if nick in num_chans %}
<span class="tag">
{{ num_users|index:channel }}
</span>
{% endif %}
</a>
{% endfor %}
</div>

View File

@ -2,6 +2,7 @@ from django import template
register = template.Library()
@register.filter
def index(h, key):
return h[key]