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
79160071
Commit
79160071
authored
5 years ago
by
jan.bednarik
Browse files
Options
Downloads
Patches
Plain Diff
Follow tutorial to change home page
parent
a4fe7d6c
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
home/migrations/0003_homepage_body.py
+19
-0
19 additions, 0 deletions
home/migrations/0003_homepage_body.py
home/models.py
+7
-2
7 additions, 2 deletions
home/models.py
home/templates/home/home_page.html
+4
-16
4 additions, 16 deletions
home/templates/home/home_page.html
with
30 additions
and
18 deletions
home/migrations/0003_homepage_body.py
0 → 100644
+
19
−
0
View file @
79160071
# Generated by Django 3.0.5 on 2020-04-16 15:07
import
wagtail.core.fields
from
django.db
import
migrations
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
"
home
"
,
"
0002_create_homepage
"
),
]
operations
=
[
migrations
.
AddField
(
model_name
=
"
homepage
"
,
name
=
"
body
"
,
field
=
wagtail
.
core
.
fields
.
RichTextField
(
blank
=
True
),
),
]
This diff is collapsed.
Click to expand it.
home/models.py
+
7
−
2
View file @
79160071
from
django.db
import
models
from
wagtail.admin.edit_handlers
import
FieldPanel
from
wagtail.core.fields
import
RichTextField
from
wagtail.core.models
import
Page
class
HomePage
(
Page
):
pass
body
=
RichTextField
(
blank
=
True
)
content_panels
=
Page
.
content_panels
+
[
FieldPanel
(
"
body
"
,
classname
=
"
full
"
),
]
This diff is collapsed.
Click to expand it.
home/templates/home/home_page.html
+
4
−
16
View file @
79160071
{% extends "base.html" %}
{% load static %}
{% block body_class %}template-homepage{% endblock %}
{% block extra_css %}
{% load wagtailcore_tags %}
{% comment %}
Delete the line below if you're just getting started and want to remove the welcome screen!
{% endcomment %}
<link
rel=
"stylesheet"
href=
"{% static 'css/welcome_page.css' %}"
>
{% endblock extra_css %}
{% block body_class %}template-homepage{% endblock %}
{% block content %}
{% comment %}
Delete the line below if you're just getting started and want to remove the welcome screen!
{% endcomment %}
{% include 'home/welcome_page.html' %}
{% endblock content %}
{{ page.body|richtext }}
{% endblock %}
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