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


{% block title %}
{% trans "Ban users" %} | {{ active_link.name }} | {{ block.super }}
{% endblock title %}


{% block page-target %}
{% trans "Ban users" %}
{% endblock page-target %}


{% block form-header %}
<h1>{% trans "Ban selected users:" %}</h1>
{% endblock %}


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


{% block form-body %}
<input type="hidden" name="action" value="ban">
{% for user in users %}
<input type="hidden" name="selected_items" value="{{ user.pk }}">
{% endfor %}
<table class="table table-condensed form-table">
  {% for user in users %}
  <tr>
    <td style="width: 1%;">
      <a href="{{ user.get_absolute_url }}">
        <img src="{{ user|avatar:24 }}" alt="{% trans "Avatar" %}" width="24" height="24">
      </a>
    </td>
    <td class="item-name">
      <a href="{{ user.get_absolute_url }}">{{ user }}</a>
    </td>
    <td>
      {{ user.email }}
    </td>
    <td>
      {{ user.joined_from_ip }}
    </td>
  </tr>
  {% endfor %}
</table>
<div class="form-body">
  {% with label_class="col-md-3" field_class="col-md-9" %}
  <fieldset>
    <legend>{% trans "Ban settings" %}</legend>

    {% form_row form.ban_type label_class field_class %}
    {% form_row form.expires_on 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 %}
<button class="btn btn-primary" name="finalize">{% trans "Set bans" %}</button>
{% endblock %}


{% 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 %}
