diff --git a/NEWS.md b/NEWS.md index 65ff7c7..d106087 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,14 @@ +# Mortimer v0.4.3 + +## Bugfixes + +* Fixed a bug that caused the `web_experiments.experiment()` page to crash as a consequence of a specific experiment startup error. + +## Smaller changes + +* Improved error handling: Subjects will now always receive a neutral error page, if an experiment crashes. Previously, they were redirected to the login page in some cases. +* Small UI improvements + # Mortimer v0.4.2 ## Bugfixes diff --git a/mortimer/__init__.py b/mortimer/__init__.py index b5e7ebe..4bfd8c5 100644 --- a/mortimer/__init__.py +++ b/mortimer/__init__.py @@ -8,9 +8,8 @@ from flask_mail import Mail from flask_dropzone import Dropzone import pymongo -import alfred -__version__ = '0.4.2' +__version__ = '0.4.3' # the EnvironSetter sets enviroment variables for the current session # It is not included in the GitHub repository, because it contains sensitive diff --git a/mortimer/config.py b/mortimer/config.py index d3ac65d..d46dd51 100644 --- a/mortimer/config.py +++ b/mortimer/config.py @@ -65,7 +65,7 @@ class Config: # Flask-Dropzone settings: DROPZONE_ALLOWED_FILE_CUSTOM = True - DROPZONE_ALLOWED_FILE_TYPE = ".pdf, image/*, .txt, .xml, .pem, .mp3, .mp4, .ogg" + DROPZONE_ALLOWED_FILE_TYPE = ".pdf, image/*, .txt, .xml, .pem, .mp3, .mp4, .ogg, .csv" DROPZONE_MAX_FILE_SIZE = 10 DROPZONE_MAX_FILES = 100 DROPZONE_UPLOAD_ON_CLICK = True diff --git a/mortimer/errors/handlers.py b/mortimer/errors/handlers.py index d8dfc07..476894a 100644 --- a/mortimer/errors/handlers.py +++ b/mortimer/errors/handlers.py @@ -6,9 +6,9 @@ errors = Blueprint("erros", __name__) -@errors.app_errorhandler(404) -def error_404(error): - return render_template('errors/404.html'), 404 +@errors.app_errorhandler(400) +def error_400(error): + return render_template("errors/400.html"), 400 @errors.app_errorhandler(403) @@ -16,6 +16,12 @@ def error_403(error): return render_template('errors/403.html'), 403 +@errors.app_errorhandler(404) +def error_404(error): + return render_template('errors/404.html'), 404 + + @errors.app_errorhandler(500) def error_500(error): - return render_template('errors/500.html'), 500 + return render_template('errors/500_alfred.html'), 500 + diff --git a/mortimer/static/style.css b/mortimer/static/style.css index 550a716..c14b77c 100644 --- a/mortimer/static/style.css +++ b/mortimer/static/style.css @@ -34,7 +34,7 @@ #sidebar ul.components { padding: 20px 0; - border-bttom: 1px solid #47748b; + border-bottom: 1px solid #47748b; } #sidebar ul p { @@ -56,8 +56,8 @@ /*background: #343a40;*/ } -#contentNav { - color: #fff; +/* #contentNav { + color: inherit; } #contentNav ul li a{ @@ -66,8 +66,8 @@ } #contentNav ul li a:hover { - color: #343a40; -} + color: #6c757d; +} */ #sidebar ul li.active > a, a[aria-expanded="true"] { color: #fff; diff --git a/mortimer/templates/create_experiment.html b/mortimer/templates/create_experiment.html index f7cf8fa..545c6b4 100644 --- a/mortimer/templates/create_experiment.html +++ b/mortimer/templates/create_experiment.html @@ -8,7 +8,7 @@ Web Experiment (current) - diff --git a/mortimer/templates/errors/400.html b/mortimer/templates/errors/400.html new file mode 100644 index 0000000..22ed70a --- /dev/null +++ b/mortimer/templates/errors/400.html @@ -0,0 +1,9 @@ +{% extends "skeleton.html" %} + + +{% block layout %} +
+

Bad Request (400)

+

Something went wrong. Please try again later.

+
+{% endblock %} \ No newline at end of file diff --git a/mortimer/templates/experiment.html b/mortimer/templates/experiment.html index c07b433..4e5220f 100644 --- a/mortimer/templates/experiment.html +++ b/mortimer/templates/experiment.html @@ -140,8 +140,20 @@

public

- +
+
+
+ Script +
+
+ +
+
+
+ + {% if experiment.description %} @@ -153,102 +165,18 @@
Description
Alfred versions used for data collection in this experiment: {% for v in alfred_versions %} - {{ v }} +{{ v }} {% endfor %} - - - - -
-
- {{ form.hidden_tag() }} -

{{ form.script.label() }}

-
-
- -
- -
- {% if form.version.errors %} - {{ form.version(class="form-control form-control-sm is-invalid") }} - -
- {% for error in form.version.errors %} - {{ error }} - {% endfor %} -
- - {% else %} - {{ form.version(class="form-control form-control-sm", placeholder=experiment.version) }} - {% endif %} -
-
- -
-
- - {{ form.script(class="form-control-file") }} - {% if form.script.errors %} - {% for error in form.script.errors %} - {{ error }}
- {% endfor %} - {% endif %} -
-
- - Changing the version number allows you to choose, for which versions of an experiment you want to download data. - If you made substantial changes to your experiment, you should change the version. - -
-
- {{ form.submit(class="btn btn-primary btn-sm", id="submit")}} -
-
-
- - -
-
+ + + {% endblock content %} diff --git a/mortimer/templates/layout.html b/mortimer/templates/layout.html index 7b93066..110c1e8 100644 --- a/mortimer/templates/layout.html +++ b/mortimer/templates/layout.html @@ -45,7 +45,7 @@

mortimer

v{{ v_morti
-