diff --git a/district/models.py b/district/models.py index c4636ba5776974c1c101335b1fc0f13ad07d13ca..d30cf51e0194ade8aeff1c175566298631d4f13d 100644 --- a/district/models.py +++ b/district/models.py @@ -105,7 +105,6 @@ class DistrictHomePage(MetadataPageMixin, Page): ### RELATIONS subpage_types = [ "shared.Article", - "shared.PersonPage", "shared.PeoplePage", "DistrictArticles", ] diff --git a/shared/models.py b/shared/models.py index e848a3e35ad0f0433047ff527e354aaf70b71aa5..8a9768211e7fc217873ec5b7fef77ab0461b54e2 100644 --- a/shared/models.py +++ b/shared/models.py @@ -121,12 +121,14 @@ class PeoplePage(MetadataPageMixin, Page): settings_panels = [] + subpage_types = [ + "shared.PersonPage", + ] + class Meta: verbose_name = "Stránka Lidé" def get_context(self, request): context = super().get_context(request) - context["people"] = ( - self.get_siblings(inclusive=False).type(PersonPage).live().specific() - ) + context["people"] = self.get_children().live().specific() return context diff --git a/shared/templates/shared/_person_badge.html b/shared/templates/shared/_person_badge.html index 0063df4beb17332134d557819eb2e3615b85d549..3f2ee662ecdc828f845021e99f93acaf7baeb5c0 100644 --- a/shared/templates/shared/_person_badge.html +++ b/shared/templates/shared/_person_badge.html @@ -1,13 +1,13 @@ <div class="badge "> - <a href="/{{ person.slug }}" class="avatar badge__avatar avatar--sm"> + <a href="{{ person.url }}" class="avatar badge__avatar avatar--sm"> <img src="{{ person.portrait }}" alt="{{ person.name }}" /> </a> <div class="badge__body"> <h2 class="head-heavy-xs badge__title"> - <a href="/{{person.slug}}" title="{{ person.name }}" class="content-block--nostyle"> + <a href="{{ person.url }}" title="{{ person.name }}" class="content-block--nostyle"> {{ person.name }} </a> </h2>