From af9befc8277c95cc93d045a2d4b1b03612a6acfc Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Nov 23 2017 11:33:49 +0000 Subject: [PATCH 1/2] Fix the new PR and delete buttons for branch name with + in them Fixes https://pagure.io/pagure/issue/2795 Signed-off-by: Pierre-Yves Chibon --- diff --git a/pagure/templates/repo_info.html b/pagure/templates/repo_info.html index c81a3ed..09a23b1 100644 --- a/pagure/templates/repo_info.html +++ b/pagure/templates/repo_info.html @@ -130,7 +130,9 @@ git push -u origin master
{% if g.repo_committer and branch != head and config.get('ALLOW_DELETE_BRANCH', True) %} -
{{ form.csrf_token }} + onclick="$('#delete_branch_form-{{ + branch | replace('/', '__') | replace('.', '\\\\.') + | replace('+', '___') + }}').submit();">
@@ -334,8 +339,8 @@ $(function() { commit not in the main branch. Click to create new PR now.'+'"> New PR \
'; {%endif%} - $('#branch-' + branch.replace('.', '\\.').replace('/', '__') - + ' .branch_del').prepend(html2); + var _b = branch.replace('.', '\\.').replace('/', '__').replace('\+', '\\+'); + $('#branch-' + _b + ' .branch_del').prepend(html2); $('[data-toggle="tooltip"]').tooltip({placement : 'bottom'}); } for (branch in res.message.branch_w_pr){ From edf1c5e5806b1f51c64d47e9ce0664e71f7571aa Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Nov 23 2017 11:35:41 +0000 Subject: [PATCH 2/2] Small style changes Signed-off-by: Pierre-Yves Chibon --- diff --git a/pagure/templates/repo_info.html b/pagure/templates/repo_info.html index 09a23b1..f7d960a 100644 --- a/pagure/templates/repo_info.html +++ b/pagure/templates/repo_info.html @@ -111,8 +111,9 @@ git push -u origin master {% endif %} - {% for branch in g.branches if branch != head%} -
+ {% for branch in g.branches if branch != head %} +
{% if branchname != branch %} @@ -357,7 +358,6 @@ $(function() { title="' + branch +' is already in an opened pull-request">' + 'PR#' + res.message.branch_w_pr[branch] + ' \
'; - console.log(html); $('#branch-' + branch.replace('.', '\\.').replace('/', '__') + ' .branch_del').prepend(html); $('[data-toggle="tooltip"]').tooltip({placement : 'bottom'});