diff --git a/progit/app.py b/progit/app.py index f305f3d..0f3cbec 100644 --- a/progit/app.py +++ b/progit/app.py @@ -499,6 +499,26 @@ def edit_issue(repo, issueid, username=None): ) +def request_pulls(repo, username=None): + """ Returns the list of pull-requests opened on a project. + """ + repo = progit.lib.get_project(SESSION, repo, user=username) + + if not repo: + flask.abort(404, 'Project not found') + + requests = progit.lib.get_pull_requests( + SESSION, project_id=repo.id, status=True) + + return flask.render_template( + 'requests.html', + select='requests', + repo=repo, + username=username, + requests=requests, + ) + + def request_pull(repo, requestid, username=None): """ Request pulling the changes from the fork into the project. """ @@ -562,6 +582,7 @@ def request_pull(repo, requestid, username=None): return flask.render_template( 'pull_request.html', + select='requests', repo=repo, username=username or request.user, request=request, diff --git a/progit/templates/requests.html b/progit/templates/requests.html new file mode 100644 index 0000000..a95cd48 --- /dev/null +++ b/progit/templates/requests.html @@ -0,0 +1,40 @@ +{% extends "repo_master.html" %} + +{% block title %}Home{% endblock %} +{%block tag %}home{% endblock %} + + +{% block repo %} + +
+ No pull-request have been opened for this project. +
+ {% endif %} +