From nobody Sat Jul 12 10:30:33 2025 Delivered-To: importer2@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=patchew-devel-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; dkim=fail header.i=fam@euphon.net; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1543415790832162.86683992522944; Wed, 28 Nov 2018 06:36:30 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8091A89AE8; Wed, 28 Nov 2018 14:36:29 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6FE23601A8; Wed, 28 Nov 2018 14:36:29 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 64774181B9E9; Wed, 28 Nov 2018 14:36:29 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id wASEaS5C032172 for ; Wed, 28 Nov 2018 09:36:28 -0500 Received: by smtp.corp.redhat.com (Postfix) id BC0B54140; Wed, 28 Nov 2018 14:36:28 +0000 (UTC) Received: from mx1.redhat.com (ext-mx04.extmail.prod.ext.phx2.redhat.com [10.5.110.28]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AB40B413B; Wed, 28 Nov 2018 14:36:28 +0000 (UTC) Received: from sender1.zoho.com.cn (sender2-op-o12.zoho.com.cn [163.53.93.243]) by mx1.redhat.com (Postfix) with ESMTP id 1E18F20CFC; Wed, 28 Nov 2018 14:36:08 +0000 (UTC) Received: from localhost.localdomain (123.112.65.99 [123.112.65.99]) by mx.zoho.com.cn with SMTPS id 1543415759306423.582007622232; Wed, 28 Nov 2018 22:35:59 +0800 (CST) ARC-Seal: i=1; a=rsa-sha256; t=1543415764; cv=none; d=zoho.com.cn; s=zohoarc; b=hUdIwtoziV0tUGQhmrZ4NBnw7SfalNTiQ6+sD6873KlektHVK8lAshSJWJjBxvpxtxfCuZxGI9Wg/kiZAJEiuBOKTn7UMCU5/92R3y2KxJa1dNtI+XRPOIyxH7f5vzXccZKOyk8mPIAjX8pAEJ1QfsLXaSFkeTYqk4r2qDhs6bQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com.cn; s=zohoarc; t=1543415764; h=Cc:Date:From:In-Reply-To:Message-ID:References:Subject:To:ARC-Authentication-Results; bh=s6Lb9VpiU3YuSrMWndWHx/csIZZ8AgKYNR0JCWr10yQ=; b=ESET/yh/fe3hfLCZtBrJOk80PR/7Tt0J1St3WTVYl37UrF/eupFjfbqJ8DYjgkI2vcTNzod8w6jLod4NzaWsx6N/2yNtVi1ioF05BA+TKuHk/tWsQ0qWiSCxItUBeuGXlzCoJ1Z3ei9371wYDQqc3jMaec2y3Wvgf3B7UMg7B94= ARC-Authentication-Results: i=1; mx.zoho.com.cn; dkim=pass header.i=euphon.net; spf=pass smtp.mailfrom=fam@euphon.net; dmarc=pass header.from= header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1543415764; s=zoho; d=euphon.net; i=fam@euphon.net; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; l=5027; bh=s6Lb9VpiU3YuSrMWndWHx/csIZZ8AgKYNR0JCWr10yQ=; b=X/hX7rWolf9L+TPQGYwyxqgmZ+ULCgGPZiE1AuwCeEpZEpy+bmRuDPyQhNWcQL9x LZdeXQp0aqHukO2osVafKI6mCE330o2VnLr1A7UxYim4QIkNo8ecur+18G1ykrRTw8j TtCEckuWfxoYsQMisxHOGLvmYDb1t1yBd8d1jEFc= From: Fam Zheng To: patchew-devel@redhat.com Date: Wed, 28 Nov 2018 22:35:01 +0800 Message-Id: <20181128143505.27730-9-fam@euphon.net> In-Reply-To: <20181128143505.27730-1-fam@euphon.net> References: <20181128143505.27730-1-fam@euphon.net> X-ZohoCNMailClient: External X-Greylist: Sender passed SPF test, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Wed, 28 Nov 2018 14:36:27 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Wed, 28 Nov 2018 14:36:27 +0000 (UTC) for IP:'163.53.93.243' DOMAIN:'sender2-op-o12.zoho.com.cn' HELO:'sender1.zoho.com.cn' FROM:'fam@euphon.net' RCPT:'' X-RedHat-Spam-Score: -0.101 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, SPF_PASS) 163.53.93.243 sender2-op-o12.zoho.com.cn 163.53.93.243 sender2-op-o12.zoho.com.cn X-Scanned-By: MIMEDefang 2.78 on 10.5.110.28 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: patchew-devel@redhat.com Cc: Fam Zheng Subject: [Patchew-devel] [PATCH v2 08/12] www: Add /my-queues page X-BeenThere: patchew-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Patchew development and discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: patchew-devel-bounces@redhat.com Errors-To: patchew-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 28 Nov 2018 14:36:29 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Fam Zheng This new page lists the user's queues and the patches added to them. Signed-off-by: Fam Zheng --- mods/maintainer.py | 17 ++++++++ www/templates/base.html | 3 ++ www/templates/my-queues.html | 82 ++++++++++++++++++++++++++++++++++++ 3 files changed, 102 insertions(+) create mode 100644 www/templates/my-queues.html diff --git a/mods/maintainer.py b/mods/maintainer.py index 60ed4c4..d342748 100644 --- a/mods/maintainer.py +++ b/mods/maintainer.py @@ -14,6 +14,7 @@ from django.http import Http404, HttpResponseRedirect, Ht= tpResponseBadRequest from django.urls import reverse from mod import PatchewModule from api.models import Message, Queue, WatchedQuery +from django.shortcuts import render from api.search import SearchEngine from event import register_handler =20 @@ -119,6 +120,21 @@ class MaintainerModule(PatchewModule): self._drop_from_queue(request.user, m, queue) return HttpResponseRedirect(request.META.get('HTTP_REFERER')) =20 + def www_view_my_queues(self, request): + if not request.user.is_authenticated: + raise PermissionDenied() + data =3D {} + for i in Queue.objects.filter(message__is_patch=3DTrue, + user=3Drequest.user).\ + order_by("message__project", "name", "message__date"): + pn =3D i.message.project.name + qn =3D i.name + data.setdefault(pn, {}) + data[pn].setdefault(qn, []) + data[pn][qn].append(i.message) + + return render(request, "my-queues.html", context=3D{"projects": da= ta}) + def render_page_hook(self, request, context_data): if request.user.is_authenticated and context_data.get("is_search"): q =3D WatchedQuery.objects.filter(user=3Drequest.user).first() @@ -157,6 +173,7 @@ class MaintainerModule(PatchewModule): urlpatterns.append(url(r"^drop-from-queue/(?P[^/]*)/(?P.*)/", self.www_view_drop_from_queue, name=3D"drop-from-queue")) + urlpatterns.append(url(r"^my-queues/", self.www_view_my_queues)) urlpatterns.append(url(r"^watch-query/", self.www_view_watch_query= )) =20 def prepare_message_hook(self, request, message, detailed): diff --git a/www/templates/base.html b/www/templates/base.html index 850317f..f8d407d 100644 --- a/www/templates/base.html +++ b/www/templates/base.html @@ -77,6 +77,9 @@ crossorigin=3D"anonymous"/> Hi {{ user.username }}
    + {% if request.user.is_authenticated %} +
  • My queues<= /a>
  • + {% endif %} {% if request.user.is_staff %}
  • Admin
  • {% endif %} diff --git a/www/templates/my-queues.html b/www/templates/my-queues.html new file mode 100644 index 0000000..627dc5a --- /dev/null +++ b/www/templates/my-queues.html @@ -0,0 +1,82 @@ +{% extends 'base.html' %} + +{% block header %} + + + + + +{% endblock %} + +{% block title %}My queues{% endblock %} + +{% block content %} + +
    + +
    + +
    + + +{% if projects %} +{% for p, queues in projects.items %} + +
    + {% for qn, msgs in queues.items %} +

    Queue: {{ qn }} [{{ p }}]

    + + {% endfor %} +
    + +{% endfor %} +{% else %} +

    You haven't created any queue

    +{% endif %} + + + +{% endblock %} --=20 2.17.2 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://www.redhat.com/mailman/listinfo/patchew-devel