[Patchew-devel] [PATCH] maintainer: show at most 25 elements in the my-queues page

Paolo Bonzini posted 1 patch 2 years, 2 months ago
mods/maintainer.py           | 2 +-
www/templates/my-queues.html | 5 ++++-
2 files changed, 5 insertions(+), 2 deletions(-)
[Patchew-devel] [PATCH] maintainer: show at most 25 elements in the my-queues page
Posted by Paolo Bonzini 2 years, 2 months ago
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 mods/maintainer.py           | 2 +-
 www/templates/my-queues.html | 5 ++++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/mods/maintainer.py b/mods/maintainer.py
index 215a96a..545f572 100644
--- a/mods/maintainer.py
+++ b/mods/maintainer.py
@@ -269,7 +269,7 @@ class MaintainerModule(PatchewModule):
                 raise Http404("Project not found")
             q = q.filter(message__project=po)
 
-        for pid, qn, msgid, subject in q.values_list(
+        for pid, qn, msgid, subject in q[:26].values_list(
             "message__project_id", "name", "message__message_id", "message__subject"
         ):
             data.setdefault(pid, {})
diff --git a/www/templates/my-queues.html b/www/templates/my-queues.html
index b112e2b..ef1d12f 100644
--- a/www/templates/my-queues.html
+++ b/www/templates/my-queues.html
@@ -35,12 +35,15 @@
 </a></div>
             </div>
 	    <ul class="no-bullet card-body card-collapse collapse{% if qn != "reject" %} show" aria-expanded="true"{% else %}" aria-expanded="false"{% endif %}>
-            {% for patch in msgs %}
+            {% for patch in msgs|slice:":25" %}
                 <li><a href="/{{ pn }}/{{ patch.message_id }}/">
                   <span class="fa-lg fa fa-ellipsis-v"></span>
                   {{ patch.subject }}
                   </a></li>
             {% endfor %}
+	    {% if msgs|length > 25 %}
+	    <li><a href="{% url "maintainer_queue" project=pn name=qn %}">View all series in queue...</a></li>
+	    {% endif %}
             </ul>
 	</div>
     {% endfor %}
-- 
2.37.1

_______________________________________________
Patchew-devel mailing list
Patchew-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/patchew-devel