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()
|
||||
->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()
|
||||
->map(fn($event) => [
|
||||
'id' => $event->id,
|
||||
@@ -66,7 +71,7 @@ class BitcoinEventTable extends Component
|
||||
'#table',
|
||||
'country' => $this->country->code,
|
||||
'year' => $this->year,
|
||||
'table' => [
|
||||
'bitcoin_events' => [
|
||||
'filters' => [
|
||||
'byid' => $id,
|
||||
],
|
||||
@@ -80,7 +85,7 @@ class BitcoinEventTable extends Component
|
||||
'#table',
|
||||
'country' => $this->country->code,
|
||||
'year' => $this->year,
|
||||
'table' => [
|
||||
'bitcoin_events' => [
|
||||
'filters' => [
|
||||
'byid' => $ids,
|
||||
]
|
||||
|
||||
@@ -11,9 +11,9 @@ class BookCaseTable extends Component
|
||||
{
|
||||
public ?Country $country = null;
|
||||
public string $c = 'de';
|
||||
public array $table = [];
|
||||
public array $bookcases = [];
|
||||
|
||||
protected $queryString = ['table'];
|
||||
protected $queryString = ['bookcases'];
|
||||
|
||||
public function render()
|
||||
{
|
||||
|
||||
@@ -8,10 +8,10 @@ use Livewire\Component;
|
||||
class SearchByTagComponent extends Component
|
||||
{
|
||||
public string $country = 'de';
|
||||
public ?array $table = [];
|
||||
public ?array $bookcases = [];
|
||||
|
||||
protected $queryString = [
|
||||
'table',
|
||||
'library_items',
|
||||
];
|
||||
|
||||
public function render()
|
||||
|
||||
@@ -71,7 +71,7 @@ class MeetupEventTable extends Component
|
||||
'#table',
|
||||
'country' => $this->country->code,
|
||||
'year' => $this->year,
|
||||
'table' => [
|
||||
'meetup_events' => [
|
||||
'filters' => [
|
||||
'byid' => $id,
|
||||
],
|
||||
@@ -85,7 +85,8 @@ class MeetupEventTable extends Component
|
||||
return to_route('meetup.table.meetupEvent', [
|
||||
'#table',
|
||||
'year' => $this->year,
|
||||
'country' => $this->country->code, 'table' => [
|
||||
'country' => $this->country->code,
|
||||
'meetup_events' => [
|
||||
'filters' => [
|
||||
'byid' => $ids,
|
||||
]
|
||||
|
||||
@@ -6,13 +6,13 @@ use App\Models\Country;
|
||||
use Livewire\Component;
|
||||
use RalphJSmit\Laravel\SEO\Support\SEOData;
|
||||
|
||||
class CouseTable extends Component
|
||||
class CourseTable extends Component
|
||||
{
|
||||
public Country $country;
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.school.couse-table')->layout('layouts.app', [
|
||||
return view('livewire.school.course-table')->layout('layouts.app', [
|
||||
'SEOData' => new SEOData(
|
||||
title: __('Courses'),
|
||||
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',
|
||||
'country' => $this->country->code,
|
||||
'year' => $this->year,
|
||||
'table' => [
|
||||
'course_events' => [
|
||||
'filters' => [
|
||||
'byid' => $id,
|
||||
],
|
||||
@@ -84,7 +84,7 @@ class EventTable extends Component
|
||||
'#table',
|
||||
'country' => $this->country->code,
|
||||
'year' => $this->year,
|
||||
'table' => [
|
||||
'course_events' => [
|
||||
'filters' => [
|
||||
'byid' => $ids,
|
||||
]
|
||||
|
||||
@@ -8,10 +8,10 @@ use Livewire\Component;
|
||||
class SearchByTagComponent extends Component
|
||||
{
|
||||
public string $country = 'de';
|
||||
public ?array $table = [];
|
||||
public ?array $courses = [];
|
||||
|
||||
protected $queryString = [
|
||||
'table',
|
||||
'courses',
|
||||
];
|
||||
|
||||
public function render()
|
||||
|
||||
@@ -92,7 +92,7 @@ class CityTable extends DataTableComponent
|
||||
return to_route('school.table.event', [
|
||||
'#table',
|
||||
'country' => $this->country,
|
||||
'table' => [
|
||||
'course_events' => [
|
||||
'filters' => [
|
||||
'stadt' => $query->pluck('name')
|
||||
->push($city->name)
|
||||
@@ -117,7 +117,7 @@ class CityTable extends DataTableComponent
|
||||
return to_route('bookCases.table.bookcases', [
|
||||
'#table',
|
||||
'country' => $this->country,
|
||||
'table' => [
|
||||
'bookcases' => [
|
||||
'filters' => [
|
||||
'byids' => $ids->implode(',')
|
||||
],
|
||||
|
||||
@@ -61,6 +61,7 @@ class CourseTable extends DataTableComponent
|
||||
->sortable()
|
||||
->collapseOnMobile(),
|
||||
Column::make("Name", "name")
|
||||
->searchable(fn(Builder $query, string $term) => $query->where('name', 'ilike', '%'.$term.'%'))
|
||||
->sortable(),
|
||||
Column::make("Tags")
|
||||
->label(
|
||||
@@ -105,7 +106,7 @@ class CourseTable extends DataTableComponent
|
||||
return to_route('school.table.event', [
|
||||
'#table',
|
||||
'country' => $this->country,
|
||||
'table' => [
|
||||
'course_events' => [
|
||||
'filters' => [
|
||||
'course_id' => $id,
|
||||
],
|
||||
|
||||
@@ -17,7 +17,7 @@ class EventTable extends DataTableComponent
|
||||
public string $country;
|
||||
public bool $viewingModal = false;
|
||||
public $currentModal;
|
||||
public string $tableName = 'events';
|
||||
public string $tableName = 'course_events';
|
||||
|
||||
public function configure(): void
|
||||
{
|
||||
|
||||
@@ -47,6 +47,7 @@ class LecturerTable extends DataTableComponent
|
||||
])
|
||||
->collapseOnMobile(),
|
||||
Column::make("Name", "name")
|
||||
->searchable(fn($query, $term) => $query->where('name', 'ilike', '%'.$term.'%'))
|
||||
->sortable(),
|
||||
BooleanColumn::make("Aktiv", 'active')
|
||||
->sortable()
|
||||
@@ -89,7 +90,7 @@ class LecturerTable extends DataTableComponent
|
||||
return to_route('school.table.event', [
|
||||
'#table',
|
||||
'country' => $this->country,
|
||||
'table' => [
|
||||
'course_events' => [
|
||||
'filters' => [
|
||||
'dozent' => $lecturer->id,
|
||||
],
|
||||
@@ -99,7 +100,7 @@ class LecturerTable extends DataTableComponent
|
||||
return to_route('library.table.libraryItems', [
|
||||
'#table',
|
||||
'country' => $this->country,
|
||||
'table' => [
|
||||
'library_items' => [
|
||||
'filters' => [
|
||||
'lecturer_id' => $lecturer->id,
|
||||
],
|
||||
|
||||
@@ -93,7 +93,7 @@ class MeetupTable extends DataTableComponent
|
||||
|
||||
return to_route('meetup.table.meetupEvent', [
|
||||
'country' => $this->country ?? $meetup->city->country->code,
|
||||
'table' => [
|
||||
'meetup_events' => [
|
||||
'filters' => ['bymeetupid' => $id],
|
||||
]
|
||||
]);
|
||||
|
||||
@@ -47,6 +47,7 @@ class VenueTable extends DataTableComponent
|
||||
])
|
||||
->collapseOnMobile(),
|
||||
Column::make("Name", "name")
|
||||
->searchable(fn($query, $term) => $query->where('name', 'ilike', '%'.$term.'%'))
|
||||
->sortable(),
|
||||
Column::make("Street", "street")
|
||||
->sortable()
|
||||
@@ -82,7 +83,7 @@ class VenueTable extends DataTableComponent
|
||||
return to_route('school.table.event', [
|
||||
'#table',
|
||||
'country' => $this->country,
|
||||
'table' => [
|
||||
'course_events' => [
|
||||
'filters' => [
|
||||
'venue' => $venue->name,
|
||||
],
|
||||
|
||||
@@ -8,12 +8,12 @@
|
||||
style="font-size: 128%; background-position: 0px center; list-style: outside;"
|
||||
>
|
||||
@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';
|
||||
@endphp
|
||||
<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]"
|
||||
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
|
||||
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;"
|
||||
>
|
||||
@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';
|
||||
@endphp
|
||||
<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]"
|
||||
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
|
||||
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)
|
||||
->name('table.venue');
|
||||
|
||||
Route::get('/course', \App\Http\Livewire\School\CouseTable::class)
|
||||
Route::get('/course', \App\Http\Livewire\School\CourseTable::class)
|
||||
->name('table.course');
|
||||
|
||||
Route::get('/event', \App\Http\Livewire\School\EventTable::class)
|
||||
|
||||
Reference in New Issue
Block a user