From 8846a867f5b062d4bbf5c9afbc50eb48a69ea8d1 Mon Sep 17 00:00:00 2001 From: Mo8it Date: Sun, 11 Sep 2022 16:29:26 +0200 Subject: [PATCH] Format templates --- .../templates/analysis/analysis.jinja.html | 2 +- .../analysis/assistant_marks.jinja.html | 6 +- .../analysis/final_part_marks.jinja.html | 6 +- advlabdb/templates/assistant_index.jinja.html | 2 +- advlabdb/templates/docs/assistant.jinja.html | 110 +++++++++--------- advlabdb/templates/macros.jinja.html | 49 +++++--- 6 files changed, 93 insertions(+), 82 deletions(-) diff --git a/advlabdb/templates/analysis/analysis.jinja.html b/advlabdb/templates/analysis/analysis.jinja.html index b51a0d7..3b05596 100644 --- a/advlabdb/templates/analysis/analysis.jinja.html +++ b/advlabdb/templates/analysis/analysis.jinja.html @@ -2,7 +2,7 @@ {% extends "admin/master.html" %} {% block body %} - {{information(current_user, active_semester_str, role="admin")}} + {{ information(current_user, active_semester_str, role="admin")}}
diff --git a/advlabdb/templates/analysis/assistant_marks.jinja.html b/advlabdb/templates/analysis/assistant_marks.jinja.html index 0894fee..2206c5b 100644 --- a/advlabdb/templates/analysis/assistant_marks.jinja.html +++ b/advlabdb/templates/analysis/assistant_marks.jinja.html @@ -2,7 +2,7 @@ {% extends "admin/master.html" %} {% block body %} - {{information(current_user, active_semester_str, role="admin")}} + {{ information(current_user, active_semester_str, role="admin")}}
@@ -15,8 +15,8 @@
{% for histInd in histIndices %} - - + +
{% endfor %} {% endblock body %} diff --git a/advlabdb/templates/analysis/final_part_marks.jinja.html b/advlabdb/templates/analysis/final_part_marks.jinja.html index b0c727d..4dcf8a0 100644 --- a/advlabdb/templates/analysis/final_part_marks.jinja.html +++ b/advlabdb/templates/analysis/final_part_marks.jinja.html @@ -2,14 +2,14 @@ {% extends "admin/master.html" %} {% block body %} - {{information(current_user, active_semester_str, role="admin")}} + {{ information(current_user, active_semester_str, role="admin")}}
{% for activeSemesterFinalPartMarksHist in activeSemesterFinalPartMarksHists %} - +
{% endfor %} - + {% endblock body %} diff --git a/advlabdb/templates/assistant_index.jinja.html b/advlabdb/templates/assistant_index.jinja.html index 5a16e2a..8b789a6 100644 --- a/advlabdb/templates/assistant_index.jinja.html +++ b/advlabdb/templates/assistant_index.jinja.html @@ -6,7 +6,7 @@
- {{missing_final_experiment_marks(number_of_missing_final_experiment_marks, number_of_all_experiment_marks)}} + {{ missing_final_experiment_marks(number_of_missing_final_experiment_marks, number_of_all_experiment_marks)}} {{ super() }} diff --git a/advlabdb/templates/docs/assistant.jinja.html b/advlabdb/templates/docs/assistant.jinja.html index f97894d..a690e7a 100644 --- a/advlabdb/templates/docs/assistant.jinja.html +++ b/advlabdb/templates/docs/assistant.jinja.html @@ -1,84 +1,84 @@

Welcome

- Welcome to this website, AdvLabDB, where you will be able to manage your lab - assistance. Please, read this documentation to familiarize - yourself with this website. + Welcome to this website, AdvLabDB, where you will be able to manage your lab + assistance. Please, read this documentation to familiarize + yourself with this website.

Menu items

- In this section, you will find explanations to each menu item on the upper - navigation bar. + In this section, you will find explanations to each menu item on the upper + navigation bar.

Home

- This is your home page. Here, you currently only find the number of - missing final experiment marks for the experiments that you - are assigned to. At the latest at the end of the semester, this number should - be 0. A number higher than 0 means that some oral and/or protocol marks are - missing. The final experiment mark is calculated automatically after the oral - and protocol marks of an experiment are set. + This is your home page. Here, you currently only find the number of + missing final experiment marks for the experiments that you + are assigned to. At the latest at the end of the semester, this number should + be 0. A number higher than 0 means that some oral and/or protocol marks are + missing. The final experiment mark is calculated automatically after the oral + and protocol marks of an experiment are set.

Group Experiment

- This is the most important menu item. Here, you see all pairs of experiments - and groups that you are responsible for. If a value in the column - Experiment Marks Missing is Yes, then - you did not set all the experiment marks for the pair in the related row. If - you click on the edit button on the left side of a row, then you will get a - form. + This is the most important menu item. Here, you see all pairs of experiments + and groups that you are responsible for. If a value in the column + Experiment Marks Missing is Yes, then + you did not set all the experiment marks for the pair in the related row. If + you click on the edit button on the left side of a row, then you will get a + form.

- In the form, you can edit the date of an appointment by clicking on - it. You should do so after writing with the students doing the experiment - corresponding to the appointment. The initial date you find before editing it - is only a suggestion in the week where the appointment should take place. - Please take take into account if the appointment should be in the semester - break. + In the form, you can edit the date of an appointment by clicking on + it. You should do so after writing with the students doing the experiment + corresponding to the appointment. The initial date you find before editing it + is only a suggestion in the week where the appointment should take place. + Please take take into account if the appointment should be in the semester + break.

- Below the appointments in the form, you can set the students' oral and - protocol marks. Students in a group have separate marks. The oral mark has to - be set after the oral exam. The protocol mark has to be set after correcting - the group's protocol. + Below the appointments in the form, you can set the students' oral and + protocol marks. Students in a group have separate marks. The oral mark has to + be set after the oral exam. The protocol mark has to be set after correcting + the group's protocol.

- After editing appointment date(s) or experiment marks, click on the - Save button to save the changes. + After editing appointment date(s) or experiment marks, click on the + Save button to save the changes.

- The changes are lost if you don't click on Save. Therefore, if you - want to discard the changes, just click on the back button of your browser. + The changes are lost if you don't click on Save. Therefore, if you + want to discard the changes, just click on the back button of your browser.

User

- Here, you find a table with only one row which is you as a user. Make sure - that the fields Phone Number, Mobile Phone Number, - Building and Room are filled and up to date, especially if - you are a new assistant. To edit these fields, click on the pen icon at the - left of the single entry in the table. After editing, click on Save. + Here, you find a table with only one row which is you as a user. Make sure + that the fields Phone Number, Mobile Phone Number, + Building and Room are filled and up to date, especially if + you are a new assistant. To edit these fields, click on the pen icon at the + left of the single entry in the table. After editing, click on Save.

- You can generate a new random password by clicking on the pen icon, checking - the corresponding checkbox and then clicking on - Save. You will be then logged out. Your new password is displayed - above the login fields. Make sure that you save the password in a safe place. - Using a free open source password manager like - Bitwarden - or - KeepassXC - is recommended. + You can generate a new random password by clicking on the pen icon, checking + the corresponding checkbox and then clicking on + Save. You will be then logged out. Your new password is displayed + above the login fields. Make sure that you save the password in a safe place. + Using a free open source password manager like + Bitwarden + or + KeepassXC + is recommended.

Docs

@@ -86,13 +86,13 @@

Active semester

- An active semester is the semester you are working in. All shown experiment - marks and appointments are in your active semester. By default as a new - assistant, your active semester should be the latest semester. + An active semester is the semester you are working in. All shown experiment + marks and appointments are in your active semester. By default as a new + assistant, your active semester should be the latest semester.

- If you see a warning that you are in an old semester, click on - Active semester and choose the latest semester. You should only work - in an old semester if there are still experiment marks to be set in the old - semester. + If you see a warning that you are in an old semester, click on + Active semester and choose the latest semester. You should only work + in an old semester if there are still experiment marks to be set in the old + semester.

diff --git a/advlabdb/templates/macros.jinja.html b/advlabdb/templates/macros.jinja.html index 6bfa97d..a1e076e 100644 --- a/advlabdb/templates/macros.jinja.html +++ b/advlabdb/templates/macros.jinja.html @@ -1,20 +1,31 @@ -{% macro information(current_user, active_semester_str, role) %} User: -{{ current_user }} - -| Active semester: {{ active_semester_str() }} {% if (role == "admin") and -(current_user.has_role("assistant")) %} | -Assistant space. {% elif -(role == "assistant") and (current_user.has_role("admin")) %} | -Admin space. {% endif %} {% -endmacro %} {% macro -missing_final_experiment_marks(number_of_missing_final_experiment_marks, -number_of_all_experiment_marks) %} -

- Number of missing final experiment marks: {{ - number_of_missing_final_experiment_marks }} / {{ - number_of_all_experiment_marks }} -

+{% macro information(current_user, active_semester_str, role) %} + User: + + {{ current_user }} + + | Active semester: {{ active_semester_str() }} + {% if (role == "admin") and (current_user.has_role("assistant")) %} + | + + Assistant space + . + {% elif (role == "assistant") and (current_user.has_role("admin")) %} + | + + Admin space + . + {% endif %} +{% endmacro %} + +{% macro missing_final_experiment_marks(number_of_missing_final_experiment_marks, number_of_all_experiment_marks) %} +

+ Number of missing final experiment marks: + {{ number_of_missing_final_experiment_marks }} / {{ number_of_all_experiment_marks }} +

{% endmacro %}