Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Maják
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hemp
Maják
Commits
dc75e84a
Commit
dc75e84a
authored
5 years ago
by
jan.bednarik
Browse files
Options
Downloads
Patches
Plain Diff
Senator: News link on homepage
parent
6cf94411
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
senator/models.py
+13
-0
13 additions, 0 deletions
senator/models.py
senator/templates/senator/senator_home_page.html
+5
-1
5 additions, 1 deletion
senator/templates/senator/senator_home_page.html
with
18 additions
and
1 deletion
senator/models.py
+
13
−
0
View file @
dc75e84a
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
senator/templates/senator/senator_home_page.html
+
5
−
1
View file @
dc75e84a
...
@@ -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>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment