{% extends "repo_master.html" %}
{% from "_formhelper.html" import render_field_in_row %}
{% block title %}Pull request #{{ request.id }} - {{ repo.name }}{% endblock %}
{%block tag %}home{% endblock %}
{% block repo %}
<h2>Request pull
{% if '/fork/' in request.url %}
<a href="{{ url_for('view_fork_repo', username=username, repo=repo.name)}}">
{% else %}
<a href="{{ url_for('view_repo', repo=repo.name)}}">
{% endif %}
{{ repo.name }}
</a>
{% if '/fork/' in request.url %}
(<a href="{{ url_for('view_fork_tree', username=username,
repo=repo.name, identifier=commitid) }}"
>tree</a>)
{% else %}
(<a href="{{ url_for('view_tree',
repo=repo.name, identifier=commitid) }}"
>tree</a>)
{% endif %}
</h2>
{% if request %}
<h3>Title: {{ request.title }}</h3>
{% if request.status %}
<span>
{% if '/fork/' in request.url %}
<a href="{{ url_for('fork_merge_request_pull', username=username,
repo=repo.name, requestid=request.id) }}" class="message">
{% else %}
<a href="{{ url_for('merge_request_pull',
repo=repo.name, requestid=request.id) }}" class="message">
{% endif %}
Merge
</a>
</span>
{% else %}
<span class="error">Merged</span>
{% endif %}
{% endif %}
<section class="commit_list">
<ul>
{% for commit in diff_commits %}
<li>
<a href="{{ url_for('view_fork_commit', username=username,
repo=repo.name, commitid=commit.oid.hex)}}">
{{ commit.message.split('\n')[0] }}
</a>
</li>
{% endfor %}
</ul>
</section>
{% if form %}
<section class="new_project">
<form action="{{ url_for('.new_request_pull', username=username,
repo=repo.name, commitid=commitid) }}" method="post">
<table>
{{ render_field_in_row(form.title) }}
</table>
<p class="buttons indent">
<input type="submit" class="submit positive button" value="Create">
<input type="button" value="Cancel" class="button" onclick="history.back();">
{{ form.csrf_token }}
</p>
</form>
</section>
{% endif %}
<section class="request_diff">
<h3>Diff:</h3>
{% for html_diff in html_diffs %}
<h3>Commit: {{ diff_commits[loop.index - 1].oid.hex }}</h3>
<table>
<tr>
<td>Author</td>
<td>
{{ diff_commits[loop.index - 1].author.name }} {{ '<' + diff_commits[loop.index - 1].author.email + '>' }}
- {{ diff_commits[loop.index - 1].commit_time }}
</td>
</tr>
<tr>
<td>Committer</td>
<td>
{{ diff_commits[loop.index - 1].committer.name }} {{ '<' + diff_commits[loop.index - 1].committer.email + '>' }}
- {{ diff_commits[loop.index - 1].commit_time }}
</td>
</tr>
<tr>
<td>Parent</td>
<td>
{% for parent in diff_commits[loop.index - 1].parents %}
{% if '/fork/' in request.url %}
<a href="{{ url_for('view_fork_commit', username=username,
repo=repo.name, commitid=parent.oid.hex) }}">
{% else %}
<a href="{{ url_for('view_commit',
repo=repo.name, commitid=parent.oid.hex) }}">
{% endif %}
{{ parent.oid.hex }}
</a> <br />
{% endfor %}
</td>
</tr>
</table>
<p>
{{ diff_commits[loop.index - 1].message }}
</p>
{% autoescape false %}
{{ html_diff }}
{% endautoescape %}
{% endfor %}
</section>
{% endblock %}