Skip to content
This repository has been archived by the owner on Mar 24, 2023. It is now read-only.

Fix nav and breadcrumbs for objects, findings and tasks #197

Merged
merged 3 commits into from
Jan 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions rocky/templates/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@
</li>
<li>
<a href="{% url 'finding_list' organization.code %}"
{% if 'finding' in request.path|urlencode %} aria-current="page"{% endif %}>{% translate 'Findings' %}</a>
{% if 'finding' in request.path|urlencode or 'Finding' in request.get_full_path|urlencode %} aria-current="page"{% endif %}>{% translate 'Findings' %}</a>
</li>
<li>
<a href="{% url 'ooi_list' organization.code %}"
{% if 'objects' in request.path|urlencode %} aria-current="page"{% endif %}>{% translate 'Objects' %}</a>
{% if 'objects' in request.path|urlencode and not 'Finding' in request.get_full_path|urlencode %} aria-current="page"{% endif %}>{% translate 'Objects' %}</a>
</li>
<li>
<a href="{% url 'task_list' organization.code %}"
Expand Down
3 changes: 2 additions & 1 deletion rocky/views/ooi_detail.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from katalogus.views.mixins import BoefjeMixin
from octopoes.models import OOI
from rocky import scheduler
from rocky.views.mixins import OOIBreadcrumbsMixin
from rocky.views.ooi_detail_related_object import OOIRelatedObjectAddView
from rocky.views.ooi_view import BaseOOIDetailView
from tools.forms.base import ObservedAtForm
Expand All @@ -29,6 +30,7 @@ class OOIDetailView(
BoefjeMixin,
OOIRelatedObjectAddView,
BaseOOIDetailView,
OOIBreadcrumbsMixin,
):
template_name = "oois/ooi_detail.html"
connector_form_class = ObservedAtForm
Expand Down Expand Up @@ -170,7 +172,6 @@ def get_context_data(self, **kwargs):
context["severity_summary_totals"] = self.get_findings_severity_totals()
context["possible_boefjes_filter_form"] = filter_form
context["organization_indemnification"] = self.get_organization_indemnification()

context["scan_history"] = self.get_scan_history()
context["scan_history_form_fields"] = [
"scan_history_from",
Expand Down
4 changes: 4 additions & 0 deletions rocky/views/ooi_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from django.urls import reverse_lazy
from django.utils.translation import gettext_lazy as _
from django_otp.decorators import otp_required
from django.urls import reverse
from requests import RequestException
from two_factor.views.utils import class_view_decorator

Expand Down Expand Up @@ -50,6 +51,9 @@ def get_context_data(self, **kwargs):
context["member"] = self.organization_member
context["scan_levels"] = [alias for level, alias in SCAN_LEVEL.choices]
context["organization_indemnification"] = self.get_organization_indemnification
context["breadcrumbs"] = [
{"url": reverse("ooi_list", kwargs={"organization_code": self.organization.code}), "text": _("Objects")},
]

return context

Expand Down
1 change: 0 additions & 1 deletion rocky/views/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ def get_queryset(self):
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context["breadcrumbs"] = [
{"url": reverse("ooi_list", kwargs={"organization_code": self.organization.code}), "text": _("Objects")},
{"url": reverse("task_list", kwargs={"organization_code": self.organization.code}), "text": _("Tasks")},
]
return context
Expand Down