switchable countries

This commit is contained in:
Benjamin Takats
2022-12-13 14:04:25 +01:00
parent bb2b722ea3
commit 2214142871
4 changed files with 68 additions and 21 deletions

View File

@@ -2,12 +2,33 @@
namespace App\Http\Livewire\Frontend;
use App\Models\Country;
use Livewire\Component;
class Welcome extends Component
{
public string $c = 'de';
protected $queryString = ['c'];
public function rules()
{
return [
'c' => 'required',
];
}
public function updated($property, $value)
{
$this->validate();
return to_route('welcome', ['c' => $value]);
}
public function render()
{
return view('livewire.frontend.welcome')->layout('layouts.guest');
return view('livewire.frontend.welcome', [
'countries' => Country::get(),
])->layout('layouts.guest');
}
}

14
composer.lock generated
View File

@@ -4434,7 +4434,7 @@
},
{
"name": "nova/start",
"version": "dev-blueprint",
"version": "dev-master",
"dist": {
"type": "path",
"url": "./nova-components/Start",
@@ -13815,16 +13815,16 @@
},
{
"name": "phpunit/php-code-coverage",
"version": "9.2.19",
"version": "9.2.20",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
"reference": "c77b56b63e3d2031bd8997fcec43c1925ae46559"
"reference": "af7463c955007de36db0c5e26d03e2f933c2e980"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/c77b56b63e3d2031bd8997fcec43c1925ae46559",
"reference": "c77b56b63e3d2031bd8997fcec43c1925ae46559",
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/af7463c955007de36db0c5e26d03e2f933c2e980",
"reference": "af7463c955007de36db0c5e26d03e2f933c2e980",
"shasum": ""
},
"require": {
@@ -13880,7 +13880,7 @@
],
"support": {
"issues": "https://github.com/sebastianbergmann/php-code-coverage/issues",
"source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.19"
"source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.20"
},
"funding": [
{
@@ -13888,7 +13888,7 @@
"type": "github"
}
],
"time": "2022-11-18T07:47:47+00:00"
"time": "2022-12-13T07:49:28+00:00"
},
{
"name": "phpunit/php-file-iterator",

View File

@@ -11,7 +11,7 @@
<nav
class="flex flex-wrap items-center mb-5 text-lg md:mb-0 md:pl-8 md:ml-8 md:border-l md:border-gray-800">
<a href="{{ route('welcome') }}"
<a href="{{ route('welcome', ['c' => $c]) }}"
class="text-gray-400 mr-5 font-medium leading-6 hover:text-gray-300">
Zurück zur Übersicht
</a>

View File

@@ -11,10 +11,24 @@
<p class="max-w-sm text-lg text-gray-200">
Eine Bitcoin Community für alle.
</p>
<div class="max-w-sm text-lg text-gray-200">
<x-select
label="Land wechseln"
placeholder="Land wechseln"
wire:model="c"
:clearable="false"
>
@foreach($countries as $country)
<x-select.user-option
src="{{ asset('vendor/blade-country-flags/4x3-'.$country->code.'.svg') }}"
label="{{ $country->name }}" value="{{ $country->code }}"/>
@endforeach
</x-select>
</div>
</div>
<div class="grid w-full grid-cols-1 gap-8 sm:grid-cols-2 md:grid-cols-3 xl:grid-cols-4">
<div class="row-span-2 col-span-full sm:col-span-1 md:col-start-1 sm:row-start-2 md:row-start-3">
<a href="{{ route('meetup.table.meetup', ['country' => 'de']) }}"
<a href="{{ route('meetup.table.meetup', ['country' => $c]) }}"
class="relative flex flex-col items-start justify-end w-full h-full overflow-hidden bg-black shadow-lg rounded-xl group"
style="aspect-ratio: 1/1;">
<div class="absolute inset-0 w-full h-full">
@@ -24,6 +38,9 @@
class="absolute inset-0 object-cover object-center w-full h-full transition duration-500 lg:opacity-80 group-hover:opacity-100 group-hover:scale-110"
src="{{ asset('img/meetup_saarland.jpg') }}" alt="">
</div>
<div class="absolute top-1 right-1 z-10 flex flex-col items-end justify-end w-full px-4 py-4">
<img class="rounded" src="{{ asset('vendor/blade-country-flags/4x3-'.$c.'.svg') }}" width="64" height="64"/>
</div>
<div class="relative z-10 flex flex-col items-start justify-start w-full px-6 py-7">
<span
class="px-2 py-1 mb-3 text-xs font-semibold tracking-tight text-white uppercase bg-amber-500 rounded-md">Plebs together strong</span>
@@ -35,7 +52,7 @@
</div>
<div
class="row-span-2 col-span-full sm:col-span-1 md:col-start-1 xl:col-start-2 sm:row-start-4 md:row-start-5 xl:row-start-2">
<a href="{{ route('school.table.city', ['country' => 'de']) }}"
<a href="{{ route('school.table.city', ['country' => $c]) }}"
class="relative flex flex-col items-start justify-end w-full h-full overflow-hidden bg-black shadow-lg rounded-xl group"
style="aspect-ratio: 1/1;">
<div class="absolute inset-0 w-full h-full">
@@ -45,6 +62,9 @@
class="absolute inset-0 object-cover object-center w-full h-full transition duration-500 lg:opacity-80 group-hover:opacity-100 group-hover:scale-110"
src="{{ asset('img/vhs_kurs.jpg') }}" alt="">
</div>
<div class="absolute top-1 right-1 z-10 flex flex-col items-end justify-end w-full px-4 py-4">
<img class="rounded" src="{{ asset('vendor/blade-country-flags/4x3-'.$c.'.svg') }}" width="64" height="64"/>
</div>
<div class="relative z-10 flex flex-col items-start justify-start w-full px-6 py-7">
<span
class="px-2 py-1 mb-3 text-xs font-semibold tracking-tight text-white uppercase bg-amber-500 rounded-md">Education</span>
@@ -56,7 +76,7 @@
</div>
<div
class="row-span-2 col-span-full sm:col-span-1 md:col-start-2 xl:col-start-2 sm:row-start-6 md:row-start-2 xl:row-start-4">
<a href="{{ route('library.table.libraryItems', ['country' => 'de']) }}"
<a href="{{ route('library.table.libraryItems', ['country' => $c]) }}"
class="relative flex flex-col items-start justify-end w-full h-full overflow-hidden bg-black shadow-lg rounded-xl group"
style="aspect-ratio: 1/1;">
<div class="absolute inset-0 w-full h-full">
@@ -77,7 +97,7 @@
</div>
<div
class="row-span-2 col-span-full sm:col-span-1 md:col-start-2 xl:col-start-3 sm:row-start-1 md:row-start-4 xl:row-start-1">
<a href="{{ route('bitcoinEvent.table.bitcoinEvent', ['country' => 'de']) }}"
<a href="{{ route('bitcoinEvent.table.bitcoinEvent', ['country' => $c]) }}"
class="relative flex flex-col items-start justify-end w-full h-full overflow-hidden bg-black shadow-lg rounded-xl group"
style="aspect-ratio: 1/1;">
<div class="absolute inset-0 w-full h-full">
@@ -87,6 +107,9 @@
class="absolute inset-0 object-cover object-center w-full h-full transition duration-500 lg:opacity-80 group-hover:opacity-100 group-hover:scale-110"
src="{{ asset('img/20220915_007_industryday.webp') }}" alt="">
</div>
<div class="absolute top-1 right-1 z-10 flex flex-col items-end justify-end w-full px-4 py-4">
<img class="rounded" src="{{ asset('vendor/blade-country-flags/4x3-'.$c.'.svg') }}" width="64" height="64"/>
</div>
<div class="relative z-10 flex flex-col items-start justify-start w-full px-6 py-7">
<span
class="px-2 py-1 mb-3 text-xs font-semibold tracking-tight text-white uppercase bg-amber-500 rounded-md">Worldwide</span>
@@ -98,7 +121,7 @@
</div>
<div
class="row-span-2 col-span-full sm:col-span-1 md:col-start-3 xl:col-start-3 sm:row-start-3 md:row-start-1 xl:row-start-3">
<a href="{{ route('bookCases.table.bookcases', ['country' => 'de']) }}"
<a href="{{ route('bookCases.table.bookcases', ['country' => $c]) }}"
class="relative flex flex-col items-start justify-end w-full h-full overflow-hidden bg-black shadow-lg rounded-xl group"
style="aspect-ratio: 1/1;">
<div class="absolute inset-0 w-full h-full">
@@ -108,6 +131,9 @@
class="absolute inset-0 object-cover object-center w-full h-full transition duration-500 lg:opacity-80 group-hover:opacity-100 group-hover:scale-110"
src="{{ asset('img/aprycot-media-bitcoin-21-lektionen-01.webp') }}" alt="">
</div>
<div class="absolute top-1 right-1 z-10 flex flex-col items-end justify-end w-full px-4 py-4">
<img class="rounded" src="{{ asset('vendor/blade-country-flags/4x3-'.$c.'.svg') }}" width="64" height="64"/>
</div>
<div class="relative z-10 flex flex-col items-start justify-start w-full px-6 py-7">
<span
class="px-2 py-1 mb-3 text-xs font-semibold tracking-tight text-white uppercase bg-amber-500 rounded-md">Reading</span>
@@ -119,7 +145,7 @@
</div>
{{--<div
class="row-span-2 col-span-full sm:col-span-1 md:col-start-3 xl:col-start-4 sm:row-start-5 md:row-start-3 xl:row-start-2">
<a href="{{ route('bookCases.table.bookcases', ['country' => 'de']) }}"
<a href="{{ route('bookCases.table.bookcases', ['country' => $c]) }}"
class="relative flex flex-col items-start justify-end w-full h-full overflow-hidden bg-black shadow-lg rounded-xl group"
style="aspect-ratio: 1/1;">
<div class="absolute inset-0 w-full h-full">