From 131672d4d18ea7b401f93ddc6e83996ae8b061bc Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Aug 21 2018 12:17:47 +0000 Subject: Fix the URLs when opening a new PR vias the drop-down button Basically, in this commit we make sure to give a value to the branch_to and branch_from variable so the url is properly generated, then we remove the random value and replace them by the content returned by the ajax query. Fixes https://pagure.io/pagure/issue/3535 Signed-off-by: Pierre-Yves Chibon --- diff --git a/pagure/templates/repo_master.html b/pagure/templates/repo_master.html index f465bfe..a21392f 100644 --- a/pagure/templates/repo_master.html +++ b/pagure/templates/repo_master.html @@ -439,9 +439,9 @@ $(function() { repo=repo.name, username=repo.user.user if repo.is_fork else None, namespace=repo.namespace, - branch_to='', - branch_from='') }}"; - url = url.slice(0, -2) + res.message.new_branch[branch]['target_branch'] + '..' + branch; + branch_to='-', + branch_from='-') }}"; + url = url.slice(0, -4) + res.message.new_branch[branch]['target_branch'] + '..' + branch; html = '' + '' + ' ' @@ -489,9 +489,9 @@ $(function() { repo=repo.name, username=g.fas_user.username, namespace=repo.namespace, - branch_to='', - branch_from='') }}"; - url = url.slice(0, -2) + res.message.new_branch[branch]['target_branch'] + '..' + branch; + branch_to='-', + branch_from='-') }}"; + url = url.slice(0, -4) + res.message.new_branch[branch]['target_branch'] + '..' + branch; html = '' + ''