{% embed 'WebsiteBundle:Layout:layout.html.twig' with { metaSettings: { 'viewport': 'width=device-width, initial-scale=1', 'keywords': '', 'description': 'site.metadata.description'|trans }, ogSettings: { 'title': 'site.metadata.title'|trans, 'image': '', 'description': 'site.metadata.description'|trans, 'url': url(app.request.get('_route'), app.request.get('_route_params')) } } %} {% block content %} {% set isFirstRun = testSession is empty or testSession.number == 1 %}
{% if app.session.flashBag.peek('error') is not empty %}
{% for flashMessage in app.session.flashbag.get('error') %} {{ flashMessage }} {% endfor %}
{% endif %} {% if app.session.flashBag.peek('success') is not empty %}
{% for flashMessage in app.session.flashbag.get('success') %} {{ flashMessage }} {% endfor %}
{% endif %}

{{ 'site.testSession.home.title'|trans({'%firstName%': app.user.name }) }}

{% if app.user.completedAllSessions %} {# Show a thank you message #}

{{ 'site.testSession.home.completedAllSessionsText'|trans|nl2br }}

{% else %} {# session reminder text #} {% if testSession is not empty and testSession.number > 1 %}

{{ 'site.results.reminderText'|trans({ '%firstName%': app.user.name|capitalize, '%weekday%': (('date.'~(testSession.scheduled|date('l', "Europe/Brussels")))|trans({}, 'admin'))|lower, '%time%': testSession.scheduled|date('H:i', "Europe/Brussels"), '%sessionNumber%': testSession.number }) }}

{% endif %} {% if isFirstRun %}

{{ 'site.testSession.home.firstSessionText'|trans|nl2br }}

{% else %}

{{ 'site.testSession.home.text'|trans|nl2br }}

{% endif %} {% endif %} {% if not app.user.consented %}

{{ 'site.testSession.home.informedConsent'|trans|nl2br }}

{% endif %} {% if not app.user.agreesToTermsAndConditions %}
{% endif %} {# determine where the navigation should take you #} {% if testSession is empty or (testSession is not empty and testSession.number == 1) %} {# Then this is the first session! #} {% if app.user.completedPsychEducation %} {% set route = 'session_survey' %} {% else %} {% set route = 'session_psycho_edu' %} {% endif %} {% elseif experiment.totalSessions == testSession.number %} {# Then this is the last session! #} {% if testSession.availableFrom > date("now") %} {# session is not yet available #} {% set route = app.request.get('_route') %} {% else %} {% set route = 'session_survey' %} {% endif %} {% else %} {# This is a normal session #} {% if testSession.availableFrom > date("now") %} {% set route = app.request.get('_route') %} {% else %} {% set route = 'session_tutorial' %} {% endif %} {% endif %}
{% if lastSession is not empty %} {% endif %} {% if (not app.user.completedAllSessions) or lastSession is empty %} {% endif %}
{% endblock %} {% block footer %} {% include 'WebsiteBundle:Layout/Partials:_footer.html.twig' %} {% endblock %} {% endembed %}