From 57af283eeb89b4f929f6cce8bae90f0ea172f12c Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Nov 17 2020 09:41:08 +0000 Subject: Only show the subscribers list on demand This will speed up the page loading as the images will only be loaded on demand and not on page load, which for issues/PRs with lots of people subscribed will have quite a performance impact. Fixes https://pagure.io/pagure/issue/5012 Signed-off-by: Pierre-Yves Chibon --- diff --git a/pagure/templates/issue.html b/pagure/templates/issue.html index 2e5c51d..f3c619d 100644 --- a/pagure/templates/issue.html +++ b/pagure/templates/issue.html @@ -590,6 +590,9 @@ namespace=repo.namespace, repo=repo.name, issueid=issueid)
Subscribers {{subscribers|count}} + + +
{% if subscribers %} -
+ @@ -816,6 +819,16 @@ $(document).ready(function() { return false; }; + $('#subscribers-toggle').click(function(event){ + var _el = $('#subscribers_list'); + if (! _el.is(':visible')){ + $('#subscribers-toggle').html(''); + } else { + $('#subscribers-toggle').html(''); + } + _el.toggle(); + }); + {% if g.repo_user %} $('#closeticket').click(function(event){ event.preventDefault(); diff --git a/pagure/templates/repo_pull_request.html b/pagure/templates/repo_pull_request.html index ce1562b..8e53c2d 100644 --- a/pagure/templates/repo_pull_request.html +++ b/pagure/templates/repo_pull_request.html @@ -626,6 +626,9 @@
Subscribers {{subscribers|count}} + + +
- {% if subscribers %} -
+ {% if subscribers %} +