From 72ed91a6dbdc523fdb655f697caa1516f11d57c3 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Sep 30 2016 13:46:05 +0000 Subject: [PATCH 1/2] Fix showing the PR number or New PR button on branches containing a dot Fixes https://pagure.io/pagure/issue/1361 --- diff --git a/pagure/templates/repo_info.html b/pagure/templates/repo_info.html index 3cf2c9c..86efe0b 100644 --- a/pagure/templates/repo_info.html +++ b/pagure/templates/repo_info.html @@ -327,7 +327,7 @@ $(function() { commit not in the main branch. Click to create new PR now.'+'"> New PR \ '; {%endif%} - $('#branch-'+branch+' .branch_del').prepend(html2); + $('#branch-' + branch.replace('.', '\\.') + ' .branch_del').prepend(html2); $('[data-toggle="tooltip"]').tooltip({placement : 'bottom'}); } for (branch in res.message.branch_w_pr){ @@ -345,7 +345,7 @@ $(function() { + 'PR#' + res.message.branch_w_pr[branch] + ' \ '; console.log(html); - $('#branch-' + branch + ' .branch_del').prepend(html); + $('#branch-' + branch.replace('.', '\\.') + ' .branch_del').prepend(html); $('[data-toggle="tooltip"]').tooltip({placement : 'bottom'}); } } From c60bf118d3e399ba9cc55b74147e9c14c9ba9aec Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Sep 30 2016 13:46:05 +0000 Subject: [PATCH 2/2] Fix deleting branches containing a dot in their name --- diff --git a/pagure/templates/repo_info.html b/pagure/templates/repo_info.html index 86efe0b..1508c9a 100644 --- a/pagure/templates/repo_info.html +++ b/pagure/templates/repo_info.html @@ -133,7 +133,7 @@ git push -u origin master onsubmit="return confirm('Are you sure you want to remove the branch: {{ branch }}?\nThis cannot be un-done!');"> {{ form.csrf_token }} + onclick="$('#delete_branch_form-{{ branch | replace('/', '_') | replace('.', '\\\\.') }}').submit();">