{% extends "layout.html" %}
{% block sidebar %}
{% if not suite %}
{% include "cupboard/sidebar.html" %}
{% else %}
{% include [suite + "-sidebar.html", "generic/sidebar.html"] %}
{% endif %}
{% endblock %}
{% block page_title %}Merge Proposal Status{% endblock %}
{% block body %}
<div class="section" id="merge-proposal-status">
<h1>Merge Proposal Status</h1>

{% macro display_merge_proposal(proposal) %}
<a class="reference external" href="{{ proposal.url }}">{% if proposal.package %}{{ proposal.package }}{% else %}{{ proposal.url }}{% endif %}</a>
{% if proposal.suite %}
(<a href="/{{ proposal.suite }}/pkg/{{ proposal.package }}">Details</a>)
{% endif %}
{% if not suite %}
(<a href="/cupboard/merge-proposal?url={{ proposal.url|urlencode }}">Info</a>)
{% endif %}
{% endmacro %}

{% if open_proposals %}
<div class="section" id="open-proposals">
<h2>Open Proposals</h2>
<p>These proposals are currently waiting for review.</p>
<ul class="simple">
{% for proposal in open_proposals %}
<li>{{ display_merge_proposal(proposal) }}</li>
{% endfor %}
</ul>
</div>
{% endif %}

{% if merged_proposals %}
<div class="section" id="merged-proposals">
<h2>Merged Proposals</h2>
<p>These proposals have been merged in the past.</p>
<ul class="simple">
{% for proposal in merged_proposals %}
<li>{{ display_merge_proposal(proposal) }}</li>
{% endfor %}
</ul>
</div>
{% endif %}

{% if closed_proposals %}
<div class="section" id="closed-proposals">
<h2>Closed Proposals</h2>
<p>Proposals can be closed without being merged for a number of reasons - a
similar change has already been applied, the change was rejected or the change
was merged without history being referenced (i.e. in the case of a
cherry-pick merge).</p>
<ul class="simple">
{% for proposal in closed_proposals %}
<li>{{ display_merge_proposal(proposal) }}</li>
{% endfor %}
</ul>
</div>
{% endif %}

{% if abandoned_proposals %}
<div class="section" id="abandoned-proposals">
<h2>Abandoned Proposals</h2>
<p>Proposals can be abandoned by the bot for a number of reasons. In some
cases, the relevant branch changes (e.g. if it is named after the active release),
or the package could have been removed from the archive.</p>
<ul class="simple">
{% for proposal in abandoned_proposals %}
<li>{{ display_merge_proposal(proposal) }}</li>
{% endfor %}
</ul>
</div>
{% endif %}

{% if rejected_proposals %}
<div class="section" id="rejected-proposals">
<h2>Rejected Proposals</h2>
<p>Rejected proposals are proposals that are closed by somebody other than the
bot itself, e.g. because the maintainer didn't think the change was correct.
</p>
<ul class="simple">
{% for proposal in rejected_proposals %}
<li>{{ display_merge_proposal(proposal) }}</li>
{% endfor %}
</ul>
</div>
{% endif %}
</div>

{% endblock %}
