generated from bisco/codex-bootstrap
fix: update theatre laboratory details
This commit is contained in:
+1
-1
@@ -4,7 +4,7 @@ Edit this file for each repository.
|
||||
|
||||
## Project identity
|
||||
|
||||
Project name: `Laboratorio Teatrale`
|
||||
Project name: `Azione!Lab`
|
||||
Project description: `Headless Wagtail CMS and Astro single-page website for a theatre workshop.`
|
||||
Primary language/runtime: `Python 3.12 and Node.js 22`
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Laboratorio Teatrale
|
||||
# Azione!Lab
|
||||
|
||||
A warm, editorial single-page website for a contemporary theatre workshop. Wagtail
|
||||
provides an editor-friendly headless CMS, Astro renders the public site, PostgreSQL
|
||||
|
||||
@@ -113,7 +113,7 @@ MEDIA_ROOT = BASE_DIR / "media"
|
||||
|
||||
DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"
|
||||
|
||||
WAGTAIL_SITE_NAME = "Laboratorio Teatrale"
|
||||
WAGTAIL_SITE_NAME = "Azione!Lab"
|
||||
WAGTAILADMIN_BASE_URL = os.getenv("WAGTAILADMIN_BASE_URL", "http://localhost:8000")
|
||||
WAGTAIL_I18N_ENABLED = False
|
||||
|
||||
|
||||
@@ -106,46 +106,50 @@ class Command(BaseCommand):
|
||||
site = Site.objects.create(
|
||||
hostname="localhost",
|
||||
port=8000,
|
||||
site_name="Laboratorio Teatrale",
|
||||
site_name="Azione!Lab",
|
||||
root_page=homepage,
|
||||
is_default_site=True,
|
||||
)
|
||||
elif site.root_page_id != homepage.id:
|
||||
else:
|
||||
update_fields = []
|
||||
if site.root_page_id != homepage.id:
|
||||
site.root_page = homepage
|
||||
site.site_name = "Laboratorio Teatrale"
|
||||
site.save(update_fields=["root_page", "site_name"])
|
||||
update_fields.append("root_page")
|
||||
if site.site_name != "Azione!Lab":
|
||||
site.site_name = "Azione!Lab"
|
||||
update_fields.append("site_name")
|
||||
if update_fields:
|
||||
site.save(update_fields=update_fields)
|
||||
|
||||
settings, _ = SiteSettings.objects.get_or_create(site=site)
|
||||
settings.laboratory_name = "Laboratorio Teatrale"
|
||||
settings.laboratory_name = "Azione!Lab"
|
||||
settings.short_claim = "Il teatro diventa presenza."
|
||||
settings.email = "ciao@laboratorioteatrale.it"
|
||||
settings.phone = "+39 333 123 4567"
|
||||
settings.whatsapp = "+39 333 123 4567"
|
||||
settings.instagram = "https://www.instagram.com/"
|
||||
settings.facebook = "https://www.facebook.com/"
|
||||
settings.address = "Via del Teatro 12, Roma"
|
||||
settings.address = "Via dell'Epomeo 9999, Napoli"
|
||||
settings.footer_text = "Uno spazio di ricerca, ascolto e presenza."
|
||||
settings.save()
|
||||
|
||||
TeacherProfile.objects.update_or_create(
|
||||
name="Andrea Rossi",
|
||||
defaults={
|
||||
"photo": teacher_image,
|
||||
"short_bio": (
|
||||
teacher = TeacherProfile.objects.order_by("id").first() or TeacherProfile()
|
||||
teacher.name = "Ernesto Estatico"
|
||||
teacher.photo = teacher_image
|
||||
teacher.short_bio = (
|
||||
"Attore, regista e formatore. Accompagna gruppi e persone "
|
||||
"nella ricerca di una presenza scenica sincera."
|
||||
),
|
||||
"full_bio": (
|
||||
)
|
||||
teacher.full_bio = (
|
||||
"<p>Da oltre quindici anni lavora tra formazione, creazione "
|
||||
"collettiva e spettacolo dal vivo.</p>"
|
||||
),
|
||||
"quote": "Il teatro non è fingere: è imparare a essere presenti.",
|
||||
},
|
||||
)
|
||||
teacher.quote = "Il teatro non è fingere: è imparare a essere presenti."
|
||||
teacher.save()
|
||||
LessonInfo.objects.update_or_create(
|
||||
day_time="Ogni mercoledì, 19:30–22:00",
|
||||
defaults={
|
||||
"location": "Spazio Teatro, Via del Teatro 12, Roma",
|
||||
"location": "Spazio Teatro, Via dell'Epomeo 9999, Napoli",
|
||||
"audience": "Adulti, con o senza esperienza precedente.",
|
||||
"description": (
|
||||
"<p>Training fisico e vocale, improvvisazione, ascolto, "
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies = [
|
||||
("home", "0001_initial"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name="sitesettings",
|
||||
name="laboratory_name",
|
||||
field=models.CharField(default="Azione!Lab", max_length=120),
|
||||
),
|
||||
]
|
||||
@@ -9,7 +9,7 @@ from wagtail.snippets.models import register_snippet
|
||||
|
||||
@register_setting(icon="cog")
|
||||
class SiteSettings(BaseSiteSetting):
|
||||
laboratory_name = models.CharField(max_length=120, default="Laboratorio Teatrale")
|
||||
laboratory_name = models.CharField(max_length=120, default="Azione!Lab")
|
||||
short_claim = models.CharField(max_length=180, blank=True)
|
||||
email = models.EmailField(blank=True)
|
||||
phone = models.CharField(max_length=40, blank=True)
|
||||
|
||||
@@ -3,7 +3,7 @@ import tempfile
|
||||
from django.core.management import call_command
|
||||
from django.test import TestCase, override_settings
|
||||
|
||||
from home.models import GalleryItem, HomePage, Show
|
||||
from home.models import GalleryItem, HomePage, Show, TeacherProfile
|
||||
|
||||
|
||||
@override_settings(WAGTAILADMIN_BASE_URL="https://cms.example.test")
|
||||
@@ -36,6 +36,13 @@ class HomeApiTests(TestCase):
|
||||
},
|
||||
)
|
||||
self.assertEqual(payload["homepage"]["hero_title"], "Il teatro diventa presenza.")
|
||||
self.assertEqual(payload["settings"]["laboratory_name"], "Azione!Lab")
|
||||
self.assertEqual(payload["settings"]["address"], "Via dell'Epomeo 9999, Napoli")
|
||||
self.assertEqual(payload["teacher"]["name"], "Ernesto Estatico")
|
||||
self.assertEqual(
|
||||
payload["lesson_info"]["location"],
|
||||
"Spazio Teatro, Via dell'Epomeo 9999, Napoli",
|
||||
)
|
||||
self.assertEqual(len(payload["feature_cards"]), 3)
|
||||
self.assertTrue(
|
||||
payload["homepage"]["hero_image"]["url"].startswith(
|
||||
@@ -61,6 +68,16 @@ class HomeApiTests(TestCase):
|
||||
self.assertEqual(Show.objects.count(), 2)
|
||||
self.assertEqual(GalleryItem.objects.count(), 4)
|
||||
|
||||
def test_seed_updates_the_existing_teacher_without_creating_a_duplicate(self):
|
||||
teacher = TeacherProfile.objects.get()
|
||||
teacher.name = "Andrea Rossi"
|
||||
teacher.save(update_fields=["name"])
|
||||
|
||||
call_command("seed_demo", verbosity=0)
|
||||
|
||||
self.assertEqual(TeacherProfile.objects.count(), 1)
|
||||
self.assertEqual(TeacherProfile.objects.get().name, "Ernesto Estatico")
|
||||
|
||||
|
||||
class HealthTests(TestCase):
|
||||
def test_health_endpoint_checks_database(self):
|
||||
|
||||
@@ -88,14 +88,14 @@ const placeholder = (name: string, alt: string): CmsImage => ({
|
||||
|
||||
export const fallbackHomeData: HomeData = {
|
||||
settings: {
|
||||
site_name: "Laboratorio Teatrale",
|
||||
site_name: "Azione!Lab",
|
||||
short_claim: "Il teatro diventa presenza.",
|
||||
email: "ciao@laboratorioteatrale.it",
|
||||
phone: "+39 333 123 4567",
|
||||
whatsapp: "+39 333 123 4567",
|
||||
instagram: "https://instagram.com/",
|
||||
facebook: "https://facebook.com/",
|
||||
address: "Via della Scena 12, Roma",
|
||||
address: "Via dell'Epomeo 9999, Napoli",
|
||||
footer_text: "Uno spazio aperto a chi desidera incontrare il teatro, insieme.",
|
||||
},
|
||||
homepage: {
|
||||
@@ -132,8 +132,8 @@ export const fallbackHomeData: HomeData = {
|
||||
},
|
||||
],
|
||||
teacher: {
|
||||
name: "Andrea Morelli",
|
||||
photo: placeholder("teacher", "Ritratto del maestro Andrea Morelli"),
|
||||
name: "Ernesto Estatico",
|
||||
photo: placeholder("teacher", "Ritratto del maestro Ernesto Estatico"),
|
||||
short_bio:
|
||||
"Attore, regista e formatore, accompagna gruppi di ogni esperienza con cura e concretezza.",
|
||||
full_bio:
|
||||
@@ -142,7 +142,7 @@ export const fallbackHomeData: HomeData = {
|
||||
},
|
||||
lesson_info: {
|
||||
schedule: "Ogni martedì, dalle 20:00 alle 22:30",
|
||||
location: "Spazio Scena, Via della Scena 12, Roma",
|
||||
location: "Spazio Teatro, Via dell'Epomeo 9999, Napoli",
|
||||
audience: "Adulti, con o senza esperienza",
|
||||
description: "Training fisico e vocale, improvvisazione, ascolto, costruzione del personaggio e lavoro di scena.",
|
||||
trial_lesson: "La prima lezione di prova è gratuita, su prenotazione.",
|
||||
|
||||
Reference in New Issue
Block a user