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
Container registry
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TO
Maják
Commits
588a4aa3
Commit
588a4aa3
authored
3 years ago
by
jan.bednarik
Browse files
Options
Downloads
Patches
Plain Diff
elections2021: Fix calendar
parent
c2a5932a
Branches
Branches containing commit
No related tags found
2 merge requests
!342
elections2021: Fix calendar
,
!341
elections2021: Fix calendar
Pipeline
#4798
passed
3 years ago
Stage: build
Changes
2
Pipelines
3
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
elections2021/models.py
+5
-13
5 additions, 13 deletions
elections2021/models.py
elections2021/templates/elections2021/elections2021_calendar_page.html
+1
-1
1 addition, 1 deletion
.../templates/elections2021/elections2021_calendar_page.html
with
6 additions
and
14 deletions
elections2021/models.py
+
5
−
13
View file @
588a4aa3
...
...
@@ -383,7 +383,7 @@ class Elections2021HomePage(MetadataPageMixin, RoutablePageMixin, Page):
.
live
()
.
specific
()
.
first
()
.
calendar
.
get_
calendar
()
)
@cached_property
...
...
@@ -2428,16 +2428,9 @@ class Elections2021CalendarPage(SubpageMixin, MetadataPageMixin, CalendarMixin,
def
has_calendar
(
self
):
return
self
.
calendar_id
is
not
None
def
get_context
(
self
,
request
):
context
=
super
().
get_context
(
request
)
future_events
=
self
.
calendar
.
future_events
for
event
in
future_events
:
event
[
"
pir
"
]
=
{
"
name
"
:
None
,
"
tags
"
:
[],
"
region
"
:
None
,
}
def
get_calendar
(
self
):
for
event
in
self
.
calendar
.
future_events
:
event
[
"
pir
"
]
=
{
"
name
"
:
None
,
"
tags
"
:
[],
"
region
"
:
None
}
pir_name
=
[]
...
...
@@ -2453,5 +2446,4 @@ class Elections2021CalendarPage(SubpageMixin, MetadataPageMixin, CalendarMixin,
event
[
"
pir
"
][
"
name
"
]
=
"
"
.
join
(
pir_name
)
context
[
"
future_events
"
]
=
future_events
return
context
return
self
.
calendar
This diff is collapsed.
Click to expand it.
elections2021/templates/elections2021/elections2021_calendar_page.html
+
1
−
1
View file @
588a4aa3
...
...
@@ -148,7 +148,7 @@
</div>
<div
class=
"container container--default pt-8 pb-16 px-0 md:px-1"
>
{% for event in future_events %}
{% for event in
page.get_calendar.
future_events %}
{% if not request.GET.tag or request.GET.tag in event.pir.tags %}
{% if not request.GET.region or request.GET.region == event.pir.region %}
<div
class=
"grid grid-cols-12 items-center calendar-table-row my-1"
>
...
...
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