Skip to content

Commit

Permalink
fix stasuse in front
Browse files Browse the repository at this point in the history
  • Loading branch information
gheorghelupu17 committed Oct 16, 2023
1 parent 8565553 commit cfa8b0b
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 19 deletions.
5 changes: 2 additions & 3 deletions app/Http/Resources/Project/EditProjectResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ class EditProjectResource extends Resource

public function toArray(Request $request): array
{

return [
'id' => $this->id,
// 'type' => $this->type,
Expand All @@ -39,8 +38,8 @@ public function toArray(Request $request): array
'description' => $this->description ?? '',
'scope' => $this->scope ?? '',
'reason_to_donate' => $this->reason_to_donate ?? '',
'accepting_volunteers' =>$this->accepting_volunteers ? __('field.boolean.true'): __('field.boolean.false'),
'accepting_comments' => $this->accepting_comments ? __('field.boolean.true'): __('field.boolean.false'),
'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(),
Expand Down
1 change: 1 addition & 0 deletions app/Http/Resources/ProjectCardResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public function toArray(Request $request): array
'is_pending' => $this->is_pending,
'is_ending_soon' => $this->is_ending_soon,
'is_draft' => $this->is_draft,
'is_starting_soon' => $this->isStartingSoon(),
'can_be_archived' => $this->can_be_archived,
'championship' => [
'troffees_count' => 2,
Expand Down
2 changes: 2 additions & 0 deletions lang/ro.json
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,8 @@
"range": "Aria de acoperire",
"project_ends": "Se incheie in",
"project_ending_soon": "Se încheie curând",
"project_starting_soon": "Se deschide in curând",
"project_active": "Proiect activ",
"days": "zile",
"donate_to_project": "Donează către proiectul",
"donate_form_intro": "Completează datele de mai jos pentru a face donația",
Expand Down
44 changes: 28 additions & 16 deletions resources/js/Components/cards/ProjectCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,39 @@
<ProjectTag v-else-if="project.is_draft" :label="$t('project_draft')" />

<ProjectTag v-else-if="!project.is_active" :label="$t('project_closed')" />

<div v-if="project.is_active && project.championship" class="flex flex-wrap items-center gap-1">
<ProjectTag
v-if="project.championship.troffees_count"
:label="project.championship.troffees_count"
icon="troffee"
accent
/>

<ProjectTag v-if="project.championship.score" accent>
<span class="font-bold" v-text="$t('scor')" />
<span class="font-extrabold" v-text="project.championship.score" />
</ProjectTag>
</div>

<ProjectTag
v-if="project.is_active && project.is_ending_soon"
v-else-if="project.is_active && project.is_starting_soon"
:label="$t('project_starting_soon')"
icon="clock"
/>
<ProjectTag
v-else-if="project.is_active && project.is_ending_soon"
:label="$t('project_ending_soon')"
icon="clock"
/>

<ProjectTag
v-else-if="project.is_active"
:label="$t('project_active')"
icon="clock"
/>

<!-- <div v-if="project.is_active && project.championship" class="flex flex-wrap items-center gap-1">-->
<!-- <ProjectTag-->
<!-- v-if="project.championship.troffees_count"-->
<!-- :label="project.championship.troffees_count"-->
<!-- icon="troffee"-->
<!-- accent-->
<!-- />-->

<!-- <ProjectTag v-if="project.championship.score" accent>-->
<!-- <span class="font-bold" v-text="$t('scor')" />-->
<!-- <span class="font-extrabold" v-text="project.championship.score" />-->
<!-- </ProjectTag>-->
<!-- </div>-->




</div>
</Link>
Expand Down

0 comments on commit cfa8b0b

Please sign in to comment.