{% extends 'layouts/base.html' %}

{% set active_menu = 'synchronization' %}
{% set page_title = 'Synchronization Blacklist' %}

{% block breadcrumbs %}
<nav class="pt-3" aria-label="breadcrumb">
    <ol class="breadcrumb">
        <li>
            <a href="{{ url_for('overview.index') }}">Home</a>
        </li>
        <li>
            <a href="{{ url_for('synchronization.index') }}">Sync</a>
        </li>
        <li>
          <p class="px-2">{{sconf.repo.name}}</p>
        </li>
        <li>
          <p class="px-2">{{sconf.destination_suite.name}} (from {{sconf.source.os_name}} {{sconf.source.suite_name}})</p>
        </li>
        <li class="is-active">
          <a href="#" aria-current="page">Denylist</a>
        </li>
    </ol>
</nav>
{% endblock %}

{% block body_header %}
<h1 class="title mb-4">Packages Prevented From Synchronization</h1>
{% endblock %}

{% block body %}
{% if not entries %}
<article class="message is-success">
    <div class="message-header">
        <p><span class="fa fa-check" aria-hidden="true"></span> Any package is permitted to enter the destination suite.</p>
    </div>
</article>
{% else %}

<table class="table is-striped is-hoverable">
    <thead>
      <tr>
        <th>Package</th>
        <th>Reason</th>
        <th>Date</th>
      </tr>
    </thead>
    <tbody>
    {% for entry in entries %}
        <tr>
          <th scope="row">{{entry.pkgname}}</th>
          <td>{{entry.reason}}</td>
          <td>{{ entry.time_created.strftime('%Y-%m-%d %H:%M %z') if entry.time_created else 'Unknown' }}</td>
        </tr>
    {% endfor %}
    </tbody>
</table>

{% endif %}
{% endblock %}
