{% set default_group_type = h.default_group_type('organization') %} {% block package_basic_fields_title %} {{ ui.input(name='title', label=_('Title'), placeholder=_('eg. A descriptive title'), value=data.title, errors=errors.title) }} {% endblock %} {% block package_basic_fields_url %} {{ ui.input(name='name', label=_('URL'), placeholder=_('eg. my-dataset'), value=data.name, errors=errors.name, required=true) }} {% endblock %} {% block package_basic_fields_custom %}{% endblock %} {% block package_basic_fields_description %} {{ ui.markdown(name='notes', label=_('Description'), placeholder=_('eg. Some useful notes about the data'), value=data.notes, errors=errors.notes) }} {% endblock %} {% block package_basic_fields_tags %} {{ ui.input(name='tag_string', label=_('Tags'), placeholder=_('eg. economy, mental health, government'), value=data.tag_string, errors=errors.tags) }} {% endblock %} {% block package_basic_fields_license %} {%- call ui.util.call(ui.select_box, name="license_id", label=_("License"), errors=errors.license_id, options=h.license_options(existing_license_id)) -%} {%- for value, text in h.license_options(existing_license_id) -%} {{ ui.select_option(text, value=value, selected=value == data.license_id) }} {%- endfor %} {%- endcall %} {% endblock %} {% block package_basic_fields_org %} {# if we have a default group then this wants remembering #} {{ ui.hidden_input(name="groups__0__id", value=data.group_id) if data.group_id }} {% set organizations_available = h.organizations_available('create_dataset') %} {% if organizations_available and h.can_update_owner_org(data, organizations_available) %} {% set existing_org = data.owner_org or data.group_id %} {%- call ui.util.call(ui.select_box, name="owner_org", label=h.humanize_entity_type('organization', default_group_type, 'default label') or _('Organization'), errors=errors.owner_org) -%} {%- if h.check_config_permission('create_unowned_dataset') -%} {{ ui.select_option(h.humanize_entity_type('organization', default_group_type, 'no label') or _('No Organization'), value="", selected=not data.owner_org and data.id) }} {%- endif %} {%- for organization in organizations_available %} {{ ui.select_option(organization.display_name, value=organization.id, selected=data.owner_org == organization.id) }} {%- endfor %} {%- endcall %} {%- endif %} {% if data.owner_org or data.group_id or (organizations_available and (current_user.sysadmin or data.get('state', 'draft') == 'draft')) %} {% block package_metadata_fields_visibility %} {{ ui.select(name="private", label=_("Visibility"), selected=data.private|trim, options=[{"text": _("Private"), "value": "True"}, {"text": _("Public"), "value": "False"}]) }} {% endblock %} {% endif %} {% if data.id and h.check_access('package_delete', {'id': data.id}) and data.state != 'active' %} {{ ui.select(name="state", label=_("State"), selected=data.state, options=[{"text": _("Active"), "value": "active"}, {"text": _("Deleted"), "value": "deleted"}]) }} {% endif %} {% endblock %}