{% extends "misago/admin/generic/form.html" %}
{% load i18n misago_admin_form %}


{% block title %}
{% if target.pk %}
{% trans target.get_final_title %}
{% else %}
{% trans "New agreement" %}
{% endif %} | {{ active_link.name }} | {{ block.super }}
{% endblock title %}


{% block page-header %}
{{ block.super }}
{% if target.pk %}
  <small>
    {{ target.get_final_title }}
  </small>
{% endif %}
{% endblock page-header %}


{% block page-actions %}
{% if target.get_absolute_url %}
  <div class="col-auto page-action">
    <a href="{{ target.get_absolute_url }}" class="btn btn-primary btn-sm">
      <span class="fas fa-external-link-alt"></span>
      {% trans "View on site" %}
    </a>
  </div>
{% endif %}
{% endblock %}


{% block form-header %}
{% if target.pk %}
  {% trans "Edit agreement" %}
{% else %}
  {% trans "New agreement" %}
{% endif %}
{% endblock %}


{% block form-body %}
<div class="form-fieldset">
  <fieldset>
    <legend>{% trans "Basic settings" %}</legend>

    {% form_row form.type %}
    {% form_row form.title %}
    {% form_row form.is_active %}

  </fieldset>
</div>
<div class="form-fieldset">
  <fieldset>
    <legend>{% trans "Agreement contents" %}</legend>

    <div class="alert alert-info" role="alert">
      {% trans "Fill in one of the fields." %}
    </div>

    {% form_row form.link %}
    {% form_row form.text %}

  </fieldset>
</div>
{% endblock form-body %}
