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


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


{% block page-target %}
{% if target.pk %}
{% trans target.banned_value %}
{% else %}
{% trans "New ban" %}
{% endif %}
{% endblock page-target %}


{% block form-header %}
<h1>
  {% if target.pk %}
  {% trans target.banned_value %}
  {% else %}
  {% trans "New ban" %}
  {% endif %}
</h1>
{% endblock %}


{% block form-extra %}
class="form-horizontal"
{% endblock form-extra%}


{% block form-body %}
<div class="form-body">
  {% with label_class="col-md-3" field_class="col-md-9" %}
  <fieldset>
    <legend>{% trans "Ban settings" %}</legend>

    {% form_row form.test label_class field_class %}
    {% form_row form.banned_value label_class field_class %}
    {% form_row form.valid_until label_class field_class %}

  </fieldset>
  <fieldset>
    <legend>{% trans "Messages" %}</legend>

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

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


{% block form-footer-class %}
col-md-offset-3
{% endblock form-footer-class %}


{% block javascripts %}
<script type="text/javascript">
  $(function() {
    $('#id_valid_until').datetimepicker({
      language: $('html').attr('lang'),
      pickTime: false
    });
  });
</script>
{% endblock %}
