{% ckan_extends %}

{% block resource_actions_inner %}
  {{ super() }}
  {% if res.datastore_active %}
    <li>{% snippet 'package/snippets/data_api_button.html', resource=res %}</li>
  {% endif %}
{% endblock %}

{% block resource_additional_information_inner %}
  {% if res.datastore_active %}
    {% set ddict=h.datastore_dictionary(res.id) %}
    <div class="module-content">
      <h2>{{ _('Data Dictionary') }}</h2>
      <table class="table table-striped table-bordered table-condensed" data-module="table-toggle-more">
        <thead>
          <tr>
            <th scope="col">{{ _('Column') }}</th>
            <th scope="col">{{ _('Type') }}</th>
            <th scope="col">{{ _('Label') }}</th>
            <th scope="col">{{ _('Description') }}</th>
          </tr>
        </thead>
        {% for f in ddict %}
          <tr>
            <td>{{ f.id }}</td>
            <td>{{ f.type }}</td>
            <td>{{ h.get_translated(f.get('info', {}), 'label') }}</td>
            <td>{{ h.render_markdown(
              h.get_translated(f.get('info', {}), 'notes')) }}</td>
          </tr>
        {% endfor %}
      </table>
    </div>
  {% endif %}
  {{ super() }}
{% endblock %}
