Update HTML package output to interim metadata standard
[ckanext-datagovau.git] / ckanext / datagovau / templates / package / snippets / package_metadata_fields.html
blob:a/ckanext/datagovau/templates/package/snippets/package_metadata_fields.html -> blob:b/ckanext/datagovau/templates/package/snippets/package_metadata_fields.html
{% ckan_extends %} {% ckan_extends %}
   
{# Remove 'free extras' from the package form. If you're using {# Remove 'free extras' from the package form. If you're using
convert_to/from_extras() as we are with our 'custom_text' field below then convert_to/from_extras() as we are with our 'custom_text' field below then
you need to remove free extras from the form, or editing your custom field you need to remove free extras from the form, or editing your custom field
won't work. #} won't work. #}
{% block custom_fields %} {% block custom_fields %}
{% endblock %} {% endblock %}
   
{# https://github.com/okfn/ckan/blob/master/ckan/templates/macros/form.html documents the macros for fields #} {# https://github.com/okfn/ckan/blob/master/ckan/templates/macros/form.html documents the macros for fields #}
   
{% block package_metadata_fields %} {% block package_metadata_fields %}
   
   
{{ super() }} {{ super() }}
   
{% endblock %} {% endblock %}
   
  {% block package_metadata_author %}
  {% endblock %}
   
  {% block package_metadata_fields_maintainer %}
  {% endblock %}
   
  {% block dataset_fields %}
  {% if data.groups %}
  <div class="control-group">
  <label class="control-label">Groups/Themes</label>
  <div class="controls">
  {% for group in data.groups %}
  <label class="checkbox" for="field-group-{{ loop.index0 }}">
  <input id="field-group-{{ loop.index0 }}" type="checkbox" name="groups__{{ loop.index0 }}__id" value="{{ group.id }}" checked="checked" />
  {{ group.title }}
  </label>
  {% endfor %}
  </div>
  </div>
  {% endif %}
  {% set group_name = 'groups__%s__id' % data.groups|length %}
  {% set group_attrs = {'data-module': 'autocomplete', 'data-module-source': '/api/2/util/group/autocomplete?q=?', 'data-module-key': 'id', 'data-module-label': 'title'} %}
  {{ form.input(group_name, label=_('Add Group/Theme'), id="field-group", value=data[group_name], classes=['control-medium'], attrs=group_attrs) }}
  {% endblock %}