Skip to content

Commit

Permalink
fix #104, fix #144, fix #160, fix #179, fix #183,
Browse files Browse the repository at this point in the history
fix #184, fix #185
  • Loading branch information
FlorinZarafu committed Aug 1, 2023
1 parent 47749a7 commit 28fe510
Show file tree
Hide file tree
Showing 15 changed files with 677 additions and 51 deletions.
11 changes: 11 additions & 0 deletions app/Http/Controllers/ChampionshipController.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,4 +187,15 @@ public function subscribeProject(Request $request)

return response()->json(['message' => 'error']);
}

public function championshipRules()
{
return Inertia::render('Public/Championship/Rules', [
'content' => [
'title' => 'Reguli Gale regionale',
'subtitle' => 'Subtitle',
'body' => '<div>body</div>'
],
]);
}
}
4 changes: 2 additions & 2 deletions app/Http/Controllers/Ngo/VolunteerController.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public function index(Request $request, $status = '')
return redirect()->route('admin.ong.edit');
}
if (auth()->user()->organization->projects->count() == 0) {
$volunteers = Volunteer::where('id', 0)->paginate();
$volunteers = Volunteer::where('id', 0)->paginate(15)->withQueryString();
} else {
$volunteers = Volunteer::whereHas('projects', function ($query) {
$query->whereIn('projects.id', auth()->user()->organization->projects->pluck('id'));
Expand All @@ -30,7 +30,7 @@ public function index(Request $request, $status = '')
return Inertia::render(
'AdminOng/Volunteers/Volunteers',
[
'volunteers' => $volunteers->paginate()->withQueryString(),
'volunteers' => $volunteers,
'status' => $status,
]
);
Expand Down
112 changes: 111 additions & 1 deletion app/Http/Controllers/RegionalController.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ public function edition()

$projects = Project::publish()->paginate(9)->withQueryString();

return Inertia::render('Public/Regional/LastEdition', [
return Inertia::render('Public/Regional/Edition', [
'query' => $projects,
'editions' => $editions,
'articles' => $articles,
Expand All @@ -206,6 +206,105 @@ public function edition()
]);
}

public function regionalEdition() {
$editions = [
[
'href' => '1',
'name' => 'Gale Regionale 2020',
],
[
'href' => '2',
'name' => 'Gale Regionale 2021',
],
[
'href' => '3',
'name' => 'Gale Regionale 2022',
],
];

$articles = [
[
'id' => 1,
'img' => '/images/project_img.png',
'author' => 'Ion Popescu',
'name' => 'Importanța educației remediare în România în timpul pandemiei',
'team' => 'Echipa BCR',
'content' => 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Architecto accusantium praesentium eius, ut atque fuga culpa, similique sequi cum eos quis dolorum.',
'date' => '15.02.2022',
],
[
'id' => 2,
'img' => '/images/project_img.png',
'author' => 'Ion Popescu',
'name' => 'Importanța educației remediare în România în timpul pandemiei',
'team' => 'Echipa BCR',
'content' => 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Architecto accusantium praesentium eius, ut atque fuga culpa, similique sequi cum eos quis dolorum.',
'date' => '15.02.2022',
],
[
'id' => 3,
'img' => '/images/project_img.png',
'author' => 'Ion Popescu',
'name' => 'Importanța educației remediare în România în timpul pandemiei',
'team' => 'Echipa BCR',
'content' => 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Architecto accusantium praesentium eius, ut atque fuga culpa, similique sequi cum eos quis dolorum.',
'date' => '15.02.2022',
],
];

$registration = [
'start' => '2023-06-01',
'end' => '2023-07-20',
];

$parteners = [
'/images/project_img.png',
'/images/project_img.png',
'/images/project_img.png',
'/images/project_img.png',
'/images/project_img.png',
'/images/project_img.png',
];

$faqs = [
[
'title' => 'Title 1',
'content' => 'Content 1',
],
[
'title' => 'Title 2',
'content' => 'Content 2',
],
[
'title' => 'Title 3',
'content' => 'Content 3',
],
[
'title' => 'Title 4',
'content' => 'Content 4',
],
];

$edition = [
'name' => 'Nume',
'start' => '2023-06-01',
'end' => '2023-07-20',
'status' => 'in-progress'
];

$projects = Project::publish()->paginate(9)->withQueryString();

return Inertia::render('Public/Regional/Edition', [
'query' => $projects,
'editions' => $editions,
'edition' => $edition,
'articles' => $articles,
'parteners' => $parteners,
'registration' => $registration,
'faqs' => $faqs,
]);
}

public function project(Project $project)
{
$gallery = [
Expand Down Expand Up @@ -316,4 +415,15 @@ public function project(Project $project)
'gallery' => $gallery,
]);
}

public function regionalRules()
{
return Inertia::render('Public/Regional/Rules', [
'content' => [
'title' => 'Reguli Gale regionale',
'subtitle' => 'Subtitle',
'body' => '<div>body</div>'
],
]);
}
}
File renamed without changes
3 changes: 0 additions & 3 deletions public/images/svg/troffe.svg

This file was deleted.

7 changes: 4 additions & 3 deletions resources/js/Components/cards/Edition.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
>
<div class="flex flex-col flex-1">
<Link
:href="route('regional.project', data.id)"
:href="urlRoute"
class="relative bg-gray-200 rounded-t-lg group-hover:opacity-75 sm:h-52"
>

Expand All @@ -21,7 +21,7 @@
<p v-if="'winners' === data.status" class="pb-4 text-sm font-medium text-red-500">{{ $t('regional_winners') }}</p>

<Link
:href="route('regional.project', data.id)"
:href="urlRoute"
class="mt-4 text-2xl font-bold text-gray-700"
>
{{ data.name }}
Expand All @@ -31,7 +31,7 @@


<Link
:href="route('lastedition', data.id)"
:href="urlRoute"
class="flex items-center p-6 text-sm font-semibold gap-x-2 text-primary-500"
>
{{ $t('see') }}
Expand All @@ -53,5 +53,6 @@
const props = defineProps({
data: Object,
cardType: String,
urlRoute: String
});
</script>
25 changes: 16 additions & 9 deletions resources/js/Pages/Public/Championship/Championship.vue
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@

<p class="hidden mt-10 text-base text-gray-500 lg:block">{{ $t('competition') }}</p>

<p class="hidden text-base text-gray-500 lg:block">
{{ $t('regional_rules') }}
<Link :href="route('championship.rules')" class="text-blue-500">{{ $t('here') }}.</Link>
</p>

<div class="absolute hidden md:block -top-24 -left-32">
<SvgLoader class="shrink-0 fill-primary-300" name="dotted_square" />
</div>
Expand All @@ -131,7 +136,7 @@

<div
class="absolute flex items-center justify-center w-32 h-32 rounded-lg bg-gray-50 -bottom-10 -left-10">
<SvgLoader class="shrink-0" name="trofee" />
<SvgLoader class="shrink-0" name="cup" />
</div>
</div>
</div>
Expand Down Expand Up @@ -162,7 +167,7 @@
</div>

<!-- Projects -->
<div id="projects" class="mx-auto mb-10 p-9 max-w-7xl">
<div v-if="0 < projects?.data.length" id="projects" class="mx-auto mb-10 p-9 max-w-7xl">
<div class="flex items-center gap-4">
<div class="flex items-center justify-center w-8 h-8 rounded-lg bg-primary-500">
Expand Down Expand Up @@ -209,7 +214,7 @@
</div>

<!-- Testimonials -->
<div class="w-full bg-cyan-900">
<div v-if="0 < testimonials.length" class="w-full bg-cyan-900">
<div class="flex items-center mx-auto max-w-7xl p-9 gap-x-4">
<div class="flex items-center justify-center w-8 h-8 rounded-lg bg-primary-500">
<SvgLoader class="shrink-0 fill-white" name="quote" />
Expand All @@ -219,7 +224,7 @@
</div>

<!-- Carousel -->
<div class="relative overflow-hidden bg-gray-50">
<div v-if="0 < testimonials.length" class="relative overflow-hidden bg-gray-50">
<div class="flex items-center max-w-5xl mx-auto mt-12 mb-8 p-9 gap-x-4">
<carousel class="w-full" :items-to-show="1" :autoplay="4000" :pauseAutoplayOnHover="true" :wrapAround="true"
:transition="300">
Expand All @@ -243,7 +248,7 @@
</div>

<!-- Articles -->
<div class="relative mb-10 overflow-hidden pb-9">
<div v-if="0 < articles.length" class="relative mb-10 overflow-hidden pb-9">

<div class="pt-12 pb-20 bg-primary-500">
<div class="flex items-center gap-4 mx-auto px-9 max-w-7xl">
Expand All @@ -268,7 +273,7 @@
</div>

<!-- External links -->
<div class="mx-auto max-w-7xl p-9 gap-x-4">
<div v-if="0 < links.length" class="mx-auto max-w-7xl p-9 gap-x-4">
<div class="flex items-center mx-auto mb-10 max-w-7xl gap-x-4">
<div class="flex items-center justify-center w-8 h-8 rounded-lg bg-primary-500">
<SvgLoader class="shrink-0 fill-primary-500" name="links" />
Expand Down Expand Up @@ -296,9 +301,11 @@
</div>

<div class="flex flex-col gap-y-4">
<Link v-for="(edition, index) in editions" :key="index" >
class="text-xl font-bold text-blue-500">
{{ edition.name }}
<Link
v-for="(edition, index) in editions" :key="index" class="text-xl font-bold text-blue-500"
:href="route('edition', edition.id)"
>
{{ edition.name }}
</Link>
</div>
</div>
Expand Down
23 changes: 23 additions & 0 deletions resources/js/Pages/Public/Championship/Rules.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<template>
<PageLayout>
<!-- Inertia page head -->
<Head :title="$t('regional_rules_title')" />
<div class="w-full mx-auto space-y-9 lg:max-w-7xl p-9">
<h1 class="text-6xl font-bold text-cyan-900">{{ content?.title }}</h1>
<h2 class="text-lg font-semibold text-gray-700">{{ content?.subtitle }}</h2>
<div v-html="content?.body"></div>
</div>
</PageLayout>
</template>

<script setup>
/** Import from inertia. */
import { Head } from '@inertiajs/vue3';

/** Import components. */
import PageLayout from '@/Layouts/PageLayout.vue';

const props = defineProps({
content: Object
})
</script>
Loading

0 comments on commit 28fe510

Please sign in to comment.