From e580d4a679739c528e2212ab16d96cb9785d8e71 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Mar 26 2014 09:34:22 +0000 Subject: Simplify the url mapping for fork related endpoints Signed-off-by: Pierre-Yves Chibon --- diff --git a/progit/fork.py b/progit/fork.py index 37658c8..02233b4 100644 --- a/progit/fork.py +++ b/progit/fork.py @@ -205,44 +205,25 @@ def do_request_pulls(repo, username=None, status=True): @APP.route('//request-pulls') -def request_pulls(repo): - """ Request pulling the changes from the fork into the project. - """ - status = flask.request.args.get('status', True) - return do_request_pulls(repo, status=status) - - @APP.route('/fork///request-pulls') -def fork_request_pulls(username, repo): +def request_pulls(repo, username=None): """ Request pulling the changes from the fork into the project. """ status = flask.request.args.get('status', True) - return do_request_pulls(repo, username=username, status=status) + return do_request_pulls(repo, status=status, username=username) @APP.route('//request-pull/') -def request_pull(repo, requestid): - """ Request pulling the changes from the fork into the project. - """ - return do_request_pull(repo, requestid) - - @APP.route('/fork///request-pull/') -def fork_request_pull(username, repo, requestid): +def request_pull(repo, requestid, username=None): """ Request pulling the changes from the fork into the project. """ return do_request_pull(repo, requestid, username=username) @APP.route('//request-pull/merge/') -def merge_request_pull(repo, requestid): - """ Request pulling the changes from the fork into the project. - """ - return do_merge_request_pull(repo, requestid) - - @APP.route('/fork///request-pull/merge/') -def fork_merge_request_pull(username, repo, requestid): +def merge_request_pull(repo, requestid, username=None): """ Request pulling the changes from the fork into the project. """ return do_merge_request_pull(repo, requestid, username=username) diff --git a/progit/templates/pull_request.html b/progit/templates/pull_request.html index 6694d3e..4d11864 100644 --- a/progit/templates/pull_request.html +++ b/progit/templates/pull_request.html @@ -22,15 +22,10 @@

Title: {{ request.title }}

{% if request.status %} - {% if '/fork/' in request.url %} - - {% else %} - - {% endif %} - Merge - + + Merge + {% else %} Merged diff --git a/progit/templates/repo_master.html b/progit/templates/repo_master.html index aec204d..62b94b8 100644 --- a/progit/templates/repo_master.html +++ b/progit/templates/repo_master.html @@ -52,13 +52,10 @@ {% endif %}
  • - {% if '/fork/' in request.url %} - - {% else %} - - {% endif %} - Pull-requests + + Pull-requests +
  • {% if repo.forks %} diff --git a/progit/templates/requests.html b/progit/templates/requests.html index 0ce81c7..993f47b 100644 --- a/progit/templates/requests.html +++ b/progit/templates/requests.html @@ -11,21 +11,13 @@ Pull-requests {% if status and status not in [False, 'Closed'] %} - {% if '/fork/' in request.url %} - - {% else %} - - {% endif %} + (Closed) {% else %} - {% if '/fork/' in request.url %} - - {% else %} - - {% endif %} - (Open) + (Open) {% endif %} @@ -35,13 +27,8 @@ {% for request in requests %}
  • #{{ request.id }} - {% if '/fork/' in request.url %} - - {% else %} - - {% endif %} {{ request.title }} Opened by