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

{% if c.userobj %}
  {% set logged_in = true %}
{% else %}
  {% set logged_in = false %}
{% endif %}

{% block subtitle %}{{ _('Add data to the dataset') }}{% endblock %}

{% block form %}{% snippet 'package/snippets/resource_form.html', data=data, errors=errors, error_summary=error_summary, include_metadata=false, pkg_name=pkg_name, stage=stage, allow_upload=g.ofs_impl and logged_in %}{% endblock %}

{% block secondary_content %}
  {% if pkg_dict and pkg_dict.state != 'draft' %}
    {% snippet 'package/snippets/info.html', pkg=pkg_dict, action='resource_new' %}
  {% else %}
    <section class="module module-narrow module-shallow">
      <h2 class="module-heading"><i class="icon-info-sign"></i> {{ _('What\'s a resource?') }}</h2>
      <div class="module-content">
        <p>{{ _('A resource can be any file or link to a file containing useful data.') }}</p>
      </div>
    </section>
  {% endif %}
{% endblock %}

{% block scripts %}
  {{ super() }}
  {% resource 'vendor/fileupload' %}
{% endblock %}

{% block primary_content %}
  {% if pkg_dict and pkg_dict.state != 'draft' %}
    <header class="module-content page-header"></header>
  {% endif %}
  {{ super() }}
{% endblock %}
