warnings.twig 3.07 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
{#
    (¯`·._.·(¯`·._.· Warnings  ·._.·´¯)·._.·´¯)

    Show various warnings on top of the form

    Error Html warnings can be:
        - One or more mandatory questions have not been answered. You cannot proceed until these have been completed.
        - One or more questions have not been answered in a valid manner. You cannot proceed until these answers are valid.
        - One or more uploaded files are not in proper format/size. You cannot proceed until these files are valid.

    The easiest way to change the text in the warnings is to create a new translation.

    These warnings are complementary to the popup ones. If you're using popups (set in config file), and then don't want to show these alerts, you can uncomment the hiddenClass checker
#}

{# Preview mode warning #}
{% if aSurveyInfo.active != 'Y' %}
    <!-- Preview mode warning -->
    <div class="{{ aSurveyInfo.class.activealert }} alert alert-warning alert-dismissible fade in alert-dismissible" {{ aSurveyInfo.attr.activealert }} >
20
        <button {{ aSurveyInfo.attr.activealertbutton }} class="{{ aSurveyInfo.class.activealertbutton }} close" ><span aria-hidden="true">&times;</span><span class="sr-only">{{ gT("Close") }}</span></button>
21 22 23 24 25 26 27 28
        {{ gT("This survey is currently not active. You will not be able to save your responses.") }}
    </div>
{% endif %}

{# Survey data policy not accepted warning #}
{% if aSurveyInfo.datasecuritynotaccepted == true %}
    <!-- Preview mode warning -->
    <div class="{{ aSurveyInfo.class.activealert }} alert alert-danger alert-dismissible fade in alert-dismissible" {{ aSurveyInfo.attr.activealert }} >
29
        <button {{ aSurveyInfo.attr.activealertbutton }} class="{{ aSurveyInfo.class.activealertbutton }} close" ><span aria-hidden="true">&times;</span><span class="sr-only">{{ gT("Close") }}</span></button>
30 31 32 33
        {{ aSurveyInfo.datasecurity_error }}
    </div>
{% endif %}

34 35 36 37 38

{% if(count(aSurveyInfo.errorHtml.messages) == 1) %}
    <p class='{{ aSurveyInfo.errorHtml.hiddenClass }} fade in alert-dismissible alert alert-danger {{ aSurveyInfo.class.errorHtml }} ' role='alert'>
        <button  {{ aSurveyInfo.attr.errorHtmlbutton }} class="{{ aSurveyInfo.class.errorHtmlbutton }} close ls-no-js-hidden" ><span aria-hidden="true">×</span><span class="sr-only">{{ gT("Close") }}</span></button>
        {% for aMessage in aSurveyInfo.errorHtml.messages  %}
39 40
        <!-- Error Html warnings -->
            {{ aMessage }}
41
        {% endfor %}
42 43
    </p>
{% endif %}
44 45 46 47 48 49 50 51 52 53 54
{% if(count(aSurveyInfo.errorHtml.messages) > 1) %}
    <div class='{{ aSurveyInfo.errorHtml.hiddenClass }} fade in alert-dismissible alert alert-danger {{ aSurveyInfo.class.errorHtml }} ' role='alert'>
        <button {{ aSurveyInfo.attr.errorHtmlbutton }} class="{{ aSurveyInfo.class.errorHtmlbutton }} close ls-no-js-hidden" ><span aria-hidden="true">×</span><span class="sr-only">{{ gT("Close") }}</span></button>
        <ul>
        {% for aMessage in aSurveyInfo.errorHtml.messages  %}
        <!-- Error Html warnings -->
            <li>{{ aMessage }}</li>
        {% endfor %}
        </ul>
    </div>
{% endif %}