From d6f47d084187c64042bf2ebf76044a350a6134d1 Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Wed, 3 Aug 2022 07:20:30 +0100 Subject: [PATCH] Flip nickname and channel only if type is self --- core/templates/modals/context_table.html | 6 ++++++ core/views/ui/drilldown.py | 2 ++ 2 files changed, 8 insertions(+) diff --git a/core/templates/modals/context_table.html b/core/templates/modals/context_table.html index f95f2d2..a393e11 100644 --- a/core/templates/modals/context_table.html +++ b/core/templates/modals/context_table.html @@ -7,9 +7,15 @@ {% for item in object_list %} {{ item.time }} + {% if query is True and item.type == 'self' %} + {{ item.channel }} + {% else %} {{ item.nick }} + {% endif %} {{ item.msg }} {% endfor %} diff --git a/core/views/ui/drilldown.py b/core/views/ui/drilldown.py index 3228e72..57573f7 100644 --- a/core/views/ui/drilldown.py +++ b/core/views/ui/drilldown.py @@ -306,6 +306,8 @@ class DrilldownContextModal(APIView): "mtype": query_params["mtype"], "nick": query_params["nick"], } + if nicks: + context["query"] = True return render(request, self.template_name, context)