diff --git a/app/Http/Controllers/RedirectToElectionController.php b/app/Http/Controllers/RedirectToElectionController.php index fc067ca..207fba0 100644 --- a/app/Http/Controllers/RedirectToElectionController.php +++ b/app/Http/Controllers/RedirectToElectionController.php @@ -13,13 +13,9 @@ public function __invoke(?Election $election = null): RedirectResponse { $election ??= Election::query() ->where('is_visible', true) - ->orderBy('type') - ->latest() ->first(); - if (blank($election)) { - abort(404); - } + abort_unless($election, 404); return redirect()->to($election->getDefaultUrl()); } diff --git a/app/View/Components/Site/Footer.php b/app/View/Components/Site/Footer.php new file mode 100644 index 0000000..a2602ca --- /dev/null +++ b/app/View/Components/Site/Footer.php @@ -0,0 +1,75 @@ +menuItems = $this->getMenuItems(); + + $this->socialItems = $this->getSocialItems(); + } + + protected function getMenuItems(): Collection + { + return Cache::remember('footer-menu', Time::DAY_IN_SECONDS, function () { + $menu = Menu::location('footer'); + + if (blank($menu)) { + return collect(); + } + + return $menu->menuItems; + }); + } + + protected function getSocialItems(): Collection + { + return collect([ + [ + 'name' => 'Facebook', + 'url' => 'https://www.facebook.com/code4romania/', + 'icon' => 'ri-facebook-fill', + ], + [ + 'name' => 'Twitter', + 'url' => 'https://x.com/code4romania/', + 'icon' => 'ri-twitter-x-fill', + ], + [ + 'name' => 'Instagram', + 'url' => 'https://www.instagram.com/code4romania/', + 'icon' => 'ri-instagram-line', + ], + [ + 'name' => 'LinkedIn', + 'url' => 'https://www.linkedin.com/company/code4romania/', + 'icon' => 'ri-linkedin-fill', + ], + [ + 'name' => 'GitHub', + 'url' => 'https://github.com/code4romania/rezultatevot', + 'icon' => 'ri-github-fill', + ], + ]); + } + + public function render(): View + { + return view('components.site.footer'); + } +} diff --git a/lang/ro/app.php b/lang/ro/app.php index 173ad3c..a4b68bf 100644 --- a/lang/ro/app.php +++ b/lang/ro/app.php @@ -4,7 +4,7 @@ return [ - 'banner' => 'O soluție Commit Global.', + 'banner' => 'O soluție Code for Romania.', 'skip' => 'Sari la conținut', 'all' => 'Toate', 'generate' => 'Generează', diff --git a/resources/svg/code4commit.svg b/resources/svg/code4commit.svg deleted file mode 100644 index 01d440c..0000000 --- a/resources/svg/code4commit.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/resources/svg/code4romania.svg b/resources/svg/code4romania.svg new file mode 100644 index 0000000..81ff3c4 --- /dev/null +++ b/resources/svg/code4romania.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/resources/svg/commitglobal.svg b/resources/svg/commitglobal.svg deleted file mode 100644 index 8c63525..0000000 --- a/resources/svg/commitglobal.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/resources/views/components/navigation-item.blade.php b/resources/views/components/navigation-item.blade.php index 423e222..3a0a63c 100644 --- a/resources/views/components/navigation-item.blade.php +++ b/resources/views/components/navigation-item.blade.php @@ -1,14 +1,17 @@ -@props(['mobile' => false]) +@props([ + 'mobile' => false, + 'primary' => false, +]) merge([ 'href' => $item->url, 'wire:navigate' => $item->target === '_self', ])->class([ - 'font-medium leading-tight', - 'text-primary-900 hover:bg-primary-50', + ' leading-tight', + $primary ? 'font-medium text-primary-900 hover:bg-primary-50' : 'text-gray-600 hover:text-gray-900', // $isCurrent() ? 'bg-primary-50' : '', - $mobile ? 'flex px-2 py-3' : 'px-3 py-2 rounded', + $primary ? ($mobile ? 'flex px-2 py-3' : 'px-3 py-2 rounded') : '', ]) }}> {{ $item->title }} diff --git a/resources/views/components/site/banner.blade.php b/resources/views/components/site/banner.blade.php index 6be55af..da85fcb 100644 --- a/resources/views/components/site/banner.blade.php +++ b/resources/views/components/site/banner.blade.php @@ -10,11 +10,11 @@ @endif - + {{ __('app.banner') }} diff --git a/resources/views/components/site/footer.blade.php b/resources/views/components/site/footer.blade.php index 15d95c1..52d4354 100644 --- a/resources/views/components/site/footer.blade.php +++ b/resources/views/components/site/footer.blade.php @@ -1,31 +1,24 @@