Skip to content
Snippets Groups Projects
Select Git revision
  • 07b25f4be82e844571a9e02f9c1022481e6a90ec
  • master default protected
  • add-frequency-to-form
  • dev protected
  • ckan-2.11.0
  • add-package-custom-fields
  • fix-adding-datasets-for-users-and-editors
  • add-auth-subroute
  • 71-migrate-custom-fields-to-ckanext-scheming
  • add-author-maintainer-information
  • fix-inline-flex-btns
  • fix-known-spatial-uri-validation
  • py3
  • 47-aktuelle-resource-einer-collection-wird-nicht-mehr-gefunden
  • 10-eingabe-der-dct-accrualperiodicity-in-weboberflache
  • v1.3
  • 2.5.3
  • 2.5.2
  • 2.5.1
  • 2.5.0
  • 2.4.7
  • 2.4.6
  • 2.4.5
  • 2.4.4
  • 2.4.3
  • 2.4.2
  • 2.4.1
  • 2.4.0
  • 2.3.1
  • 2.3.0
  • 2.2.0
  • 2.1.0
  • 2.0.0
  • 1.4.3
  • 1.4.2
  • 1.4.1
36 results

package_basic_fields.html

Blame
  • package_basic_fields.html 14.55 KiB
    {% import 'macros/form.html' as form %}
    {% resource 'odsh/odsh_form.js' %}
    {% resource 'odsh/bootstrap-multiselect.js' %}
    {% set dataset_is_draft = data.get('state', 'draft').startswith('draft') or data.get('state', 'none') == 'none' %}
    
    <!-- field title -->
    {% block package_basic_fields_title %}
    {% set error_string = _(_('Title') + ': '+errors.title[0]) if errors.title %}
    {{ form.input('title', id='field-title', label=_('Title'), value=data.title,
    error=error_string, classes=['control-full'], attrs={'data-module': 'slug-preview-target'},
    is_required=true,placeholder=_('Enter title')) }}
    {% endblock %}
    
    
        <!-- field notes -->
        {% block package_basic_fields_description %}
        {% set error_string = _(_('Description') + ': '+errors.notes[0]) if errors.notes %}
        {{ form.markdown('notes', id='field-notes', label=_('Description'), value=data.notes,
        error=error_string, is_required=true, placeholder=_('Enter description')) }}
        {% endblock %}
    
        {% block package_basic_fields_org %}
        {% if data.group_id %}
        <input type="hidden" name="groups__0__id" value="{{ data.group_id }}" />
        {% endif %}
    
        {% set dataset_has_organization = data.owner_org or data.group_id %}
        {% set organizations_available = h.organizations_available('create_dataset') %}
        {% set user_is_sysadmin = h.check_access('sysadmin') %}
        {% set show_organizations_selector = organizations_available %}
        {% set show_visibility_selector = dataset_has_organization or (organizations_available and (user_is_sysadmin or
        dataset_is_draft)) %}
        {% set existing_org = data.owner_org or data.group_id %}
    
        <div class="control-group field-organization">
            <label for="field-organizations" class="control-label">{{ _('Organization') }}
                <span title="{{ _("This field is required") }}" class="control-required">*</span>
            </label>
            <div class="controls">
                <div class="row-fluid">
                    <div class="span6">
                        <select id="field-organizations" name="owner_org" data-module="autocomplete">
                            {% if h.check_config_permission('create_unowned_dataset') %}
                            <option value="" {% if not selected_org and data.id %} selected="selected" {% endif %}>{{ _('No
                                organization') }}</option>
                            {% endif %}
                            {% for organization in organizations_available %}
                            {# get out first org from users list only if there is not an existing org #}
                            {% set selected_org = (existing_org and existing_org == organization.id) or (not existing_org and not data.id and organization.id == organizations_available[0].id) %}
                            <option value="{{ organization.id }}" {% if selected_org %} selected="selected" {% endif %}>{{
                                organization.display_name }}</option>
                            {% endfor %}
                        </select>
                    </div>
                </div>
            </div>
        </div>
        {% endblock %}
    
    
        <!-- field license -->
        {% set error_missing_attr = h.odsh_extract_error('licenseAttributionByText', errors) %}
        <label class="control-label" for="field-license">
            {{ _("License") }}:
            <span title="{{ _("This field is required") }}" class="control-required">*</span>
        </label>
        <div class='row-fluid'>
            <div class='span3'>
                {% block package_basic_fields_license %}
                    {% set error = errors.license_id %}