diff --git a/advlabdb/adminModelViews.py b/advlabdb/adminModelViews.py index c364823..7c8b12f 100644 --- a/advlabdb/adminModelViews.py +++ b/advlabdb/adminModelViews.py @@ -136,6 +136,14 @@ class UserView(SecureAdminModelView): def default_roles(): return [user_datastore.find_role("assistant")] + active_semester = QuerySelectField( + "Active Semester", + query_factory=semesterQueryFactory, + validators=[DataRequired()], + default=Semester.lastSemester, + description="Not fixed and users (including assistants) can change it.", + ) + email = StringField( "Email", validators=[DataRequired(), Email()], @@ -170,13 +178,6 @@ class UserView(SecureAdminModelView): "Active", default=True, ) - active_semester = QuerySelectField( - "Active Semester", - query_factory=semesterQueryFactory, - validators=[DataRequired()], - default=Semester.lastSemester, - description="Not fixed and users (including assistants) can change it.", - ) class EditForm(CreateForm): semester_experiments = None @@ -1298,7 +1299,7 @@ class ImportView(SecureAdminBaseView): except Exception as ex: flash(str(ex), "error") - return self.render("import.html", form=form) + return self.render("import.jinja.html", form=form) class ActionsView(SecureAdminBaseView): @@ -1320,7 +1321,7 @@ class ActionsView(SecureAdminBaseView): return redirect(url_for("main.index")) - return self.render("actions.html", form=form) + return self.render("actions.jinja.html", form=form) class AnalysisView(SecureAdminBaseView): @@ -1420,7 +1421,7 @@ class AnalysisView(SecureAdminBaseView): protocolMarkHists = AnalysisView.markHists("Protocol", activeAssistants) return self.render( - "analysis/assistant_marks.html", + "analysis/assistant_marks.jinja.html", histIndices=range(len(oralMarkHists)), oralMarkHists=oralMarkHists, protocolMarkHists=protocolMarkHists, @@ -1469,18 +1470,18 @@ class AnalysisView(SecureAdminBaseView): meanFinalPartMarksPlot = AnalysisView.htmlFig(fig) return self.render( - "analysis/final_part_marks.html", + "analysis/final_part_marks.jinja.html", activeSemesterFinalPartMarksHists=activeSemesterFinalPartMarksHists, meanFinalPartMarksPlot=meanFinalPartMarksPlot, ) - return self.render("analysis/analysis.html", form=form) + return self.render("analysis/analysis.jinja.html", form=form) class DocsView(SecureAdminBaseView): @expose("/") def index(self): - return self.render("docs/docs.html", role="admin") + return self.render("docs/docs.jinja.html", role="admin") def init_admin_model_views(app): diff --git a/advlabdb/assistantModelViews.py b/advlabdb/assistantModelViews.py index 910e7b0..33d8cc5 100644 --- a/advlabdb/assistantModelViews.py +++ b/advlabdb/assistantModelViews.py @@ -168,7 +168,7 @@ class AssistantGroupExperimentView(SecureAssistantModelView): final_experiment_marks = [experiment_mark.final_experiment_mark for experiment_mark in experiment_marks] return self.render( - "assistant_group_experiment_form.html", + "assistant_group_experiment_form.jinja.html", form=form, experiment_label=group_experiment.semester_experiment.experiment.str(), group_number=group_experiment.group.number, @@ -220,7 +220,7 @@ class AssistantUserView(SecureAssistantModelView): class AssistantDocsView(SecureAssistantBaseView): @expose("/") def index(self): - return self.render("docs/docs.html", role="assistant") + return self.render("docs/docs.jinja.html", role="assistant") def init_assistant_model_views(app): diff --git a/advlabdb/custom_classes.py b/advlabdb/custom_classes.py index 3232cbd..a2779d6 100644 --- a/advlabdb/custom_classes.py +++ b/advlabdb/custom_classes.py @@ -61,7 +61,7 @@ class SecureAdminIndexView(CustomIndexView): ) return self.render( - "admin_index.html", + "admin_index.jinja.html", number_of_missing_final_experiment_marks=number_of_missing_final_experiment_marks, number_of_all_experiment_marks=number_of_all_experiment_marks, ) @@ -89,7 +89,7 @@ class SecureAssistantIndexView(CustomIndexView): ) return self.render( - "assistant_index.html", + "assistant_index.jinja.html", number_of_missing_final_experiment_marks=number_of_missing_final_experiment_marks, number_of_all_experiment_marks=number_of_all_experiment_marks, ) @@ -230,10 +230,10 @@ class SecureAdminModelView(CustomModelView): column_display_actions = True can_view_details = True - list_template = "admin_list.html" - create_template = "admin_create.html" - edit_template = "admin_edit.html" - details_template = "admin_details.html" + list_template = "admin_list.jinja.html" + create_template = "admin_create.jinja.html" + edit_template = "admin_edit.jinja.html" + details_template = "admin_details.jinja.html" def __init__(self, model, **kwargs): url = get_url(kwargs) @@ -250,10 +250,10 @@ class SecureAssistantModelView(CustomModelView): can_edit = False column_display_actions = False - list_template = "assistant_list.html" - create_template = "assistant_create.html" - edit_template = "assistant_edit.html" - details_template = "assistant_details.html" + list_template = "assistant_list.jinja.html" + create_template = "assistant_create.jinja.html" + edit_template = "assistant_edit.jinja.html" + details_template = "assistant_details.jinja.html" """ SECURITY NOTES: diff --git a/advlabdb/templates/actions.html b/advlabdb/templates/actions.jinja.html similarity index 86% rename from advlabdb/templates/actions.html rename to advlabdb/templates/actions.jinja.html index 99cdc57..4d61545 100644 --- a/advlabdb/templates/actions.html +++ b/advlabdb/templates/actions.jinja.html @@ -1,4 +1,4 @@ -{% from "macros.html" import information %} +{% from "macros.jinja.html" import information %} {% extends "admin/master.html" %} {% block body %} diff --git a/advlabdb/templates/admin_create.html b/advlabdb/templates/admin_create.jinja.html similarity index 78% rename from advlabdb/templates/admin_create.html rename to advlabdb/templates/admin_create.jinja.html index 18442ae..012a03b 100644 --- a/advlabdb/templates/admin_create.html +++ b/advlabdb/templates/admin_create.jinja.html @@ -1,4 +1,4 @@ -{% from "macros.html" import information %} +{% from "macros.jinja.html" import information %} {% extends "admin/model/create.html" %} {% block body %} diff --git a/advlabdb/templates/admin_details.html b/advlabdb/templates/admin_details.jinja.html similarity index 78% rename from advlabdb/templates/admin_details.html rename to advlabdb/templates/admin_details.jinja.html index e67dce2..a0fb365 100644 --- a/advlabdb/templates/admin_details.html +++ b/advlabdb/templates/admin_details.jinja.html @@ -1,4 +1,4 @@ -{% from "macros.html" import information %} +{% from "macros.jinja.html" import information %} {% extends "admin/model/details.html" %} {% block body %} diff --git a/advlabdb/templates/admin_edit.html b/advlabdb/templates/admin_edit.jinja.html similarity index 78% rename from advlabdb/templates/admin_edit.html rename to advlabdb/templates/admin_edit.jinja.html index 8441e91..696e4ad 100644 --- a/advlabdb/templates/admin_edit.html +++ b/advlabdb/templates/admin_edit.jinja.html @@ -1,4 +1,4 @@ -{% from "macros.html" import information %} +{% from "macros.jinja.html" import information %} {% extends "admin/model/edit.html" %} {% block body %} diff --git a/advlabdb/templates/admin_index.html b/advlabdb/templates/admin_index.jinja.html similarity index 78% rename from advlabdb/templates/admin_index.html rename to advlabdb/templates/admin_index.jinja.html index 53d5c71..b343060 100644 --- a/advlabdb/templates/admin_index.html +++ b/advlabdb/templates/admin_index.jinja.html @@ -1,4 +1,4 @@ -{% from "macros.html" import information, missing_final_experiment_marks %} +{% from "macros.jinja.html" import information, missing_final_experiment_marks %} {% extends "admin/index.html" %} {% block body %} diff --git a/advlabdb/templates/admin_list.html b/advlabdb/templates/admin_list.jinja.html similarity index 78% rename from advlabdb/templates/admin_list.html rename to advlabdb/templates/admin_list.jinja.html index cc6a8c9..9be6750 100644 --- a/advlabdb/templates/admin_list.html +++ b/advlabdb/templates/admin_list.jinja.html @@ -1,4 +1,4 @@ -{% from "macros.html" import information %} +{% from "macros.jinja.html" import information %} {% extends "admin/model/list.html" %} {% block body %} diff --git a/advlabdb/templates/analysis/analysis.html b/advlabdb/templates/analysis/analysis.jinja.html similarity index 86% rename from advlabdb/templates/analysis/analysis.html rename to advlabdb/templates/analysis/analysis.jinja.html index f470bf8..b51a0d7 100644 --- a/advlabdb/templates/analysis/analysis.html +++ b/advlabdb/templates/analysis/analysis.jinja.html @@ -1,4 +1,4 @@ -{% from "macros.html" import information %} +{% from "macros.jinja.html" import information %} {% extends "admin/master.html" %} {% block body %} diff --git a/advlabdb/templates/analysis/assistant_marks.html b/advlabdb/templates/analysis/assistant_marks.jinja.html similarity index 91% rename from advlabdb/templates/analysis/assistant_marks.html rename to advlabdb/templates/analysis/assistant_marks.jinja.html index 0ef343b..0894fee 100644 --- a/advlabdb/templates/analysis/assistant_marks.html +++ b/advlabdb/templates/analysis/assistant_marks.jinja.html @@ -1,4 +1,4 @@ -{% from "macros.html" import information %} +{% from "macros.jinja.html" import information %} {% extends "admin/master.html" %} {% block body %} diff --git a/advlabdb/templates/analysis/final_part_marks.html b/advlabdb/templates/analysis/final_part_marks.jinja.html similarity index 89% rename from advlabdb/templates/analysis/final_part_marks.html rename to advlabdb/templates/analysis/final_part_marks.jinja.html index 348cf47..b0c727d 100644 --- a/advlabdb/templates/analysis/final_part_marks.html +++ b/advlabdb/templates/analysis/final_part_marks.jinja.html @@ -1,4 +1,4 @@ -{% from "macros.html" import information %} +{% from "macros.jinja.html" import information %} {% extends "admin/master.html" %} {% block body %} diff --git a/advlabdb/templates/assistant_create.html b/advlabdb/templates/assistant_create.jinja.html similarity index 79% rename from advlabdb/templates/assistant_create.html rename to advlabdb/templates/assistant_create.jinja.html index c29c5af..2ff8540 100644 --- a/advlabdb/templates/assistant_create.html +++ b/advlabdb/templates/assistant_create.jinja.html @@ -1,4 +1,4 @@ -{% from "macros.html" import information %} +{% from "macros.jinja.html" import information %} {% extends "admin/model/create.html" %} {% block body %} diff --git a/advlabdb/templates/assistant_details.html b/advlabdb/templates/assistant_details.jinja.html similarity index 79% rename from advlabdb/templates/assistant_details.html rename to advlabdb/templates/assistant_details.jinja.html index 0b54651..a5a6493 100644 --- a/advlabdb/templates/assistant_details.html +++ b/advlabdb/templates/assistant_details.jinja.html @@ -1,4 +1,4 @@ -{% from "macros.html" import information %} +{% from "macros.jinja.html" import information %} {% extends "admin/model/details.html" %} {% block body %} diff --git a/advlabdb/templates/assistant_edit.html b/advlabdb/templates/assistant_edit.jinja.html similarity index 78% rename from advlabdb/templates/assistant_edit.html rename to advlabdb/templates/assistant_edit.jinja.html index 123ba00..3b5069c 100644 --- a/advlabdb/templates/assistant_edit.html +++ b/advlabdb/templates/assistant_edit.jinja.html @@ -1,4 +1,4 @@ -{% from "macros.html" import information %} +{% from "macros.jinja.html" import information %} {% extends "admin/model/edit.html" %} {% block body %} diff --git a/advlabdb/templates/assistant_group_experiment_form.html b/advlabdb/templates/assistant_group_experiment_form.jinja.html similarity index 99% rename from advlabdb/templates/assistant_group_experiment_form.html rename to advlabdb/templates/assistant_group_experiment_form.jinja.html index b95fd01..e9d1d69 100644 --- a/advlabdb/templates/assistant_group_experiment_form.html +++ b/advlabdb/templates/assistant_group_experiment_form.jinja.html @@ -1,4 +1,4 @@ -{% from "macros.html" import information %} +{% from "macros.jinja.html" import information %} {% extends "admin/master.html" %} {% block body %} diff --git a/advlabdb/templates/assistant_index.html b/advlabdb/templates/assistant_index.jinja.html similarity index 78% rename from advlabdb/templates/assistant_index.html rename to advlabdb/templates/assistant_index.jinja.html index ec7960d..5a16e2a 100644 --- a/advlabdb/templates/assistant_index.html +++ b/advlabdb/templates/assistant_index.jinja.html @@ -1,4 +1,4 @@ -{% from "macros.html" import information, missing_final_experiment_marks %} +{% from "macros.jinja.html" import information, missing_final_experiment_marks %} {% extends "admin/index.html" %} {% block body %} diff --git a/advlabdb/templates/assistant_list.html b/advlabdb/templates/assistant_list.jinja.html similarity index 78% rename from advlabdb/templates/assistant_list.html rename to advlabdb/templates/assistant_list.jinja.html index 397328a..45117d9 100644 --- a/advlabdb/templates/assistant_list.html +++ b/advlabdb/templates/assistant_list.jinja.html @@ -1,4 +1,4 @@ -{% from "macros.html" import information %} +{% from "macros.jinja.html" import information %} {% extends "admin/model/list.html" %} {% block body %} diff --git a/advlabdb/templates/docs/admin.html b/advlabdb/templates/docs/admin.jinja.html similarity index 100% rename from advlabdb/templates/docs/admin.html rename to advlabdb/templates/docs/admin.jinja.html diff --git a/advlabdb/templates/docs/assistant.html b/advlabdb/templates/docs/assistant.jinja.html similarity index 100% rename from advlabdb/templates/docs/assistant.html rename to advlabdb/templates/docs/assistant.jinja.html diff --git a/advlabdb/templates/docs/docs.html b/advlabdb/templates/docs/docs.jinja.html similarity index 63% rename from advlabdb/templates/docs/docs.html rename to advlabdb/templates/docs/docs.jinja.html index 7246e0d..e98a4da 100644 --- a/advlabdb/templates/docs/docs.html +++ b/advlabdb/templates/docs/docs.jinja.html @@ -1,4 +1,4 @@ -{% from "macros.html" import information %} +{% from "macros.jinja.html" import information %} {% extends "admin/master.html" %} {% block body %} @@ -6,7 +6,7 @@
- {% include "docs/" + role + ".html" %} + {% include "docs/" + role + ".jinja.html" %} {{ footer|safe }} {% endblock body %} diff --git a/advlabdb/templates/import.html b/advlabdb/templates/import.jinja.html similarity index 99% rename from advlabdb/templates/import.html rename to advlabdb/templates/import.jinja.html index 68b1737..3d9a8b3 100644 --- a/advlabdb/templates/import.html +++ b/advlabdb/templates/import.jinja.html @@ -1,4 +1,4 @@ -{% from "macros.html" import information %} +{% from "macros.jinja.html" import information %} {% extends "admin/master.html" %} {% block body %} diff --git a/advlabdb/templates/macros.html b/advlabdb/templates/macros.jinja.html similarity index 89% rename from advlabdb/templates/macros.html rename to advlabdb/templates/macros.jinja.html index 4ee3e95..6bfa97d 100644 --- a/advlabdb/templates/macros.html +++ b/advlabdb/templates/macros.jinja.html @@ -1,6 +1,6 @@ {% macro information(current_user, active_semester_str, role) %} User: {{ current_user }}