mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig-portal.git
synced 2025-12-11 06:46:47 +00:00
table changes
This commit is contained in:
@@ -43,6 +43,11 @@ class BitcoinEventTable extends Component
|
|||||||
]),
|
]),
|
||||||
'events' => BitcoinEvent::query()
|
'events' => BitcoinEvent::query()
|
||||||
->where('bitcoin_events.from', '>=', now())
|
->where('bitcoin_events.from', '>=', now())
|
||||||
|
->where(fn($query) => $query
|
||||||
|
->whereHas('venue.city.country',
|
||||||
|
fn($query) => $query->where('countries.code', $this->country->code))
|
||||||
|
->orWhere('show_worldwide', true)
|
||||||
|
)
|
||||||
->get()
|
->get()
|
||||||
->map(fn($event) => [
|
->map(fn($event) => [
|
||||||
'id' => $event->id,
|
'id' => $event->id,
|
||||||
@@ -64,9 +69,9 @@ class BitcoinEventTable extends Component
|
|||||||
{
|
{
|
||||||
return to_route('bitcoinEvent.table.bitcoinEvent', [
|
return to_route('bitcoinEvent.table.bitcoinEvent', [
|
||||||
'#table',
|
'#table',
|
||||||
'country' => $this->country->code,
|
'country' => $this->country->code,
|
||||||
'year' => $this->year,
|
'year' => $this->year,
|
||||||
'table' => [
|
'bitcoin_events' => [
|
||||||
'filters' => [
|
'filters' => [
|
||||||
'byid' => $id,
|
'byid' => $id,
|
||||||
],
|
],
|
||||||
@@ -78,9 +83,9 @@ class BitcoinEventTable extends Component
|
|||||||
{
|
{
|
||||||
return to_route('bitcoinEvent.table.bitcoinEvent', [
|
return to_route('bitcoinEvent.table.bitcoinEvent', [
|
||||||
'#table',
|
'#table',
|
||||||
'country' => $this->country->code,
|
'country' => $this->country->code,
|
||||||
'year' => $this->year,
|
'year' => $this->year,
|
||||||
'table' => [
|
'bitcoin_events' => [
|
||||||
'filters' => [
|
'filters' => [
|
||||||
'byid' => $ids,
|
'byid' => $ids,
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -11,9 +11,9 @@ class BookCaseTable extends Component
|
|||||||
{
|
{
|
||||||
public ?Country $country = null;
|
public ?Country $country = null;
|
||||||
public string $c = 'de';
|
public string $c = 'de';
|
||||||
public array $table = [];
|
public array $bookcases = [];
|
||||||
|
|
||||||
protected $queryString = ['table'];
|
protected $queryString = ['bookcases'];
|
||||||
|
|
||||||
public function render()
|
public function render()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -8,10 +8,10 @@ use Livewire\Component;
|
|||||||
class SearchByTagComponent extends Component
|
class SearchByTagComponent extends Component
|
||||||
{
|
{
|
||||||
public string $country = 'de';
|
public string $country = 'de';
|
||||||
public ?array $table = [];
|
public ?array $bookcases = [];
|
||||||
|
|
||||||
protected $queryString = [
|
protected $queryString = [
|
||||||
'table',
|
'library_items',
|
||||||
];
|
];
|
||||||
|
|
||||||
public function render()
|
public function render()
|
||||||
|
|||||||
@@ -69,9 +69,9 @@ class MeetupEventTable extends Component
|
|||||||
{
|
{
|
||||||
return to_route('meetup.table.meetupEvent', [
|
return to_route('meetup.table.meetupEvent', [
|
||||||
'#table',
|
'#table',
|
||||||
'country' => $this->country->code,
|
'country' => $this->country->code,
|
||||||
'year' => $this->year,
|
'year' => $this->year,
|
||||||
'table' => [
|
'meetup_events' => [
|
||||||
'filters' => [
|
'filters' => [
|
||||||
'byid' => $id,
|
'byid' => $id,
|
||||||
],
|
],
|
||||||
@@ -85,7 +85,8 @@ class MeetupEventTable extends Component
|
|||||||
return to_route('meetup.table.meetupEvent', [
|
return to_route('meetup.table.meetupEvent', [
|
||||||
'#table',
|
'#table',
|
||||||
'year' => $this->year,
|
'year' => $this->year,
|
||||||
'country' => $this->country->code, 'table' => [
|
'country' => $this->country->code,
|
||||||
|
'meetup_events' => [
|
||||||
'filters' => [
|
'filters' => [
|
||||||
'byid' => $ids,
|
'byid' => $ids,
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -6,13 +6,13 @@ use App\Models\Country;
|
|||||||
use Livewire\Component;
|
use Livewire\Component;
|
||||||
use RalphJSmit\Laravel\SEO\Support\SEOData;
|
use RalphJSmit\Laravel\SEO\Support\SEOData;
|
||||||
|
|
||||||
class CouseTable extends Component
|
class CourseTable extends Component
|
||||||
{
|
{
|
||||||
public Country $country;
|
public Country $country;
|
||||||
|
|
||||||
public function render()
|
public function render()
|
||||||
{
|
{
|
||||||
return view('livewire.school.couse-table')->layout('layouts.app', [
|
return view('livewire.school.course-table')->layout('layouts.app', [
|
||||||
'SEOData' => new SEOData(
|
'SEOData' => new SEOData(
|
||||||
title: __('Courses'),
|
title: __('Courses'),
|
||||||
description: __('Choose your city, search for courses in the surrounding area and select a topic that suits you.'),
|
description: __('Choose your city, search for courses in the surrounding area and select a topic that suits you.'),
|
||||||
@@ -70,7 +70,7 @@ class EventTable extends Component
|
|||||||
'#table',
|
'#table',
|
||||||
'country' => $this->country->code,
|
'country' => $this->country->code,
|
||||||
'year' => $this->year,
|
'year' => $this->year,
|
||||||
'table' => [
|
'course_events' => [
|
||||||
'filters' => [
|
'filters' => [
|
||||||
'byid' => $id,
|
'byid' => $id,
|
||||||
],
|
],
|
||||||
@@ -84,7 +84,7 @@ class EventTable extends Component
|
|||||||
'#table',
|
'#table',
|
||||||
'country' => $this->country->code,
|
'country' => $this->country->code,
|
||||||
'year' => $this->year,
|
'year' => $this->year,
|
||||||
'table' => [
|
'course_events' => [
|
||||||
'filters' => [
|
'filters' => [
|
||||||
'byid' => $ids,
|
'byid' => $ids,
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -8,10 +8,10 @@ use Livewire\Component;
|
|||||||
class SearchByTagComponent extends Component
|
class SearchByTagComponent extends Component
|
||||||
{
|
{
|
||||||
public string $country = 'de';
|
public string $country = 'de';
|
||||||
public ?array $table = [];
|
public ?array $courses = [];
|
||||||
|
|
||||||
protected $queryString = [
|
protected $queryString = [
|
||||||
'table',
|
'courses',
|
||||||
];
|
];
|
||||||
|
|
||||||
public function render()
|
public function render()
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ class CityTable extends DataTableComponent
|
|||||||
return to_route('school.table.event', [
|
return to_route('school.table.event', [
|
||||||
'#table',
|
'#table',
|
||||||
'country' => $this->country,
|
'country' => $this->country,
|
||||||
'table' => [
|
'course_events' => [
|
||||||
'filters' => [
|
'filters' => [
|
||||||
'stadt' => $query->pluck('name')
|
'stadt' => $query->pluck('name')
|
||||||
->push($city->name)
|
->push($city->name)
|
||||||
@@ -117,7 +117,7 @@ class CityTable extends DataTableComponent
|
|||||||
return to_route('bookCases.table.bookcases', [
|
return to_route('bookCases.table.bookcases', [
|
||||||
'#table',
|
'#table',
|
||||||
'country' => $this->country,
|
'country' => $this->country,
|
||||||
'table' => [
|
'bookcases' => [
|
||||||
'filters' => [
|
'filters' => [
|
||||||
'byids' => $ids->implode(',')
|
'byids' => $ids->implode(',')
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -61,6 +61,7 @@ class CourseTable extends DataTableComponent
|
|||||||
->sortable()
|
->sortable()
|
||||||
->collapseOnMobile(),
|
->collapseOnMobile(),
|
||||||
Column::make("Name", "name")
|
Column::make("Name", "name")
|
||||||
|
->searchable(fn(Builder $query, string $term) => $query->where('name', 'ilike', '%'.$term.'%'))
|
||||||
->sortable(),
|
->sortable(),
|
||||||
Column::make("Tags")
|
Column::make("Tags")
|
||||||
->label(
|
->label(
|
||||||
@@ -104,8 +105,8 @@ class CourseTable extends DataTableComponent
|
|||||||
{
|
{
|
||||||
return to_route('school.table.event', [
|
return to_route('school.table.event', [
|
||||||
'#table',
|
'#table',
|
||||||
'country' => $this->country,
|
'country' => $this->country,
|
||||||
'table' => [
|
'course_events' => [
|
||||||
'filters' => [
|
'filters' => [
|
||||||
'course_id' => $id,
|
'course_id' => $id,
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ class EventTable extends DataTableComponent
|
|||||||
public string $country;
|
public string $country;
|
||||||
public bool $viewingModal = false;
|
public bool $viewingModal = false;
|
||||||
public $currentModal;
|
public $currentModal;
|
||||||
public string $tableName = 'events';
|
public string $tableName = 'course_events';
|
||||||
|
|
||||||
public function configure(): void
|
public function configure(): void
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ class LecturerTable extends DataTableComponent
|
|||||||
])
|
])
|
||||||
->collapseOnMobile(),
|
->collapseOnMobile(),
|
||||||
Column::make("Name", "name")
|
Column::make("Name", "name")
|
||||||
|
->searchable(fn($query, $term) => $query->where('name', 'ilike', '%'.$term.'%'))
|
||||||
->sortable(),
|
->sortable(),
|
||||||
BooleanColumn::make("Aktiv", 'active')
|
BooleanColumn::make("Aktiv", 'active')
|
||||||
->sortable()
|
->sortable()
|
||||||
@@ -88,8 +89,8 @@ class LecturerTable extends DataTableComponent
|
|||||||
if ($event) {
|
if ($event) {
|
||||||
return to_route('school.table.event', [
|
return to_route('school.table.event', [
|
||||||
'#table',
|
'#table',
|
||||||
'country' => $this->country,
|
'country' => $this->country,
|
||||||
'table' => [
|
'course_events' => [
|
||||||
'filters' => [
|
'filters' => [
|
||||||
'dozent' => $lecturer->id,
|
'dozent' => $lecturer->id,
|
||||||
],
|
],
|
||||||
@@ -98,8 +99,8 @@ class LecturerTable extends DataTableComponent
|
|||||||
} else {
|
} else {
|
||||||
return to_route('library.table.libraryItems', [
|
return to_route('library.table.libraryItems', [
|
||||||
'#table',
|
'#table',
|
||||||
'country' => $this->country,
|
'country' => $this->country,
|
||||||
'table' => [
|
'library_items' => [
|
||||||
'filters' => [
|
'filters' => [
|
||||||
'lecturer_id' => $lecturer->id,
|
'lecturer_id' => $lecturer->id,
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ class MeetupTable extends DataTableComponent
|
|||||||
|
|
||||||
return to_route('meetup.table.meetupEvent', [
|
return to_route('meetup.table.meetupEvent', [
|
||||||
'country' => $this->country ?? $meetup->city->country->code,
|
'country' => $this->country ?? $meetup->city->country->code,
|
||||||
'table' => [
|
'meetup_events' => [
|
||||||
'filters' => ['bymeetupid' => $id],
|
'filters' => ['bymeetupid' => $id],
|
||||||
]
|
]
|
||||||
]);
|
]);
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ class VenueTable extends DataTableComponent
|
|||||||
])
|
])
|
||||||
->collapseOnMobile(),
|
->collapseOnMobile(),
|
||||||
Column::make("Name", "name")
|
Column::make("Name", "name")
|
||||||
|
->searchable(fn($query, $term) => $query->where('name', 'ilike', '%'.$term.'%'))
|
||||||
->sortable(),
|
->sortable(),
|
||||||
Column::make("Street", "street")
|
Column::make("Street", "street")
|
||||||
->sortable()
|
->sortable()
|
||||||
@@ -81,8 +82,8 @@ class VenueTable extends DataTableComponent
|
|||||||
|
|
||||||
return to_route('school.table.event', [
|
return to_route('school.table.event', [
|
||||||
'#table',
|
'#table',
|
||||||
'country' => $this->country,
|
'country' => $this->country,
|
||||||
'table' => [
|
'course_events' => [
|
||||||
'filters' => [
|
'filters' => [
|
||||||
'venue' => $venue->name,
|
'venue' => $venue->name,
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -8,12 +8,12 @@
|
|||||||
style="font-size: 128%; background-position: 0px center; list-style: outside;"
|
style="font-size: 128%; background-position: 0px center; list-style: outside;"
|
||||||
>
|
>
|
||||||
@php
|
@php
|
||||||
$isActive = collect($table)->pluck('tag')->collapse()->contains($tag->name);
|
$isActive = collect($library_items)->pluck('tag')->collapse()->contains($tag->name);
|
||||||
$activeClass = $isActive ? 'text-amber-500 bg-amber-500' : 'bg-blue-50 text-white hover:text-amber-500';
|
$activeClass = $isActive ? 'text-amber-500 bg-amber-500' : 'bg-blue-50 text-white hover:text-amber-500';
|
||||||
@endphp
|
@endphp
|
||||||
<a
|
<a
|
||||||
class="{{ $activeClass }} flex relative flex-col flex-shrink-0 justify-between py-1 px-3 w-full h-20 border-0 border-solid duration-300 ease-in-out cursor-pointer bg-opacity-[0.07]"
|
class="{{ $activeClass }} flex relative flex-col flex-shrink-0 justify-between py-1 px-3 w-full h-20 border-0 border-solid duration-300 ease-in-out cursor-pointer bg-opacity-[0.07]"
|
||||||
href="{{ route(request()->route()->getName(), ['country' => $country, 'table' => ['filters' => ['tag' => [$tag->id]]]]) }}"
|
href="{{ route(request()->route()->getName(), ['country' => $country, 'library_items' => ['filters' => ['tag' => [$tag->id]]]]) }}"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="flex flex-1 items-center p-0 m-0 text-center align-baseline border-0 border-solid"
|
class="flex flex-1 items-center p-0 m-0 text-center align-baseline border-0 border-solid"
|
||||||
|
|||||||
@@ -8,12 +8,12 @@
|
|||||||
style="font-size: 128%; background-position: 0px center; list-style: outside;"
|
style="font-size: 128%; background-position: 0px center; list-style: outside;"
|
||||||
>
|
>
|
||||||
@php
|
@php
|
||||||
$isActive = collect($table)->pluck('tag')->collapse()->contains($tag->name);
|
$isActive = collect($courses)->pluck('tag')->collapse()->contains($tag->name);
|
||||||
$activeClass = $isActive ? 'text-amber-500 bg-amber-500' : 'bg-blue-50 text-white hover:text-amber-500';
|
$activeClass = $isActive ? 'text-amber-500 bg-amber-500' : 'bg-blue-50 text-white hover:text-amber-500';
|
||||||
@endphp
|
@endphp
|
||||||
<a
|
<a
|
||||||
class="{{ $activeClass }} flex relative flex-col flex-shrink-0 justify-between py-1 px-3 w-full h-20 border-0 border-solid duration-300 ease-in-out cursor-pointer bg-opacity-[0.07]"
|
class="{{ $activeClass }} flex relative flex-col flex-shrink-0 justify-between py-1 px-3 w-full h-20 border-0 border-solid duration-300 ease-in-out cursor-pointer bg-opacity-[0.07]"
|
||||||
href="{{ $isActive ? '#table' : route('school.table.course', ['country' => $country, 'table' => ['filters' => ['tag' => [$tag->name]]], '#table']) }}"
|
href="{{ $isActive ? '#table' : route('school.table.course', ['country' => $country, 'courses' => ['filters' => ['tag' => [$tag->name]]], '#table']) }}"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="flex flex-1 items-center p-0 m-0 text-center align-baseline border-0 border-solid"
|
class="flex flex-1 items-center p-0 m-0 text-center align-baseline border-0 border-solid"
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ Route::middleware([
|
|||||||
Route::get('/venue', \App\Http\Livewire\School\VenueTable::class)
|
Route::get('/venue', \App\Http\Livewire\School\VenueTable::class)
|
||||||
->name('table.venue');
|
->name('table.venue');
|
||||||
|
|
||||||
Route::get('/course', \App\Http\Livewire\School\CouseTable::class)
|
Route::get('/course', \App\Http\Livewire\School\CourseTable::class)
|
||||||
->name('table.course');
|
->name('table.course');
|
||||||
|
|
||||||
Route::get('/event', \App\Http\Livewire\School\EventTable::class)
|
Route::get('/event', \App\Http\Livewire\School\EventTable::class)
|
||||||
|
|||||||
Reference in New Issue
Block a user