From 6451d075b495b958d392e1d1445808f99208daaa Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Oct 21 2020 08:59:59 +0000 Subject: [PATCH 1/2] Adjust html indentation Signed-off-by: Pierre-Yves Chibon --- diff --git a/pagure/themes/srcfpo/templates/repo_branches.html b/pagure/themes/srcfpo/templates/repo_branches.html index a606288..bd30e77 100644 --- a/pagure/themes/srcfpo/templates/repo_branches.html +++ b/pagure/themes/srcfpo/templates/repo_branches.html @@ -51,68 +51,68 @@ {% for branch in g.branches if branch != head %}
-
- -
-
-
- - - - + +
+
+ + {% if g.repo_committer and branch != head + and ( + config.get('ALLOW_DELETE_BRANCH', True) + or repo.is_fork) %} +
- - -
- {% if g.repo_committer and branch != head - and ( - config.get('ALLOW_DELETE_BRANCH', True) - or repo.is_fork) %} - - {{ g.confirmationform.csrf_token }} - - - - - {% endif %} -
+ branchname=branch) + }}" method="post" class="icon d-inline delete-branch-form" data-branch-name="{{ branch | unicode }}"> + {{ g.confirmationform.csrf_token }} + + + + + {% endif %}
- {% endfor %}
+ {% endfor %} +
{% endblock %} From de6f7f4916a591b11e7d775936b94884ce917210 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Oct 21 2020 08:59:59 +0000 Subject: [PATCH 2/2] Split the list of branches into two lists active/inactive in dist-git This makes it more obvious which are the active branches and which are no longer active (based on the data stored and retrieved from PDC). Relates to https://pagure.io/fedora-infrastructure/issue/8390 Signed-off-by: Pierre-Yves Chibon --- diff --git a/pagure/themes/srcfpo/templates/repo_branches.html b/pagure/themes/srcfpo/templates/repo_branches.html index bd30e77..69757d8 100644 --- a/pagure/themes/srcfpo/templates/repo_branches.html +++ b/pagure/themes/srcfpo/templates/repo_branches.html @@ -24,95 +24,112 @@

Branches {{g.branches|length}}

-
- {% if head %} -
-
- -
- -
-
-
- {% endif %} - {% for branch in g.branches if branch != head %} -
-
- -
-
- - {% if g.repo_committer and branch != head - and ( - config.get('ALLOW_DELETE_BRANCH', True) - or repo.is_fork) %} -
- {{ g.confirmationform.csrf_token }} - - - -
- {% endif %} -
-
-
-
- {% endfor %} +
+

+ Active branches + +

+
+ {% if head %} +
+
+ +
+ +
+
+
+ {% endif %} + + {% for branch in g.branches if branch != head %} +
+
+ +
+
+ + {% if g.repo_committer and branch != head + and ( + config.get('ALLOW_DELETE_BRANCH', True) + or repo.is_fork) %} +
+ {{ g.confirmationform.csrf_token }} + + + +
+ {% endif %} +
+
+
+
+ {% endfor %} +
+
+ +
+

+ Inactive branches + +

+
+
+
{% endblock %} @@ -127,10 +144,13 @@ function disable_branches(){ type: 'GET', dataType: 'json', success: function(res) { + var act_br = $('#active_branches'); + var inact_br = $('#inactive_branches'); for (branch in res.results){ branch = res.results[branch]; var _it = $('#branch-' + branch.name); _it.addClass('disabled_branch'); + inact_br.append(_it); if (branch.name == 'master') { var _t = $('.projectinfo'); html = ' \ @@ -142,6 +162,9 @@ function disable_branches(){ if (res.next){ get_branches(res.next); } + + $('#active_branches_count').html($("#active_branches .list-group-item").length) + $('#inactive_branches_count').html($("#inactive_branches .list-group-item").length) } }) }