Add breadcrumb/section links
This commit is contained in:
parent
635d73d18b
commit
14413d9437
5 changed files with 23 additions and 5 deletions
|
|
@ -41,11 +41,17 @@ class GovPlanDetailView(GovernmentMixin, DetailView):
|
|||
return qs
|
||||
return qs.filter(public=True)
|
||||
|
||||
def get_section(self):
|
||||
return GovernmentPlanSection.objects.filter(
|
||||
categories__in=self.object.categories.all()
|
||||
).first()
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super().get_context_data(**kwargs)
|
||||
context["updates"] = self.object.updates.filter(public=True).order_by(
|
||||
"-timestamp"
|
||||
)
|
||||
context["section"] = self.get_section()
|
||||
return context
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue