Skip to content

Commit

Permalink
fix #117, fix #103, fix #102, fix #100 (#187)
Browse files Browse the repository at this point in the history
* fix #147, fix #148, fix #150, fix #151, fix #154,
fix #159

* fix #127, fix #138, fix #175, fix #173

* fix #117, fix #103, fix #102, fix #100

* remove console log
  • Loading branch information
FlorinZarafu authored Jul 28, 2023
1 parent b6265a7 commit 4714107
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 21 deletions.
2 changes: 1 addition & 1 deletion app/Http/Controllers/Auth/RegisteredUserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public function update(Request $request, $userId): RedirectResponse
$user->save();

// return redirect()->route('login')->with('success', 'Contul tau este pregatit');
return redirect()->back()->with('error_message', 'Contul tau este pregatit');
return redirect()->back()->with('success_message', 'Multumim pentru feedback');

} catch(\Throwable $th) {
return redirect()->back()->with('error_message', 'Something went wrong');
Expand Down
2 changes: 1 addition & 1 deletion resources/js/Components/registration/Success.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<!-- Other -->
<Input
@input="update"
v-show="show"
v-show="show && social.source_of_information"
id="other"
type="text"
v-model="other"
Expand Down
20 changes: 14 additions & 6 deletions resources/js/Pages/Auth/Register.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
<template>
<PageLayout>
<!-- Inertia page head -->

<Head title="Register" />

<!-- Alert -->
<Alert
class="fixed z-103 right-10 top-10 w-96"
:type="flash.error_message ? 'error' : flash.success_message ? 'success' : false"
:message="flash.success_message || flash.error_message"
@emptyFlash="Object.assign(props.flash, { success_message:'', error_message:'' });"
/>

<!-- Auth template. -->
<Auth :content="content">
<!-- Steps -->
Expand Down Expand Up @@ -41,6 +48,7 @@ import Step3 from '@/Components/registration/Step3.vue';
import Step4 from '@/Components/registration/Step4.vue';
import Step5 from '@/Components/registration/Step5.vue';
import Success from '@/Components/registration/Success.vue';
import Alert from '@/Components/Alert.vue';
/** Intialize inertia form object. */
const form = useForm({
Expand Down Expand Up @@ -147,8 +155,6 @@ const submit = () => {
delete form.ong;
}
console.log(form.type)
if(form.type === 'ngo-admin') {
form.ong.activity_domains_ids = form.ong.activity_domains_ids.map(domain => domain.id)
form.ong.counties_ids = form.ong.counties_ids.map(county => county.id)
Expand Down Expand Up @@ -179,9 +185,7 @@ const submit = () => {
}
},
onSuccess: (data) => {
console.log(data)
current.value = steps.value.length - 1
console.log(current.value)
if (data?.props?.flash?.success_message?.usrid) {
usrid.value = data.props.flash.success_message.usrid
}
Expand All @@ -193,7 +197,11 @@ const submit = () => {
const success = () => {
if (usrid.value) {
social.patch(route('user.update', { id: usrid.value }));
social.patch(route('user.update', { id: usrid.value }), {
onSuccess: (data) => {
social.source_of_information = ''
}
});
}
}
</script>
52 changes: 39 additions & 13 deletions resources/js/Pages/Public/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@

<!-- Header -->
<header class="flex flex-col-reverse w-full mx-auto lg:gap-10 xl:gap-20 lg:flex-row lg:max-w-7xl px-9">
<div class="w-full lg:w-6/12 lg:py-12">
<h1 :class="['relative z-50 text-2xl font-extrabold text-gray-900 lg:text-6xl']">{{ $t('home_title') }}</h1>
<div class="w-full py-12 lg:w-6/12">
<!-- Title -->
<h1 :class="['relative z-50 text-4xl font-extrabold text-gray-900 lg:text-6xl']">{{ $t('home_title') }}</h1>

<div class="relative flex flex-col items-center pb-10 my-10 md:flex-row gap-x-6">
<!-- Links -->
<div class="relative flex flex-col items-center gap-6 pb-10 my-10 md:flex-row">
<Link
:href="route('projects')"
class="bg-primary-500 text-center z-50 flex-1 w-full sm:w-auto hover:bg-primary-400 text-white focus-visible:outline-primary-500 rounded-md px-3.5 py-2.5 text-sm font-semibold shadow-sm focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2"
Expand All @@ -18,7 +20,7 @@

<Link
:href="route('evolution')"
class="rounded-md flex-1 bg-white text-center px-3.5 text-sm font-semibold text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-50 py-2.5"
class="rounded-md w-full flex-1 bg-white text-center px-3.5 text-sm font-semibold text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-50 py-2.5"
>
{{ $t('see_evolution') }}
</Link>
Expand All @@ -28,19 +30,20 @@
</div>
</div>

<div class="flex flex-col items-center gap-16 mx-auto md:flex-row">
<!-- Info texts -->
<div class="flex flex-row items-center justify-between gap-16 mx-auto md:justify-normal">
<div>
<h3 class="text-6xl font-bold text-gray-900">900+</h3>
<h3 class="text-4xl font-bold text-gray-900 lg:text-6xl">900+</h3>
<p class="text-xl text-gray-900">{{ $t('projects') }}</p>
</div>
<div>
<h3 class="text-6xl font-bold text-gray-900">700+</h3>
<h3 class="text-4xl font-bold text-gray-900 lg:text-6xl">700+</h3>
<p class="text-xl text-gray-900">{{ $t('organizations') }}</p>
</div>
</div>
</div>

<div class="w-full lg:w-6/12">
<div class="hidden w-full lg:block lg:w-6/12">
<SvgLoader name="home_bg" class="w-full" />
</div>
</header>
Expand Down Expand Up @@ -77,19 +80,26 @@
</div>
</div>

<div v-if="donate_projects" class="flex items-center justify-between w-full gap-6 mx-auto mt-10 lg:max-w-7xl px-9">
<div v-if="donate_projects" class="flex flex-col items-center justify-between w-full gap-6 mx-auto mt-10 lg:flex-row lg:max-w-7xl px-9">

<div class="flex items-center gap-6">
<h2 class="text-2xl font-bold text-red-500 lg:text-5xl">{{ $t('donate_for_good') }}</h2>
<h2 class="text-4xl font-bold text-red-500 lg:text-5xl">{{ $t('donate_for_good') }}</h2>
<Link
:href="route('projects')"
class="bg-red-500 text-center z-50 w-full sm:w-auto hover:bg-red-400 text-white focus-visible:outline-red-500 rounded-md px-3.5 py-2.5 text-sm font-semibold shadow-sm focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2"
class="bg-red-500 hidden lg:block text-center z-50 w-full sm:w-auto hover:bg-red-400 text-white focus-visible:outline-red-500 rounded-md px-3.5 py-2.5 text-sm font-semibold shadow-sm focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2"
>
{{ $t('find_projects') }}
</Link>
</div>

<div class="flex items-center gap-6">
<Link
:href="route('projects')"
class="bg-red-500 lg:hidden text-center z-50 w-full sm:w-auto hover:bg-red-400 text-white focus-visible:outline-red-500 rounded-md px-3.5 py-2.5 text-sm font-semibold shadow-sm focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2"
>
{{ $t('find_projects') }}
</Link>

<div @click="donate_projects_carousel.prev()" class="flex items-center justify-center w-10 h-10 p-2 bg-white rounded-lg shadow-md cursor-pointer">
<SvgLoader class="shrink-0 fill-gray-700" name="chevron_left"/>
</div>
Expand Down Expand Up @@ -151,18 +161,25 @@

<!-- Bcr projects -->
<div v-if="bcr_projects" class="relative w-full bg-white">
<div class="flex items-center justify-between w-full gap-6 mx-auto mt-10 lg:max-w-7xl px-9">
<div class="flex flex-col items-center justify-between w-full gap-6 mx-auto mt-10 lg:flex-row lg:max-w-7xl px-9">
<div class="flex items-center gap-6">
<h2 class="text-2xl font-bold text-cyan-900 lg:text-5xl">{{ $t('bcr_for_community') }}</h2>
<Link
:href="route('projects')"
class="bg-primary-500 text-center z-50 w-full sm:w-auto hover:bg-primary-400 text-white focus-visible:outline-primary-500 rounded-md px-3.5 py-2.5 text-sm font-semibold shadow-sm focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2"
class="bg-primary-500 hidden lg:block text-center z-50 w-full sm:w-auto hover:bg-primary-400 text-white focus-visible:outline-primary-500 rounded-md px-3.5 py-2.5 text-sm font-semibold shadow-sm focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2"
>
{{ $t('see_bcr_projects') }}
</Link>
</div>

<div class="flex items-center gap-6">
<Link
:href="route('projects')"
class="bg-primary-500 lg:hidden text-center z-50 w-full sm:w-auto hover:bg-primary-400 text-white focus-visible:outline-primary-500 rounded-md px-3.5 py-2.5 text-sm font-semibold shadow-sm focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2"
>
{{ $t('see_bcr_projects') }}
</Link>

<div @click="bcr_projects_carousel.prev()" class="flex items-center justify-center w-10 h-10 p-2 bg-white rounded-lg shadow-md cursor-pointer">
<SvgLoader class="shrink-0 fill-gray-700" name="chevron_left"/>
</div>
Expand Down Expand Up @@ -227,20 +244,27 @@
settings: {
itemsToShow: 1,
snapAlign: 'start',
wrapAround: true,
itemsToScroll: 1
},
breakpoints: {
700: {
itemsToShow: 2,
snapAlign: 'start',
wrapAround: true,
itemsToScroll: 1
},
850: {
itemsToShow: 2.5,
snapAlign: 'start',
wrapAround: true,
itemsToScroll: 1
},
1024: {
itemsToShow:3,
snapAlign: 'start',
wrapAround: true,
itemsToScroll: 3
},
1200: {
itemsToShow:3.5,
Expand All @@ -251,11 +275,13 @@
itemsToShow:4.5,
snapAlign: 'start',
wrapAround: true,
itemsToScroll: 3
},
1700: {
itemsToShow:5.5,
snapAlign: 'start',
wrapAround: true,
itemsToScroll: 3
}
},
});
Expand Down

0 comments on commit 4714107

Please sign in to comment.