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
21ca7669
Commit
21ca7669
authored
2 years ago
by
quido.zientek
Browse files
Options
Downloads
Patches
Plain Diff
[FEATURE] set month name to czech
parent
765230de
No related branches found
No related tags found
3 merge requests
!607
Pirati.cz
,
!604
Feature/pirati cz quidecek
,
!575
Feature/pirati cz
Pipeline
#9596
passed
2 years ago
Stage: build
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
elections2021/constants.py
+15
-0
15 additions, 0 deletions
elections2021/constants.py
main/models.py
+6
-2
6 additions, 2 deletions
main/models.py
with
21 additions
and
2 deletions
elections2021/constants.py
+
15
−
0
View file @
21ca7669
...
@@ -125,6 +125,21 @@ REGION_NAME_VARIANT = {code: name2 for code, slug, name, name2 in REGION_DATA}
...
@@ -125,6 +125,21 @@ REGION_NAME_VARIANT = {code: name2 for code, slug, name, name2 in REGION_DATA}
REGION_SLUGS
=
{
slug
:
code
for
code
,
slug
,
name
,
name2
in
REGION_DATA
}
REGION_SLUGS
=
{
slug
:
code
for
code
,
slug
,
name
,
name2
in
REGION_DATA
}
REGION_OPTIONS
=
[(
slug
,
name
)
for
code
,
slug
,
name
,
name2
in
REGION_DATA
]
REGION_OPTIONS
=
[(
slug
,
name
)
for
code
,
slug
,
name
,
name2
in
REGION_DATA
]
MONTH_NAMES
=
[
"
Leden
"
,
"
Únor
"
,
"
Březen
"
,
"
Duben
"
,
"
Květen
"
,
"
Červen
"
,
"
Červenec
"
,
"
Srpen
"
,
"
Září
"
,
"
Říjen
"
,
"
Listopad
"
,
"
Prosinec
"
,
]
PIRATES
=
"
pirati
"
PIRATES
=
"
pirati
"
STAN
=
"
stan
"
STAN
=
"
stan
"
PARTY_CHOICES
=
((
PIRATES
,
"
Piráti
"
),
(
STAN
,
"
STAN
"
))
PARTY_CHOICES
=
((
PIRATES
,
"
Piráti
"
),
(
STAN
,
"
STAN
"
))
...
...
This diff is collapsed.
Click to expand it.
main/models.py
+
6
−
2
View file @
21ca7669
import
locale
from
datetime
import
timedelta
from
datetime
import
timedelta
from
functools
import
cached_property
from
functools
import
cached_property
...
@@ -23,7 +24,10 @@ from wagtail.core.fields import RichTextField, StreamField
...
@@ -23,7 +24,10 @@ from wagtail.core.fields import RichTextField, StreamField
from
wagtail.core.models
import
Page
from
wagtail.core.models
import
Page
from
wagtailmetadata.models
import
MetadataPageMixin
from
wagtailmetadata.models
import
MetadataPageMixin
from
elections2021.constants
import
REGION_CHOICES
# pozor, import ze sousedního modulu
from
elections2021.constants
import
(
# pozor, import ze sousedního modulu
MONTH_NAMES
,
REGION_CHOICES
,
)
from
shared.const
import
RICH_TEXT_DEFAULT_FEATURES
from
shared.const
import
RICH_TEXT_DEFAULT_FEATURES
from
shared.forms
import
SubscribeForm
from
shared.forms
import
SubscribeForm
from
shared.models
import
(
# MenuMixin,
from
shared.models
import
(
# MenuMixin,
...
@@ -380,7 +384,7 @@ class MainArticlesPage(
...
@@ -380,7 +384,7 @@ class MainArticlesPage(
def
get_empty_month_data
(
date_obj
):
def
get_empty_month_data
(
date_obj
):
return
{
return
{
"
month_number
"
:
date_obj
.
month
,
"
month_number
"
:
date_obj
.
month
,
"
month_text
"
:
date_obj
.
strftime
(
"
%B
"
)
,
"
month_text
"
:
MONTH_NAMES
[
date_obj
.
month
-
1
]
,
"
left_column
"
:
[],
"
left_column
"
:
[],
"
right_column
"
:
[],
"
right_column
"
:
[],
}
}
...
...
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