diff --git a/app/routes.py b/app/routes.py index 95f25cbd71a5e0714a717a08b39ba9e669783897..35c4632b6331a535945e06a917d43141ad19b535 100644 --- a/app/routes.py +++ b/app/routes.py @@ -23,8 +23,8 @@ def index(): session['group'] = None - if not session: - session['language'] = "English" + if 'language' not in session: + session['language'] = "All" return render_template('home.html', title='Home', groups=groups) @@ -42,8 +42,8 @@ def group_page(group_tag): experiments = experiment.query.filter_by(group_id=group.id).all() session['group'] = group_tag - if not session: - session['language'] = "English" + if 'language' not in session: + session['language'] = "All" return render_template('index.html', title='Home', experiments=experiments, group=group) diff --git a/app/templates/index.html b/app/templates/index.html index eefc3e6220027bbc547096d4e54a9e272de30b19..9bebd0cbc8ad159af143e054db5b6604218b5e3f 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -15,7 +15,7 @@ a previously started task, click on the "Continue task" button.') }}</p> <p class="lead text-center">{{ _('You can choose the language suitable for you from the language menu in the upper right corner.') }}</p> - + </p> <div class="row"> <div class="col mt-5"> @@ -23,7 +23,7 @@ <p class="lead text-left mt-3 font-weight-bold">{{ _('List of experiments:') }}</p> {% block attributes %} {% for exp in experiments %} - + {% if exp.status == 'Public' and session['language'] == exp.language %} <ul class="list-group mb-3"> @@ -74,9 +74,6 @@ {% autoescape false %} {{ exp.short_instruction }}</li> {% endautoescape %} - - - {% if current_user.is_authenticated %} <li class="list-group-item"><span class="font-weight-bold">ID number:</span> {{ exp.idexperiment }} </li> @@ -91,7 +88,7 @@ <li class="list-group-item"> <a class="btn btn-outline-primary" href="{{ url_for('consent', exp_id=exp.idexperiment) }}" role="button">{{ _('Begin task') }}</a> - <a class="btn btn-outline-primary" href="{{ url_for('task.continue_task', exp_id=exp.idexperiment) }}" role="button">{{ _('Continue task') }}</a + <a class="btn btn-outline-primary" href="{{ url_for('task.continue_task', exp_id=exp.idexperiment) }}" role="button">{{ _('Continue task') }}</a> {% if current_user.is_authenticated %} <span class="text-right"> @@ -108,14 +105,6 @@ {% endif %} - - - - - - - - {% if (exp.status == 'Private') and (current_user.is_authenticated) and session['language'] == exp.language %} <br> <h3>Private experiment:</h3> @@ -196,11 +185,6 @@ {% endif %} - - - - - {% if (exp.status == 'Hidden') and (current_user.is_authenticated) and session['language'] == exp.language %} <br> <h3>Unpublished experiment:</h3>