Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
gheorghelupu17 committed Jul 30, 2023
1 parent 56788c5 commit 231bd77
Show file tree
Hide file tree
Showing 32 changed files with 170 additions and 154 deletions.
2 changes: 1 addition & 1 deletion app/Filament/Resources/ArticleResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public static function form(Form $form): Form
->label(__('article.gallery'))
->enableReordering()->columnSpanFull(),

]);
]);
}

public static function table(Table $table): Table
Expand Down
18 changes: 9 additions & 9 deletions app/Http/Controllers/AdminBBTemporary.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function about()
];

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

Expand All @@ -54,29 +54,29 @@ public function faqs()
'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>'
'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>'
'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>'
'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>'
'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>'
]
]
'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
'faqs' => $faqs,
]);
}
}
4 changes: 2 additions & 2 deletions app/Http/Controllers/ArticleController.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function index(Request $request)

$articles = Article::active()->with('category');
if ($request->get('category')) {
$category = $categories->search(function (ArticleCategory $item) use ($request) {
$category = $categories->search(function (ArticleCategory $item) use ($request) {
return $item['slug'] == $request->get('category');
});
$articles = $articles->where('article_category_id', $category);
Expand All @@ -38,7 +38,7 @@ public function article(Article $article)
{
$article->load('category');
$gallery = $article->getMedia('gallery');
//dd($article->relatedArticles()->get());
//dd($article->relatedArticles()->get());
return Inertia::render('Public/Articles/Article', [
'article' => $article,
'gallery' => $gallery,
Expand Down
15 changes: 6 additions & 9 deletions app/Http/Controllers/Auth/RegisteredUserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
use Illuminate\Auth\Events\Registered;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Log\Logger;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Notification;
use Illuminate\Support\Facades\Redirect;
Expand All @@ -40,7 +40,7 @@ public function create(): Response
'Auth/Register',
[
'activity_domains' => $activityDomains,
'counties' => $counties
'counties' => $counties,
]
);
}
Expand All @@ -53,21 +53,22 @@ public function create(): Response
public function store(RegistrationRequest $request): RedirectResponse
{
try {

$data = $request->validated();
$user = $data['user'];

$user = User::create([
'name' => $user['name'],
'email' => $user['email'],
'password' => Hash::make($user['password']),
'role' => $data['type']
'role' => $data['type'],
]);
event(new Registered($user));

if ($data['type'] == 'ngo-admin') {
$ong = $data['ong'];
$organization = Organization::create($ong);
$organization->addMediaFromRequest('ong.logo')->toMediaCollection('organizationFilesLogo');
$organization->addMediaFromRequest('ong.statute')->toMediaCollection('organizationFilesStatute');
$organization->activityDomains()->attach($ong['activity_domains_ids']);
$organization->counties()->attach($ong['counties_ids']);
$adminUsers = User::whereRole(UserRole::bb_admin)->get();
Expand All @@ -76,8 +77,8 @@ public function store(RegistrationRequest $request): RedirectResponse
$user->organization_id = $organization->id;
$user->save();
}
return redirect()->route('register')->with('success_message', ['message' => 'Contul a fost creat', 'usrid' => $user['id']]);

return redirect()->route('register')->with('success_message', ['message' => 'Contul a fost creat', 'usrid' => $user['id']]);
} catch(\Throwable $th) {
return redirect()->back()->with('error_message', 'Contul nu a fost creat');
}
Expand All @@ -88,12 +89,8 @@ public function update(Request $request, $userId): RedirectResponse
try {
$user = User::find($userId);
$user->source_of_information = $request->input('source_of_information');

$user->save();

// return redirect()->route('login')->with('success', '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
90 changes: 44 additions & 46 deletions app/Http/Controllers/DonorController.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,143 +4,141 @@

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Inertia\Inertia;

class DonorController extends Controller
{
public function index()
{
$profile = [
'description' =>
'<p>Mulțumim că ești alături de noi. Prin participarea ta activă la această inițiativă, ne arăți că ești preocupat de problemele sociale și că vrei să faci o diferență pozitivă în lumea în care trăim, iar contribuția ta este extrem de valoroasă.</p>
'description' => '<p>Mulțumim că ești alături de noi. Prin participarea ta activă la această inițiativă, ne arăți că ești preocupat de problemele sociale și că vrei să faci o diferență pozitivă în lumea în care trăim, iar contribuția ta este extrem de valoroasă.</p>
<p>Prin distribuirea informațiilor despre proiectele de pe Bursa Binelui și încurajând prietenii și familia să se alăture, devii un promotor important al inițiativei noastre.</p>
<p>Fiecare pas pe care îl facem împreună contează și, împreună, putem face o diferență semnificativă.</p>',
'donations_place' => '5%',
'donations_status' => [
'Ai donat către mai mult de 5 organizații',
'Volunariezi la 3 organizații',
'Ești abonat la newsletterul de bine',
'Ai distribuit de multiple ori informații utile'
'Ai distribuit de multiple ori informații utile',
],
];

$badges = [
[
'name' => 'multiple_donor',
'title' => 'multiple_donor_title',
'description' => 'multiple_donor_description'
'description' => 'multiple_donor_description',
],
[
'name' => 'subscriber',
'title' => 'subscriber_donor_title',
'description' => 'subscriber_donor_description'
'description' => 'subscriber_donor_description',
],
[
'name' => 'long_race',
'title' => 'long_race_title',
'description' => 'long_race_description'
'description' => 'long_race_description',
],
[
'name' => 'supporter',
'title' => 'supporter_donor_title',
'description' => 'supporter_donor_description'
'description' => 'supporter_donor_description',
],
[
'name' => 'month_volunteer',
'title' => 'month_volunteer_title',
'description' => 'month_volunteer_description'
'description' => 'month_volunteer_description',
],
[
'name' => 'top_donor',
'title' => 'top_donor_title',
'description' => 'top_donor_description'
'description' => 'top_donor_description',
],
[
'name' => 'donor',
'title' => 'recurent_donor_title',
'description' => 'recurent_donor_description'
]
'description' => 'recurent_donor_description',
],
];

return Inertia::render('Donor/Dashboard', [
'profile' => $profile,
'badges' => $badges
'badges' => $badges,
]);
}

public function donations()
{
$donations = [
"current_page" => 2,
"data" => [
'current_page' => 2,
'data' => [
[
'id' => 1,
'organization' => 'Asociația Un Zâmbet pentru copilul tău',
'project' => 'Zambet pentru copiii noștri',
'created_at' => '12.08.2022',
'amount' => '300'
'amount' => '300',
],
[
'id' => 2,
'organization' => 'Asociația Un Zâmbet pentru copilul tău',
'project' => 'Zambet pentru copiii noștri',
'created_at' => '12.08.2022',
'amount' => '300'
'amount' => '300',
],

[
'id' => 3,
'organization' => 'Asociația Un Zâmbet pentru copilul tău',
'project' => 'Zambet pentru copiii noștri',
'created_at' => '12.08.2022',
'amount' => '300'
'amount' => '300',
],
[
'id' => 4,
'organization' => 'Asociația Un Zâmbet pentru copilul tău',
'project' => 'Zambet pentru copiii noștri',
'created_at' => '12.08.2022',
'amount' => '300'
]
'amount' => '300',
],
],
"first_page_url" => "http=>//bursabinelui.test/proiecte?page=1",
"from"=> 1,
"last_page"=> 2,
"last_page_url"=> "http://bursabinelui.test/proiecte?page=2",
"links"=> [
'first_page_url' => 'http=>//bursabinelui.test/proiecte?page=1',
'from'=> 1,
'last_page'=> 2,
'last_page_url'=> 'http://bursabinelui.test/proiecte?page=2',
'links'=> [
[
"url"=> "http://bursabinelui.test/proiecte?page=1",
"label"=> "1",
"active"=> true
'url'=> 'http://bursabinelui.test/proiecte?page=1',
'label'=> '1',
'active'=> true,
],
[
"url"=> "http://bursabinelui.test/proiecte?page=1",
"label"=> "1",
"active"=> true
'url'=> 'http://bursabinelui.test/proiecte?page=1',
'label'=> '1',
'active'=> true,
],
[
"url"=> "http://bursabinelui.test/proiecte?page=2",
"label"=> "2",
"active"=> false
'url'=> 'http://bursabinelui.test/proiecte?page=2',
'label'=> '2',
'active'=> false,
],
[
"url"=> "http://bursabinelui.test/proiecte?page=3",
"label"=> "3",
"active"=> false
'url'=> 'http://bursabinelui.test/proiecte?page=3',
'label'=> '3',
'active'=> false,
],
[
"url"=> "http://bursabinelui.test/proiecte?page=1",
"label"=> "1",
"active"=> true
'url'=> 'http://bursabinelui.test/proiecte?page=1',
'label'=> '1',
'active'=> true,
],
],
"next_page_url"=> "http://bursabinelui.test/proiecte?page=3",
"path"=> "http://bursabinelui.test/proiecte",
"per_page"=> 15,
"prev_page_url"=> 'http://bursabinelui.test/proiecte?page=1',
"to"=> 15,
"total"=> 20
'next_page_url'=> 'http://bursabinelui.test/proiecte?page=3',
'path'=> 'http://bursabinelui.test/proiecte',
'per_page'=> 15,
'prev_page_url'=> 'http://bursabinelui.test/proiecte?page=1',
'to'=> 15,
'total'=> 20,
];

return Inertia::render('Donor/Donations', [
Expand Down
Loading

0 comments on commit 231bd77

Please sign in to comment.