{% extends '@admin/index.twig' %}

{% block content %}
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 mb-3 border-bottom">
  <h1 class="h2">
    <i aria-hidden="true" class="bi bi-wrench"></i>
    {{ 'msgPlugins' | translate }}
  </h1>
</div>

<div class="row">
  <div class="col-lg-12">

    <p>
      {{ 'msgPluginListing' | translate }}
    </p>

    <table class="table table-striped">
      <thead>
        <tr>
          <th>{{ 'msgPluginName' | translate }}</th>
          <th>{{ 'msgPluginVersion' | translate }}</th>
          <th>{{ 'msgPluginAuthor' | translate }}</th>
          <th>{{ 'msgPluginDescription' | translate }}</th>
        </tr>
      </thead>
      <tbody>
        {% for plugin in pluginList %}
        <tr>
          <td>{{ plugin.name }}</td>
          <td>{{ plugin.version }}</td>
          <td>{{ plugin.author }}</td>
          <td>{{ plugin.description }}</td>
        </tr>
        {% endfor %}
      </tbody>
    </table>

    {% if incompatiblePlugins is not empty %}
    <div class="alert alert-warning mt-4" role="alert">
      <h5 class="alert-heading">
        <i aria-hidden="true" class="bi bi-exclamation-triangle-fill"></i>
        {{ 'msgIncompatiblePlugins' | translate }}
      </h5>
      <p>{{ 'msgIncompatiblePluginsInfo' | translate }}</p>
    </div>

      <table class="table table-striped">
      <thead>
        <tr>
          <th>{{ 'msgPluginName' | translate }}</th>
          <th>{{ 'msgPluginVersion' | translate }}</th>
          <th>{{ 'msgPluginAuthor' | translate }}</th>
          <th>{{ 'msgPluginReason' | translate }}</th>
        </tr>
      </thead>
      <tbody>
        {% for name, info in incompatiblePlugins %}
        <tr>
          <td>{{ info.plugin.name }}</td>
          <td>{{ info.plugin.version }}</td>
          <td>{{ info.plugin.author }}</td>
          <td><small class="text-danger">{{ info.reason }}</small></td>
        </tr>
        {% endfor %}
      </tbody>
    </table>
    {% endif %}

    <p class="mt-3">
      <a target="_blank" href="https://phpmyfaq.readthedocs.io/en/main/plugins/">
        {{ 'msgDocumentation' | translate }}
      </a>
    </p>

  </div>
</div>

{% endblock %}

