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


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


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


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


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

    {% form_row form.check_type %}
    {% form_row form.banned_value %}
    {% form_row form.registration_only %}
    {% form_row form.expires_on %}

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

    {% form_row form.user_message %}
    {% form_row form.staff_message %}

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


{% block javascripts %}
<script type="text/javascript">
  window.misago.initDatepicker({
    elementId: "id_expires_on",
    never: "{% trans 'Never' %}",
    setDate: "{% trans 'Set date' %}"
  })
</script>
{% endblock %}
