From 10d747b7d250f6c778db7af87707429cc27f0c7f Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Apr 01 2019 08:28:46 +0000 Subject: Fix the new PR drop-down button Currently we only populate the new PR drop-down button if the user is a maintainer, however, if the user has a fork, the drop-down button should work. So instead of preventing the entire button from working, we've adjusted so that only the main project is considered if the user is a maintainer and the fork is considered everytime otherwise. Fixes https://pagure.io/pagure/issue/4310 Signed-off-by: Pierre-Yves Chibon --- diff --git a/pagure/templates/repo_master.html b/pagure/templates/repo_master.html index 7b0d666..355fe82 100644 --- a/pagure/templates/repo_master.html +++ b/pagure/templates/repo_master.html @@ -376,12 +376,13 @@ function generate_branch_list_fork(data) { _b.show(); $("#pr-dropdown-forklist .pr-dropdown-spinner").hide(); } +{% endif %} $("#pr-button").one("click", function() { var _pr_url = "{{ url_for('internal_ns.get_pull_request_ready_branch') }}"; - + {% if g.repo_committer %} var data = { repo: "{{ repo.name }}", namespace: "{{ repo.namespace if repo.namespace }}", @@ -402,6 +403,8 @@ $("#pr-button").one("click", _b.show(); $("#pr-dropdown-mainlist .pr-dropdown-spinner").hide(); }) + {% endif %} + var data = { repo: "{{ repo.name }}", namespace: "{{ repo.namespace if repo.namespace }}", @@ -424,7 +427,6 @@ $("#pr-button").one("click", }) } ); -{% endif %} {% endif %}