Skip to content
Snippets Groups Projects
Commit dc75e84a authored by jan.bednarik's avatar jan.bednarik
Browse files

Senator: News link on homepage

parent 6cf94411
Branches
No related tags found
No related merge requests found
......@@ -45,6 +45,7 @@ class SenatorHomePage(Page):
def get_context(self, request):
context = super().get_context(request)
articles = (
self.get_descendants()
.type(SenatorNewsPage)
......@@ -52,6 +53,18 @@ class SenatorHomePage(Page):
.order_by("-senatornewspage__date")[:3]
)
context["articles"] = articles
try:
context["news_url"] = (
self.get_children()
.type(SenatorNewsIndexPage)
.live()
.get()
.get_url(request)
)
except SenatorNewsIndexPage.DoesNotExist:
context["news_url"] = "#"
return context
......
......@@ -183,7 +183,11 @@
</div>
</div>
<div class="w-separator type_invisible size_large thick_1 style_solid color_border cont_none"><span class="w-separator-h"></span></div>
<div class="w-btn-wrapper align_center"><a class="w-btn style_raised color_contrast icon_atright outlined-black" href="https://lukaswagenknecht.cz/novinky/" style="font-size:20px;"><i class="fa fa-arrow-right"></i><span class="w-btn-label">Všechny novinky</span></a></div>
<div class="w-btn-wrapper align_center">
<a class="w-btn style_raised color_contrast icon_atright outlined-black" href="{{ news_url }}" style="font-size:20px;">
<i class="fa fa-arrow-right"></i><span class="w-btn-label">Všechny novinky</span>
</a>
</div>
</div>
</div>
</div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment