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
eedddccb
Commit
eedddccb
authored
6 months ago
by
Alexa Valentová
Browse files
Options
Downloads
Patches
Plain Diff
prepare for form
parent
7eb31468
No related branches found
No related tags found
2 merge requests
!1208
Release
,
!1201
Release career template test
Pipeline
#20271
passed
6 months ago
Stage: build
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
main/forms.py
+5
-0
5 additions, 0 deletions
main/forms.py
main/models.py
+27
-1
27 additions, 1 deletion
main/models.py
with
32 additions
and
1 deletion
main/forms.py
+
5
−
0
View file @
eedddccb
import
os
import
tempfile
from
django
import
forms
from
shared.forms
import
ArticlesPageForm
as
SharedArticlesPageForm
from
shared.forms
import
JekyllImportForm
as
SharedJekyllImportForm
...
...
@@ -7,6 +8,10 @@ from shared.forms import JekyllImportForm as SharedJekyllImportForm
from
.tasks
import
import_jekyll_articles
class
CareerSubmissionForm
(
forms
.
Form
):
pass
class
JekyllImportForm
(
SharedJekyllImportForm
):
def
handle_import
(
self
):
lock_file_name
=
os
.
path
.
join
(
...
...
This diff is collapsed.
Click to expand it.
main/models.py
+
27
−
1
View file @
eedddccb
...
...
@@ -9,6 +9,8 @@ from wagtail.fields import RichTextField, StreamField
from
wagtail.models
import
Page
from
wagtailmetadata.models
import
MetadataPageMixin
from
datetime
import
date
from
django.contrib
import
messages
from
django.shortcuts
import
render
from
shared
import
blocks
as
shared_blocks
from
shared.const
import
RICH_TEXT_DEFAULT_FEATURES
...
...
@@ -32,7 +34,7 @@ from shared.models import ( # MenuMixin,
from
shared.utils
import
make_promote_panels
from
.
import
blocks
from
.forms
import
MainArticlesPageForm
from
.forms
import
MainArticlesPageForm
,
CareerSubmissionForm
class
MainHomePage
(
MainHomePageMixin
):
...
...
@@ -520,6 +522,30 @@ class MainCareerPage(
parent_page_types
=
[
"
main.MainCareersPage
"
]
def
serve
(
self
,
request
):
form
=
None
if
request
.
method
==
'
POST
'
:
form
=
CareerSubmissionForm
(
request
.
POST
)
if
form
.
is_valid
():
# TODO
pass
messages
.
add_message
(
request
,
messages
.
SUCCESS
,
"
Přihláška odeslána.
"
)
else
:
form
=
CareerSubmissionForm
()
return
render
(
request
,
self
.
template
,
{
'
page
'
:
self
,
'
self
'
:
self
,
'
form
'
:
form
,
})
class
Meta
:
verbose_name
=
"
Pracovní nabídka
"
...
...
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