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
No related branches found
No related tags found
No related merge requests found
...@@ -45,6 +45,7 @@ class SenatorHomePage(Page): ...@@ -45,6 +45,7 @@ class SenatorHomePage(Page):
def get_context(self, request): def get_context(self, request):
context = super().get_context(request) context = super().get_context(request)
articles = ( articles = (
self.get_descendants() self.get_descendants()
.type(SenatorNewsPage) .type(SenatorNewsPage)
...@@ -52,6 +53,18 @@ class SenatorHomePage(Page): ...@@ -52,6 +53,18 @@ class SenatorHomePage(Page):
.order_by("-senatornewspage__date")[:3] .order_by("-senatornewspage__date")[:3]
) )
context["articles"] = articles 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 return context
......
...@@ -183,7 +183,11 @@ ...@@ -183,7 +183,11 @@
</div> </div>
</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-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> </div>
</div> </div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment