From 8565553280db858fe852e4d483d3dd0b4f9c2005 Mon Sep 17 00:00:00 2001 From: Lupu Gheorghe Date: Mon, 16 Oct 2023 14:38:22 +0300 Subject: [PATCH] fix accepting volunteer on edit page --- .../Resources/Project/EditProjectResource.php | 5 +- lang/ro.json | 4 + lang/ro/field.php | 4 + lang/ro/validation.php | 2 +- .../Pages/AdminOng/Projects/EditProject.vue | 200 ++++++++++++------ 5 files changed, 148 insertions(+), 67 deletions(-) diff --git a/app/Http/Resources/Project/EditProjectResource.php b/app/Http/Resources/Project/EditProjectResource.php index 23449879..617a3c07 100644 --- a/app/Http/Resources/Project/EditProjectResource.php +++ b/app/Http/Resources/Project/EditProjectResource.php @@ -13,6 +13,7 @@ class EditProjectResource extends Resource public function toArray(Request $request): array { + return [ 'id' => $this->id, // 'type' => $this->type, @@ -38,8 +39,8 @@ public function toArray(Request $request): array 'description' => $this->description ?? '', 'scope' => $this->scope ?? '', 'reason_to_donate' => $this->reason_to_donate ?? '', - 'accepting_volunteers' => \boolval($this->accepting_volunteers), - 'accepting_comments' => \boolval($this->accepting_comments), + 'accepting_volunteers' =>$this->accepting_volunteers ? __('field.boolean.true'): __('field.boolean.false'), + 'accepting_comments' => $this->accepting_comments ? __('field.boolean.true'): __('field.boolean.false'), 'videos' => '', 'external_links' => $this->external_links, 'counties' => $this->counties->pluck('id')->toArray(), diff --git a/lang/ro.json b/lang/ro.json index 176c47db..c85bdab2 100644 --- a/lang/ro.json +++ b/lang/ro.json @@ -93,6 +93,10 @@ "project_beneficiary_extra": "Descrie beneficiarii proiectului/comunitatea căreia i se adresează, incluzând timpul și numărul acestora. Nu depăși 500 caractere", "why_to_donate": "De ce să donez?", "why_to_donate_extra": "Precizează nevoile sesizate în rândul beneficiarilor/comunității în care va fi implementat proiectul.", + "accepting_volunteers": "Proiectul acceptă voluntari?", + "accepting_volunteers_extra": "Dacă da, precizează care sunt activitățile pentru care se pot înscrie voluntarii.", + "accepting_comments": "Proiectul acceptă comentarii?", + "accepting_comments_extra": "Dacă da, text.", "has_comments_label": "Proiectul acceptă comentarii?", "has_volunteers_label": "Proiectul acceptă voluntari?", "photo_gallery": "Galerie foto", diff --git a/lang/ro/field.php b/lang/ro/field.php index b7091b74..14f6f802 100644 --- a/lang/ro/field.php +++ b/lang/ro/field.php @@ -8,5 +8,9 @@ 'updated_at' => 'Actualizată la', 'id' => 'ID', 'id_format' => '#:number', + 'boolean'=>[ + 'true'=>'Da', + 'false'=>'Nu', + ], ]; diff --git a/lang/ro/validation.php b/lang/ro/validation.php index 0aa82794..007b6f4c 100644 --- a/lang/ro/validation.php +++ b/lang/ro/validation.php @@ -222,6 +222,6 @@ 'target_budget' => 'Bugetul țintă', 'categories' => 'Categorii', 'counties' => 'Județe', - 'preview' => 'Imaginea principala' + 'preview' => 'Imaginea principala', ], ]; diff --git a/resources/js/Pages/AdminOng/Projects/EditProject.vue b/resources/js/Pages/AdminOng/Projects/EditProject.vue index 22dc78fd..e167f67b 100644 --- a/resources/js/Pages/AdminOng/Projects/EditProject.vue +++ b/resources/js/Pages/AdminOng/Projects/EditProject.vue @@ -259,6 +259,77 @@ + + + + + + + + + + + @@ -300,7 +371,7 @@ > {{ $t('remove_image') }} {{ $t('set_cover_image') }} + >{{ $t('set_cover_image') }} @@ -406,70 +477,71 @@