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
0bb53313
Commit
0bb53313
authored
4 years ago
by
Dan Nepejchal
Committed by
jan.bednarik
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Regulace konopí - initial commit
- alter Page names with app name prefix
parent
1f826fb4
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
regulace_konopi/migrations/0001_initial.py
+3
-3
3 additions, 3 deletions
regulace_konopi/migrations/0001_initial.py
regulace_konopi/models.py
+6
-6
6 additions, 6 deletions
regulace_konopi/models.py
with
9 additions
and
9 deletions
regulace_konopi/migrations/0001_initial.py
+
3
−
3
View file @
0bb53313
...
@@ -20,7 +20,7 @@ class Migration(migrations.Migration):
...
@@ -20,7 +20,7 @@ class Migration(migrations.Migration):
operations
=
[
operations
=
[
migrations
.
CreateModel
(
migrations
.
CreateModel
(
name
=
'
SubPage
'
,
name
=
'
Regkon
SubPage
'
,
fields
=
[
fields
=
[
(
'
page_ptr
'
,
models
.
OneToOneField
(
auto_created
=
True
,
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
parent_link
=
True
,
primary_key
=
True
,
serialize
=
False
,
to
=
'
wagtailcore.page
'
)),
(
'
page_ptr
'
,
models
.
OneToOneField
(
auto_created
=
True
,
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
parent_link
=
True
,
primary_key
=
True
,
serialize
=
False
,
to
=
'
wagtailcore.page
'
)),
(
'
content
'
,
wagtail
.
core
.
fields
.
StreamField
([(
'
title
'
,
wagtail
.
core
.
blocks
.
CharBlock
(
icon
=
'
title
'
,
label
=
'
nadpis
'
)),
(
'
text
'
,
wagtail
.
core
.
blocks
.
RichTextBlock
(
features
=
[
'
h2
'
,
'
h3
'
,
'
h4
'
,
'
h5
'
,
'
bold
'
,
'
italic
'
,
'
ol
'
,
'
ul
'
,
'
hr
'
,
'
link
'
,
'
document-link
'
,
'
image
'
,
'
superscript
'
,
'
subscript
'
,
'
strikethrough
'
,
'
blockquote
'
],
label
=
'
text
'
)),
(
'
carousel
'
,
wagtail
.
core
.
blocks
.
ListBlock
(
wagtail
.
images
.
blocks
.
ImageChooserBlock
(
label
=
'
obrázek
'
),
icon
=
'
image
'
,
label
=
'
carousel
'
)),
(
'
FAQ
'
,
wagtail
.
core
.
blocks
.
ListBlock
(
wagtail
.
core
.
blocks
.
StructBlock
([(
'
question
'
,
wagtail
.
core
.
blocks
.
TextBlock
()),
(
'
answer
'
,
wagtail
.
core
.
blocks
.
RichTextBlock
())],
template
=
'
regulace_konopi/blocks/faq.html
'
),
label
=
'
faq
'
)),
(
'
meps
'
,
wagtail
.
core
.
blocks
.
StructBlock
([(
'
name
'
,
wagtail
.
core
.
blocks
.
CharBlock
(
label
=
'
název
'
)),
(
'
mep
'
,
wagtail
.
core
.
blocks
.
ListBlock
(
wagtail
.
core
.
blocks
.
StructBlock
([(
'
name
'
,
wagtail
.
core
.
blocks
.
CharBlock
(
label
=
'
jméno
'
)),
(
'
approved
'
,
wagtail
.
core
.
blocks
.
ChoiceBlock
(
choices
=
[(
1
,
'
schváleno
'
),
(
0
,
'
odmítá
'
),
(
-
1
,
'
nevyjádřil se
'
)],
label
=
'
hlasoval
'
))])))],
template
=
'
regulace_konopi/blocks/party.html
'
))],
blank
=
True
,
verbose_name
=
'
obsah stránky
'
)),
(
'
content
'
,
wagtail
.
core
.
fields
.
StreamField
([(
'
title
'
,
wagtail
.
core
.
blocks
.
CharBlock
(
icon
=
'
title
'
,
label
=
'
nadpis
'
)),
(
'
text
'
,
wagtail
.
core
.
blocks
.
RichTextBlock
(
features
=
[
'
h2
'
,
'
h3
'
,
'
h4
'
,
'
h5
'
,
'
bold
'
,
'
italic
'
,
'
ol
'
,
'
ul
'
,
'
hr
'
,
'
link
'
,
'
document-link
'
,
'
image
'
,
'
superscript
'
,
'
subscript
'
,
'
strikethrough
'
,
'
blockquote
'
],
label
=
'
text
'
)),
(
'
carousel
'
,
wagtail
.
core
.
blocks
.
ListBlock
(
wagtail
.
images
.
blocks
.
ImageChooserBlock
(
label
=
'
obrázek
'
),
icon
=
'
image
'
,
label
=
'
carousel
'
)),
(
'
FAQ
'
,
wagtail
.
core
.
blocks
.
ListBlock
(
wagtail
.
core
.
blocks
.
StructBlock
([(
'
question
'
,
wagtail
.
core
.
blocks
.
TextBlock
()),
(
'
answer
'
,
wagtail
.
core
.
blocks
.
RichTextBlock
())],
template
=
'
regulace_konopi/blocks/faq.html
'
),
label
=
'
faq
'
)),
(
'
meps
'
,
wagtail
.
core
.
blocks
.
StructBlock
([(
'
name
'
,
wagtail
.
core
.
blocks
.
CharBlock
(
label
=
'
název
'
)),
(
'
mep
'
,
wagtail
.
core
.
blocks
.
ListBlock
(
wagtail
.
core
.
blocks
.
StructBlock
([(
'
name
'
,
wagtail
.
core
.
blocks
.
CharBlock
(
label
=
'
jméno
'
)),
(
'
approved
'
,
wagtail
.
core
.
blocks
.
ChoiceBlock
(
choices
=
[(
1
,
'
schváleno
'
),
(
0
,
'
odmítá
'
),
(
-
1
,
'
nevyjádřil se
'
)],
label
=
'
hlasoval
'
))])))],
template
=
'
regulace_konopi/blocks/party.html
'
))],
blank
=
True
,
verbose_name
=
'
obsah stránky
'
)),
...
@@ -32,12 +32,12 @@ class Migration(migrations.Migration):
...
@@ -32,12 +32,12 @@ class Migration(migrations.Migration):
bases
=
(
'
wagtailcore.page
'
,
uniweb
.
models
.
SubpageMixin
,
wagtailmetadata
.
models
.
MetadataMixin
,
models
.
Model
),
bases
=
(
'
wagtailcore.page
'
,
uniweb
.
models
.
SubpageMixin
,
wagtailmetadata
.
models
.
MetadataMixin
,
models
.
Model
),
),
),
migrations
.
CreateModel
(
migrations
.
CreateModel
(
name
=
'
HomePage
'
,
name
=
'
Regkon
HomePage
'
,
fields
=
[
fields
=
[
(
'
page_ptr
'
,
models
.
OneToOneField
(
auto_created
=
True
,
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
parent_link
=
True
,
primary_key
=
True
,
serialize
=
False
,
to
=
'
wagtailcore.page
'
)),
(
'
page_ptr
'
,
models
.
OneToOneField
(
auto_created
=
True
,
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
parent_link
=
True
,
primary_key
=
True
,
serialize
=
False
,
to
=
'
wagtailcore.page
'
)),
(
'
content
'
,
wagtail
.
core
.
fields
.
StreamField
([(
'
title
'
,
wagtail
.
core
.
blocks
.
CharBlock
(
icon
=
'
title
'
,
label
=
'
nadpis
'
)),
(
'
text
'
,
wagtail
.
core
.
blocks
.
RichTextBlock
(
features
=
[
'
h2
'
,
'
h3
'
,
'
h4
'
,
'
h5
'
,
'
bold
'
,
'
italic
'
,
'
ol
'
,
'
ul
'
,
'
hr
'
,
'
link
'
,
'
document-link
'
,
'
image
'
,
'
superscript
'
,
'
subscript
'
,
'
strikethrough
'
,
'
blockquote
'
],
label
=
'
text
'
)),
(
'
carousel
'
,
wagtail
.
core
.
blocks
.
ListBlock
(
wagtail
.
images
.
blocks
.
ImageChooserBlock
(
label
=
'
obrázek
'
),
icon
=
'
image
'
,
label
=
'
carousel
'
))],
blank
=
True
,
verbose_name
=
'
obsah stránky
'
)),
(
'
content
'
,
wagtail
.
core
.
fields
.
StreamField
([(
'
title
'
,
wagtail
.
core
.
blocks
.
CharBlock
(
icon
=
'
title
'
,
label
=
'
nadpis
'
)),
(
'
text
'
,
wagtail
.
core
.
blocks
.
RichTextBlock
(
features
=
[
'
h2
'
,
'
h3
'
,
'
h4
'
,
'
h5
'
,
'
bold
'
,
'
italic
'
,
'
ol
'
,
'
ul
'
,
'
hr
'
,
'
link
'
,
'
document-link
'
,
'
image
'
,
'
superscript
'
,
'
subscript
'
,
'
strikethrough
'
,
'
blockquote
'
],
label
=
'
text
'
)),
(
'
carousel
'
,
wagtail
.
core
.
blocks
.
ListBlock
(
wagtail
.
images
.
blocks
.
ImageChooserBlock
(
label
=
'
obrázek
'
),
icon
=
'
image
'
,
label
=
'
carousel
'
))],
blank
=
True
,
verbose_name
=
'
obsah stránky
'
)),
(
'
matomo_id
'
,
models
.
IntegerField
(
blank
=
True
,
null
=
True
,
verbose_name
=
'
Matomo ID pro sledování návštěvnosti
'
)),
(
'
matomo_id
'
,
models
.
IntegerField
(
blank
=
True
,
null
=
True
,
verbose_name
=
'
Matomo ID pro sledování návštěvnosti
'
)),
(
'
top_menu
'
,
wagtail
.
core
.
fields
.
StreamField
([(
'
item
'
,
wagtail
.
core
.
blocks
.
StructBlock
([(
'
name
'
,
wagtail
.
core
.
blocks
.
CharBlock
(
label
=
'
název
'
)),
(
'
page
'
,
wagtail
.
core
.
blocks
.
PageChooserBlock
(
label
=
'
stránka
'
,
page_type
=
[
'
regulace_konopi.HomePage
'
,
'
regulace_konopi.SubPage
'
]))]))],
blank
=
True
,
verbose_name
=
'
horní menu
'
)),
(
'
top_menu
'
,
wagtail
.
core
.
fields
.
StreamField
([(
'
item
'
,
wagtail
.
core
.
blocks
.
StructBlock
([(
'
name
'
,
wagtail
.
core
.
blocks
.
CharBlock
(
label
=
'
název
'
)),
(
'
page
'
,
wagtail
.
core
.
blocks
.
PageChooserBlock
(
label
=
'
stránka
'
,
page_type
=
[
'
regulace_konopi.
Regkon
HomePage
'
,
'
regulace_konopi.
Regkon
SubPage
'
]))]))],
blank
=
True
,
verbose_name
=
'
horní menu
'
)),
(
'
search_image
'
,
models
.
ForeignKey
(
blank
=
True
,
null
=
True
,
on_delete
=
django
.
db
.
models
.
deletion
.
SET_NULL
,
related_name
=
'
+
'
,
to
=
'
wagtailimages.image
'
,
verbose_name
=
'
Search image
'
)),
(
'
search_image
'
,
models
.
ForeignKey
(
blank
=
True
,
null
=
True
,
on_delete
=
django
.
db
.
models
.
deletion
.
SET_NULL
,
related_name
=
'
+
'
,
to
=
'
wagtailimages.image
'
,
verbose_name
=
'
Search image
'
)),
],
],
options
=
{
options
=
{
...
...
This diff is collapsed.
Click to expand it.
regulace_konopi/models.py
+
6
−
6
View file @
0bb53313
...
@@ -44,7 +44,7 @@ class MenuItemBlock(blocks.StructBlock):
...
@@ -44,7 +44,7 @@ class MenuItemBlock(blocks.StructBlock):
name
=
blocks
.
CharBlock
(
label
=
"
název
"
)
name
=
blocks
.
CharBlock
(
label
=
"
název
"
)
page
=
blocks
.
PageChooserBlock
(
page
=
blocks
.
PageChooserBlock
(
label
=
"
stránka
"
,
label
=
"
stránka
"
,
page_type
=
[
"
regulace_konopi.HomePage
"
,
"
regulace_konopi.SubPage
"
],
page_type
=
[
"
regulace_konopi.
Regkon
HomePage
"
,
"
regulace_konopi.
Regkon
SubPage
"
],
)
)
class
Meta
:
class
Meta
:
...
@@ -72,7 +72,7 @@ class FaqBlock(blocks.StructBlock):
...
@@ -72,7 +72,7 @@ class FaqBlock(blocks.StructBlock):
answer
=
blocks
.
RichTextBlock
()
answer
=
blocks
.
RichTextBlock
()
class
HomePage
(
MetadataPageMixin
,
Page
):
class
Regkon
HomePage
(
MetadataPageMixin
,
Page
):
### FIELDS
### FIELDS
content
=
StreamField
(
content
=
StreamField
(
[
[
...
@@ -122,7 +122,7 @@ class HomePage(MetadataPageMixin, Page):
...
@@ -122,7 +122,7 @@ class HomePage(MetadataPageMixin, Page):
### RELATIONS
### RELATIONS
subpage_types
=
[
subpage_types
=
[
"
regulace_konopi.SubPage
"
,
"
regulace_konopi.
Regkon
SubPage
"
,
]
]
### OTHERS
### OTHERS
...
@@ -135,7 +135,7 @@ class HomePage(MetadataPageMixin, Page):
...
@@ -135,7 +135,7 @@ class HomePage(MetadataPageMixin, Page):
return
self
return
self
class
SubPage
(
Page
,
SubpageMixin
,
MetadataPageMixin
):
class
Regkon
SubPage
(
Page
,
SubpageMixin
,
MetadataPageMixin
):
### FIELDS
### FIELDS
content
=
StreamField
(
content
=
StreamField
(
...
@@ -181,7 +181,7 @@ class SubPage(Page, SubpageMixin, MetadataPageMixin):
...
@@ -181,7 +181,7 @@ class SubPage(Page, SubpageMixin, MetadataPageMixin):
### RELATIONS
### RELATIONS
parent_page_types
=
[
"
regulace_konopi.HomePage
"
]
parent_page_types
=
[
"
regulace_konopi.
Regkon
HomePage
"
]
subpage_types
=
[]
subpage_types
=
[]
### OTHERS
### OTHERS
...
@@ -192,7 +192,7 @@ class SubPage(Page, SubpageMixin, MetadataPageMixin):
...
@@ -192,7 +192,7 @@ class SubPage(Page, SubpageMixin, MetadataPageMixin):
@property
@property
def
root_page
(
self
):
def
root_page
(
self
):
if
not
hasattr
(
self
,
"
_root_page
"
):
if
not
hasattr
(
self
,
"
_root_page
"
):
self
.
_root_page
=
self
.
get_ancestors
().
type
(
HomePage
).
specific
().
get
()
self
.
_root_page
=
self
.
get_ancestors
().
type
(
Regkon
HomePage
).
specific
().
get
()
return
self
.
_root_page
return
self
.
_root_page
def
get_meta_image
(
self
):
def
get_meta_image
(
self
):
...
...
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