{% import 'macros/form.html' as form %}
{% resource 'requestdata/request-data.js' %}

<section id="dataset-resources" class="resources">
  <h3>{{ _('Data and Resources') }}</h3>
  {% block resource_list %}
    {% if resources %}
      <ul class="{% block resource_list_class %}resource-list{% endblock %}">
        {% block resource_list_inner %}
          {% for resource in resources %}
            {% snippet 'package/snippets/resource_item.html', pkg=pkg, res=resource %}
          {% endfor %}
        {% endblock %}
      </ul>
    {% else %}
      {% if h.check_access('resource_create', {'package_id': pkg['id']}) %}
           {% set sender_name = form.input('name', id='field-name', label=_('Name'), placeholder=_('Name'), value='', error='', classes=['control-full']) %}
           {% set template = '<div class="modal"><div class="modal-body">'+ sender_name +'</div></div>' %}
          {% trans url=h.url_for(controller='package', action='new_resource', id=pkg.name) %}
              <p class="empty">Unfortunately the actual data isn't available right now. If you are interested to receive it you can request data</p>
              <a href="#" class="btn pull-right" data-module="request-data" >Request data resource</a>
          {% endtrans %}
      {% else %}
          <p class="empty">{{ _('This dataset has no data') }}</p>
      {% endif %}
    {% endif %}
    {% endblock %}
</section>

{% import 'macros/form.html' as form %}

{% resource 'requestdata/modal-form.js' %}

<section id="dataset-resources" class="resources">
  <h3>{{ _('Data and Resources') }}</h3>
  {% block resource_list %}
    {% if resources %}
      <ul class="{% block resource_list_class %}resource-list{% endblock %}">
        {% block resource_list_inner %}
          {% for resource in resources %}
            {% snippet 'package/snippets/resource_item.html', pkg=pkg, res=resource %}
          {% endfor %}
        {% endblock %}
      </ul>
    {% else %}
      {% if h.check_access('resource_create', {'package_id': pkg['id']}) %}
           {% set sender_name = form.input('name', id='field-name', label=_('Name'), placeholder=_('Name'), value='', error='', classes=['control-full']) %}
           {% set template = '<div class="modal"><div class="modal-body">'+ sender_name +'</div></div>' %}
          {% trans url=h.url_for(controller='package', action='new_resource', id=pkg.name) %}
              <p class="empty">Unfortunately the actual data isn't available right now. If you are interested to receive it you can request data</p>
              <a href="#" class="btn pull-right" data-module="modal-form" data-module-template_file="request_contact.html">Request data resource</a>
          {% endtrans %}
      {% else %}
          <p class="empty">{{ _('This dataset has no data') }}</p>
      {% endif %}
    {% endif %}
    {% endblock %}
</section>

Use new module name 'modal-form' and add template file
Use new module name 'modal-form' and add template file
