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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TO
Maják
Commits
db20b3a8
Commit
db20b3a8
authored
2 years ago
by
OndraRehounek
Browse files
Options
Downloads
Patches
Plain Diff
main: fix codestyle etc.
parent
5bd792bc
No related branches found
No related tags found
2 merge requests
!607
Pirati.cz
,
!575
Feature/pirati cz
Pipeline
#9340
passed
2 years ago
Stage: build
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
main/models.py
+12
-1
12 additions, 1 deletion
main/models.py
main/templates/main/includes/layout/header.html
+27
-27
27 additions, 27 deletions
main/templates/main/includes/layout/header.html
with
39 additions
and
28 deletions
main/models.py
+
12
−
1
View file @
db20b3a8
from
datetime
import
timedelta
from
functools
import
cached_property
from
django.conf
import
settings
...
...
@@ -5,6 +6,7 @@ from django.core.paginator import Paginator
from
django.db
import
models
from
django.http
import
HttpResponseRedirect
from
django.shortcuts
import
render
from
django.utils
import
timezone
from
modelcluster.contrib.taggit
import
ClusterTaggableManager
from
modelcluster.fields
import
ParentalKey
from
taggit.models
import
TaggedItemBase
...
...
@@ -172,7 +174,7 @@ class MainHomePage(MenuMixin, ExtendedMetadataHomePageMixin, MetadataPageMixin,
class
MainWorkPage
(
ExtendedMetadataPageMixin
,
SubpageMixin
,
MetadataPageMixin
,
Page
):
perex
=
models
.
TextField
()
timeline
=
StreamField
(
timeline
=
StreamField
(
# TODO delete
[
(
"
article_list
"
,
...
...
@@ -198,6 +200,14 @@ class MainWorkPage(ExtendedMetadataPageMixin, SubpageMixin, MetadataPageMixin, P
class
Meta
:
verbose_name
=
"
Piráti pracují
"
def
get_context
(
self
,
request
,
*
args
,
**
kwargs
):
ctx
=
super
().
get_context
(
request
,
args
,
kwargs
)
last_month
=
timezone
.
now
().
today
().
replace
(
day
=
1
)
-
timedelta
(
days
=
1
)
first_day_of_last_month
=
last_month
.
replace
(
day
=
1
)
article_qs
=
MainArticlePage
.
objects
.
filter
(
date__gt
=
first_day_of_last_month
)
# article_data_list =
return
ctx
class
MainArticleTag
(
TaggedItemBase
):
content_object
=
ParentalKey
(
"
main.MainArticlePage
"
,
on_delete
=
models
.
CASCADE
)
...
...
@@ -229,6 +239,7 @@ class MainArticlePage(
content_panels
=
ArticleMixin
.
content_panels
+
[
FieldPanel
(
"
author_page
"
),
FieldPanel
(
"
region
"
),
FieldPanel
(
"
tags
"
),
]
...
...
This diff is collapsed.
Click to expand it.
main/templates/main/includes/layout/header.html
+
27
−
27
View file @
db20b3a8
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