diff --git a/building_dialouge_webapp/heat/flows.py b/building_dialouge_webapp/heat/flows.py index 8282586..4ca339f 100644 --- a/building_dialouge_webapp/heat/flows.py +++ b/building_dialouge_webapp/heat/flows.py @@ -477,10 +477,11 @@ def dispatch(self, request, *args, **kwargs) -> HttpResponse: # Fill template with state partials by adding them with their target_id return self.render_to_response(context) - def finished(self): + def finished(self, request): """Check if the given flow is finished.""" + self.request = request state_responses = self.start.set() - return any(isinstance(response, EndState) for response in state_responses.values()) + return any(isinstance(response, RedirectStateResponse) for response in state_responses.values()) class BuildingTypeFlow(SidebarNavigationMixin, Flow): diff --git a/building_dialouge_webapp/heat/navigation.py b/building_dialouge_webapp/heat/navigation.py index 63a5c4c..3d525fb 100644 --- a/building_dialouge_webapp/heat/navigation.py +++ b/building_dialouge_webapp/heat/navigation.py @@ -6,11 +6,11 @@ def get_context_data(self, **kwargs): for category in index: for step in category["steps"]: - flow_object = step["object"] + flow_object = step["object"]() if step["url"] == current_url: step["index_state"] = "active" - elif flow_object.finished(self): + elif hasattr(flow_object, "finished") and flow_object.finished(self.request): step["index_state"] = "visited" else: step["index_state"] = "" diff --git a/building_dialouge_webapp/static/css/layouts/_questions.scss b/building_dialouge_webapp/static/css/layouts/_questions.scss index c931f4e..6e4cb89 100644 --- a/building_dialouge_webapp/static/css/layouts/_questions.scss +++ b/building_dialouge_webapp/static/css/layouts/_questions.scss @@ -3,7 +3,7 @@ @mixin sidebar-items { a { color: $grey-400; - pointer-events: none; + pointer-events: auto; } &.visited a { @@ -151,4 +151,4 @@ main .step-question { @media screen and (min-width: $breakpoint-3xl) { width: 40rem; } -} \ No newline at end of file +}