{#
LimeSurvey
Copyright (C) 2007-2026 The LimeSurvey Project Team
All rights reserved.
License: GNU/GPL License v2 or later, see LICENSE.php
LimeSurvey is free software. This version may have been modified pursuant
to the GNU General Public License, and as distributed it includes or
is derivative of works licensed under the GNU General Public License or
other free or open source software licenses.
See COPYRIGHT.php for copyright notices and details.



(¯`·._.·(¯`·._.·  Save/Load buttons  ·._.·´¯)·._.·´¯)

Display the buttons to load/save a survey.
There are many cases when those button are not shown:
via survey configuration, at start page, when survey is completed, etc
#}
{% if aSurveyInfo.aNavigator.load.show == "Y" %}
    <!-- Load unfinished survey button -->
    <li class="nav-item ls-no-js-hidden" {{ aSurveyInfo.attr.loadlinksli }}>
        <a href="#" data-limesurvey-submit='{ "loadall":"loadall" }'
           class='nav-link ls-link-action ls-link-loadall'>
            {{ gT('Load unfinished survey') }}
        </a>
    </li>
    {% if aSurveyInfo.access_mode == "O" and aSurveyInfo.hastokenstable == true and not aSurveyInfo.filltoken %}
    <!-- Fill token button -->
    <li class="nav-item ls-no-js-hidden">
        <a href="{{ aSurveyInfo.surveyUrl }}?lang=en&filltoken=true"
            class="nav-link ls-link-action">
            {% if aSurveyInfo.allowregister == "Y" %}
                {{ gT("Register") }}
            {% else %}
                {{ gT("Enter access code") }}
            {% endif %}
        </a>
    </li>
    {% endif %}
{% endif %}

{% if aSurveyInfo.aNavigator.save.show == "Y" %}
    <!-- Resume later button -->
    <li class="nav-item ls-no-js-hidden">
        <a href="#" data-limesurvey-submit='{ "saveall":"saveall" }' class='nav-link'>
            {{ gT('Resume later') }}
        </a>
        {% if(aSurveyInfo.saved.text and aSurveyInfo.options.showpopups > 0) %}
            {{ registerScript("saveflashmessage","
            var modalElement = document.getElementById('bootstrap-alert-box-modal');
            var myModal = new bootstrap.Modal(modalElement, {});
            myModal.hide();
            var modalBody = modalElement.getElementsByClassName('modal-body');
            modalBody[0].textContent = '" ~ aSurveyInfo.saved.text ~ "';
            myModal.show();

            modalElement.addEventListener('hidden.bs.modal', function (event) {
                document.body.classList.remove('modal-open');
                document.querySelectorAll('.modal-backdrop').forEach(el => el.remove());
            });
                ", "POS_POSTSCRIPT" ) }}
        {% endif %}
    </li>
{% endif %}
