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
9bc97f70
Commit
9bc97f70
authored
4 years ago
by
jan.bednarik
Browse files
Options
Downloads
Patches
Plain Diff
majak: Improve comments in code
parent
ad559ac9
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
districts/models.py
+8
-0
8 additions, 0 deletions
districts/models.py
home/models.py
+10
-0
10 additions, 0 deletions
home/models.py
senat_campaign/models.py
+42
-2
42 additions, 2 deletions
senat_campaign/models.py
senate/models.py
+8
-0
8 additions, 0 deletions
senate/models.py
with
68 additions
and
2 deletions
districts/models.py
+
8
−
0
View file @
9bc97f70
...
@@ -9,10 +9,14 @@ from tuning import help
...
@@ -9,10 +9,14 @@ from tuning import help
class
DistrictsHomePage
(
MetadataPageMixin
,
Page
):
class
DistrictsHomePage
(
MetadataPageMixin
,
Page
):
### FIELDS
matomo_id
=
models
.
IntegerField
(
matomo_id
=
models
.
IntegerField
(
"
Matomo ID pro sledování návštěvnosti
"
,
blank
=
True
,
null
=
True
"
Matomo ID pro sledování návštěvnosti
"
,
blank
=
True
,
null
=
True
)
)
### PANELS
promote_panels
=
[
promote_panels
=
[
MultiFieldPanel
(
MultiFieldPanel
(
[
[
...
@@ -29,7 +33,11 @@ class DistrictsHomePage(MetadataPageMixin, Page):
...
@@ -29,7 +33,11 @@ class DistrictsHomePage(MetadataPageMixin, Page):
FieldPanel
(
"
matomo_id
"
),
FieldPanel
(
"
matomo_id
"
),
]
]
### RELATIONS
subpage_types
=
[]
subpage_types
=
[]
### OTHERS
class
Meta
:
class
Meta
:
verbose_name
=
"
Krajský rozcestník
"
verbose_name
=
"
Krajský rozcestník
"
This diff is collapsed.
Click to expand it.
home/models.py
+
10
−
0
View file @
9bc97f70
...
@@ -4,12 +4,22 @@ from wagtail.core.models import Page
...
@@ -4,12 +4,22 @@ from wagtail.core.models import Page
class
HomeIndexPage
(
Page
):
class
HomeIndexPage
(
Page
):
### FIELDS
body
=
RichTextField
(
"
obsah
"
)
body
=
RichTextField
(
"
obsah
"
)
### PANELS
content_panels
=
Page
.
content_panels
+
[
content_panels
=
Page
.
content_panels
+
[
FieldPanel
(
"
body
"
),
FieldPanel
(
"
body
"
),
]
]
### RELATIONS
subpage_types
=
[]
### OTHERS
class
Meta
:
class
Meta
:
verbose_name
=
"
Maják homepage
"
verbose_name
=
"
Maják homepage
"
...
...
This diff is collapsed.
Click to expand it.
senat_campaign/models.py
+
42
−
2
View file @
9bc97f70
...
@@ -54,6 +54,8 @@ class ContactBlock(blocks.StructBlock):
...
@@ -54,6 +54,8 @@ class ContactBlock(blocks.StructBlock):
class
SenatCampaignHomePage
(
Page
,
MetadataPageMixin
,
CalendarMixin
):
class
SenatCampaignHomePage
(
Page
,
MetadataPageMixin
,
CalendarMixin
):
### FIELDS
# top section
# top section
headline
=
models
.
CharField
(
"
podtitulek pod jménem
"
,
max_length
=
250
,
blank
=
True
)
headline
=
models
.
CharField
(
"
podtitulek pod jménem
"
,
max_length
=
250
,
blank
=
True
)
top_photo
=
models
.
ForeignKey
(
top_photo
=
models
.
ForeignKey
(
...
@@ -127,6 +129,8 @@ class SenatCampaignHomePage(Page, MetadataPageMixin, CalendarMixin):
...
@@ -127,6 +129,8 @@ class SenatCampaignHomePage(Page, MetadataPageMixin, CalendarMixin):
"
Matomo ID pro sledování návštěvnosti
"
,
blank
=
True
,
null
=
True
"
Matomo ID pro sledování návštěvnosti
"
,
blank
=
True
,
null
=
True
)
)
### PANELS
content_panels
=
Page
.
content_panels
+
[
content_panels
=
Page
.
content_panels
+
[
MultiFieldPanel
(
MultiFieldPanel
(
[
[
...
@@ -185,12 +189,16 @@ class SenatCampaignHomePage(Page, MetadataPageMixin, CalendarMixin):
...
@@ -185,12 +189,16 @@ class SenatCampaignHomePage(Page, MetadataPageMixin, CalendarMixin):
StreamFieldPanel
(
"
contacts
"
),
StreamFieldPanel
(
"
contacts
"
),
]
]
### RELATIONS
subpage_types
=
[
subpage_types
=
[
"
senat_campaign.SenatCampaignNewsIndexPage
"
,
"
senat_campaign.SenatCampaignNewsIndexPage
"
,
"
senat_campaign.SenatCampaignProgramPage
"
,
"
senat_campaign.SenatCampaignProgramPage
"
,
"
senat_campaign.SenatCampaignCookiesPage
"
,
"
senat_campaign.SenatCampaignCookiesPage
"
,
]
]
### OTHERS
# flag for rendering anchor links in menu
# flag for rendering anchor links in menu
is_home
=
True
is_home
=
True
...
@@ -276,8 +284,9 @@ class SenatCampaignHomePage(Page, MetadataPageMixin, CalendarMixin):
...
@@ -276,8 +284,9 @@ class SenatCampaignHomePage(Page, MetadataPageMixin, CalendarMixin):
class
SenatCampaignNewsIndexPage
(
Page
,
SubpageMixin
,
MetadataPageMixin
):
class
SenatCampaignNewsIndexPage
(
Page
,
SubpageMixin
,
MetadataPageMixin
):
parent_page_types
=
[
"
senat_campaign.SenatCampaignHomePage
"
]
### FIELDS
subpage_types
=
[
"
senat_campaign.SenatCampaignNewsPage
"
]
### PANELS
promote_panels
=
[
promote_panels
=
[
MultiFieldPanel
(
MultiFieldPanel
(
...
@@ -294,6 +303,13 @@ class SenatCampaignNewsIndexPage(Page, SubpageMixin, MetadataPageMixin):
...
@@ -294,6 +303,13 @@ class SenatCampaignNewsIndexPage(Page, SubpageMixin, MetadataPageMixin):
settings_panels
=
[]
settings_panels
=
[]
### RELATIONS
parent_page_types
=
[
"
senat_campaign.SenatCampaignHomePage
"
]
subpage_types
=
[
"
senat_campaign.SenatCampaignNewsPage
"
]
### OTHERS
# flag for rendering anchor links in menu
# flag for rendering anchor links in menu
is_home
=
False
is_home
=
False
...
@@ -308,6 +324,8 @@ class SenatCampaignNewsIndexPage(Page, SubpageMixin, MetadataPageMixin):
...
@@ -308,6 +324,8 @@ class SenatCampaignNewsIndexPage(Page, SubpageMixin, MetadataPageMixin):
class
SenatCampaignNewsPage
(
Page
,
SubpageMixin
,
MetadataPageMixin
):
class
SenatCampaignNewsPage
(
Page
,
SubpageMixin
,
MetadataPageMixin
):
### FIELDS
date
=
models
.
DateField
(
"
datum
"
)
date
=
models
.
DateField
(
"
datum
"
)
perex
=
models
.
TextField
(
"
perex
"
)
perex
=
models
.
TextField
(
"
perex
"
)
body
=
RichTextField
(
"
článek
"
,
blank
=
True
)
body
=
RichTextField
(
"
článek
"
,
blank
=
True
)
...
@@ -321,6 +339,8 @@ class SenatCampaignNewsPage(Page, SubpageMixin, MetadataPageMixin):
...
@@ -321,6 +339,8 @@ class SenatCampaignNewsPage(Page, SubpageMixin, MetadataPageMixin):
# we will use photo as search image
# we will use photo as search image
search_image
=
None
search_image
=
None
### PANELS
content_panels
=
Page
.
content_panels
+
[
content_panels
=
Page
.
content_panels
+
[
FieldPanel
(
"
date
"
),
FieldPanel
(
"
date
"
),
FieldPanel
(
"
perex
"
),
FieldPanel
(
"
perex
"
),
...
@@ -345,9 +365,13 @@ class SenatCampaignNewsPage(Page, SubpageMixin, MetadataPageMixin):
...
@@ -345,9 +365,13 @@ class SenatCampaignNewsPage(Page, SubpageMixin, MetadataPageMixin):
),
),
]
]
### RELATIONS
parent_page_types
=
[
"
senat_campaign.SenatCampaignNewsIndexPage
"
]
parent_page_types
=
[
"
senat_campaign.SenatCampaignNewsIndexPage
"
]
subpage_types
=
[]
subpage_types
=
[]
### OTHERS
# flag for rendering anchor links in menu
# flag for rendering anchor links in menu
is_home
=
False
is_home
=
False
...
@@ -394,6 +418,8 @@ class ProgramBlock(blocks.StructBlock):
...
@@ -394,6 +418,8 @@ class ProgramBlock(blocks.StructBlock):
class
SenatCampaignProgramPage
(
Page
,
SubpageMixin
,
MetadataPageMixin
):
class
SenatCampaignProgramPage
(
Page
,
SubpageMixin
,
MetadataPageMixin
):
### FIELDS
committee_preference
=
StreamField
(
committee_preference
=
StreamField
(
[(
"
committee
"
,
blocks
.
CharBlock
(
label
=
"
výbor či komise
"
))],
[(
"
committee
"
,
blocks
.
CharBlock
(
label
=
"
výbor či komise
"
))],
verbose_name
=
"
preferované výbory a komise
"
,
verbose_name
=
"
preferované výbory a komise
"
,
...
@@ -403,6 +429,8 @@ class SenatCampaignProgramPage(Page, SubpageMixin, MetadataPageMixin):
...
@@ -403,6 +429,8 @@ class SenatCampaignProgramPage(Page, SubpageMixin, MetadataPageMixin):
[(
"
item
"
,
ProgramBlock
())],
verbose_name
=
"
programové body
"
,
blank
=
True
[(
"
item
"
,
ProgramBlock
())],
verbose_name
=
"
programové body
"
,
blank
=
True
)
)
### PANELS
content_panels
=
Page
.
content_panels
+
[
content_panels
=
Page
.
content_panels
+
[
StreamFieldPanel
(
"
committee_preference
"
),
StreamFieldPanel
(
"
committee_preference
"
),
StreamFieldPanel
(
"
content
"
),
StreamFieldPanel
(
"
content
"
),
...
@@ -423,9 +451,13 @@ class SenatCampaignProgramPage(Page, SubpageMixin, MetadataPageMixin):
...
@@ -423,9 +451,13 @@ class SenatCampaignProgramPage(Page, SubpageMixin, MetadataPageMixin):
settings_panels
=
[]
settings_panels
=
[]
### RELATIONS
parent_page_types
=
[
"
senat_campaign.SenatCampaignHomePage
"
]
parent_page_types
=
[
"
senat_campaign.SenatCampaignHomePage
"
]
subpage_types
=
[]
subpage_types
=
[]
### OTHERS
# flag for rendering anchor links in menu
# flag for rendering anchor links in menu
is_home
=
False
is_home
=
False
...
@@ -434,8 +466,12 @@ class SenatCampaignProgramPage(Page, SubpageMixin, MetadataPageMixin):
...
@@ -434,8 +466,12 @@ class SenatCampaignProgramPage(Page, SubpageMixin, MetadataPageMixin):
class
SenatCampaignCookiesPage
(
Page
,
SubpageMixin
,
MetadataPageMixin
):
class
SenatCampaignCookiesPage
(
Page
,
SubpageMixin
,
MetadataPageMixin
):
### FIELDS
body
=
RichTextField
(
"
obsah
"
,
blank
=
True
)
body
=
RichTextField
(
"
obsah
"
,
blank
=
True
)
### PANELS
content_panels
=
Page
.
content_panels
+
[
content_panels
=
Page
.
content_panels
+
[
FieldPanel
(
"
body
"
,
classname
=
"
full
"
),
FieldPanel
(
"
body
"
,
classname
=
"
full
"
),
]
]
...
@@ -455,9 +491,13 @@ class SenatCampaignCookiesPage(Page, SubpageMixin, MetadataPageMixin):
...
@@ -455,9 +491,13 @@ class SenatCampaignCookiesPage(Page, SubpageMixin, MetadataPageMixin):
settings_panels
=
[]
settings_panels
=
[]
### RELATIONS
parent_page_types
=
[
"
senat_campaign.SenatCampaignHomePage
"
]
parent_page_types
=
[
"
senat_campaign.SenatCampaignHomePage
"
]
subpage_types
=
[]
subpage_types
=
[]
### OTHERS
# flag for rendering anchor links in menu
# flag for rendering anchor links in menu
is_home
=
False
is_home
=
False
...
...
This diff is collapsed.
Click to expand it.
senate/models.py
+
8
−
0
View file @
9bc97f70
...
@@ -31,6 +31,8 @@ class PersonBlock(blocks.StructBlock):
...
@@ -31,6 +31,8 @@ class PersonBlock(blocks.StructBlock):
class
SenateHomePage
(
MetadataPageMixin
,
Page
):
class
SenateHomePage
(
MetadataPageMixin
,
Page
):
### FIELDS
senators
=
StreamField
(
senators
=
StreamField
(
[(
"
item
"
,
PersonBlock
())],
verbose_name
=
"
naši senátoři
"
,
blank
=
True
[(
"
item
"
,
PersonBlock
())],
verbose_name
=
"
naši senátoři
"
,
blank
=
True
)
)
...
@@ -41,6 +43,8 @@ class SenateHomePage(MetadataPageMixin, Page):
...
@@ -41,6 +43,8 @@ class SenateHomePage(MetadataPageMixin, Page):
"
Matomo ID pro sledování návštěvnosti
"
,
blank
=
True
,
null
=
True
"
Matomo ID pro sledování návštěvnosti
"
,
blank
=
True
,
null
=
True
)
)
### PANELS
content_panels
=
Page
.
content_panels
+
[
content_panels
=
Page
.
content_panels
+
[
StreamFieldPanel
(
"
senators
"
),
StreamFieldPanel
(
"
senators
"
),
StreamFieldPanel
(
"
candidates
"
),
StreamFieldPanel
(
"
candidates
"
),
...
@@ -62,7 +66,11 @@ class SenateHomePage(MetadataPageMixin, Page):
...
@@ -62,7 +66,11 @@ class SenateHomePage(MetadataPageMixin, Page):
FieldPanel
(
"
matomo_id
"
),
FieldPanel
(
"
matomo_id
"
),
]
]
### RELATIONS
subpage_types
=
[]
subpage_types
=
[]
### OTHERS
class
Meta
:
class
Meta
:
verbose_name
=
"
Senátní rozcestník
"
verbose_name
=
"
Senátní rozcestník
"
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