Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Timo Heikkilä
PET-rating
Commits
dc85793f
Commit
dc85793f
authored
Apr 14, 2021
by
Ossi Laine
Browse files
Show all experiments if language not defined in session
parent
52da9456
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/routes.py
View file @
dc85793f
...
...
@@ -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
)
...
...
app/templates/index.html
View file @
dc85793f
...
...
@@ -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>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment