From a56042376c00f9c2755cf6cbae47c358a252ff5c Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Thu, 21 Jul 2022 13:51:52 +0100 Subject: [PATCH] Implement user and channel tags for intersections --- core/templates/modals/info.html | 10 ++++++++++ core/templatetags/index.py | 3 ++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/core/templates/modals/info.html b/core/templates/modals/info.html index a90892c..9d7587d 100644 --- a/core/templates/modals/info.html +++ b/core/templates/modals/info.html @@ -101,6 +101,11 @@ {{ user }} + {% if channel in num_users %} + + {{ num_chans|index:user }} + + {% endif %} {% endfor %} @@ -112,6 +117,11 @@ {{ channel }} + {% if nick in num_chans %} + + {{ num_users|index:channel }} + + {% endif %} {% endfor %} diff --git a/core/templatetags/index.py b/core/templatetags/index.py index b329a88..aa3e4c8 100644 --- a/core/templatetags/index.py +++ b/core/templatetags/index.py @@ -2,6 +2,7 @@ from django import template register = template.Library() + @register.filter def index(h, key): - return h[key] \ No newline at end of file + return h[key]