{% extends "base.html" %} {% set active_page = "plugins" %} {% block
title%}Plugins{% endblock %} {% block styles %}{{ super() }}{% endblock %} {%
block script %}{% endblock %} {% block content %}
<div id="container">
  {% for name in database.keys() | sort %} {% set has_info = name in loaded and
  loaded[name].__description__ is defined %}
  <div class="plugins-box">
    <div class="tooltip">
      <div class="plugin-header">
        <h4>
          {% if name in loaded and loaded[name].on_webhook is defined %}
          <a href="/plugins/{{ name | urlencode }}">{{ name }}</a>
          {% else %}{{ name }}{% endif %}
        </h4>
        {% if name in loaded and loaded[name].__version__ is defined %}
        <span class="badge version">{{ loaded[name].__version__ }}</span>
        {% endif %}
      </div>
      {% if name in loaded %} {% if has_info %}
      <span class="tooltiptext">{{ loaded[name].__description__ }}</span>
      {% else %}
      <span class="tooltiptext">Description unable to load yet.</span>
      {% endif %} {% endif %}
    </div>
    <div class="author">
      {% if name in loaded and loaded[name].__author__ is defined %} {{
      loaded[name].__author__ }} {% endif %}
    </div>
    <div class="plugin-badges">
      {% if name in default_plugins %}
      <span class="badge default">DEFAULT</span>
      {% endif %}
    </div>
    <div>
      <form method="POST" action="/plugins/toggle" class="plugin-toggle">
        <label class="switch">
          <input
            type="checkbox"
            name="enabled"
            id="flip-checkbox-{{name}}"
            {%
            if
            name
            in
            loaded
            %}
            checked
            {%
            endif
            %}
          />
          <span class="slider"></span>
        </label>
        <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
        <input type="hidden" name="plugin" value="{{ name }}" />
      </form>
      <form method="POST" action="/plugins/upgrade">
        <button
          type="submit"
          name="upgrade"
          class="btn primary plugin-upgrade-btn"
        >
          Upgrade Plugin
        </button>
        <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
        <input type="hidden" name="plugin" value="{{ name }}" />
      </form>
    </div>
  </div>
  {% endfor %}
</div>
{% endblock %} {% block scripts %}{{ super() }}
<script src="/js/plugins.js"></script>
{% endblock %}
