Skip to content

Commit

Permalink
Bug fixing (#91)
Browse files Browse the repository at this point in the history
* Added donor pages, started evolution page

* evolution charts

* fix #27, fix #26, fix
fix #45,  fix #49,  fix #54,  fix #56,  fix #57, fix #58, fix #59, fix #67

* fix #50, fix #42, fix #38

* fix #31, fix #48, fix #43

* fix #60

* Added deafault no images for cards

* fixes

* fixes

* fixes

* fix conflicts

* fix #78

* fix #75, #76

* fix #89

* fix #80
  • Loading branch information
FlorinZarafu authored Jul 20, 2023
1 parent 3d5b6ba commit 9cc8e9e
Show file tree
Hide file tree
Showing 39 changed files with 707 additions and 269 deletions.
85 changes: 85 additions & 0 deletions app/Http/Controllers/AdminBBTemporary.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
<?php

declare(strict_types=1);

namespace App\Http\Controllers;

use Inertia\Inertia;

class AdminBBTemporary extends Controller
{
public function about()
{
$content = [
[
'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',
],
];

return Inertia::render('Public/Home', [
'content' => $content
]);
}

public function faqs()
{
$faqs = [
'title' => 'Intrebări frecvente',
'content' => '
<p>Purus morbi dignissim senectus mattis adipiscing. Amet, massa quam varius orci dapibus volutpat cras. In amet eu ridiculus leo sodales cursus tristique. Tincidunt sed tempus ut viverra ridiculus non molestie. Gravida quis fringilla amet eget dui tempor dignissim. Facilisis auctor venenatis varius nunc, congue erat ac. Cras fermentum convallis quam.</p>
<h3>What’s the best thing about Switzerland?</h3>
<p>I dont know, but the flag is a big plus. Lorem ipsum dolor sit amet consectetur adipisicing elit. Quas cupiditate laboriosam fugiat.</p>
',
'faqs' => [
[
'title' => 'How do you make holy water?',
'content' => '<p>Purus morbi dignissim senectus mattis adipiscing. Amet, massa quam varius orci dapibus volutpat cras. In amet eu ridiculus leo sodales cursus tristique. Tincidunt sed tempus ut viverra ridiculus non molestie. Gravida quis fringilla amet eget dui tempor dignissim. Facilisis auctor venenatis varius nunc, congue erat ac. Cras fermentum convallis quam.</p>'
],
[
'title' => 'How do you make holy water?',
'content' => '<p>Purus morbi dignissim senectus mattis adipiscing. Amet, massa quam varius orci dapibus volutpat cras. In amet eu ridiculus leo sodales cursus tristique. Tincidunt sed tempus ut viverra ridiculus non molestie. Gravida quis fringilla amet eget dui tempor dignissim. Facilisis auctor venenatis varius nunc, congue erat ac. Cras fermentum convallis quam.</p>'
],
[
'title' => 'How do you make holy water?',
'content' => '<p>Purus morbi dignissim senectus mattis adipiscing. Amet, massa quam varius orci dapibus volutpat cras. In amet eu ridiculus leo sodales cursus tristique. Tincidunt sed tempus ut viverra ridiculus non molestie. Gravida quis fringilla amet eget dui tempor dignissim. Facilisis auctor venenatis varius nunc, congue erat ac. Cras fermentum convallis quam.</p>'
],
[
'title' => 'How do you make holy water?',
'content' => '<p>Purus morbi dignissim senectus mattis adipiscing. Amet, massa quam varius orci dapibus volutpat cras. In amet eu ridiculus leo sodales cursus tristique. Tincidunt sed tempus ut viverra ridiculus non molestie. Gravida quis fringilla amet eget dui tempor dignissim. Facilisis auctor venenatis varius nunc, congue erat ac. Cras fermentum convallis quam.</p>'
],
[
'title' => 'How do you make holy water?',
'content' => '<p>Purus morbi dignissim senectus mattis adipiscing. Amet, massa quam varius orci dapibus volutpat cras. In amet eu ridiculus leo sodales cursus tristique. Tincidunt sed tempus ut viverra ridiculus non molestie. Gravida quis fringilla amet eget dui tempor dignissim. Facilisis auctor venenatis varius nunc, congue erat ac. Cras fermentum convallis quam.</p>'
]
]
];

return Inertia::render('Public/Website/Faqs', [
'faqs' => $faqs
]);
}
}
8 changes: 6 additions & 2 deletions app/Http/Controllers/Auth/RegisteredUserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ public function store(RegistrationRequest $request): RedirectResponse
'password' => Hash::make($user['password']),
]);
event(new Registered($user));
// Auth::login($user);

if ($data['type'] == 'ong') {
$ong = $data['ong'];
Expand All @@ -75,10 +74,15 @@ public function store(RegistrationRequest $request): RedirectResponse
$user->save();
}

return Redirect::route('register');
\Log::info(print_r($user, true));
// $request->session()->flash('user', 'sdaaaaaaaaaa');
// return Redirect::route('register');
// return redirect()->route('register')->with('user', 'sdaaaaaaaaaa');
return Redirect::back()->with('user', 'Registration successful');
}

public function update(RegistrationRequest $request): RedirectResponse
{
\Log::info($request);
}
}
23 changes: 18 additions & 5 deletions app/Http/Controllers/ProjectController.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use App\Models\County;
use App\Models\Project;
use App\Models\Volunteer;
use App\Models\ActivityDomain;
use Illuminate\Http\Request;
use Illuminate\Validation\ValidationException;
use Inertia\Inertia;
Expand All @@ -26,20 +27,32 @@ public function index(Request $request)
if ($request->query('status')) {
$projects->whereIn('status', $request->query('status'));
}
// $projects->dd();
if ($request->query('start_date')) {
$projects->where('start', '>=', $request->query('start_date'));

if ($request->query('category')) {
$projects->whereIn('category', $request->query('category'));
}

if ($request->query('end_date')) {
$projects->where('end', '<=', $request->query('end_date'));
/** For this wee need to sent to front the small start and biggest end */
if ($request->query('date')) {
$date = explode('-', $request->query('date'));
$projects->where('start', '>=', str_replace('.', '-', $date[0]));
$projects->where('end', '<=', str_replace('.', '-', $date[1]));
}

// if ($request->query('start_date')) {
// $projects->where('start', '>=', $request->query('start_date'));
// }

// if ($request->query('end_date')) {
// $projects->where('end', '<=', $request->query('end_date'));
// }

$counties = County::get(['name', 'id']);

return Inertia::render('Public/Projects/Projects', [
'query' => $projects->paginate()->withQueryString(),
'counties' => $counties,
'categories' => ActivityDomain::all()
]);
}

Expand Down
1 change: 1 addition & 0 deletions app/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class User extends Authenticatable implements FilamentUser
'role',
'phone',
'organization_id',
'source_of_information'
];

/**
Expand Down
Binary file added public/images/no_image.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion resources/js/Components/Navbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@
{
name: 'Întrebări frecvente',
description: 'Ai o neclaritate? Găsește răspunsul aici.',
href: 'about'
href: 'faqs'
}
];
Expand Down
2 changes: 1 addition & 1 deletion resources/js/Components/cards/ArticleCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<li class="flex flex-col col-span-1 bg-white rounded-lg shadow-md">
<div class="flex flex-col flex-1">
<Link href="#" class="relative sm:h-52">
<img class="object-cover object-center w-full h-full rounded-t-lg sm:h-full sm:w-full" :src="data.cover_image" alt="aticle image" />
<img class="object-cover object-center w-full h-full rounded-t-lg sm:h-full sm:w-full" :src="data.cover_image ? data.cover_image : '/images/no_image.jpg'" alt="aticle image" />
</Link>

<div class="p-4 space-y-6">
Expand Down
2 changes: 1 addition & 1 deletion resources/js/Components/cards/ChampionshipProject.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
>

<img
:src="data.cover_image!=='' ?data.cover_image: 'https://images.unsplash.com/photo-1508779544523-dd1b27685be3?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1470&q=80'"
:src="data.cover_image!=='' ?data.cover_image: '/images/no_image.jpg'"
alt="imagine proiect"
class="object-cover object-center w-full h-full rounded-t-lg sm:h-full sm:w-full"
/>
Expand Down
2 changes: 1 addition & 1 deletion resources/js/Components/cards/Edition.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
>

<img
:src="data.cover_image!=='' ?data.cover_image: 'https://images.unsplash.com/photo-1508779544523-dd1b27685be3?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1470&q=80'"
:src="data.cover_image!=='' ?data.cover_image: '/images/no_image.jpg'"
alt="imagine proiect"
class="object-cover object-center w-full h-full rounded-t-lg sm:h-full sm:w-full"
/>
Expand Down
6 changes: 3 additions & 3 deletions resources/js/Components/cards/ProjectCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
<div class="flex flex-col flex-1">
<Link
:href="route('project', data.slug)"
class="relative bg-gray-200 group-hover:opacity-75 sm:h-52"
class="relative bg-gray-200 rounded-t-lg group-hover:opacity-75 sm:h-52"
>

<img
:src="data.cover_image!=='' ?data.cover_image: 'https://images.unsplash.com/photo-1508779544523-dd1b27685be3?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1470&q=80'"
:src="data.cover_image!=='' ?data.cover_image: '/images/no_image.jpg'"
alt="imagine proiect"
class="object-cover object-center w-full h-full rounded-t-lg sm:h-full sm:w-full"
/>
Expand Down Expand Up @@ -189,7 +189,7 @@ import {computed, onMounted} from "vue";

/** Get days till project ends. */
const project_end_date = computed(() => {
const targetDate = new Date(props.data.period_end);
const targetDate = new Date(props.data.end);
const today = new Date();
const timeDiff = targetDate.getTime() - today.getTime();
const daysDiff = Math.ceil(timeDiff / (1000 * 3600 * 24));
Expand Down
2 changes: 1 addition & 1 deletion resources/js/Components/cards/ProjectSummaryCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
class="relative sm:h-52"
>
<img
:src="data.cover_image!=='' ?data.cover_image: 'https://images.unsplash.com/photo-1508779544523-dd1b27685be3?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1470&q=80'"
:src="data.cover_image!=='' ?data.cover_image: '/images/no_image.jpg'"
alt="imagine proiect"
class="object-cover object-center w-full h-full rounded-lg shadow sm:h-full sm:w-full"
/>
Expand Down
2 changes: 1 addition & 1 deletion resources/js/Components/cards/RegionalProject.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
>

<img
:src="data.cover_image!=='' ?data.cover_image: 'https://images.unsplash.com/photo-1508779544523-dd1b27685be3?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1470&q=80'"
:src="data.cover_image!=='' ?data.cover_image: '/images/no_image.jpg'"
alt="imagine proiect"
class="object-cover object-center w-full h-full rounded-t-lg sm:h-full sm:w-full"
/>
Expand Down
3 changes: 3 additions & 0 deletions resources/js/Components/filters/MultiSelectFilter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,7 @@
overflow-x: auto;
white-space: nowrap;
}
ul::-webkit-scrollbar {
display: none;
}
</style>
30 changes: 21 additions & 9 deletions resources/js/Components/filters/MultiSelectObjectFilter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
<ComboboxLabel class="block text-sm font-medium leading-6 text-gray-900">{{ label }}</ComboboxLabel>
<div class="relative">

<div class="h-9 rounded-md border-0 bg-white py-1.5 px-3 pr-10 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 focus:ring-2 focus:ring-inset focus:ring-primary-500 sm:text-sm sm:leading-6">
<div class="w-full flex rounded-md h-9 border-0 bg-white py-1.5 px-3 pr-10 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 focus:ring-2 focus:ring-inset focus:ring-primary-500 sm:text-sm sm:leading-6">
<p v-if="selectedOptions.length > 0">({{selectedOptions.length}})</p>
<ul class="flex flex-wrap gap-1" v-if="selectedOptions.length > 0">
<li v-for="option in selectedOptions" :key="option.id">
{{ option.name }}
Expand Down Expand Up @@ -61,10 +62,13 @@
/** Query input. */
const query = ref('');
// /** Selected options. */
// const selectedOptions = ref([]);
/** Selected options. */
const selectedOptions = ref([]);
const localOptions = ref([]);
const emit = defineEmits(['update:modelValue']);
const emit = defineEmits(['update:modelValue', 'callback']);
/** Option list. */
const selectOptions = computed(() =>
Expand All @@ -73,12 +77,17 @@
})
);
/** Watch changes in selected options. */
watch(selectedOptions, () => {
let ids = selectedOptions.value.map(item => item.id)
emit('update:modelValue', ids);
emit('callback', ids)
})
const selectedOptions = computed({
get() {
return localOptions.value;
},
set(value) {
localOptions.value = value
let ids = localOptions.value.map(item => item.id)
emit('update:modelValue', ids);
emit('callback', ids)
},
});
</script>

<style scoped>
Expand All @@ -87,4 +96,7 @@
overflow-x: auto;
white-space: nowrap;
}
ul::-webkit-scrollbar {
display: none;
}
</style>
2 changes: 1 addition & 1 deletion resources/js/Components/filters/Sort.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<Menu as="div" class="relative z-50 inline-block text-left">
<Menu as="div" class="relative inline-block text-left z-101">
<div>
<MenuButton class="inline-flex items-center justify-center w-full px-3 py-2 text-sm font-semibold text-gray-900 bg-white rounded-md shadow-sm gap-x-4 ring-1 ring-inset ring-gray-300 hover:bg-gray-50">
<SvgLoader name="sort" />
Expand Down
Loading

0 comments on commit 9cc8e9e

Please sign in to comment.