From 63cfbe1243653cec1145c8cdca0b80ccd1d3f195 Mon Sep 17 00:00:00 2001 From: Kamieljv Date: Sun, 1 Dec 2024 16:19:49 +0100 Subject: [PATCH] Fixes after merge --- .../Controllers/ActieWijzerController.php | 2 +- app/Notifications/ReportAccepted.php | 27 +++++++++++++++++-- .../js/components/CoordinatesFormField.vue | 19 +++++++++---- resources/lang/nl/reports.php | 9 ++++++- .../assets/js/components/apps/ActieAgenda.vue | 5 ++-- .../assets/js/components/apps/HomeAgenda.vue | 1 + .../js/components/apps/Notifications.vue | 9 ++++--- .../assets/js/components/apps/Organizers.vue | 11 +++++--- .../assets/js/components/apps/Referenties.vue | 2 +- .../assets/js/components/partials/Actie.vue | 4 +-- .../views/partials/notifications.blade.php | 2 +- 11 files changed, 68 insertions(+), 23 deletions(-) diff --git a/app/Http/Controllers/ActieWijzerController.php b/app/Http/Controllers/ActieWijzerController.php index 6abc261f..76613afa 100644 --- a/app/Http/Controllers/ActieWijzerController.php +++ b/app/Http/Controllers/ActieWijzerController.php @@ -25,7 +25,7 @@ public function landing() { $questions = Question::active()->get()->toArray(); $dimensions = Dimension::all()->toArray(); - $themes = Theme::orderBy('name', 'ASC')->all()->toArray(); + $themes = Theme::orderBy('name', 'ASC')->get()->toArray(); $result_route = route('actiewijzer.result'); // SEO diff --git a/app/Notifications/ReportAccepted.php b/app/Notifications/ReportAccepted.php index 8a38eb7b..ba2fb427 100644 --- a/app/Notifications/ReportAccepted.php +++ b/app/Notifications/ReportAccepted.php @@ -3,13 +3,18 @@ namespace App\Notifications; use App\Models\Actie; +use App\Models\User; use Illuminate\Bus\Queueable; use Illuminate\Notifications\Notification; +use Illuminate\Notifications\Messages\MailMessage; class ReportAccepted extends Notification { use Queueable; + public Actie $actie; + public User $user; + /** * Create a new notification instance. * @@ -18,6 +23,7 @@ class ReportAccepted extends Notification public function __construct(Actie $actie) { $this->actie = $actie; + $this->user = User::find($actie->user_id); } /** @@ -28,7 +34,7 @@ public function __construct(Actie $actie) */ public function via($notifiable) { - return ['database']; + return ['database', 'mail']; } /** @@ -41,9 +47,26 @@ public function toArray($notifiable) { return [ 'title' => __('reports.accepted_notif_title'), - 'icon' => 'bell', 'body' => __('reports.accepted_notif_body', ['title' => $this->actie->title]), 'link' => route('acties.actie', $this->actie->slug), ]; } + + /** + * Get the mail representation of the notification. + * + * @param mixed $notifiable + * @return \Illuminate\Notifications\Messages\MailMessage + */ + public function toMail($notifiable) + { + $url = config('app.url') . '/actie/' . $this->actie->slug; + + return (new MailMessage()) + ->subject(__("reports.report_accepted_subject") . ' | ' . config('app.name')) + ->greeting(__("reports.report_accepted_greeting") . ' ' . $this->user->name . ',') + ->line(__("reports.report_accepted_message", ['title' => $this->actie->title])) + ->action(__("reports.report_accepted_action"), $url) + ->salutation(__('emails.salutation')); + } } diff --git a/resources/js/components/CoordinatesFormField.vue b/resources/js/components/CoordinatesFormField.vue index e91ef489..71a0c6ad 100644 --- a/resources/js/components/CoordinatesFormField.vue +++ b/resources/js/components/CoordinatesFormField.vue @@ -2,10 +2,18 @@
- +
+ + +
+
+ + +
_.get(window.i18n, str) const emit = defineEmits(['input']) @@ -136,7 +146,6 @@ watch(hasNoLatLng, (newVal) => { lat.value = null lng.value = null } else { - console.log(props.defaultCenter) lat.value = props.defaultCenter[0].lat lng.value = props.defaultCenter[0].lng } diff --git a/resources/lang/nl/reports.php b/resources/lang/nl/reports.php index 4117a475..da6b5769 100644 --- a/resources/lang/nl/reports.php +++ b/resources/lang/nl/reports.php @@ -24,15 +24,22 @@ 'location_human' => 'Locatienaam (bijv. "Museumplein, Amsterdam")', 'organizer' => 'Organisator', 'organizer(s)' => 'Organisator(en)', + 'has_no_latlng' => 'Deze actie heeft geen specifieke locatie.', 'date_reported' => 'Wanneer toegevoegd', 'status' => 'Status', 'view' => 'Bekijk', + 'user_mismatch' => 'Er is iets misgegaan met het verifiëren van je identiteit. Probeer het opnieuw.', + // ReportAccepted notification 'accepted_notif_title' => 'Toegevoegde actie geaccepteerd', 'accepted_notif_body' => 'De actie \':title\' is geaccepteerd. Klik om te bekijken.', - 'user_mismatch' => 'Er is iets misgegaan met het verifiëren van je identiteit. Probeer het opnieuw.', // ReportReceived email 'report_received_subject' => 'Nieuwe actie aangemeld', 'report_received_greeting' => 'Beste administrator', 'report_received_message' => 'Er is een nieuwe actie aangemeld. Klik op de knop hieronder om de actie te bekijken.', 'report_received_action' => 'Aangemelde actie bekijken', + // ReportAccepted email + 'report_accepted_subject' => 'Actie geaccepteerd', + 'report_accepted_greeting' => 'Beste', + 'report_accepted_message' => 'Je aangemelde actie met de titel \':title\' is geaccepteerd. Klik op de knop hieronder om de actie te bekijken.', + 'report_accepted_action' => 'Actie bekijken', ]; diff --git a/resources/views/assets/js/components/apps/ActieAgenda.vue b/resources/views/assets/js/components/apps/ActieAgenda.vue index 072b9fb5..c7be4149 100644 --- a/resources/views/assets/js/components/apps/ActieAgenda.vue +++ b/resources/views/assets/js/components/apps/ActieAgenda.vue @@ -115,9 +115,8 @@
-
- -
+ +
diff --git a/resources/views/assets/js/components/apps/HomeAgenda.vue b/resources/views/assets/js/components/apps/HomeAgenda.vue index 3e8445e7..9fc0a12c 100644 --- a/resources/views/assets/js/components/apps/HomeAgenda.vue +++ b/resources/views/assets/js/components/apps/HomeAgenda.vue @@ -68,6 +68,7 @@ import { ref, computed, onMounted } from 'vue' import debounce from 'lodash/debounce' import _ from 'lodash' +import axios from 'axios' const __ = str => _.get(window.i18n, str) const props = defineProps({ diff --git a/resources/views/assets/js/components/apps/Notifications.vue b/resources/views/assets/js/components/apps/Notifications.vue index 5ecba38f..53453093 100644 --- a/resources/views/assets/js/components/apps/Notifications.vue +++ b/resources/views/assets/js/components/apps/Notifications.vue @@ -15,7 +15,7 @@
- + {{ __("dashboard.no_notifications") }}
@@ -29,8 +29,8 @@ >
-
- +
+
@@ -58,7 +58,10 @@