diff --git a/evap/grades/templates/grades_course_base.html b/evap/grades/templates/grades_course_base.html
index 83f9024530..8c9d5006fe 100644
--- a/evap/grades/templates/grades_course_base.html
+++ b/evap/grades/templates/grades_course_base.html
@@ -1,14 +1,13 @@
{% extends 'grades_semester_base.html' %}
+{% load staff_templatetags %}
{% block title %}{{ course.name }} - {{ block.super }}{% endblock %}
{% block breadcrumb %}
{{ block.super }}
{% if course %}
- {% if disable_breadcrumb_course %}
-
- {% endif %}
+ {% breadcrumb_item_url 'grades:course_view' course.id %}
+ {{ course.name }}
+ {% endbreadcrumb_item_url %}
{% endif %}
{% endblock %}
diff --git a/evap/grades/templates/grades_semester_base.html b/evap/grades/templates/grades_semester_base.html
index 4a6f6bce10..6d3e08dbca 100644
--- a/evap/grades/templates/grades_semester_base.html
+++ b/evap/grades/templates/grades_semester_base.html
@@ -1,18 +1,21 @@
{% extends 'grades_base.html' %}
{% load evaluation_filters %}
+{% load staff_templatetags %}
{% block title %}{{ semester.name }} - {{ block.super }}{% endblock %}
{% block breadcrumb %}
{{ block.super }}
{% if semester %}
- {% if disable_breadcrumb_semester or not user.is_grade_publisher %}
-
+ {% if not user.is_grade_publisher %}
+ {% breadcrumb_item %}
+ {{ semester.name }}
+ {% endbreadcrumb_item %}
{% else %}
-
+ {% breadcrumb_item_url 'grades:semester_view' semester.id %}
+ {{ semester.name }}
+ {% endbreadcrumb_item_url %}
{% endif %}
{% endif %}
{% endblock %}
diff --git a/evap/grades/templates/grades_upload_form.html b/evap/grades/templates/grades_upload_form.html
index 61ea0a9ef2..0e7fdb138c 100644
--- a/evap/grades/templates/grades_upload_form.html
+++ b/evap/grades/templates/grades_upload_form.html
@@ -1,8 +1,12 @@
{% extends 'grades_course_base.html' %}
+{% load staff_templatetags %}
+
{% block breadcrumb %}
{{ block.super }}
-
+ {% breadcrumb_item %}
+ {% translate "Upload document" %}
+ {% endbreadcrumb_item %}
{% endblock %}
{% block content %}
diff --git a/evap/grades/views.py b/evap/grades/views.py
index 5cd31aac3e..1f6c02f562 100644
--- a/evap/grades/views.py
+++ b/evap/grades/views.py
@@ -28,8 +28,7 @@ class IndexView(TemplateView):
def get_context_data(self, **kwargs) -> dict[str, Any]:
return super().get_context_data(**kwargs) | {
- "semesters": Semester.objects.filter(grade_documents_are_deleted=False),
- "disable_breadcrumb_grades": True,
+ "semesters": Semester.objects.filter(grade_documents_are_deleted=False)
}
@@ -69,10 +68,7 @@ def get_context_data(self, **kwargs) -> dict[str, Any]:
)
courses = course_grade_document_count_tuples(query)
- return super().get_context_data(**kwargs) | {
- "courses": courses,
- "disable_breadcrumb_semester": True,
- }
+ return super().get_context_data(**kwargs) | {"courses": courses}
@grade_publisher_or_manager_required
@@ -91,7 +87,6 @@ def get_context_data(self, **kwargs) -> dict[str, Any]:
return super().get_context_data(**kwargs) | {
"semester": self.object.semester,
"grade_documents": self.object.grade_documents.all(),
- "disable_breadcrumb_course": True,
}
diff --git a/evap/results/templates/results_evaluation_detail.html b/evap/results/templates/results_evaluation_detail.html
index 8700cbbb78..68f4883e5d 100644
--- a/evap/results/templates/results_evaluation_detail.html
+++ b/evap/results/templates/results_evaluation_detail.html
@@ -3,6 +3,7 @@
{% load static %}
{% load evaluation_filters %}
{% load results_templatetags %}
+{% load staff_templatetags %}
{% block title %}{{ evaluation.full_name }} - {{ evaluation.course.semester.name }} - {% translate 'Results' %} -
{{ block.super }}{% endblock %}
@@ -10,8 +11,12 @@
{% block breadcrumb_bar %}
{% endblock %}
diff --git a/evap/rewards/templates/rewards_reward_point_redemption_event_form.html b/evap/rewards/templates/rewards_reward_point_redemption_event_form.html
index 0780415b26..e1b88f1eec 100644
--- a/evap/rewards/templates/rewards_reward_point_redemption_event_form.html
+++ b/evap/rewards/templates/rewards_reward_point_redemption_event_form.html
@@ -1,13 +1,15 @@
{% extends 'staff_base.html' %}
+{% load staff_templatetags %}
+
{% block breadcrumb %}
{{ block.super }}
-
+ {% breadcrumb_item_url 'rewards:reward_point_redemption_events' %}
+ {% translate 'Reward Point Redemption Events' %}
+ {% endbreadcrumb_item_url %}
+ {% breadcrumb_item %}
+ {% translate 'Edit event' %}
+ {% endbreadcrumb_item %}
{% endblock %}
{% block content %}
diff --git a/evap/rewards/templates/rewards_reward_point_redemption_events.html b/evap/rewards/templates/rewards_reward_point_redemption_events.html
index c813387af0..759402b769 100644
--- a/evap/rewards/templates/rewards_reward_point_redemption_events.html
+++ b/evap/rewards/templates/rewards_reward_point_redemption_events.html
@@ -1,10 +1,13 @@
{% extends 'staff_base.html' %}
{% load static %}
+{% load staff_templatetags %}
{% block breadcrumb %}
{{ block.super }}
-
+ {% breadcrumb_item %}
+ {% translate 'Reward Point Redemption Events' %}
+ {% endbreadcrumb_item %}
{% endblock %}
{% block content %}
diff --git a/evap/staff/templates/staff_base.html b/evap/staff/templates/staff_base.html
index 07a0b928b9..dc8358f25b 100644
--- a/evap/staff/templates/staff_base.html
+++ b/evap/staff/templates/staff_base.html
@@ -1,4 +1,5 @@
{% extends 'base.html' %}
+{% load staff_templatetags %}
{% block title %}{% translate 'Manage' %} - {{ block.super }}{% endblock %}
@@ -6,10 +7,14 @@
{% block breadcrumb %}
- {% if disable_breadcrumb_manager or not user.is_manager %}
- - {% translate 'Manage' %}
+ {% if not user.is_manager %}
+ {% breadcrumb_item %}
+ {% translate 'Manage' %}
+ {% endbreadcrumb_item %}
{% else %}
- - {% translate 'Manage' %}
+ {% breadcrumb_item_url 'staff:index' %}
+ {% translate 'Manage' %}
+ {% endbreadcrumb_item_url %}
{% endif %}
{% endblock %}
diff --git a/evap/staff/templates/staff_course_base.html b/evap/staff/templates/staff_course_base.html
index 4086ece2b5..78506412ea 100644
--- a/evap/staff/templates/staff_course_base.html
+++ b/evap/staff/templates/staff_course_base.html
@@ -1,4 +1,5 @@
{% extends 'staff_semester_base.html' %}
+{% load staff_templatetags %}
{% block title %}
{% if course %}
@@ -12,14 +13,12 @@
{% block breadcrumb %}
{{ block.super }}
{% if course %}
- {% if disable_breadcrumb_course %}
-
{{ course.name }}
- {% else %}
-
{{ course.name }}
- {% endif %}
+ {% breadcrumb_item_url 'staff:course_edit' course.id %}
+ {{ course.name }}
+ {% endbreadcrumb_item_url %}
{% elif evaluation.course %}
-
- {{ evaluation.course.name }}
-
+ {% breadcrumb_item_url 'staff:course_edit' evaluation.course.id %}
+ {{ evaluation.course.name }}
+ {% endbreadcrumb_item_url %}
{% endif %}
{% endblock %}
diff --git a/evap/staff/templates/staff_course_type_index.html b/evap/staff/templates/staff_course_type_index.html
index e778e2acac..964f0a7f9b 100644
--- a/evap/staff/templates/staff_course_type_index.html
+++ b/evap/staff/templates/staff_course_type_index.html
@@ -1,10 +1,14 @@
{% extends 'staff_base.html' %}
+{% load staff_templatetags %}
{% load static %}
{% block breadcrumb %}
{{ block.super }}
-
{% translate 'Course types' %}
+
+ {% breadcrumb_item %}
+ {% translate 'Course types' %}
+ {% endbreadcrumb_item %}
{% endblock %}
{% block content %}
diff --git a/evap/staff/templates/staff_course_type_merge.html b/evap/staff/templates/staff_course_type_merge.html
index 6f41e82d65..532af19c54 100644
--- a/evap/staff/templates/staff_course_type_merge.html
+++ b/evap/staff/templates/staff_course_type_merge.html
@@ -1,11 +1,17 @@
{% extends 'staff_base.html' %}
{% load evaluation_filters %}
+{% load staff_templatetags %}
{% block breadcrumb %}
{{ block.super }}
-
{% translate 'Course types' %}
-
{% translate 'Merge course types' %}
+ {% breadcrumb_item_url 'staff:course_type_index' %}
+ {% translate 'Course types' %}
+ {% endbreadcrumb_item_url %}
+
+ {% breadcrumb_item_url 'staff:course_type_merge_selection' %}
+ {% translate 'Merge course types' %}
+ {% endbreadcrumb_item_url %}
{% endblock %}
{% block content %}
diff --git a/evap/staff/templates/staff_course_type_merge_selection.html b/evap/staff/templates/staff_course_type_merge_selection.html
index d4e86a4542..8877d0ff65 100644
--- a/evap/staff/templates/staff_course_type_merge_selection.html
+++ b/evap/staff/templates/staff_course_type_merge_selection.html
@@ -1,9 +1,16 @@
{% extends 'staff_base.html' %}
+{% load staff_templatetags %}
+
{% block breadcrumb %}
{{ block.super }}
-
{% translate 'Course types' %}
-
{% translate 'Merge course types' %}
+ {% breadcrumb_item_url 'staff:course_type_index' %}
+ {% translate 'Course types' %}
+ {% endbreadcrumb_item_url %}
+
+ {% breadcrumb_item %}
+ {% translate 'Merge course types' %}
+ {% endbreadcrumb_item %}
{% endblock %}
{% block content %}
diff --git a/evap/staff/templates/staff_evaluation_base.html b/evap/staff/templates/staff_evaluation_base.html
index a0457bcfa2..2f30d27ffd 100644
--- a/evap/staff/templates/staff_evaluation_base.html
+++ b/evap/staff/templates/staff_evaluation_base.html
@@ -1,5 +1,6 @@
{% extends 'staff_course_base.html' %}
+{% load staff_templatetags %}
{% block title %}
{% if evaluation.name %}
{{ evaluation.name }} -
@@ -11,9 +12,13 @@
{{ block.super }}
{% if evaluation %}
{% if evaluation.name %}
-
{{ evaluation.name }}
+ {% breadcrumb_item_url 'staff:evaluation_edit' evaluation.id %}
+ {{ evaluation.name }}
+ {% endbreadcrumb_item_url %}
{% else %}
-
{{ evaluation.course.name }}
+ {% breadcrumb_item_url 'staff:evaluation_edit' evaluation.id %}
+ {{ evaluation.course.name }}
+ {% endbreadcrumb_item_url %}
{% endif %}
{% endif %}
{% endblock %}
diff --git a/evap/staff/templates/staff_evaluation_textanswer_edit.html b/evap/staff/templates/staff_evaluation_textanswer_edit.html
index 04e6a62da8..f222bfb58c 100644
--- a/evap/staff/templates/staff_evaluation_textanswer_edit.html
+++ b/evap/staff/templates/staff_evaluation_textanswer_edit.html
@@ -1,13 +1,16 @@
{% extends 'staff_evaluation_base.html' %}
+{% load staff_templatetags %}
{% block breadcrumb %}
{{ block.super }}
-
- {% translate 'Text answers' %}
-
-
{{ textanswer.id }}
+
+ {% breadcrumb_item_url 'staff:evaluation_textanswers' evaluation.id fragment=textanswer.id|stringformat:"s" %}
+ {% translate 'Text answers' %}
+ {% endbreadcrumb_item_url %}
+
+ {% breadcrumb_item %}
+ {{ textanswer.id }}
+ {% endbreadcrumb_item %}
{% endblock %}
{% block content %}
diff --git a/evap/staff/templates/staff_evaluation_textanswers.html b/evap/staff/templates/staff_evaluation_textanswers.html
index 61a6480bf6..38f64ee188 100644
--- a/evap/staff/templates/staff_evaluation_textanswers.html
+++ b/evap/staff/templates/staff_evaluation_textanswers.html
@@ -1,10 +1,14 @@
{% extends 'staff_evaluation_base.html' %}
{% load evaluation_filters %}
+{% load staff_templatetags %}
{% block breadcrumb %}
{{ block.super }}
-
{% translate 'Text answers' %}
+
+ {% breadcrumb_item %}
+ {% translate 'Text answers' %}
+ {% endbreadcrumb_item %}
{% endblock %}
{% block content %}
diff --git a/evap/staff/templates/staff_exam_type_index.html b/evap/staff/templates/staff_exam_type_index.html
index 0fb7e40023..a633a44082 100644
--- a/evap/staff/templates/staff_exam_type_index.html
+++ b/evap/staff/templates/staff_exam_type_index.html
@@ -1,10 +1,14 @@
{% extends 'staff_base.html' %}
{% load static %}
+{% load staff_templatetags %}
{% block breadcrumb %}
{{ block.super }}
-
{% translate 'Exam types' %}
+
+ {% breadcrumb_item %}
+ {% translate 'Exam types' %}
+ {% endbreadcrumb_item %}
{% endblock %}
{% block content %}
diff --git a/evap/staff/templates/staff_faq_index.html b/evap/staff/templates/staff_faq_index.html
index b0c05f0141..8289a7aaba 100644
--- a/evap/staff/templates/staff_faq_index.html
+++ b/evap/staff/templates/staff_faq_index.html
@@ -1,10 +1,14 @@
{% extends 'staff_base.html' %}
{% load static %}
+{% load staff_templatetags %}
{% block breadcrumb %}
{{ block.super }}
-
{% translate 'FAQ Sections' %}
+
+ {% breadcrumb_item %}
+ {% translate 'FAQ Sections' %}
+ {% endbreadcrumb_item %}
{% endblock %}
{% block content %}
diff --git a/evap/staff/templates/staff_faq_section.html b/evap/staff/templates/staff_faq_section.html
index 1e31b89a31..a739427c5e 100644
--- a/evap/staff/templates/staff_faq_section.html
+++ b/evap/staff/templates/staff_faq_section.html
@@ -1,11 +1,18 @@
{% extends 'staff_base.html' %}
{% load static %}
+{% load staff_templatetags %}
{% block breadcrumb %}
{{ block.super }}
-
{% translate 'FAQ Sections' %}
-
{{ section.title }}
+
+ {% breadcrumb_item_url 'staff:faq_index' %}
+ {% translate 'FAQ Sections' %}
+ {% endbreadcrumb_item_url %}
+
+ {% breadcrumb_item %}
+ {{ section.title }}
+ {% endbreadcrumb_item %}
{% endblock %}
{% block content %}
diff --git a/evap/staff/templates/staff_infotexts.html b/evap/staff/templates/staff_infotexts.html
index 9065b4cdfe..d4f856f663 100644
--- a/evap/staff/templates/staff_infotexts.html
+++ b/evap/staff/templates/staff_infotexts.html
@@ -1,8 +1,13 @@
{% extends 'staff_base.html' %}
+{% load staff_templatetags %}
+
{% block breadcrumb %}
{{ block.super }}
-
{% translate 'Infotexts' %}
+
+ {% breadcrumb_item %}
+ {% translate 'Infotexts' %}
+ {% endbreadcrumb_item %}
{% endblock %}
{% block content %}
diff --git a/evap/staff/templates/staff_program_index.html b/evap/staff/templates/staff_program_index.html
index cf2ffa86d7..8032994d04 100644
--- a/evap/staff/templates/staff_program_index.html
+++ b/evap/staff/templates/staff_program_index.html
@@ -1,10 +1,14 @@
{% extends 'staff_base.html' %}
{% load static %}
+{% load staff_templatetags %}
{% block breadcrumb %}
{{ block.super }}
-
{% translate 'Programs' %}
+
+ {% breadcrumb_item %}
+ {% translate 'Programs' %}
+ {% endbreadcrumb_item %}
{% endblock %}
{% block content %}
diff --git a/evap/staff/templates/staff_program_merge.html b/evap/staff/templates/staff_program_merge.html
index b05a1ade0f..6dbb6ec789 100644
--- a/evap/staff/templates/staff_program_merge.html
+++ b/evap/staff/templates/staff_program_merge.html
@@ -1,11 +1,18 @@
{% extends 'staff_base.html' %}
{% load evaluation_filters %}
+{% load staff_templatetags %}
{% block breadcrumb %}
{{ block.super }}
-
{% translate 'Programs' %}
-
{% translate 'Merge programs' %}
+
+ {% breadcrumb_item_url 'staff:program_index' %}
+ {% translate 'Programs' %}
+ {% endbreadcrumb_item_url %}
+
+ {% breadcrumb_item %}
+ {% translate 'Merge programs' %}
+ {% endbreadcrumb_item %}
{% endblock %}
{% block content %}
diff --git a/evap/staff/templates/staff_program_merge_selection.html b/evap/staff/templates/staff_program_merge_selection.html
index 577a5c5034..b3ceb25525 100644
--- a/evap/staff/templates/staff_program_merge_selection.html
+++ b/evap/staff/templates/staff_program_merge_selection.html
@@ -1,9 +1,17 @@
{% extends 'staff_base.html' %}
+{% load staff_templatetags %}
+
{% block breadcrumb %}
{{ block.super }}
-
{% translate 'Programs' %}
-
{% translate 'Merge programs' %}
+
+ {% breadcrumb_item_url 'staff:program_index' %}
+ {% translate 'Programs' %}
+ {% endbreadcrumb_item_url %}
+
+ {% breadcrumb_item %}
+ {% translate 'Merge programs' %}
+ {% endbreadcrumb_item %}
{% endblock %}
{% block content %}
diff --git a/evap/staff/templates/staff_questionnaire_base.html b/evap/staff/templates/staff_questionnaire_base.html
index 2613b0fc69..c81edf85c9 100644
--- a/evap/staff/templates/staff_questionnaire_base.html
+++ b/evap/staff/templates/staff_questionnaire_base.html
@@ -1,20 +1,16 @@
{% extends 'staff_base.html' %}
+{% load staff_templatetags %}
+
{% block breadcrumb %}
{{ block.super }}
+ {% breadcrumb_item_url 'staff:questionnaire_index' %}
+ {% translate 'Questionnaires' %}
+ {% endbreadcrumb_item_url %}
{% if questionnaire %}
-
- {% translate 'Questionnaires' %}
-
- {% if disable_breadcrumb_questionnaire %}
-
{{ questionnaire.name }}
- {% else %}
-
- {{ questionnaire.name }}
-
- {% endif %}
- {% else %}
-
{% translate 'Questionnaires' %}
+ {% breadcrumb_item_url 'staff:questionnaire_edit' questionnaire.id %}
+ {{ questionnaire.name }}
+ {% endbreadcrumb_item_url %}
{% endif %}
{% endblock %}
diff --git a/evap/staff/templates/staff_questionnaire_usage.html b/evap/staff/templates/staff_questionnaire_usage.html
index 25ab73febd..51a8c268d7 100644
--- a/evap/staff/templates/staff_questionnaire_usage.html
+++ b/evap/staff/templates/staff_questionnaire_usage.html
@@ -1,8 +1,13 @@
{% extends 'staff_questionnaire_base.html' %}
+{% load staff_templatetags %}
+
{% block breadcrumb %}
{{ block.super }}
-
{% translate 'Usage' %}
+
+ {% breadcrumb_item %}
+ {% translate 'Usage' %}
+ {% endbreadcrumb_item %}
{% endblock %}
{% block content %}
diff --git a/evap/staff/templates/staff_questionnaire_view.html b/evap/staff/templates/staff_questionnaire_view.html
index 1b3a2f10fc..d7e4c2a55c 100644
--- a/evap/staff/templates/staff_questionnaire_view.html
+++ b/evap/staff/templates/staff_questionnaire_view.html
@@ -1,8 +1,12 @@
{% extends 'staff_questionnaire_base.html' %}
+{% load staff_templatetags %}
+
{% block breadcrumb %}
{{ block.super }}
-
{% translate 'Preview' %}
+ {% breadcrumb_item %}
+ {% translate 'Preview' %}
+ {% endbreadcrumb_item %}
{% endblock %}
{% block content %}
diff --git a/evap/staff/templates/staff_semester_base.html b/evap/staff/templates/staff_semester_base.html
index b3ad2ce697..a45d3fed50 100644
--- a/evap/staff/templates/staff_semester_base.html
+++ b/evap/staff/templates/staff_semester_base.html
@@ -1,4 +1,5 @@
{% extends 'staff_base.html' %}
+{% load staff_templatetags %}
{% block title %}
{% if semester %}
@@ -9,14 +10,9 @@
{% block breadcrumb %}
{{ block.super }}
-
{% translate 'Semesters' %}
{% if semester %}
- {% if disable_breadcrumb_semester %}
-
{{ semester.name }}
- {% else %}
-
- {{ semester.name }}
-
- {% endif %}
+ {% breadcrumb_item_url 'staff:semester_view' semester.id %}
+ {{ semester.name }}
+ {% endbreadcrumb_item_url %}
{% endif %}
{% endblock %}
diff --git a/evap/staff/templates/staff_semester_export.html b/evap/staff/templates/staff_semester_export.html
index ff31194732..eac9aa6e94 100644
--- a/evap/staff/templates/staff_semester_export.html
+++ b/evap/staff/templates/staff_semester_export.html
@@ -1,10 +1,14 @@
{% extends 'staff_semester_base.html' %}
{% load evaluation_filters static %}
+{% load staff_templatetags %}
{% block breadcrumb %}
{{ block.super }}
-
{% translate 'Export' %}
+
+ {% breadcrumb_item %}
+ {% translate 'Export' %}
+ {% endbreadcrumb_item %}
{% endblock %}
{% block content %}
diff --git a/evap/staff/templates/staff_semester_flagged_textanswers.html b/evap/staff/templates/staff_semester_flagged_textanswers.html
index 11d297ce8f..6f4ee991b5 100644
--- a/evap/staff/templates/staff_semester_flagged_textanswers.html
+++ b/evap/staff/templates/staff_semester_flagged_textanswers.html
@@ -1,8 +1,13 @@
{% extends 'staff_semester_base.html' %}
+{% load staff_templatetags %}
+
{% block breadcrumb %}
{{ block.super }}
-
{% translate 'Flagged textanswers' %}
+
+ {% breadcrumb_item %}
+ {% translate 'Flagged textanswers' %}
+ {% endbreadcrumb_item %}
{% endblock %}
{% block content %}
diff --git a/evap/staff/templates/staff_semester_grade_reminder.html b/evap/staff/templates/staff_semester_grade_reminder.html
index 74e875f8dc..3f485dd783 100644
--- a/evap/staff/templates/staff_semester_grade_reminder.html
+++ b/evap/staff/templates/staff_semester_grade_reminder.html
@@ -1,8 +1,13 @@
{% extends 'staff_semester_base.html' %}
+{% load staff_templatetags %}
+
{% block breadcrumb %}
{{ block.super }}
-
{% translate 'Grade publish reminder' %}
+
+ {% breadcrumb_item %}
+ {% translate 'Grade publish reminder' %}
+ {% endbreadcrumb_item %}
{% endblock %}
{% block content %}
diff --git a/evap/staff/templates/staff_semester_import.html b/evap/staff/templates/staff_semester_import.html
index c2de28c5ef..e48b912afd 100644
--- a/evap/staff/templates/staff_semester_import.html
+++ b/evap/staff/templates/staff_semester_import.html
@@ -1,10 +1,14 @@
{% extends 'staff_semester_base.html' %}
{% load static %}
+{% load staff_templatetags %}
{% block breadcrumb %}
{{ block.super }}
-
{% translate 'Import semester data' %}
+
+ {% breadcrumb_item %}
+ {% translate 'Import semester data' %}
+ {% endbreadcrumb_item %}
{% endblock %}
{% block content %}
diff --git a/evap/staff/templates/staff_semester_preparation_reminder.html b/evap/staff/templates/staff_semester_preparation_reminder.html
index da3fdc9dc5..22303ac04f 100644
--- a/evap/staff/templates/staff_semester_preparation_reminder.html
+++ b/evap/staff/templates/staff_semester_preparation_reminder.html
@@ -1,10 +1,13 @@
{% extends 'staff_semester_base.html' %}
{% load evaluation_filters %}
+{% load staff_templatetags %}
{% block breadcrumb %}
{{ block.super }}
-
{% translate 'Preparation reminder' %}
+ {% breadcrumb_item %}
+ {% translate 'Preparation reminder' %}
+ {% endbreadcrumb_item %}
{% endblock %}
{% block content %}
diff --git a/evap/staff/templates/staff_semester_questionnaire_assign_form.html b/evap/staff/templates/staff_semester_questionnaire_assign_form.html
index 1d836f2431..581d0faaa1 100644
--- a/evap/staff/templates/staff_semester_questionnaire_assign_form.html
+++ b/evap/staff/templates/staff_semester_questionnaire_assign_form.html
@@ -1,8 +1,12 @@
{% extends 'staff_semester_base.html' %}
+{% load staff_templatetags %}
+
{% block breadcrumb %}
{{ block.super }}
-
{% translate 'Assign questionnaires' %}
+ {% breadcrumb_item %}
+ {% translate 'Assign questionnaires' %}
+ {% endbreadcrumb_item %}
{% endblock %}
{% block content %}
diff --git a/evap/staff/templates/staff_semester_send_reminder.html b/evap/staff/templates/staff_semester_send_reminder.html
index 22a86c00f4..f9d1430321 100644
--- a/evap/staff/templates/staff_semester_send_reminder.html
+++ b/evap/staff/templates/staff_semester_send_reminder.html
@@ -1,13 +1,16 @@
{% extends 'staff_evaluation_base.html' %}
{% load evaluation_filters %}
+{% load staff_templatetags %}
{% block breadcrumb %}
{{ block.super }}
-
- {% translate 'Preparation reminder' %}
-
-
{{ responsible }}
+ {% breadcrumb_item_url 'staff:semester_preparation_reminder' semester.id %}
+ {% translate 'Preparation reminder' %}
+ {% endbreadcrumb_item_url %}
+ {% breadcrumb_item %}
+ {{ responsible }}
+ {% endbreadcrumb_item %}
{% endblock %}
{% block content %}
diff --git a/evap/staff/templates/staff_template_form.html b/evap/staff/templates/staff_template_form.html
index 3f7f9f705d..7cc4cd9373 100644
--- a/evap/staff/templates/staff_template_form.html
+++ b/evap/staff/templates/staff_template_form.html
@@ -1,11 +1,16 @@
{% extends 'staff_base.html' %}
{% load static %}
+{% load staff_templatetags %}
{% block breadcrumb %}
{{ block.super }}
-
{% translate 'Templates' %}
-
{{ template.name }}
+ {% breadcrumb_item %}
+ {% translate 'Templates' %}
+ {% endbreadcrumb_item %}
+ {% breadcrumb_item %}
+ {{ template.name }}
+ {% endbreadcrumb_item %}
{% endblock %}
{% block content %}
diff --git a/evap/staff/templates/staff_text_answer_warnings.html b/evap/staff/templates/staff_text_answer_warnings.html
index 82ce9a5a3f..5206af1efb 100644
--- a/evap/staff/templates/staff_text_answer_warnings.html
+++ b/evap/staff/templates/staff_text_answer_warnings.html
@@ -2,10 +2,13 @@
{% load static %}
{% load student_filters %}
+{% load staff_templatetags %}
{% block breadcrumb %}
{{ block.super }}
-
{% translate 'Text answer warnings' %}
+ {% breadcrumb_item %}
+ {% translate 'Text answer warnings' %}
+ {% endbreadcrumb_item %}
{% endblock %}
{% block content %}
diff --git a/evap/staff/templates/staff_user_bulk_update.html b/evap/staff/templates/staff_user_bulk_update.html
index ece0200800..bbbe010853 100644
--- a/evap/staff/templates/staff_user_bulk_update.html
+++ b/evap/staff/templates/staff_user_bulk_update.html
@@ -1,9 +1,15 @@
{% extends 'staff_base.html' %}
+{% load staff_templatetags %}
+
{% block breadcrumb %}
{{ block.super }}
-
{% translate 'Users' %}
-
{% translate 'Bulk update' %}
+ {% breadcrumb_item_url 'staff:user_index' %}
+ {% translate 'Users' %}
+ {% endbreadcrumb_item_url %}
+ {% breadcrumb_item %}
+ {% translate 'Bulk update' %}
+ {% endbreadcrumb_item %}
{% endblock %}
{% block content %}
diff --git a/evap/staff/templates/staff_user_form.html b/evap/staff/templates/staff_user_form.html
index 3fb911b1e8..7b8ac442eb 100644
--- a/evap/staff/templates/staff_user_form.html
+++ b/evap/staff/templates/staff_user_form.html
@@ -1,15 +1,16 @@
{% extends 'staff_base.html' %}
{% load evaluation_filters %}
+{% load staff_templatetags %}
{% block breadcrumb %}
{{ block.super }}
-
{% translate 'Users' %}
- {% if form.instance.id %}
-
{{ form.instance.full_name }}
- {% else %}
-
{% translate 'Create user' %}
- {% endif %}
+ {% breadcrumb_item_url 'staff:user_index' %}
+ {% translate 'Users' %}
+ {% endbreadcrumb_item_url %}
+ {% breadcrumb_item %}
+ {% if form.instance.id %}{{ form.instance.full_name }}{% else %}{% translate 'Create user' %}{% endif %}
+ {% endbreadcrumb_item %}
{% endblock %}
{% block content %}
diff --git a/evap/staff/templates/staff_user_import.html b/evap/staff/templates/staff_user_import.html
index 5180720f86..856b6eb5a6 100644
--- a/evap/staff/templates/staff_user_import.html
+++ b/evap/staff/templates/staff_user_import.html
@@ -1,11 +1,16 @@
{% extends 'staff_base.html' %}
{% load static %}
+{% load staff_templatetags %}
{% block breadcrumb %}
{{ block.super }}
-
{% translate 'Users' %}
-
{% translate 'Import users' %}
+ {% breadcrumb_item_url 'staff:user_index' %}
+ {% translate 'Users' %}
+ {% endbreadcrumb_item_url %}
+ {% breadcrumb_item %}
+ {% translate 'Import users' %}
+ {% endbreadcrumb_item %}
{% endblock %}
{% block content %}
diff --git a/evap/staff/templates/staff_user_index.html b/evap/staff/templates/staff_user_index.html
index fa13bc6e64..0290fd5348 100644
--- a/evap/staff/templates/staff_user_index.html
+++ b/evap/staff/templates/staff_user_index.html
@@ -1,10 +1,13 @@
{% extends 'staff_base.html' %}
{% load static %}
+{% load staff_templatetags %}
{% block breadcrumb %}
{{ block.super }}
-
{% translate 'Users' %}
+ {% breadcrumb_item_url 'staff:user_index' %}
+ {% translate 'Users' %}
+ {% endbreadcrumb_item_url %}
{% endblock %}
{% block content %}
diff --git a/evap/staff/templates/staff_user_list.html b/evap/staff/templates/staff_user_list.html
index fb705bfbb9..3abab49a24 100644
--- a/evap/staff/templates/staff_user_list.html
+++ b/evap/staff/templates/staff_user_list.html
@@ -1,11 +1,16 @@
{% extends 'staff_base.html' %}
{% load static %}
+{% load staff_templatetags %}
{% block breadcrumb %}
{{ block.super }}
-
{% translate 'Users' %}
-
{% translate 'User list' %}
+ {% breadcrumb_item_url 'staff:user_index' %}
+ {% translate 'Users' %}
+ {% endbreadcrumb_item_url %}
+ {% breadcrumb_item %}
+ {% translate 'User list' %}
+ {% endbreadcrumb_item %}
{% endblock %}
{% block content %}
diff --git a/evap/staff/templates/staff_user_merge.html b/evap/staff/templates/staff_user_merge.html
index a81d16b733..d1b5189e7b 100644
--- a/evap/staff/templates/staff_user_merge.html
+++ b/evap/staff/templates/staff_user_merge.html
@@ -1,11 +1,16 @@
{% extends 'staff_base.html' %}
+{% load staff_templatetags %}
{% load evaluation_filters %}
{% block breadcrumb %}
{{ block.super }}
-
{% translate 'Users' %}
-
{% translate 'Merge users' %}
+ {% breadcrumb_item_url 'staff:user_index' %}
+ {% translate 'Users' %}
+ {% endbreadcrumb_item_url %}
+ {% breadcrumb_item %}
+ {% translate 'Merge users' %}
+ {% endbreadcrumb_item %}
{% endblock %}
{% block content %}
diff --git a/evap/staff/templates/staff_user_merge_selection.html b/evap/staff/templates/staff_user_merge_selection.html
index 01ba367643..1de987d44a 100644
--- a/evap/staff/templates/staff_user_merge_selection.html
+++ b/evap/staff/templates/staff_user_merge_selection.html
@@ -1,9 +1,15 @@
{% extends 'staff_base.html' %}
+{% load staff_templatetags %}
+
{% block breadcrumb %}
{{ block.super }}
-
{% translate 'Users' %}
-
{% translate 'Merge users' %}
+ {% breadcrumb_item_url 'staff:user_index' %}
+ {% translate 'Users' %}
+ {% endbreadcrumb_item_url %}
+ {% breadcrumb_item %}
+ {% translate 'Merge users' %}
+ {% endbreadcrumb_item %}
{% endblock %}
{% block content %}
diff --git a/evap/staff/templatetags/staff_templatetags.py b/evap/staff/templatetags/staff_templatetags.py
index 86d8a04340..21dafe0d07 100644
--- a/evap/staff/templatetags/staff_templatetags.py
+++ b/evap/staff/templatetags/staff_templatetags.py
@@ -1,4 +1,6 @@
from django.template import Library
+from django.urls import reverse
+from django.utils.html import format_html
from evap.staff.forms import ExamEvaluationForm
@@ -9,3 +11,28 @@
def create_exam_evaluation_form(evaluation):
form_id = f"exam_creation_form_{evaluation.id}"
return ExamEvaluationForm(None, evaluation=evaluation, form_id=form_id)
+
+
+@register.simple_block_tag(takes_context=True)
+def breadcrumb_item(context, content):
+ return breadcrumb_item_url(context, content, None)
+
+
+@register.simple_block_tag(takes_context=True)
+def breadcrumb_item_url(context, content, url_path, *args, fragment=None):
+ url = reverse(url_path, args=args, fragment=fragment) if url_path is not None else None
+
+ request = context["request"]
+ current_path = request.path
+
+ if url is None or current_path == url:
+ return format_html(
+ '
{}',
+ content,
+ )
+
+ return format_html(
+ '
{}',
+ url,
+ content,
+ )
diff --git a/evap/staff/views.py b/evap/staff/views.py
index d9dc39f3b4..a6c9041416 100644
--- a/evap/staff/views.py
+++ b/evap/staff/views.py
@@ -149,7 +149,6 @@ def index(request):
"semesters": Semester.objects.all(),
"templates": EmailTemplate.objects.all().order_by("id"),
"sections": FaqSection.objects.all(),
- "disable_breadcrumb_manager": True,
}
return render(request, "staff_index.html", template_data)
@@ -254,7 +253,6 @@ class Stats:
"semester": semester,
"evaluations": evaluations,
"Evaluation": Evaluation,
- "disable_breadcrumb_semester": True,
"rewards_active": rewards_active,
"num_evaluations": len(evaluations),
"program_stats": program_stats_with_total,
@@ -1127,7 +1125,6 @@ def course_copy(request, course_id):
"semester": course.semester,
"course_form": course_form,
"editable": True,
- "disable_breadcrumb_course": True,
},
)
@@ -1167,7 +1164,6 @@ def get_context_data(self, **kwargs) -> dict[str, Any]:
context_data = super().get_context_data(**kwargs) | {
"semester": self.object.semester,
"editable": self.object.can_be_edited_by_manager,
- "disable_breadcrumb_course": True,
}
context_data["course_form"] = context_data.pop("form")
return context_data
@@ -1986,13 +1982,7 @@ def questionnaire_edit(request, questionnaire_id):
messages.success(request, _("Successfully updated questionnaire."))
return redirect("staff:questionnaire_index")
- template_data = {
- "questionnaire": questionnaire,
- "form": form,
- "formset": formset,
- "editable": editable,
- "disable_breadcrumb_questionnaire": True,
- }
+ template_data = {"questionnaire": questionnaire, "form": form, "formset": formset, "editable": editable}
return render(request, "staff_questionnaire_form.html", template_data)
diff --git a/evap/student/templates/student_vote.html b/evap/student/templates/student_vote.html
index d848cf4d8c..74ce14803f 100644
--- a/evap/student/templates/student_vote.html
+++ b/evap/student/templates/student_vote.html
@@ -3,14 +3,19 @@
{% load static %}
{% load evaluation_filters %}
{% load student_filters %}
+{% load staff_templatetags %}
{% block title %}{{ evaluation.full_name }} - {% translate 'Evaluation' %} - {{ block.super }}{% endblock %}
{% block breadcrumb_bar %}
- - {{ evaluation.course.semester.name }}
- - {{ evaluation.full_name }}
+ {% breadcrumb_item %}
+ {{ evaluation.course.semester.name }}
+ {% endbreadcrumb_item %}
+ {% breadcrumb_item %}
+ {{ evaluation.full_name }}
+ {% endbreadcrumb_item %}
{% endblock %}
diff --git a/pyproject.toml b/pyproject.toml
index 00da4c5d1c..46ba4eea0a 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -110,6 +110,7 @@ exclude = ["**/urls.py"]
[tool.djangofmt]
extend-exclude = ["evap/static/bootstrap"]
html-void-self-closing = "unchanged"
+custom-blocks = ["breadcrumb_item", "breadcrumb_item_url"]
##############################################