new header

This commit is contained in:
HolgerHatGarKeineNode
2023-02-25 23:56:07 +01:00
parent 86e1ed6007
commit f0311f8230
17 changed files with 1596 additions and 296 deletions

View File

@@ -5,6 +5,7 @@ namespace App\Http\Livewire\BookCase\Form;
use App\Models\BookCase; use App\Models\BookCase;
use App\Models\Country; use App\Models\Country;
use App\Models\OrangePill; use App\Models\OrangePill;
use Illuminate\Validation\Rule;
use Livewire\Component; use Livewire\Component;
use Livewire\WithFileUploads; use Livewire\WithFileUploads;
@@ -27,12 +28,13 @@ class OrangePillForm extends Component
public function rules() public function rules()
{ {
return [ return [
'orangePill.book_case_id' => 'required', 'orangePill.book_case_id' => ['required'],
'orangePill.user_id' => 'required', 'orangePill.user_id' => ['required'],
'orangePill.amount' => 'required|numeric', 'orangePill.amount' => ['required', 'numeric'],
'orangePill.date' => 'required|date', 'orangePill.date' => ['required', 'date'],
'orangePill.comment' => 'required|string', 'orangePill.comment' => ['required', 'string'],
'image' => 'image|max:8192', // 8MB Max
'image' => ['max:8192', Rule::requiredIf(!$this->orangePill->id), 'image', 'nullable'], // 8MB Max
]; ];
} }
@@ -54,10 +56,13 @@ class OrangePillForm extends Component
{ {
$this->validate(); $this->validate();
$this->orangePill->save(); $this->orangePill->save();
if ($this->image) {
$this->orangePill $this->orangePill
->addMedia($this->image) ->addMedia($this->image)
->usingFileName(md5($this->image->getClientOriginalName()).'.'.$this->image->getClientOriginalExtension()) ->usingFileName(md5($this->image->getClientOriginalName()).'.'.$this->image->getClientOriginalExtension())
->toMediaCollection('images'); ->toMediaCollection('images');
}
return redirect($this->fromUrl); return redirect($this->fromUrl);
} }

View File

@@ -24,7 +24,11 @@ class ContentCreatorForm extends Component
return [ return [
'image' => [Rule::requiredIf(!$this->lecturer->id), 'nullable', 'mimes:jpeg,png,jpg,gif', 'max:10240'], 'image' => [Rule::requiredIf(!$this->lecturer->id), 'nullable', 'mimes:jpeg,png,jpg,gif', 'max:10240'],
'lecturer.name' => 'required', 'lecturer.name' => [
'required',
Rule::unique('lecturers', 'name')
->ignore($this->lecturer),
],
'lecturer.active' => 'boolean', 'lecturer.active' => 'boolean',
'lecturer.subtitle' => 'nullable|string', 'lecturer.subtitle' => 'nullable|string',
'lecturer.intro' => 'nullable|string', 'lecturer.intro' => 'nullable|string',

View File

@@ -2,8 +2,13 @@
namespace App\Http\Livewire\Frontend; namespace App\Http\Livewire\Frontend;
use App\Models\BitcoinEvent;
use App\Models\City; use App\Models\City;
use App\Models\Country; use App\Models\Country;
use App\Models\CourseEvent;
use App\Models\LibraryItem;
use App\Models\MeetupEvent;
use App\Models\OrangePill;
use Illuminate\Support\Facades\Cookie; use Illuminate\Support\Facades\Cookie;
use Illuminate\Support\Facades\Route; use Illuminate\Support\Facades\Route;
use Livewire\Component; use Livewire\Component;
@@ -33,7 +38,7 @@ class Header extends Component
public function mount() public function mount()
{ {
$this->l = Cookie::get('lang') ?: config('app.locale'); $this->l = Cookie::get('lang') ?: config('app.locale');
if (! $this->country) { if (!$this->country) {
$this->country = Country::query() $this->country = Country::query()
->where('code', $this->c) ->where('code', $this->c)
->first(); ->first();
@@ -59,6 +64,60 @@ class Header extends Component
Cookie::queue('lang', $this->l, 60 * 24 * 365); Cookie::queue('lang', $this->l, 60 * 24 * 365);
return view('livewire.frontend.header', [ return view('livewire.frontend.header', [
'news' => LibraryItem::query()
->with([
'createdBy.roles',
'lecturer',
'tags',
])
->where('type', 'markdown_article')
->where('news', true)
->orderByDesc('created_at')
->take(2)
->get(),
'meetups' => MeetupEvent::query()
->with([
'meetup.users',
'meetup.city.country',
])
->where('start', '>', now())
->orderBy('start')
->take(2)
->get(),
'courseEvents' => CourseEvent::query()
->with([
'venue.city.country',
'course.lecturer',
])
->where('from', '>', now())
->orderBy('from')
->take(2)
->get(),
'libraryItems' => LibraryItem::query()
->with([
'lecturer',
])
->where('type', '<>', 'markdown_article')
->orderBy('created_at')
->take(2)
->get(),
'bitcoinEvents' => BitcoinEvent::query()
->with([
'venue',
])
->where('from', '>', now())
->orderBy('from')
->take(2)
->get(),
'orangePills' => OrangePill::query()
->with([
'user',
'bookCase',
])
->where('date', '>', now())
->orderBy('date')
->take(2)
->get(),
'cities' => City::query() 'cities' => City::query()
->select(['latitude', 'longitude']) ->select(['latitude', 'longitude'])
->get(), ->get(),

96
composer.lock generated
View File

@@ -1643,24 +1643,24 @@
}, },
{ {
"name": "graham-campbell/result-type", "name": "graham-campbell/result-type",
"version": "v1.1.0", "version": "v1.1.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/GrahamCampbell/Result-Type.git", "url": "https://github.com/GrahamCampbell/Result-Type.git",
"reference": "a878d45c1914464426dc94da61c9e1d36ae262a8" "reference": "672eff8cf1d6fe1ef09ca0f89c4b287d6a3eb831"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/GrahamCampbell/Result-Type/zipball/a878d45c1914464426dc94da61c9e1d36ae262a8", "url": "https://api.github.com/repos/GrahamCampbell/Result-Type/zipball/672eff8cf1d6fe1ef09ca0f89c4b287d6a3eb831",
"reference": "a878d45c1914464426dc94da61c9e1d36ae262a8", "reference": "672eff8cf1d6fe1ef09ca0f89c4b287d6a3eb831",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": "^7.2.5 || ^8.0", "php": "^7.2.5 || ^8.0",
"phpoption/phpoption": "^1.9" "phpoption/phpoption": "^1.9.1"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "^8.5.28 || ^9.5.21" "phpunit/phpunit": "^8.5.32 || ^9.6.3 || ^10.0.12"
}, },
"type": "library", "type": "library",
"autoload": { "autoload": {
@@ -1689,7 +1689,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/GrahamCampbell/Result-Type/issues", "issues": "https://github.com/GrahamCampbell/Result-Type/issues",
"source": "https://github.com/GrahamCampbell/Result-Type/tree/v1.1.0" "source": "https://github.com/GrahamCampbell/Result-Type/tree/v1.1.1"
}, },
"funding": [ "funding": [
{ {
@@ -1701,7 +1701,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2022-07-30T15:56:11+00:00" "time": "2023-02-25T20:23:15+00:00"
}, },
{ {
"name": "guzzlehttp/guzzle", "name": "guzzlehttp/guzzle",
@@ -2811,16 +2811,16 @@
}, },
{ {
"name": "laravel/framework", "name": "laravel/framework",
"version": "v10.1.3", "version": "v10.1.5",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/laravel/framework.git", "url": "https://github.com/laravel/framework.git",
"reference": "12256504186326a9d02b2ab3b43a4031a59b52d1" "reference": "57850ab537cf0554b5b616215079c761b98168c8"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/laravel/framework/zipball/12256504186326a9d02b2ab3b43a4031a59b52d1", "url": "https://api.github.com/repos/laravel/framework/zipball/57850ab537cf0554b5b616215079c761b98168c8",
"reference": "12256504186326a9d02b2ab3b43a4031a59b52d1", "reference": "57850ab537cf0554b5b616215079c761b98168c8",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -3007,7 +3007,7 @@
"issues": "https://github.com/laravel/framework/issues", "issues": "https://github.com/laravel/framework/issues",
"source": "https://github.com/laravel/framework" "source": "https://github.com/laravel/framework"
}, },
"time": "2023-02-22T14:38:35+00:00" "time": "2023-02-24T09:57:13+00:00"
}, },
{ {
"name": "laravel/horizon", "name": "laravel/horizon",
@@ -3214,17 +3214,17 @@
}, },
{ {
"name": "laravel/nova", "name": "laravel/nova",
"version": "4.22.0", "version": "4.22.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "git@github.com:laravel/nova.git", "url": "git@github.com:laravel/nova.git",
"reference": "eb105414c6dedc3fda8e9ca62bdbe99dec80cd31" "reference": "3daa3889d1bc6687f71282d8079ba174bc2283fe"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://nova.laravel.com/dist/laravel/nova/laravel-nova-eb105414c6dedc3fda8e9ca62bdbe99dec80cd31-zip-668949.zip", "url": "https://nova.laravel.com/dist/laravel/nova/laravel-nova-3daa3889d1bc6687f71282d8079ba174bc2283fe-zip-6b73aa.zip",
"reference": "eb105414c6dedc3fda8e9ca62bdbe99dec80cd31", "reference": "3daa3889d1bc6687f71282d8079ba174bc2283fe",
"shasum": "2557303a3883136630a205c5ad858a7950515333" "shasum": "6ae486d53c6aa00d16ef36395e1688b0e2e93b67"
}, },
"require": { "require": {
"brick/money": "^0.5.0|^0.6.0|^0.7.0|^0.8.0", "brick/money": "^0.5.0|^0.6.0|^0.7.0|^0.8.0",
@@ -3243,7 +3243,6 @@
"symfony/process": "^5.4|^6.0" "symfony/process": "^5.4|^6.0"
}, },
"require-dev": { "require-dev": {
"laravel/framework": "10.x-dev",
"laravel/nova-dusk-suite": "8.4.x-dev|9.4.x-dev|10.4.x-dev", "laravel/nova-dusk-suite": "8.4.x-dev|9.4.x-dev|10.4.x-dev",
"laravel/pint": "^1.4", "laravel/pint": "^1.4",
"laravel/scout": "^9.8", "laravel/scout": "^9.8",
@@ -3318,9 +3317,9 @@
"laravel" "laravel"
], ],
"support": { "support": {
"source": "https://github.com/laravel/nova/tree/v4.22.0" "source": "https://github.com/laravel/nova/tree/v4.22.1"
}, },
"time": "2023-02-08T20:59:46+00:00" "time": "2023-02-23T23:50:42+00:00"
}, },
{ {
"name": "laravel/sanctum", "name": "laravel/sanctum",
@@ -5211,16 +5210,16 @@
}, },
{ {
"name": "nova-kit/nova-packages-tool", "name": "nova-kit/nova-packages-tool",
"version": "v1.7.0", "version": "v1.7.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/nova-kit/nova-packages-tool.git", "url": "https://github.com/nova-kit/nova-packages-tool.git",
"reference": "8d57d348f3779d66a36cfc6c5316e31877a9e781" "reference": "1e6317f9f370ae8e778f147092b8e288171e94e2"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/nova-kit/nova-packages-tool/zipball/8d57d348f3779d66a36cfc6c5316e31877a9e781", "url": "https://api.github.com/repos/nova-kit/nova-packages-tool/zipball/1e6317f9f370ae8e778f147092b8e288171e94e2",
"reference": "8d57d348f3779d66a36cfc6c5316e31877a9e781", "reference": "1e6317f9f370ae8e778f147092b8e288171e94e2",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -5228,7 +5227,8 @@
"php": "^7.3 || ^8.0" "php": "^7.3 || ^8.0"
}, },
"require-dev": { "require-dev": {
"orchestra/testbench": "^6.24 || ^7.0 || ^8.0" "orchestra/testbench": "^6.24 || ^7.0 || ^8.0",
"phpunit/phpunit": "^9.6"
}, },
"type": "library", "type": "library",
"extra": { "extra": {
@@ -5255,9 +5255,9 @@
], ],
"description": "Tool for Laravel Nova Packages Development", "description": "Tool for Laravel Nova Packages Development",
"support": { "support": {
"source": "https://github.com/nova-kit/nova-packages-tool/tree/v1.7.0" "source": "https://github.com/nova-kit/nova-packages-tool/tree/v1.7.1"
}, },
"time": "2023-02-08T22:02:49+00:00" "time": "2023-02-23T23:53:41+00:00"
}, },
{ {
"name": "nova/start", "name": "nova/start",
@@ -6268,24 +6268,24 @@
}, },
{ {
"name": "phpoption/phpoption", "name": "phpoption/phpoption",
"version": "1.9.0", "version": "1.9.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/schmittjoh/php-option.git", "url": "https://github.com/schmittjoh/php-option.git",
"reference": "dc5ff11e274a90cc1c743f66c9ad700ce50db9ab" "reference": "dd3a383e599f49777d8b628dadbb90cae435b87e"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/schmittjoh/php-option/zipball/dc5ff11e274a90cc1c743f66c9ad700ce50db9ab", "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/dd3a383e599f49777d8b628dadbb90cae435b87e",
"reference": "dc5ff11e274a90cc1c743f66c9ad700ce50db9ab", "reference": "dd3a383e599f49777d8b628dadbb90cae435b87e",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": "^7.2.5 || ^8.0" "php": "^7.2.5 || ^8.0"
}, },
"require-dev": { "require-dev": {
"bamarni/composer-bin-plugin": "^1.8", "bamarni/composer-bin-plugin": "^1.8.2",
"phpunit/phpunit": "^8.5.28 || ^9.5.21" "phpunit/phpunit": "^8.5.32 || ^9.6.3 || ^10.0.12"
}, },
"type": "library", "type": "library",
"extra": { "extra": {
@@ -6327,7 +6327,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/schmittjoh/php-option/issues", "issues": "https://github.com/schmittjoh/php-option/issues",
"source": "https://github.com/schmittjoh/php-option/tree/1.9.0" "source": "https://github.com/schmittjoh/php-option/tree/1.9.1"
}, },
"funding": [ "funding": [
{ {
@@ -6339,7 +6339,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2022-07-30T15:51:26+00:00" "time": "2023-02-25T19:38:58+00:00"
}, },
{ {
"name": "pimple/pimple", "name": "pimple/pimple",
@@ -14617,16 +14617,16 @@
}, },
{ {
"name": "laravel-lang/lang", "name": "laravel-lang/lang",
"version": "12.18.2", "version": "12.18.3",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/Laravel-Lang/lang.git", "url": "https://github.com/Laravel-Lang/lang.git",
"reference": "fcf3750d1fc56c86649d9b70418dbe5309303957" "reference": "b7f80e78e9555895f1a94db9a3bf311c98942bff"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/Laravel-Lang/lang/zipball/fcf3750d1fc56c86649d9b70418dbe5309303957", "url": "https://api.github.com/repos/Laravel-Lang/lang/zipball/b7f80e78e9555895f1a94db9a3bf311c98942bff",
"reference": "fcf3750d1fc56c86649d9b70418dbe5309303957", "reference": "b7f80e78e9555895f1a94db9a3bf311c98942bff",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -14679,7 +14679,7 @@
"type": "open_collective" "type": "open_collective"
} }
], ],
"time": "2023-02-22T17:19:29+00:00" "time": "2023-02-23T16:22:56+00:00"
}, },
{ {
"name": "laravel-lang/publisher", "name": "laravel-lang/publisher",
@@ -15247,23 +15247,23 @@
}, },
{ {
"name": "phpunit/php-code-coverage", "name": "phpunit/php-code-coverage",
"version": "9.2.24", "version": "9.2.25",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/php-code-coverage.git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git",
"reference": "2cf940ebc6355a9d430462811b5aaa308b174bed" "reference": "0e2b40518197a8c0d4b08bc34dfff1c99c508954"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/2cf940ebc6355a9d430462811b5aaa308b174bed", "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/0e2b40518197a8c0d4b08bc34dfff1c99c508954",
"reference": "2cf940ebc6355a9d430462811b5aaa308b174bed", "reference": "0e2b40518197a8c0d4b08bc34dfff1c99c508954",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"ext-dom": "*", "ext-dom": "*",
"ext-libxml": "*", "ext-libxml": "*",
"ext-xmlwriter": "*", "ext-xmlwriter": "*",
"nikic/php-parser": "^4.14", "nikic/php-parser": "^4.15",
"php": ">=7.3", "php": ">=7.3",
"phpunit/php-file-iterator": "^3.0.3", "phpunit/php-file-iterator": "^3.0.3",
"phpunit/php-text-template": "^2.0.2", "phpunit/php-text-template": "^2.0.2",
@@ -15312,7 +15312,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues",
"source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.24" "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.25"
}, },
"funding": [ "funding": [
{ {
@@ -15320,7 +15320,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2023-01-26T08:26:55+00:00" "time": "2023-02-25T05:32:00+00:00"
}, },
{ {
"name": "phpunit/php-file-iterator", "name": "phpunit/php-file-iterator",

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,7 +1,7 @@
{ {
"/app.js": "/app.js?id=57a9e6e71f0c0b5b86c21f72196b043f", "/app.js": "/app.js?id=98c5c53ef4ec8700776f999086de129e",
"/manifest.js": "/manifest.js?id=d75058ce2144a4049857d3ff9e02de1e", "/manifest.js": "/manifest.js?id=d75058ce2144a4049857d3ff9e02de1e",
"/app.css": "/app.css?id=a8d233b21d4b19672e83a23a2dabfed7", "/app.css": "/app.css?id=f33fcd06eab1fae1d91d0347f8a3f06c",
"/vendor.js": "/vendor.js?id=de86bde8857e857b607852d11627d8e4", "/vendor.js": "/vendor.js?id=de86bde8857e857b607852d11627d8e4",
"/fonts/snunitosansv11pe01mimslybiv1o4x1m8cce4g1pty10iurt9w6fk2a.woff2": "/fonts/snunitosansv11pe01mimslybiv1o4x1m8cce4g1pty10iurt9w6fk2a.woff2?id=c8390e146be0a3c8a5498355dec892ae", "/fonts/snunitosansv11pe01mimslybiv1o4x1m8cce4g1pty10iurt9w6fk2a.woff2": "/fonts/snunitosansv11pe01mimslybiv1o4x1m8cce4g1pty10iurt9w6fk2a.woff2?id=c8390e146be0a3c8a5498355dec892ae",
"/fonts/snunitosansv11pe01mimslybiv1o4x1m8cce4g1pty14iurt9w6fk2a.woff2": "/fonts/snunitosansv11pe01mimslybiv1o4x1m8cce4g1pty14iurt9w6fk2a.woff2?id=b0735c7dd6126471acbaf9d6e9f5e41a", "/fonts/snunitosansv11pe01mimslybiv1o4x1m8cce4g1pty14iurt9w6fk2a.woff2": "/fonts/snunitosansv11pe01mimslybiv1o4x1m8cce4g1pty14iurt9w6fk2a.woff2?id=b0735c7dd6126471acbaf9d6e9f5e41a",

View File

@@ -1,3 +1,4 @@
import './components'
import './bootstrap' import './bootstrap'
import Alpine from 'alpinejs' import Alpine from 'alpinejs'

396
resources/js/components.js Normal file
View File

@@ -0,0 +1,396 @@
function useTrackedPointer () {
let e = [
-1,
-1
]
return {
wasMoved (t) {
let n = [
t.screenX,
t.screenY
]
return (
e[0] !== n[0] || e[1] !== n[1]
) && (
e = n, !0
)
},
update (t) {
e = [
t.screenX,
t.screenY
]
}
}
}
window.Components = {}, window.Components.listbox = function (e) {
let t = e.modelName || 'selected', n = useTrackedPointer()
return {
init () {
this.optionCount = this.$refs.listbox.children.length, this.$watch(
'activeIndex',
(
e => {
this.open && (
null !== this.activeIndex ? this.activeDescendant
= this.$refs.listbox.children[this.activeIndex].id : this.activeDescendant = ''
)
}
)
)
},
activeDescendant: null,
optionCount: null,
open: !1,
activeIndex: null,
selectedIndex: 0,
get active () {return this.items[this.activeIndex]},
get [t] () {return this.items[this.selectedIndex]},
choose (e) {this.selectedIndex = e, this.open = !1},
onButtonClick () {
this.open || (
this.activeIndex = this.selectedIndex, this.open = !0, this.$nextTick((
() => {this.$refs.listbox.focus(), this.$refs.listbox.children[this.activeIndex].scrollIntoView({ block: 'nearest' })}
))
)
},
onOptionSelect () {
null !== this.activeIndex && (
this.selectedIndex = this.activeIndex
), this.open = !1, this.$refs.button.focus()
},
onEscape () {this.open = !1, this.$refs.button.focus()},
onArrowUp () {
this.activeIndex = this.activeIndex - 1 < 0 ? this.optionCount - 1 : this.activeIndex
- 1, this.$refs.listbox.children[this.activeIndex].scrollIntoView({ block: 'nearest' })
},
onArrowDown () {
this.activeIndex = this.activeIndex + 1 > this.optionCount - 1 ? 0 : this.activeIndex
+ 1, this.$refs.listbox.children[this.activeIndex].scrollIntoView({ block: 'nearest' })
},
onMouseEnter (e) {n.update(e)},
onMouseMove (
e,
t
) {
n.wasMoved(e) && (
this.activeIndex = t
)
},
onMouseLeave (e) {
n.wasMoved(e) && (
this.activeIndex = null
)
}, ...e
}
}, window.Components.menu = function (e = { open: !1 }) {
let t = useTrackedPointer()
return {
init () {
this.items = Array.from(this.$el.querySelectorAll('[role="menuitem"]')), this.$watch(
'open',
(
() => {
this.open && (
this.activeIndex = -1
)
}
)
)
},
activeDescendant: null,
activeIndex: null,
items: null,
open: e.open,
focusButton () {this.$refs.button.focus()},
onButtonClick () {
this.open = !this.open, this.open && this.$nextTick((
() => {this.$refs['menu-items'].focus()}
))
},
onButtonEnter () {
this.open = !this.open, this.open && (
this.activeIndex = 0, this.activeDescendant = this.items[this.activeIndex].id, this.$nextTick((
() => {this.$refs['menu-items'].focus()}
))
)
},
onArrowUp () {
if (!this.open) {
return this.open = !0, this.activeIndex = this.items.length - 1, void (
this.activeDescendant = this.items[this.activeIndex].id
)
}
0 !== this.activeIndex && (
this.activeIndex = -1 === this.activeIndex ? this.items.length - 1 : this.activeIndex
- 1, this.activeDescendant
= this.items[this.activeIndex].id
)
},
onArrowDown () {
if (!this.open) {
return this.open = !0, this.activeIndex = 0, void (
this.activeDescendant = this.items[this.activeIndex].id
)
}
this.activeIndex !== this.items.length - 1 && (
this.activeIndex = this.activeIndex + 1, this.activeDescendant = this.items[this.activeIndex].id
)
},
onClickAway (e) {
if (this.open) {
const t = [
'[contentEditable=true]',
'[tabindex]',
'a[href]',
'area[href]',
'button:not([disabled])',
'iframe',
'input:not([disabled])',
'select:not([disabled])',
'textarea:not([disabled])'
].map((
e => `${e}:not([tabindex='-1'])`
))
.join(',')
this.open = !1, e.target.closest(t) || this.focusButton()
}
},
onMouseEnter (e) {t.update(e)},
onMouseMove (
e,
n
) {
t.wasMoved(e) && (
this.activeIndex = n
)
},
onMouseLeave (e) {
t.wasMoved(e) && (
this.activeIndex = -1
)
}
}
}, window.Components.popoverGroup = function () {
return {
__type: 'popoverGroup',
init () {
let e = t => {
document.body.contains(this.$el) ? t.target instanceof Element && !this.$el.contains(t.target)
&& window.dispatchEvent(new CustomEvent(
'close-popover-group',
{ detail: this.$el }
)) : window.removeEventListener(
'focus',
e,
!0
)
}
window.addEventListener(
'focus',
e,
!0
)
}
}
}, window.Components.popover = function ({
open: e = !1,
focus: t = !1
} = {}) {
const n = [
'[contentEditable=true]',
'[tabindex]',
'a[href]',
'area[href]',
'button:not([disabled])',
'iframe',
'input:not([disabled])',
'select:not([disabled])',
'textarea:not([disabled])'
].map((
e => `${e}:not([tabindex='-1'])`
))
.join(',')
return {
__type: 'popover',
open: e,
init () {
t && this.$watch(
'open',
(
e => {
e && this.$nextTick((
() => {
!function (e) {
const t = Array.from(e.querySelectorAll(n))
!function e (n) {
void 0 !== n && (
n.focus({ preventScroll: !0 }), document.activeElement !== n
&& e(t[t.indexOf(n) + 1])
)
}(t[0])
}(this.$refs.panel)
}
))
}
)
)
let e = n => {
if (!document.body.contains(this.$el)) {
return void window.removeEventListener(
'focus',
e,
!0
)
}
let i = t ? this.$refs.panel : this.$el
if (this.open && n.target instanceof Element && !i.contains(n.target)) {
let e = this.$el
for (; e.parentNode;) {
if (e = e.parentNode, e.__x instanceof this.constructor) {
if ('popoverGroup' === e.__x.$data.__type) return
if ('popover' === e.__x.$data.__type) break
}
}
this.open = !1
}
}
window.addEventListener(
'focus',
e,
!0
)
},
onEscape () {this.open = !1, this.restoreEl && this.restoreEl.focus()},
onClosePopoverGroup (e) {
e.detail.contains(this.$el) && (
this.open = !1
)
},
toggle (e) {
this.open = !this.open, this.open ? this.restoreEl = e.currentTarget : this.restoreEl
&& this.restoreEl.focus()
}
}
}, window.Components.radioGroup = function ({ initialCheckedIndex: e = 0 } = {}) {
return {
value: void 0,
active: void 0,
init () {
let t = Array.from(this.$el.querySelectorAll('input'))
this.value = t[e]?.value
for (let e of t) {
e.addEventListener(
'change',
(
() => {this.active = e.value}
)
), e.addEventListener(
'focus',
(
() => {this.active = e.value}
)
)
}
window.addEventListener(
'focus',
(
() => {
console.log('Focus change'), t.includes(document.activeElement) || (
console.log('HIT'), this.active = void 0
)
}
),
!0
)
}
}
}, window.Components.tabs = function () {
return {
selectedIndex: 0,
onTabClick (e) {
if (!this.$el.contains(e.detail)) return
let t = Array.from(this.$el.querySelectorAll('[x-data^="Components.tab("]')),
n = Array.from(this.$el.querySelectorAll('[x-data^="Components.tabPanel("]')),
i = t.indexOf(e.detail)
this.selectedIndex = i, window.dispatchEvent(new CustomEvent(
'tab-select',
{
detail: {
tab: e.detail,
panel: n[i]
}
}
))
},
onTabKeydown (e) {
if (!this.$el.contains(e.detail.tab)) return
let t = Array.from(this.$el.querySelectorAll('[x-data^="Components.tab("]')), n = t.indexOf(e.detail.tab)
'ArrowLeft' === e.detail.key ? this.onTabClick({
detail: t[(
n - 1 + t.length
) % t.length]
}) : 'ArrowRight' === e.detail.key ? this.onTabClick({
detail: t[(
n + 1
) % t.length]
}) : 'Home' === e.detail.key || 'PageUp' === e.detail.key ? this.onTabClick({ detail: t[0] }) : 'End'
!== e.detail.key
&& 'PageDown'
!== e.detail.key
|| this.onTabClick({
detail: t[t.length - 1]
})
}
}
}, window.Components.tab = function (e = 0) {
return {
selected: !1,
init () {
let t = Array.from(this.$el.closest('[x-data^="Components.tabs("]')
.querySelectorAll('[x-data^="Components.tab("]'))
this.selected = t.indexOf(this.$el) === e, this.$watch(
'selected',
(
e => {e && this.$el.focus()}
)
)
},
onClick () {
window.dispatchEvent(new CustomEvent(
'tab-click',
{ detail: this.$el }
))
},
onKeydown (e) {
[
'ArrowLeft',
'ArrowRight',
'Home',
'PageUp',
'End',
'PageDown'
].includes(e.key) && e.preventDefault(), window.dispatchEvent(new CustomEvent(
'tab-keydown',
{
detail: {
tab: this.$el,
key: e.key
}
}
))
},
onTabSelect (e) {this.selected = e.detail.tab === this.$el}
}
}, window.Components.tabPanel = function (e = 0) {
return {
selected: !1,
init () {
let t = Array.from(this.$el.closest('[x-data^="Components.tabs("]')
.querySelectorAll('[x-data^="Components.tabPanel("]'));
this.selected = t.indexOf(this.$el) === e
},
onTabSelect (e) {this.selected = e.detail.panel === this.$el}
}
};

View File

@@ -79,6 +79,10 @@
background-color: #F7931A !important; background-color: #F7931A !important;
} }
.leaflet-pane {
z-index: 0 !important;
}
[x-cloak] { [x-cloak] {
display: none !important; display: none !important;
} }
@@ -94,17 +98,6 @@
<livewire:laravel-echo/> <livewire:laravel-echo/>
<x-jet-banner/> <x-jet-banner/>
<div class="min-h-screen"> <div class="min-h-screen">
@auth
@livewire('navigation-menu')
@endauth
<!-- Page Heading -->
@if (isset($header))
<header class="bg-white shadow">
<div class="max-w-7xl mx-auto py-6 px-4 sm:px-6 lg:px-8">
{{ $header }}
</div>
</header>
@endif
<!-- Page Content --> <!-- Page Content -->
<main> <main>
{{ $slot }} {{ $slot }}

View File

@@ -77,19 +77,34 @@
background-color: #F7931A !important; background-color: #F7931A !important;
} }
.leaflet-pane {
z-index: 0 !important;
}
[x-cloak] { [x-cloak] {
display: none !important; display: none !important;
} }
</style> </style>
</head> </head>
<body class="font-sans antialiased bg-21gray dark"> <body class="font-sans antialiased bg-21gray dark">
<x-notifications z-index="z-[99999]" blur="md" align="center"/>
<x-dialog z-index="z-[99999]" blur="md" align="center" />
@if(auth()->user())
{{-- HIGHSCORE-CHAT --}}
<livewire:chat.highscore-chat/>
@endif
<livewire:laravel-echo/> <livewire:laravel-echo/>
<x-notifications z-index="z-50" blur="md" align="center"/> <x-jet-banner/>
<x-dialog z-index="z-50" blur="md" align="center" /> <div class="min-h-screen">
{{ $slot }} <!-- Page Content -->
<main>
{{ $slot }}
</main>
</div>
@stack('modals') @stack('modals')
@livewireScripts @livewireScripts
<!-- ProductLift SDK - Include it only once --> <!-- ProductLift SDK - Include it only once -->
<script defer src="https://bitcoin.productlift.dev/widgets_sdk"></script> <script defer src="https://bitcoin.productlift.dev/widgets_sdk"></script>
<script src="https://cdn.jsdelivr.net/npm/easymde/dist/easymde.min.js"></script>
</body> </body>
</html> </html>

View File

@@ -31,9 +31,9 @@
@error('image') <span class="text-red-500">{{ $message }}</span> @enderror @error('image') <span class="text-red-500">{{ $message }}</span> @enderror
</x-input.group> </x-input.group>
<x-input.group :for="md5('lecturer.name')" :label="__('Title')"> <x-input.group :for="md5('lecturer.name')" :label="__('Name')">
<x-input autocomplete="off" wire:model.debounce="lecturer.name" <x-input autocomplete="off" wire:model.debounce="lecturer.name"
:placeholder="__('Title')"/> :placeholder="__('Name')"/>
</x-input.group> </x-input.group>
<x-input.group :for="md5('lecturer.subtitle')" :label="__('Subtitle')"> <x-input.group :for="md5('lecturer.subtitle')" :label="__('Subtitle')">

File diff suppressed because it is too large Load Diff

View File

@@ -132,4 +132,5 @@
</div> </div>
</div> </div>
</form> </form>
</div> </div>

View File

@@ -39,7 +39,7 @@
<div> <div>
<x-button xs amber href="{{ route('profile.wallet') }}" <x-button xs amber href="{{ route('profile.wallet') }}"
:active="request()->routeIs('profile.wallet')"> :active="request()->routeIs('profile.wallet')">
<i class="fa fa-thin fa-user"></i> <i class="fa fa-thin fa-qrcode"></i>
{{ __('Change lightning wallet/pubkey') }} {{ __('Change lightning wallet/pubkey') }}
</x-button> </x-button>
</div> </div>