diff --git a/elections2021/models.py b/elections2021/models.py index 07a9faed89aaf742cdc59dcf1f8068e682a56594..cd3a73a115bc5d50fccd258d41944f897bf3a734 100644 --- a/elections2021/models.py +++ b/elections2021/models.py @@ -389,6 +389,20 @@ class Elections2021HomePage(MetadataPageMixin, RoutablePageMixin, Page): def going_to_vote_page_url(self): return get_subpage_url(self, Elections2021GoingToVotePage) + @cached_property + def full_program_page_url(self): + try: + return ( + self.get_descendants() + .type(Elections2021ProgramPage) + .live() + .specific() + .first() + .get_full_program_url() + ) + except (Page.DoesNotExist, AttributeError): + return "#" + @cached_property def has_calendar(self): try: @@ -1238,6 +1252,9 @@ class Elections2021ProgramPage( def get_my_program_url(self): return self.url + self.reverse_subpage("my_program") + def get_full_program_url(self): + return self.url + self.reverse_subpage("full_program") + @route(r"^$") def plan_all(self, request): query = request.GET.get("q", None) diff --git a/elections2021/templates/elections2021/base.html b/elections2021/templates/elections2021/base.html index 8ce3f83017b4c1a871619181d5eec952656df04f..e77f1f4c30154fdc18d55993f81efdaf1cf04c80 100644 --- a/elections2021/templates/elections2021/base.html +++ b/elections2021/templates/elections2021/base.html @@ -119,6 +119,7 @@ <li><a href="{{ page.root_page.program_strategic_page_url }}" class="navbar-menu__link">Program v 5 minutách</a></li> <li><a href="{{ page.root_page.program_silver_page_url }}" class="navbar-menu__link">Stříbrný program pro seniory</a></li> <li><a href="{{ page.root_page.going_to_vote_page_url }}" class="navbar-menu__link">Program pro mladé</a></li> + <li><a href="{{ page.root_page.full_program_page_url }}" class="navbar-menu__link">Program přístupný pro zrakově postižené</a></li> </ul> </ui-navbar-subtitem> </li> diff --git a/elections2021/templates/elections2021/elections2021_full_program_page.html b/elections2021/templates/elections2021/elections2021_full_program_page.html index 9c624eb6e24299698ecfe6668e70e9e268e22631..999a02bfef914e8179715333cbe23aebcc18318c 100644 --- a/elections2021/templates/elections2021/elections2021_full_program_page.html +++ b/elections2021/templates/elections2021/elections2021_full_program_page.html @@ -26,7 +26,7 @@ <article class="relative bg-lemon md:bg-split-color px-4 md:pl-8 md:pr-0 2xl:px-8 hero py-0 w-full"> <div class="2xl:container w-auto bg-lemon md:pl-20 pr-0 grid lg:grid-rows-1 h-40 sm:h-56 md:h-64 lg:grid-cols-7 items-center 2xl:mx-auto"> <div class="lg:row-span-1 lg:col-span-4 order-1 md:pr-20"> - <h1 class="head-alt-md sm:head-alt-lg pt-1">Kompletní program koalice Piráti a Starostové</h1> + <h1 class="head-alt-md sm:head-alt-lg pt-1">Program přístupný pro zrakově postižené</h1> </div> </div> </article>