{% extends "admin/base.html" %} {#- Migrate to Actor Registry, step 1: contact points. Find -> Review -> Link. See contact_migration.py for the rules. Plain forms, no JavaScript. -#} {% block subtitle %}{{ _('Migrate to Actor Registry') }}{% endblock %} {% block breadcrumb_content %}
  • {{ _('Migrate to Actor Registry') }}
  • {% endblock %} {% block primary_content_inner %}

    {{ _('Migrate to Actor Registry') }}

    {{ _("Contact details are often stored as free text in CKAN's own fields, Maintainer and Author, and repeated on many datasets. Here you turn them into shared contact points and link the datasets to them. Maintainer is used first, and Author only when a dataset has no maintainer.") }}

    {{ _('The original fields are never changed. A dataset that has a contact point is done and is no longer listed. You only see the datasets you may edit.') }}

    {% if closed %}
    {{ _('Migration closed.') }} {{ _('Maintainer and Author are hidden and no longer exported. Their values are still stored.') }}
    {% else %}
    {{ _('Migration in progress.') }} {{ _('Maintainer and Author are still shown and used in the DCAT export for datasets without a contact point.') }}
    {% endif %} {% if not data.types %}
    {{ _('None of the dataset schemas has a contact points field (contact_point_ids). Add it to your schema before you migrate.') }}
    {% else %} {% set counts = data.counts %}

    {{ _('Overview') }}

    {{ _('Datasets with contact details in Maintainer or Author') }}{{ counts.old }}
    {{ _('of which linked to a contact point') }}{{ counts.linked }}
    {{ _('of which changed since linking') }}{% if counts.changed %}{{ counts.changed }}{% else %}0{% endif %}
    {{ _('of which skipped') }}{{ counts.skipped }}{% if counts.skipped %} · {{ _('Show') }}{% endif %}
    {{ _('of which remaining') }}{{ counts.remaining }}
    {{ _('Datasets with no contact details at all') }}{{ counts.no_contact }}{% if counts.no_contact %} · {{ _('Add contact points') }}{% endif %}
    {% if data.changed %}

    {{ _('Changed since linking') }}

    {{ _('Maintainer or Author has changed on these datasets after they were linked. Decide whether the contact point should follow the change.') }}

    {% for item in data.changed %} {% set contact = item.contact_point %} {% set can_update = contact and contact.active and item.contact_point_in_dataset %}

    {{ item.title }}{% if item.organization %} · {{ item.organization }}{% endif %}

    {% for field, label in [('maintainer', _('Maintainer')), ('maintainer_email', _('Maintainer email')), ('author', _('Author')), ('author_email', _('Author email'))] %} {% set before = item.previous[field] if item.previous else none %} {% set now = item['values'][field] %} {% if before is none or before != now %} {% endif %} {% endfor %}
    {{ _('Linked to') }}{% if contact %}{{ contact.name }}{% if contact.email %} <{{ contact.email }}>{% endif %}{% if not contact.active %} {{ _('Inactive') }}{% endif %}{% if not item.contact_point_in_dataset %} {{ _('no longer on the dataset') }}{% endif %}{% else %}–{% endif %}
    {{ label }}{% if item.previous %}{{ before or '–' }} → {% endif %}{{ now or '–' }}
    {{ h.csrf_input() }}

    {{ _('Details for an updated or new contact point, taken from the new values:') }}

    {% if can_update %}
    {% endif %}
    {% endfor %}
    {% endif %}

    {{ _('Contact details to migrate') }}

    {% if not candidates %}

    {{ _('Nothing remains to migrate.') }}

    {% endif %} {% for candidate in candidates %} {% set number = first_number + loop.index0 %} {% set default_action = 'existing' if candidate.matches else 'create' %}

    {{ candidate.suggested_name }}{% if candidate.email and candidate.email != candidate.suggested_name %} {{ candidate.email }}{% endif %}

    {% trans count=candidate.datasets|length %}{{ count }} dataset{% pluralize %}{{ count }} datasets{% endtrans %}

    {% if candidate.variants|length > 1 %}

    {{ _('Names used:') }} {% for variant, count in candidate.variants %}{{ variant }} ({{ count }}){% if not loop.last %}, {% endif %}{% endfor %}

    {% endif %} {% if candidate.invalid_emails %}

    {{ _('Not a valid email address:') }} {{ candidate.invalid_emails|join(', ') }}. {{ _('Enter a correct address, or leave the field empty.') }}

    {% endif %}
    {{ h.csrf_input() }} {% set is_large = candidate.datasets|length > large_group %}
    {{ _('Datasets') }} {% if is_large %} {# A large group: all its datasets are included; only the ones to leave out are posted. #}

    {% trans count=candidate.datasets|length %}All {{ count }} datasets are included.{% endtrans %}

    {% trans count=candidate.datasets|length %}Show all {{ count }} datasets, and leave some out{% endtrans %}
    {% for item in candidate.datasets %}
    {% endfor %}

    {{ _('Tick the datasets that belong to another contact point; they stay in the list for a later round. The same email address may be used by several contact points.') }}

    {% else %} {% for item in candidate.datasets %}
    {% endfor %}

    {{ _('Clear the datasets that belong to another contact point; they stay in the list for a later round. The same email address may be used by several contact points.') }}

    {% endif %}
    {{ _('What to do with the selected datasets') }}
    {% for variant, count in candidate.variants %}

    {{ _('Prefer the name of a function, such as "GIS Support", over a person.') }}

    {% endfor %} {% if pager.item_count > pager.items_per_page %}{{ pager.pager() }}{% endif %} {% if data.skipped %}

    {{ _('Skipped') }}

    {% if show_skipped %} {% for item in data.skipped %} {% endfor %}
    {{ item.title }} {{ item.name or '–' }}{% if item.raw_email %} <{{ item.raw_email }}>{% endif %}
    {{ h.csrf_input() }}
    {% else %}

    {% trans count=data.skipped|length %}Show {{ count }} skipped dataset{% pluralize %}Show {{ count }} skipped datasets{% endtrans %}

    {% endif %}
    {% endif %} {% if close_check %}
    {% if closed %}

    {{ _('Reopen the migration') }}

    {{ _('Shows Maintainer and Author again and uses them in the export for datasets without a contact point.') }}

    {{ h.csrf_input() }}
    {% else %}

    {{ _('Close the migration') }}

    {{ _('Closing hides Maintainer and Author in forms and on dataset pages, for everyone including sysadmins, and stops exporting them. Nothing is deleted: the values stay stored, and you can reopen the migration at any time. It takes effect at once, without a restart.') }}

    {{ _('Hiding works for schemas whose Maintainer and Author fields use the legacy_contact.html snippets; schemas without those fields are not affected.') }}

    {{ h.csrf_input() }} {% if close_check.needs_confirmation %}
      {% if close_check.no_contact_point %}
    • {% trans count=close_check.no_contact_point %}{{ count }} dataset will have no contact point in the export. A contact point is required in DCAT-AP.{% pluralize %}{{ count }} datasets will have no contact point in the export. A contact point is required in DCAT-AP.{% endtrans %}
    • {% endif %} {% if close_check.changed %}
    • {% trans count=close_check.changed %}{{ count }} linked dataset has unhandled changes.{% pluralize %}{{ count }} linked datasets have unhandled changes.{% endtrans %}
    • {% endif %}
    {% endif %}
    {% endif %}
    {% endif %} {% endif %} {% endblock %} {% block secondary_content %}

    {{ _('How it works') }}

    1. {{ _('Find: contact details are grouped by email address, or by name when there is no valid address.') }}
    2. {{ _('Review: create a contact point, link to an existing one, or skip. Clear datasets that belong elsewhere.') }}
    3. {{ _('Link: the selected datasets get the contact point. You can work in rounds.') }}
    {% endblock %}