{% include '_theme_head.html' %}

{{ ui_lang.done_heading }}

{% if ended_early %}{{ ended_early }}{% else %}{{ ui_lang.done_message }}{% endif %}

{% set has_platform_action = action and action.kind in ['redirect', 'post_form'] %} {% if completion_code or has_platform_action %} {% if completion_code %}
{{ completion_code }}

{% if ended_early %}{{ ui_lang.done_copy_code_hint }}{% else %}{{ ui_lang.done_copy_completion_code_hint }}{% endif %}

{% endif %} {% if action and action.kind == 'post_form' %}
{% for field_name, field_value in action.form_fields.items() %} {% endfor %}
{% elif action and action.kind == 'redirect' %} {{ ui_lang.done_return_to|replace('{platform}', action.platform_label|string) }} {% elif not action and mturk_submit_url and mturk_assignment_id %}
{% if completion_code %} {% endif %}
{% elif not action and prolific_redirect_url %} {{ ui_lang.done_return_to|replace('{platform}', 'Prolific') }} {% else %}
{% if action and action.message %}{{ action.message }}{% elif ended_early %}{{ ui_lang.done_paste_code_ended }}{% else %}{{ ui_lang.done_paste_code }}{% endif %}
{% endif %} {% else %}
{% if action and action.message %}{{ action.message }}{% else %}{{ ui_lang.done_saved_close }}{% endif %}
{% endif %}
{{ ui_lang.done_stored_on_server }}