{% extends "package/view_edit_base.html" %}

{% block subtitle %}{{ _('Add view') }} - {{ h.resource_display_name(c.resource) }}{% endblock %}
{% block form_title %}{{ _('Add view') }}{% endblock %}

{% block breadcrumb_content %}
  {{ super() }}
  <li class="active"><a href="#">{{ _('Add view') }}</a></li>
{% endblock %}

{% block content_primary_nav %}
  <li class="active"><a href="#"><i class="icon-edit"></i> {{ _('Add view') }}</a></li>
{% endblock %}

{% block form %}
  {% if resource_view.view_type == 'recline_view' and not datastore_available %}
    <p class="text-info">
      <i class="icon-info-sign"></i>
      {% trans %}
      Data Explorer views may be slow and unreliable unless the DataStore extension is enabled. For more information, please see the <a href='http://docs.ckan.org/en/latest/maintaining/data-viewer.html#viewing-structured-data-the-data-explorer' target='_blank'>Data Explorer documentation</a>.
      {% endtrans %}
    </p>
  {% endif %}

  <form class="dataset-form dataset-resource-form form-horizontal" method="post" data-module="basic-form resource-form">
    {% include 'package/snippets/view_form.html' %}
    <div class="form-actions">
        <button class="btn {% if not h.resource_view_display_preview(data) %}hide{%endif%}" name="preview" value="True" type="submit">{{ _('Preview') }}</button>
        <button class="btn btn-primary" name="save" value="Save" type="submit">{% block save_button_text %}{{ _('Add') }}{% endblock %}</button>
    </div>
  </form>
{% endblock %}
