{% extends "ui/page.html" %}

{% load i18n static ui %}

{% block title %}{% translate 'Saved!' %}{% endblock %}

{% block button_bar_class %}d-none{% endblock %}

{% block page_body %}
<div class="container">
  {% if association.target.is_netloc_banned %}
    <div class="alert alert-warning mt-3" role="alert">
      <h4 class="alert-heading">{% translate 'Heads up!' %}</h4>
      <p class="lead mb-2">
        {% translate "Your link has been saved, but..." %}
      </p>
      <p>
        {% blocktranslate %}
          The link is for a site that makes it difficult to extract metadata from. As such, sane defaults were used. This could make the save hard to identify.
        {% endblocktranslate %}
        <br>
        {% blocktranslate %}
          Click the button below to edit the save's metadata to your liking.
        {% endblocktranslate %}
      </p>
      <hr>
      <p class="mb-0">
        <a
          class="btn btn-primary btn-sm"
          href="{% url 'ui.associations.edit' pk=association.pk %}"
          role="button"
        >
          <i class="bi bi-pencil"></i> {% translate 'Edit' %}
        </a>
        <a
          class="btn btn-success btn-sm"
          href="{% url 'ui.associations.browse' %}"
          role="button"
        >
          <i class="bi bi-house-heart-fill"></i> {% translate 'Home' %}
        </a>
      </p>
    </div>
  {% else %}
    <div class="alert alert-success mt-3" role="alert">
      <h4 class="alert-heading">{% translate 'Saved!' %}</h4>
      <p class="lead">
        {% translate "Your link has been saved!" %}
      </p>
      <hr>
      <p class="mb-0">
        <a
          class="btn btn-primary btn-sm"
          href="{% url 'ui.associations.view' pk=association.pk %}"
          role="button"
        >
          <i class="bi bi-eye"></i>  {% translate 'View the link' %}
        </a>
        <a
          class="btn btn-success btn-sm"
          href="{% url 'ui.associations.browse' %}"
          role="button"
        >
          <i class="bi bi-house-heart-fill"></i> {% translate 'Home' %}
        </a>
      </p>
    </div>
  {% endif %}
</div>
{% endblock %}
