{% extends "base.html" %}
{% load i18n %}

{% block content %}
  <main id="integrations--page" class="main">
    <section class="section">
      {% include "components/header/header.html" with title="Integrations" only %}

      <div class="integrations">
        <h3 class="integrations__title">Reddit</h3>
        <div class="integrations__controls">
          {% if reddit_authorization_url %}
            <a class="link button button--reddit" href="{{ reddit_authorization_url }}">
              {% trans "Authorize account" %}
            </a>
          {% else %}
            <button class="button button--reddit button--disabled" disabled>
              {% trans "Authorize account" %}
            </button>
          {% endif %}

          {% if reddit_refresh_url %}
            <a class="link button button--reddit" href="{{ reddit_refresh_url }}">
              {% trans "Refresh token" %}
            </a>
          {% else %}
            <button class="button button--reddit button--disabled" disabled>
              {% trans "Refresh token" %}
            </button>
          {% endif %}

          {% if reddit_revoke_url %}
            <a class="link button button--reddit" href="{{ reddit_revoke_url }}">
              {% trans "Deauthorize account" %}
            </a>
          {% else %}
            <button class="button button--reddit button--disabled" disabled>
              {% trans "Deauthorize account" %}
            </button>
          {% endif %}
        </div>
      </div>

      <div class="integrations">
        <h3 class="integrations__title">Twitter</h3>
        <div class="integrations__controls">
          {% if twitter_auth_url %}
            <a class="link button button--twitter" href="{{ twitter_auth_url }}">
              {% trans "Authorize account" %}
            </a>
          {% else %}
            <button class="button button--twitter button--disabled" disabled>
              {% trans "Authorize account" %}
            </button>
          {% endif %}

          {% if twitter_revoke_url %}
            <a class="link button button--twitter" href="{{ twitter_revoke_url }}">
              {% trans "Deauthorize account" %}
            </a>
          {% else %}
            <button class="button button--twitter button--disabled" disabled>
              {% trans "Deauthorize account" %}
            </button>
          {% endif %}
        </div>
      </div>
    </section>
  </main>
{% endblock %}
