From eb7ce47754c047c6ea0d557c09f2e4bc63a748ee Mon Sep 17 00:00:00 2001 From: edwh Date: Sat, 30 May 2026 23:21:34 +0100 Subject: [PATCH] Migrate events/cantcreate page to Vue (Group 5.2) Purely presentational page shown when a restarter (or host with no groups) hits /party/create. Moves hard-coded English text into lang/{en,fr,fr-BE}/cantcreate.php and renders via a Vue component. Adds a feature test asserting the Vue mount renders. --- lang/en/cantcreate.php | 14 ++++++ lang/fr-BE/cantcreate.php | 14 ++++++ lang/fr/cantcreate.php | 14 ++++++ resources/js/app.js | 2 + .../js/components/CantCreateEventPage.vue | 44 +++++++++++++++++++ resources/views/events/cantcreate.blade.php | 35 +++------------ .../Events/CantCreateEventPageTest.php | 20 +++++++++ 7 files changed, 114 insertions(+), 29 deletions(-) create mode 100644 lang/en/cantcreate.php create mode 100644 lang/fr-BE/cantcreate.php create mode 100644 lang/fr/cantcreate.php create mode 100644 resources/js/components/CantCreateEventPage.vue create mode 100644 tests/Feature/Events/CantCreateEventPageTest.php diff --git a/lang/en/cantcreate.php b/lang/en/cantcreate.php new file mode 100644 index 0000000000..97311f893b --- /dev/null +++ b/lang/en/cantcreate.php @@ -0,0 +1,14 @@ + 'Adding events', + 'intro' => 'You need to be a host of a group in order to create a new event listing.', + 'image_alt' => 'Materials for promoting upcoming Restart events', + 'not_host_q' => 'Not a host?', + 'not_host_body' => 'You can view already listed events for any groups that you\'re following, and other events near you, on the Events page.', + 'missing_event' => '(If an event is missing, please encourage the group host to list it!)', + 'want_to_add_group_q' => 'Want to add a group that you host?', + 'want_to_add_group_body' => 'Check whether it\'s already listed on the Groups page - and if not, please create it!', + 'start_new_group_q' => 'Want to start a new group?', + 'start_new_group_body' => 'Find out more here: How to power up community repair with Restarters.net.', +]; diff --git a/lang/fr-BE/cantcreate.php b/lang/fr-BE/cantcreate.php new file mode 100644 index 0000000000..d629b1ad9a --- /dev/null +++ b/lang/fr-BE/cantcreate.php @@ -0,0 +1,14 @@ + 'Ajouter des événements', + 'intro' => 'Vous devez être hôte d\'un groupe pour pouvoir créer une nouvelle annonce d\'événement.', + 'image_alt' => 'Matériel pour promouvoir les prochains événements Restart', + 'not_host_q' => 'Vous n\'êtes pas hôte ?', + 'not_host_body' => 'Vous pouvez consulter les événements déjà annoncés par les groupes que vous suivez, ainsi que d\'autres événements près de chez vous, sur la page Événements.', + 'missing_event' => '(Si un événement est manquant, encouragez l\'hôte du groupe à l\'annoncer !)', + 'want_to_add_group_q' => 'Vous voulez ajouter un groupe dont vous êtes hôte ?', + 'want_to_add_group_body' => 'Vérifiez s\'il est déjà répertorié sur la page Groupes — sinon, créez-le !', + 'start_new_group_q' => 'Vous voulez démarrer un nouveau groupe ?', + 'start_new_group_body' => 'Pour en savoir plus : Comment dynamiser la réparation communautaire avec Restarters.net.', +]; diff --git a/lang/fr/cantcreate.php b/lang/fr/cantcreate.php new file mode 100644 index 0000000000..d629b1ad9a --- /dev/null +++ b/lang/fr/cantcreate.php @@ -0,0 +1,14 @@ + 'Ajouter des événements', + 'intro' => 'Vous devez être hôte d\'un groupe pour pouvoir créer une nouvelle annonce d\'événement.', + 'image_alt' => 'Matériel pour promouvoir les prochains événements Restart', + 'not_host_q' => 'Vous n\'êtes pas hôte ?', + 'not_host_body' => 'Vous pouvez consulter les événements déjà annoncés par les groupes que vous suivez, ainsi que d\'autres événements près de chez vous, sur la page Événements.', + 'missing_event' => '(Si un événement est manquant, encouragez l\'hôte du groupe à l\'annoncer !)', + 'want_to_add_group_q' => 'Vous voulez ajouter un groupe dont vous êtes hôte ?', + 'want_to_add_group_body' => 'Vérifiez s\'il est déjà répertorié sur la page Groupes — sinon, créez-le !', + 'start_new_group_q' => 'Vous voulez démarrer un nouveau groupe ?', + 'start_new_group_body' => 'Pour en savoir plus : Comment dynamiser la réparation communautaire avec Restarters.net.', +]; diff --git a/resources/js/app.js b/resources/js/app.js index 4cc54ab738..5cd6e21b4b 100644 --- a/resources/js/app.js +++ b/resources/js/app.js @@ -40,6 +40,7 @@ import EventAddEditPage from './components/EventAddEditPage.vue' import EventAddEdit from './components/EventAddEdit.vue' import EventsRequiringModeration from './components/EventsRequiringModeration.vue' import EventPage from './components/EventPage.vue' +import CantCreateEventPage from './components/CantCreateEventPage.vue' import FixometerPage from './components/FixometerPage.vue' import GroupsPage from './components/GroupsPage.vue' import GroupPage from './components/GroupPage.vue' @@ -400,6 +401,7 @@ function initializeJQuery() { 'eventaddedit': EventAddEdit, 'eventsrequiringmoderation': EventsRequiringModeration, 'eventpage': EventPage, + 'cantcreateeventpage': CantCreateEventPage, 'fixometerpage': FixometerPage, 'groupspage': GroupsPage, 'grouppage': GroupPage, diff --git a/resources/js/components/CantCreateEventPage.vue b/resources/js/components/CantCreateEventPage.vue new file mode 100644 index 0000000000..d9b5178243 --- /dev/null +++ b/resources/js/components/CantCreateEventPage.vue @@ -0,0 +1,44 @@ + + + diff --git a/resources/views/events/cantcreate.blade.php b/resources/views/events/cantcreate.blade.php index 57699db2d4..af43ac68a0 100644 --- a/resources/views/events/cantcreate.blade.php +++ b/resources/views/events/cantcreate.blade.php @@ -1,32 +1,9 @@ @extends('layouts.app') @section('content') -
- -
- -
-
- -
-

Adding events

-
- -

You need to be a host of a group in order to create a new event listing.

- - Materials for promoting upcoming Restart events - -

Not a host? You can view already listed events for any groups that you're following, and other events near you, on the Events page. -
(If an event is missing, please encourage the group host to list it!) -

- -

Want to add a group that you host? Check whether it's already listed on the Groups page - and if not, please create it!

- -

Want to start a new group? Find out more here: How to power up community repair with Restarters.net. -

-
-
- -
- -
+
+
@lang('partials.loading')...
+
+
+ +
@endsection diff --git a/tests/Feature/Events/CantCreateEventPageTest.php b/tests/Feature/Events/CantCreateEventPageTest.php new file mode 100644 index 0000000000..c88e7705d5 --- /dev/null +++ b/tests/Feature/Events/CantCreateEventPageTest.php @@ -0,0 +1,20 @@ +restarter()->create(); + $this->actingAs($user); + + $response = $this->get('/party/create'); + $response->assertSuccessful(); + $response->assertSee('