Skip to content

Commit

Permalink
Added editable CTA to homepage
Browse files Browse the repository at this point in the history
  • Loading branch information
katporks committed Apr 6, 2024
1 parent b5d1068 commit c5ea4f8
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 7 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ makemessages:
@docker compose -f docker-compose.dev.yml run --rm web python manage.py makemessages -l fr
@docker compose -f docker-compose.dev.yml run --rm web python manage.py makemessages -l es

makemigrations:
@docker compose -f docker-compose.dev.yml run --rm web python manage.py makemigrations
@docker compose -f docker-compose.dev.yml run --rm web python manage.py migrate

makecompile:
@docker compose -f docker-compose.dev.yml run --rm web python manage.py compilemessages

Expand Down
18 changes: 18 additions & 0 deletions home/migrations/0003_homepage_landing_page_cta.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 4.2.7 on 2024-04-05 23:57

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('home', '0002_create_homepage'),
]

operations = [
migrations.AddField(
model_name='homepage',
name='landing_page_cta',
field=models.CharField(max_length=100, null=True),
),
]
9 changes: 8 additions & 1 deletion home/models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
from django.db import models
from wagtail.admin.panels import FieldPanel
from wagtail.models import Page


class HomePage(Page):
pass
templates = "home/home_page.html"

landing_page_cta = models.CharField(max_length=100, blank=False, null=True)

content_panels = Page.content_panels + [
FieldPanel("landing_page_cta"),
]
7 changes: 1 addition & 6 deletions home/templates/home/home_page.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,5 @@
{% endcompress css %}
{% endblock extra_css %}
{% block content %}
{% comment %} <p class="bg-hot-red">Home weeee</p>
<p class="bg-violet-50">This is the homepage</p> {% endcomment %}
{% comment %}
Delete the line below if you're just getting started and want to remove the welcome screen!
{% endcomment %}
{% comment %} {% include "home/welcome_page.html" %} {% endcomment %}
{{ self.landing_page_cta }}
{% endblock content %}
2 changes: 2 additions & 0 deletions hot_osm/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"utils",
"wagtail.contrib.forms",
"wagtail.contrib.redirects",
"wagtail.contrib.settings",
"wagtail.embeds",
"wagtail.sites",
"wagtail.users",
Expand Down Expand Up @@ -84,6 +85,7 @@
"django.template.context_processors.request",
"django.contrib.auth.context_processors.auth",
"django.contrib.messages.context_processors.messages",
"wagtail.contrib.settings.context_processors.settings",
],
},
},
Expand Down

0 comments on commit c5ea4f8

Please sign in to comment.