{% extends "admin/change_list.html" %}
{% load i18n admin_urls static admin_list %}

{% block extrastyle %}{{ block.super }}
<link rel="stylesheet" type="text/css" href="{% static "admin/css/forms.css" %}">{% endblock %}

{% block content %}
<div id="content-main">
  {% block object-tools %}
  {{ block.super }}
  {% endblock %}
  {% if cl.formset and cl.formset.errors %}
  <p class="errornote">
    {% if cl.formset.total_error_count == 1 %}{% translate "Please correct the error below." %}{% else %}{% translate "Please correct the errors below." %}{% endif %}
  </p>
  {{ cl.formset.non_form_errors }}
  {% endif %}
  <div class="module{% if cl.has_filters %} filtered{% endif %}" id="changelist">
    <div class="changelist-form-container">
      {% block search %}{{ block.super }}{% endblock %}
      {% block date_hierarchy %}{{ block.super }}{% endblock %}

      <form id="changelist-form" method="post" {% if cl.formset and cl.formset.is_multipart %}
        enctype="multipart/form-data" {% endif %} novalidate>{% csrf_token %}
        {% if cl.formset %}
        <div>{{ cl.formset.management_form }}</div>
        {% endif %}

        {% block result_list %}
        {{ block.super }}
        {% endblock %}
        {% block pagination %}{{ block.super }}{% endblock %}
      </form>
    </div>
    {% block filters %}
    {{ block.super }}
    {% endblock %}
  </div>
  {% block action_buttons %}
  {% if has_add_permission or has_change_permission %}
  <div class="submit-row">
    <form action="{% url 'admin:obapi_obcontentitem_update' %}" method="post" id="action-buttons-form" novalidate>
      {% csrf_token %}
      {% if has_add_permission %}<input type="submit" value="{% translate 'Sync existing posts' %}" class="default"
        name="_sync">{% endif %}
      {% if has_change_permission %}<input type="submit" value="{% translate 'Pull new posts' %}" class="default"
        name="_pull">{% endif %}
    </form>
  </div>
  {% endif %}
  {% endblock %}
</div>
{% endblock %}