Skip to content

Commit

Permalink
Updates to links on the site
Browse files Browse the repository at this point in the history
  • Loading branch information
nanorepublica committed Jun 3, 2024
1 parent c98359a commit ac8ae02
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 6 deletions.
2 changes: 0 additions & 2 deletions bin/post_compile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,5 @@ set -eo pipefail # Exit at first error, including in a pipeline
set -u # Consider unset variables as errors
set -x # Print each command before executing it


python djangosocial/manage.py
python djangosocial/manage.py tailwind build
python djangosocial/manage.py collectstatic --noinput
1 change: 1 addition & 0 deletions dev-templates/docker-compose.override.yml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
services:
djangosocial-django:
build:
context: ./djangosocial
target: django-dev
environment:
- DJANGO_DEBUG=True
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Generated by Django 4.2.13 on 2024-06-03 13:37

from django.db import migrations
import wagtail.admin.forms.choosers
import wagtail.blocks
import wagtail.documents.blocks
import wagtail.fields
import wagtail.images.blocks


class Migration(migrations.Migration):

dependencies = [
('home', '0019_alter_homepage_body'),
]

operations = [
migrations.AlterField(
model_name='aboutpage',
name='body',
field=wagtail.fields.StreamField([('rich_text', wagtail.blocks.RichTextBlock()), ('hero_image', wagtail.blocks.StructBlock([('image', wagtail.images.blocks.ImageChooserBlock(help_text='The image to display.', required=True))])), ('timeline', wagtail.blocks.StructBlock([('timeline_moments', wagtail.blocks.ListBlock(wagtail.blocks.StructBlock([('date', wagtail.blocks.DateBlock()), ('title', wagtail.blocks.CharBlock()), ('description', wagtail.blocks.TextBlock())])))])), ('stats', wagtail.blocks.StructBlock([('title', wagtail.blocks.CharBlock()), ('lead_paragraph', wagtail.blocks.TextBlock()), ('stats', wagtail.blocks.ListBlock(wagtail.blocks.StructBlock([('number', wagtail.blocks.CharBlock()), ('title', wagtail.blocks.CharBlock()), ('description', wagtail.blocks.TextBlock()), ('size', wagtail.blocks.ChoiceBlock(choices=[('small', 'Small'), ('medium', 'Medium'), ('large', 'Large')]))]), max_num=3))])), ('hero', wagtail.blocks.StructBlock([('title', wagtail.blocks.CharBlock()), ('lead_paragraph', wagtail.blocks.TextBlock()), ('image', wagtail.images.blocks.ImageChooserBlock(help_text='The image to display.', required=True))])), ('content_list', wagtail.blocks.StructBlock([('title', wagtail.blocks.CharBlock()), ('lead_paragraph', wagtail.blocks.TextBlock()), ('image', wagtail.images.blocks.ImageChooserBlock()), ('list_title', wagtail.blocks.CharBlock()), ('list_type', wagtail.blocks.CharBlock(help_text='What does the list of represent? (eg roles, events)')), ('content_list', wagtail.blocks.ListBlock(wagtail.blocks.StructBlock([('title', wagtail.blocks.CharBlock()), ('lead_paragraph', wagtail.blocks.TextBlock()), ('link', wagtail.blocks.StructBlock([('link_to', wagtail.blocks.ChoiceBlock(choices=[('page', 'Page'), ('file', 'File'), ('custom_url', 'Custom URL'), ('email', 'Email'), ('anchor', 'Anchor'), ('phone', 'Phone')], classname='link_choice_type_selector', label='Link to', required=False)), ('page', wagtail.blocks.PageChooserBlock(form_classname='page_link', label='Page', required=False)), ('file', wagtail.documents.blocks.DocumentChooserBlock(form_classname='file_link', label='File', required=False)), ('custom_url', wagtail.blocks.CharBlock(form_classname='custom_url_link url_field', label='Custom URL', max_length=300, required=False, validators=[wagtail.admin.forms.choosers.URLOrAbsolutePathValidator()])), ('anchor', wagtail.blocks.CharBlock(form_classname='anchor_link', label='#', max_length=300, required=False)), ('email', wagtail.blocks.EmailBlock(required=False)), ('phone', wagtail.blocks.CharBlock(form_classname='phone_link', label='Phone', max_length=30, required=False)), ('new_window', wagtail.blocks.BooleanBlock(form_classname='new_window_toggle', label='Open in new window', required=False))]))]), max_num=3)), ('more_list_text', wagtail.blocks.CharBlock()), ('more_list_link', wagtail.blocks.StructBlock([('link_to', wagtail.blocks.ChoiceBlock(choices=[('page', 'Page'), ('file', 'File'), ('custom_url', 'Custom URL'), ('email', 'Email'), ('anchor', 'Anchor'), ('phone', 'Phone')], classname='link_choice_type_selector', label='Link to', required=False)), ('page', wagtail.blocks.PageChooserBlock(form_classname='page_link', label='Page', required=False)), ('file', wagtail.documents.blocks.DocumentChooserBlock(form_classname='file_link', label='File', required=False)), ('custom_url', wagtail.blocks.CharBlock(form_classname='custom_url_link url_field', label='Custom URL', max_length=300, required=False, validators=[wagtail.admin.forms.choosers.URLOrAbsolutePathValidator()])), ('anchor', wagtail.blocks.CharBlock(form_classname='anchor_link', label='#', max_length=300, required=False)), ('email', wagtail.blocks.EmailBlock(required=False)), ('phone', wagtail.blocks.CharBlock(form_classname='phone_link', label='Phone', max_length=30, required=False)), ('new_window', wagtail.blocks.BooleanBlock(form_classname='new_window_toggle', label='Open in new window', required=False))]))])), ('content_with_images', wagtail.blocks.StructBlock([('title', wagtail.blocks.CharBlock()), ('lead_paragraph', wagtail.blocks.TextBlock()), ('secondary_paragraph', wagtail.blocks.TextBlock()), ('top_image', wagtail.images.blocks.ImageChooserBlock()), ('bottom_left_image', wagtail.images.blocks.ImageChooserBlock()), ('bottom_center_image', wagtail.images.blocks.ImageChooserBlock()), ('bottom_right_image', wagtail.images.blocks.ImageChooserBlock())])), ('logo_cloud', wagtail.blocks.StructBlock([('title', wagtail.blocks.CharBlock()), ('lead_paragraph', wagtail.blocks.TextBlock()), ('logos', wagtail.blocks.ListBlock(wagtail.images.blocks.ImageChooserBlock()))]))], null=True, use_json_field=True),
),
migrations.AlterField(
model_name='homepage',
name='body',
field=wagtail.fields.StreamField([('rich_text', wagtail.blocks.RichTextBlock()), ('hero_image', wagtail.blocks.StructBlock([('image', wagtail.images.blocks.ImageChooserBlock(help_text='The image to display.', required=True))])), ('gallery', wagtail.blocks.StructBlock([('title', wagtail.blocks.CharBlock(help_text='An optional title for the gallery.', max_length=50, required=False)), ('images', wagtail.blocks.ListBlock(wagtail.blocks.StructBlock([('image', wagtail.images.blocks.ImageChooserBlock(help_text='Choose an image.', required=True)), ('caption', wagtail.blocks.CharBlock(help_text='An optional caption for the image.', required=False))])))])), ('timeline', wagtail.blocks.StructBlock([('timeline_moments', wagtail.blocks.ListBlock(wagtail.blocks.StructBlock([('date', wagtail.blocks.DateBlock()), ('title', wagtail.blocks.CharBlock()), ('description', wagtail.blocks.TextBlock())])))])), ('stats', wagtail.blocks.StructBlock([('title', wagtail.blocks.CharBlock()), ('lead_paragraph', wagtail.blocks.TextBlock()), ('stats', wagtail.blocks.ListBlock(wagtail.blocks.StructBlock([('number', wagtail.blocks.CharBlock()), ('title', wagtail.blocks.CharBlock()), ('description', wagtail.blocks.TextBlock()), ('size', wagtail.blocks.ChoiceBlock(choices=[('small', 'Small'), ('medium', 'Medium'), ('large', 'Large')]))]), max_num=3))])), ('hero', wagtail.blocks.StructBlock([('title', wagtail.blocks.CharBlock()), ('lead_paragraph', wagtail.blocks.TextBlock()), ('image', wagtail.images.blocks.ImageChooserBlock(help_text='The image to display.', required=True))])), ('content_list', wagtail.blocks.StructBlock([('title', wagtail.blocks.CharBlock()), ('lead_paragraph', wagtail.blocks.TextBlock()), ('image', wagtail.images.blocks.ImageChooserBlock()), ('list_title', wagtail.blocks.CharBlock()), ('list_type', wagtail.blocks.CharBlock(help_text='What does the list of represent? (eg roles, events)')), ('content_list', wagtail.blocks.ListBlock(wagtail.blocks.StructBlock([('title', wagtail.blocks.CharBlock()), ('lead_paragraph', wagtail.blocks.TextBlock()), ('link', wagtail.blocks.StructBlock([('link_to', wagtail.blocks.ChoiceBlock(choices=[('page', 'Page'), ('file', 'File'), ('custom_url', 'Custom URL'), ('email', 'Email'), ('anchor', 'Anchor'), ('phone', 'Phone')], classname='link_choice_type_selector', label='Link to', required=False)), ('page', wagtail.blocks.PageChooserBlock(form_classname='page_link', label='Page', required=False)), ('file', wagtail.documents.blocks.DocumentChooserBlock(form_classname='file_link', label='File', required=False)), ('custom_url', wagtail.blocks.CharBlock(form_classname='custom_url_link url_field', label='Custom URL', max_length=300, required=False, validators=[wagtail.admin.forms.choosers.URLOrAbsolutePathValidator()])), ('anchor', wagtail.blocks.CharBlock(form_classname='anchor_link', label='#', max_length=300, required=False)), ('email', wagtail.blocks.EmailBlock(required=False)), ('phone', wagtail.blocks.CharBlock(form_classname='phone_link', label='Phone', max_length=30, required=False)), ('new_window', wagtail.blocks.BooleanBlock(form_classname='new_window_toggle', label='Open in new window', required=False))]))]), max_num=3)), ('more_list_text', wagtail.blocks.CharBlock()), ('more_list_link', wagtail.blocks.StructBlock([('link_to', wagtail.blocks.ChoiceBlock(choices=[('page', 'Page'), ('file', 'File'), ('custom_url', 'Custom URL'), ('email', 'Email'), ('anchor', 'Anchor'), ('phone', 'Phone')], classname='link_choice_type_selector', label='Link to', required=False)), ('page', wagtail.blocks.PageChooserBlock(form_classname='page_link', label='Page', required=False)), ('file', wagtail.documents.blocks.DocumentChooserBlock(form_classname='file_link', label='File', required=False)), ('custom_url', wagtail.blocks.CharBlock(form_classname='custom_url_link url_field', label='Custom URL', max_length=300, required=False, validators=[wagtail.admin.forms.choosers.URLOrAbsolutePathValidator()])), ('anchor', wagtail.blocks.CharBlock(form_classname='anchor_link', label='#', max_length=300, required=False)), ('email', wagtail.blocks.EmailBlock(required=False)), ('phone', wagtail.blocks.CharBlock(form_classname='phone_link', label='Phone', max_length=30, required=False)), ('new_window', wagtail.blocks.BooleanBlock(form_classname='new_window_toggle', label='Open in new window', required=False))]))])), ('content_with_images', wagtail.blocks.StructBlock([('title', wagtail.blocks.CharBlock()), ('lead_paragraph', wagtail.blocks.TextBlock()), ('secondary_paragraph', wagtail.blocks.TextBlock()), ('top_image', wagtail.images.blocks.ImageChooserBlock()), ('bottom_left_image', wagtail.images.blocks.ImageChooserBlock()), ('bottom_center_image', wagtail.images.blocks.ImageChooserBlock()), ('bottom_right_image', wagtail.images.blocks.ImageChooserBlock())])), ('logo_cloud', wagtail.blocks.StructBlock([('title', wagtail.blocks.CharBlock()), ('lead_paragraph', wagtail.blocks.TextBlock()), ('logos', wagtail.blocks.ListBlock(wagtail.images.blocks.ImageChooserBlock()))]))], null=True, use_json_field=True),
),
]
1 change: 1 addition & 0 deletions djangosocial/requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ whitenoise==6.6.0
dj-database-url==2.1.0
django-tailwind-cli
django-browser-reload
wagtail-link-block
7 changes: 7 additions & 0 deletions djangosocial/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ django==4.2.13 \
# django-typer
# djangorestframework
# wagtail
# wagtail-link-block
django-browser-reload==1.12.1 \
--hash=sha256:08b457f1b6599bf782d4d2ecdfb0897d6fc936ac4035060d0269c2af5ef4ef7a \
--hash=sha256:875b6bd01db13380522ccb4ae75871a2edeae74bb5ac92bf32eb76763d575d86
Expand Down Expand Up @@ -470,6 +471,12 @@ urllib3==2.2.1 \
wagtail==5.2.5 \
--hash=sha256:15800e17bd03244e023d2b9d70f02a51623982c3ef1ddb121925a884d625b5bb \
--hash=sha256:576f7690ca997b0e6d9fda9880594bf4bb904117b6edd5f2d7fbab570feee5a3
# via
# -r requirements.in
# wagtail-link-block
wagtail-link-block==1.1.7 \
--hash=sha256:5b7346bd60b65b00d7bafa48ab3b54b09c97abd085c0afd8f691be3219ff7a1c \
--hash=sha256:e2f0c9dedd8e1116fc347e8d5a28164376d121fa95b9c87a85ca408fc426846e
# via -r requirements.in
webencodings==0.5.1 \
--hash=sha256:a0af1213f3c2226497a97e2b3aa01a7e4bee4f403f95be16fc9acd2947514a78 \
Expand Down
1 change: 1 addition & 0 deletions djangosocial/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"django.contrib.staticfiles",
"django_tailwind_cli",
"django_browser_reload",
"wagtail_link_block",
"home",
"search",
"streams",
Expand Down
5 changes: 3 additions & 2 deletions djangosocial/streams/blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
StructBlock,
TextBlock,
)
from wagtail_link_block.blocks import LinkBlock
from wagtail.images.blocks import ImageChooserBlock


Expand Down Expand Up @@ -110,7 +111,7 @@ class Meta:
class ContentListItemBlock(StructBlock):
title = CharBlock()
lead_paragraph = TextBlock()
link = PageChooserBlock()
link = LinkBlock()


class ContentListBlock(StructBlock):
Expand All @@ -125,7 +126,7 @@ class ContentListBlock(StructBlock):
content_list = ListBlock(ContentListItemBlock(), max_num=3)

more_list_text = CharBlock()
more_list_link = PageChooserBlock()
more_list_link = LinkBlock()

class Meta:
template = "blocks/content_with_list.html"
Expand Down
5 changes: 3 additions & 2 deletions djangosocial/streams/templates/blocks/content_with_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ <h3 class="sr-only">{{ value.list_title }}</h3>
<dd
class="w-full flex-none text-lg font-semibold tracking-tight text-gray-900"
>
<a href="{% pageurl item.link %}">
<a href="{{ item.link.get_url }}" {% if item.link.new_window %}target="_blank"{% endif %}>
{{item.title}}
<span
class="absolute inset-0"
Expand Down Expand Up @@ -60,7 +60,8 @@ <h3 class="sr-only">{{ value.list_title }}</h3>
</ul>
<div class="mt-8 flex border-t border-gray-100 pt-8">
<a
href="{% pageurl value.more_list_link %}"
href="{{ value.more_list_link.get_url }}"
{% if value.more_list_link.new_window %}target="_blank"{% endif %}
class="text-sm font-semibold leading-6 text-green-600 hover:text-green-500"
>{{value.more_list_text}}
<span aria-hidden="true">&rarr;</span></a
Expand Down

0 comments on commit ac8ae02

Please sign in to comment.