From 68335add603df67713edcba537782a62a22c7867 Mon Sep 17 00:00:00 2001 From: Mo8it Date: Sun, 9 Oct 2022 03:00:51 +0200 Subject: [PATCH] Use base templates --- advlabdb/adminModelViews.py | 4 ++-- ...{actions.jinja.html => admin_actions.jinja.html} | 13 +++---------- .../{import.jinja.html => admin_import.jinja.html} | 13 +++---------- advlabdb/templates/admin_index.jinja.html | 13 ++----------- advlabdb/templates/analysis/analysis.jinja.html | 11 +++-------- .../templates/analysis/assistant_marks.jinja.html | 11 +++-------- .../templates/analysis/final_part_marks.jinja.html | 11 +++-------- .../assistant_group_experiment_form.jinja.html | 13 +++---------- advlabdb/templates/assistant_index.jinja.html | 13 ++----------- advlabdb/templates/docs/docs.jinja.html | 10 +++++----- 10 files changed, 29 insertions(+), 83 deletions(-) rename advlabdb/templates/{actions.jinja.html => admin_actions.jinja.html} (68%) rename advlabdb/templates/{import.jinja.html => admin_import.jinja.html} (96%) diff --git a/advlabdb/adminModelViews.py b/advlabdb/adminModelViews.py index bd14b20..e61d018 100644 --- a/advlabdb/adminModelViews.py +++ b/advlabdb/adminModelViews.py @@ -1336,7 +1336,7 @@ class ImportView(SecureAdminBaseView): except Exception as ex: flash(str(ex), "error") - return self.render("import.jinja.html", form=form) + return self.render("admin_import.jinja.html", form=form) class ActionsView(SecureAdminBaseView): @@ -1364,7 +1364,7 @@ class ActionsView(SecureAdminBaseView): return redirect(self.url) - return self.render("actions.jinja.html", form=form) + return self.render("admin_actions.jinja.html", form=form) class AnalysisView(SecureAdminBaseView): diff --git a/advlabdb/templates/actions.jinja.html b/advlabdb/templates/admin_actions.jinja.html similarity index 68% rename from advlabdb/templates/actions.jinja.html rename to advlabdb/templates/admin_actions.jinja.html index 2e82037..3041781 100644 --- a/advlabdb/templates/actions.jinja.html +++ b/advlabdb/templates/admin_actions.jinja.html @@ -1,11 +1,6 @@ -{% from "macros.jinja.html" import information %} -{% extends "admin/master.html" %} - -{% block body %} - {{ information(current_user, active_semester_str, role="admin") }} - -
+{% extends "admin_base.jinja.html" %} +{% block content %}
{% for field in form %} {% if field.widget.input_type == "checkbox" %} @@ -21,6 +16,4 @@ {% endif %} {% endfor %}
- - {{ footer|safe }} -{% endblock body %} +{% endblock %} diff --git a/advlabdb/templates/import.jinja.html b/advlabdb/templates/admin_import.jinja.html similarity index 96% rename from advlabdb/templates/import.jinja.html rename to advlabdb/templates/admin_import.jinja.html index 3d9a8b3..57d8833 100644 --- a/advlabdb/templates/import.jinja.html +++ b/advlabdb/templates/admin_import.jinja.html @@ -1,11 +1,6 @@ -{% from "macros.jinja.html" import information %} -{% extends "admin/master.html" %} - -{% block body %} - {{ information(current_user, active_semester_str, role="admin") }} - -
+{% extends "admin_base.jinja.html" %} +{% block content %} {% for error in form.file.errors %}
Error! {{ error }} @@ -243,6 +238,4 @@ assistant_email - - {{ footer|safe }} -{% endblock body %} +{% endblock %} diff --git a/advlabdb/templates/admin_index.jinja.html b/advlabdb/templates/admin_index.jinja.html index 03f745e..fac63ce 100644 --- a/advlabdb/templates/admin_index.jinja.html +++ b/advlabdb/templates/admin_index.jinja.html @@ -1,11 +1,6 @@ -{% from "macros.jinja.html" import information %} -{% extends "admin/index.html" %} - -{% block body %} - {{ information(current_user, active_semester_str, role="admin") }} - -
+{% extends "admin_base.jinja.html" %} +{% block content %}
@@ -35,8 +30,4 @@
- - {{ super() }} - - {{ footer|safe }} {% endblock %} diff --git a/advlabdb/templates/analysis/analysis.jinja.html b/advlabdb/templates/analysis/analysis.jinja.html index 73e7097..e5164e9 100644 --- a/advlabdb/templates/analysis/analysis.jinja.html +++ b/advlabdb/templates/analysis/analysis.jinja.html @@ -1,11 +1,6 @@ -{% from "macros.jinja.html" import information %} -{% extends "admin/master.html" %} - -{% block body %} - {{ information(current_user, active_semester_str, role="admin")}} - -
+{% extends "admin_base.jinja.html" %} +{% block content %}
{% for field in form %} {% if field.widget.input_type == "submit" %} @@ -17,4 +12,4 @@ {% endif %} {% endfor %}
-{% endblock body %} +{% endblock %} diff --git a/advlabdb/templates/analysis/assistant_marks.jinja.html b/advlabdb/templates/analysis/assistant_marks.jinja.html index fb5bbf1..3489c25 100644 --- a/advlabdb/templates/analysis/assistant_marks.jinja.html +++ b/advlabdb/templates/analysis/assistant_marks.jinja.html @@ -1,11 +1,6 @@ -{% from "macros.jinja.html" import information %} -{% extends "admin/master.html" %} - -{% block body %} - {{ information(current_user, active_semester_str, role="admin")}} - -
+{% extends "admin_base.jinja.html" %} +{% block content %}

Assistant's marks analysis

@@ -38,4 +33,4 @@


{% endfor %} -{% endblock body %} +{% endblock %} diff --git a/advlabdb/templates/analysis/final_part_marks.jinja.html b/advlabdb/templates/analysis/final_part_marks.jinja.html index e74d571..2558ff9 100644 --- a/advlabdb/templates/analysis/final_part_marks.jinja.html +++ b/advlabdb/templates/analysis/final_part_marks.jinja.html @@ -1,11 +1,6 @@ -{% from "macros.jinja.html" import information %} -{% extends "admin/master.html" %} - -{% block body %} - {{ information(current_user, active_semester_str, role="admin")}} - -
+{% extends "admin_base.jinja.html" %} +{% block content %}

Final part marks analysis

@@ -34,4 +29,4 @@


-{% endblock body %} +{% endblock %} diff --git a/advlabdb/templates/assistant_group_experiment_form.jinja.html b/advlabdb/templates/assistant_group_experiment_form.jinja.html index d30d3d5..f62d4a8 100644 --- a/advlabdb/templates/assistant_group_experiment_form.jinja.html +++ b/advlabdb/templates/assistant_group_experiment_form.jinja.html @@ -1,11 +1,6 @@ -{% from "macros.jinja.html" import information %} -{% extends "admin/master.html" %} - -{% block body %} - {{ information(current_user, active_semester_str, role="assistant") }} - -
+{% extends "assistant_base.jinja.html" %} +{% block content %}
@@ -177,6 +172,4 @@ It is for information related to the experiment and group. Examples: Protocol received, submission until ..., etc.

- - {{ footer|safe }} -{% endblock body %} +{% endblock %} diff --git a/advlabdb/templates/assistant_index.jinja.html b/advlabdb/templates/assistant_index.jinja.html index 3054b8b..09284bc 100644 --- a/advlabdb/templates/assistant_index.jinja.html +++ b/advlabdb/templates/assistant_index.jinja.html @@ -1,16 +1,7 @@ -{% from "macros.jinja.html" import information %} -{% extends "admin/index.html" %} - -{% block body %} - {{ information(current_user, active_semester_str, role="assistant") }} - -
+{% extends "assistant_base.jinja.html" %} +{% block content %}

Number of missing final experiment marks: {{ number_of_missing_final_experiment_marks }}

- - {{ super() }} - - {{ footer|safe }} {% endblock %} diff --git a/advlabdb/templates/docs/docs.jinja.html b/advlabdb/templates/docs/docs.jinja.html index e98a4da..eab9eb3 100644 --- a/advlabdb/templates/docs/docs.jinja.html +++ b/advlabdb/templates/docs/docs.jinja.html @@ -1,12 +1,12 @@ {% from "macros.jinja.html" import information %} -{% extends "admin/master.html" %} +{% extends "base.jinja.html" %} -{% block body %} +{% block pre_content %} {{ information(current_user, active_semester_str, role=role) }}
+{% endblock %} +{% block content %} {% include "docs/" + role + ".jinja.html" %} - - {{ footer|safe }} -{% endblock body %} +{% endblock %}