This commit is contained in:
Benjamin Takats
2022-12-04 19:42:27 +01:00
parent ffd465076a
commit 3c28f79aa6
29 changed files with 664 additions and 6 deletions

View File

@@ -9,6 +9,7 @@ models:
Membership: { team_id: biginteger, user_id: biginteger, role: 'string nullable' } Membership: { team_id: biginteger, user_id: biginteger, role: 'string nullable' }
Participant: { first_name: string, last_name: string } Participant: { first_name: string, last_name: string }
Registration: { event_id: biginteger, participant_id: biginteger, active: 'boolean default:1' } Registration: { event_id: biginteger, participant_id: biginteger, active: 'boolean default:1' }
Tag: { name: json, slug: json, type: 'string nullable', order_column: 'integer nullable', icon: 'string default:tag' }
Team: { user_id: biginteger, name: string, personal_team: boolean } Team: { user_id: biginteger, name: string, personal_team: boolean }
TeamInvitation: { team_id: biginteger, email: string, role: 'string nullable' } TeamInvitation: { team_id: biginteger, email: string, role: 'string nullable' }
User: { name: string, public_key: 'string nullable', email: 'string nullable', email_verified_at: 'datetime nullable', password: 'string nullable', remember_token: 'string:100 nullable', current_team_id: 'biginteger nullable', profile_photo_path: 'string:2048 nullable', is_lecturer: 'boolean default:', two_factor_secret: 'text nullable', two_factor_recovery_codes: 'text nullable', two_factor_confirmed_at: 'datetime nullable', timezone: 'string default:Europe/Berlin' } User: { name: string, public_key: 'string nullable', email: 'string nullable', email_verified_at: 'datetime nullable', password: 'string nullable', remember_token: 'string:100 nullable', current_team_id: 'biginteger nullable', profile_photo_path: 'string:2048 nullable', is_lecturer: 'boolean default:', two_factor_secret: 'text nullable', two_factor_recovery_codes: 'text nullable', two_factor_confirmed_at: 'datetime nullable', timezone: 'string default:Europe/Berlin' }

View File

@@ -0,0 +1,38 @@
<?php
namespace App\Console\Commands\Database;
use App\Models\Tag;
use Illuminate\Console\Command;
class CreateTags extends Command
{
/**
* The name and signature of the console command.
* @var string
*/
protected $signature = 'tags:create';
/**
* The console command description.
* @var string
*/
protected $description = 'Command description';
/**
* Execute the console command.
* @return int
*/
public function handle()
{
$tags = config('tags.tags');
foreach ($tags as $tag) {
$t = Tag::findOrCreate($tag['de'], 'search');
$t->icon = $tag['icon'];
$t->setTranslation('name', 'en', $tag['en']);
$t->save();
}
return Command::SUCCESS;
}
}

View File

@@ -0,0 +1,25 @@
<?php
namespace App\Http\Livewire\Frontend;
use App\Models\Tag;
use Livewire\Component;
class SearchByTag extends Component
{
public string $country = 'de';
public function render()
{
return view('livewire.frontend.search-by-tag', [
'tags' => Tag::query()
->with([
'courses.lecturer',
])
->withCount([
'courses',
])
->get(),
]);
}
}

View File

@@ -3,9 +3,11 @@
namespace App\Http\Livewire\Tables; namespace App\Http\Livewire\Tables;
use App\Models\Course; use App\Models\Course;
use App\Models\Tag;
use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Builder;
use Rappasoft\LaravelLivewireTables\DataTableComponent; use Rappasoft\LaravelLivewireTables\DataTableComponent;
use Rappasoft\LaravelLivewireTables\Views\Column; use Rappasoft\LaravelLivewireTables\Views\Column;
use Rappasoft\LaravelLivewireTables\Views\Filters\MultiSelectFilter;
class CourseTable extends DataTableComponent class CourseTable extends DataTableComponent
{ {
@@ -32,6 +34,23 @@ class CourseTable extends DataTableComponent
->setPerPage(50); ->setPerPage(50);
} }
public function filters(): array
{
return [
MultiSelectFilter::make('Tag')
->options(
Tag::query()
->get()
->mapWithKeys(fn($item, $key) => [$item->name => $item->name])
->toArray()
)
->filter(function (Builder $builder, array $values) {
ray($values);
$builder->withAnyTags($values, 'search');
}),
];
}
public function columns(): array public function columns(): array
{ {
return [ return [
@@ -43,6 +62,10 @@ class CourseTable extends DataTableComponent
->collapseOnMobile(), ->collapseOnMobile(),
Column::make("Name", "name") Column::make("Name", "name")
->sortable(), ->sortable(),
Column::make("Tags")
->label(
fn($row, Column $column) => view('columns.courses.tags')->withRow($row)
),
Column::make("Termine") Column::make("Termine")
->label( ->label(
fn($row, Column $column) => '<strong>'.$row->events_count.'</strong>' fn($row, Column $column) => '<strong>'.$row->events_count.'</strong>'

View File

@@ -8,11 +8,13 @@ use Spatie\Image\Manipulations;
use Spatie\MediaLibrary\HasMedia; use Spatie\MediaLibrary\HasMedia;
use Spatie\MediaLibrary\InteractsWithMedia; use Spatie\MediaLibrary\InteractsWithMedia;
use Spatie\MediaLibrary\MediaCollections\Models\Media; use Spatie\MediaLibrary\MediaCollections\Models\Media;
use Spatie\Tags\HasTags;
class Course extends Model implements HasMedia class Course extends Model implements HasMedia
{ {
use HasFactory; use HasFactory;
use InteractsWithMedia; use InteractsWithMedia;
use HasTags;
/** /**
* The attributes that aren't mass assignable. * The attributes that aren't mass assignable.

11
app/Models/Tag.php Normal file
View File

@@ -0,0 +1,11 @@
<?php
namespace App\Models;
class Tag extends \Spatie\Tags\Tag
{
public function courses()
{
return $this->morphedByMany(Course::class, 'taggable');
}
}

View File

@@ -11,6 +11,7 @@ use Laravel\Nova\Fields\ID;
use Laravel\Nova\Fields\Markdown; use Laravel\Nova\Fields\Markdown;
use Laravel\Nova\Fields\Text; use Laravel\Nova\Fields\Text;
use Laravel\Nova\Http\Requests\NovaRequest; use Laravel\Nova\Http\Requests\NovaRequest;
use Spatie\TagsField\Tags;
use ZiffMedia\NovaSelectPlus\SelectPlus; use ZiffMedia\NovaSelectPlus\SelectPlus;
class Course extends Resource class Course extends Resource
@@ -65,6 +66,8 @@ class Course extends Resource
->conversionOnIndexView('thumb') ->conversionOnIndexView('thumb')
->help('Lade hier Bilder hoch, um sie eventuell später in der Markdown Description einzufügen. Du musst vorher aber Speichern.'), ->help('Lade hier Bilder hoch, um sie eventuell später in der Markdown Description einzufügen. Du musst vorher aber Speichern.'),
Tags::make('Tags')->type('search')->withLinkToTagResource(Tag::class),
Text::make('Name') Text::make('Name')
->rules('required', 'string'), ->rules('required', 'string'),

32
app/Nova/Tag.php Normal file
View File

@@ -0,0 +1,32 @@
<?php
namespace App\Nova;
use Illuminate\Http\Request;
use Laravel\Nova\Fields\Select;
use Laravel\Nova\Fields\Text;
class Tag extends Resource
{
public static $model = \App\Models\Tag::class;
public static $title = 'name';
public static $search = [
'name',
];
public function fields(Request $request)
{
return [
Text::make('Name')->sortable(),
Text::make('Translation')->sortable(),
Select::make('Type')->options([
'search' => 'search',
]),
];
}
}

View File

@@ -11,6 +11,7 @@ use App\Nova\Event;
use App\Nova\Lecturer; use App\Nova\Lecturer;
use App\Nova\Participant; use App\Nova\Participant;
use App\Nova\Registration; use App\Nova\Registration;
use App\Nova\Tag;
use App\Nova\Team; use App\Nova\Team;
use App\Nova\User; use App\Nova\User;
use App\Nova\Venue; use App\Nova\Venue;
@@ -54,6 +55,7 @@ class NovaServiceProvider extends NovaApplicationServiceProvider
MenuItem::resource(Country::class), MenuItem::resource(Country::class),
MenuItem::resource(Team::class), MenuItem::resource(Team::class),
MenuItem::resource(User::class), MenuItem::resource(User::class),
MenuItem::resource(Tag::class),
]) ])
->icon('key') ->icon('key')
->collapsable(), ->collapsable(),

View File

@@ -30,6 +30,8 @@
"spatie/laravel-medialibrary": "^10.0.0", "spatie/laravel-medialibrary": "^10.0.0",
"spatie/laravel-ray": "^1.31", "spatie/laravel-ray": "^1.31",
"spatie/laravel-sluggable": "^3.4", "spatie/laravel-sluggable": "^3.4",
"spatie/laravel-tags": "^4.3",
"spatie/nova-tags-field": "^4.0",
"staudenmeir/eloquent-has-many-deep": "^1.7", "staudenmeir/eloquent-has-many-deep": "^1.7",
"stijnvanouplines/blade-country-flags": "^1.0", "stijnvanouplines/blade-country-flags": "^1.0",
"symfony/http-client": "^6.2", "symfony/http-client": "^6.2",

341
composer.lock generated
View File

@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "6af863a20aa17f527c2cf8e0c7de11b6", "content-hash": "ff7b4ac8af19364e547306d58f6c9479",
"packages": [ "packages": [
{ {
"name": "akuechler/laravel-geoly", "name": "akuechler/laravel-geoly",
@@ -4019,6 +4019,56 @@
}, },
"time": "2022-11-12T15:38:23+00:00" "time": "2022-11-12T15:38:23+00:00"
}, },
{
"name": "nova-kit/nova-packages-tool",
"version": "v1.6.1",
"source": {
"type": "git",
"url": "https://github.com/nova-kit/nova-packages-tool.git",
"reference": "c6deaf054a94d36c20b9472979c5dc94415f1283"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/nova-kit/nova-packages-tool/zipball/c6deaf054a94d36c20b9472979c5dc94415f1283",
"reference": "c6deaf054a94d36c20b9472979c5dc94415f1283",
"shasum": ""
},
"require": {
"laravel/nova": ">=4.19.0 <4.20.0",
"php": "^7.3 || ^8.0"
},
"require-dev": {
"orchestra/testbench": "^6.24 || ^7.0"
},
"type": "library",
"extra": {
"laravel": {
"providers": [
"NovaKit\\NovaPackagesTool\\LaravelServiceProvider"
]
}
},
"autoload": {
"psr-4": {
"NovaKit\\NovaPackagesTool\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Mior Muhammad Zaki",
"email": "crynobone@gmail.com"
}
],
"description": "Tool for Laravel Nova Packages Development",
"support": {
"source": "https://github.com/nova-kit/nova-packages-tool/tree/v1.6.1"
},
"time": "2022-11-22T21:40:15+00:00"
},
{ {
"name": "nova/start", "name": "nova/start",
"version": "dev-blueprint", "version": "dev-blueprint",
@@ -6379,6 +6429,79 @@
], ],
"time": "2022-11-28T08:03:04+00:00" "time": "2022-11-28T08:03:04+00:00"
}, },
{
"name": "spatie/eloquent-sortable",
"version": "4.0.1",
"source": {
"type": "git",
"url": "https://github.com/spatie/eloquent-sortable.git",
"reference": "64a3365c0d5a7b4a1837b2f29d01ee4c578c416a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/spatie/eloquent-sortable/zipball/64a3365c0d5a7b4a1837b2f29d01ee4c578c416a",
"reference": "64a3365c0d5a7b4a1837b2f29d01ee4c578c416a",
"shasum": ""
},
"require": {
"illuminate/database": "^8.0|^9.0",
"illuminate/support": "^8.0|^9.0",
"php": "^8.0",
"spatie/laravel-package-tools": "^1.9"
},
"require-dev": {
"orchestra/testbench": "^6.0|^7.0",
"phpunit/phpunit": "^9.5"
},
"type": "library",
"extra": {
"laravel": {
"providers": [
"Spatie\\EloquentSortable\\EloquentSortableServiceProvider"
]
}
},
"autoload": {
"psr-4": {
"Spatie\\EloquentSortable\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Freek Van der Herten",
"email": "freek@spatie.be"
}
],
"description": "Sortable behaviour for eloquent models",
"homepage": "https://github.com/spatie/eloquent-sortable",
"keywords": [
"behaviour",
"eloquent",
"laravel",
"model",
"sort",
"sortable"
],
"support": {
"issues": "https://github.com/spatie/eloquent-sortable/issues",
"source": "https://github.com/spatie/eloquent-sortable/tree/4.0.1"
},
"funding": [
{
"url": "https://spatie.be/open-source/support-us",
"type": "custom"
},
{
"url": "https://github.com/spatie",
"type": "github"
}
],
"time": "2022-01-21T08:32:41+00:00"
},
{ {
"name": "spatie/image", "name": "spatie/image",
"version": "2.2.4", "version": "2.2.4",
@@ -7050,6 +7173,156 @@
], ],
"time": "2022-03-28T11:21:33+00:00" "time": "2022-03-28T11:21:33+00:00"
}, },
{
"name": "spatie/laravel-tags",
"version": "4.3.5",
"source": {
"type": "git",
"url": "https://github.com/spatie/laravel-tags.git",
"reference": "0f6b46f8af83dd9dac4df55f57009fd51d884d1c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/spatie/laravel-tags/zipball/0f6b46f8af83dd9dac4df55f57009fd51d884d1c",
"reference": "0f6b46f8af83dd9dac4df55f57009fd51d884d1c",
"shasum": ""
},
"require": {
"laravel/framework": "^8.67|^9.0",
"php": "^8.0",
"spatie/eloquent-sortable": "^3.10|^4.0",
"spatie/laravel-package-tools": "^1.4",
"spatie/laravel-translatable": "^4.6|^5.0|^6.0"
},
"require-dev": {
"orchestra/testbench": "^6.13|^7.0",
"pestphp/pest": "^1.22",
"phpunit/phpunit": "^9.5.2"
},
"type": "library",
"extra": {
"laravel": {
"providers": [
"Spatie\\Tags\\TagsServiceProvider"
]
}
},
"autoload": {
"psr-4": {
"Spatie\\Tags\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Freek Van der Herten",
"email": "freek@spatie.be",
"homepage": "https://spatie.be",
"role": "Developer"
}
],
"description": "Add tags and taggable behaviour to your Laravel app",
"homepage": "https://github.com/spatie/laravel-tags",
"keywords": [
"laravel-tags",
"spatie"
],
"support": {
"issues": "https://github.com/spatie/laravel-tags/issues",
"source": "https://github.com/spatie/laravel-tags/tree/4.3.5"
},
"funding": [
{
"url": "https://github.com/spatie",
"type": "github"
}
],
"time": "2022-11-19T20:16:17+00:00"
},
{
"name": "spatie/laravel-translatable",
"version": "6.1.0",
"source": {
"type": "git",
"url": "https://github.com/spatie/laravel-translatable.git",
"reference": "b0ee6e06c666dcfb97fb1b4ff141b34e59806f13"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/spatie/laravel-translatable/zipball/b0ee6e06c666dcfb97fb1b4ff141b34e59806f13",
"reference": "b0ee6e06c666dcfb97fb1b4ff141b34e59806f13",
"shasum": ""
},
"require": {
"illuminate/database": "^9.0",
"illuminate/support": "^9.0",
"php": "^8.0",
"spatie/laravel-package-tools": "^1.11"
},
"require-dev": {
"mockery/mockery": "^1.4",
"orchestra/testbench": "^7.0",
"pestphp/pest": "^1.20"
},
"type": "library",
"extra": {
"laravel": {
"providers": [
"Spatie\\Translatable\\TranslatableServiceProvider"
]
},
"aliases": {
"Translatable": "Spatie\\Translatable\\Facades\\Translatable"
}
},
"autoload": {
"psr-4": {
"Spatie\\Translatable\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Freek Van der Herten",
"email": "freek@spatie.be",
"homepage": "https://spatie.be",
"role": "Developer"
},
{
"name": "Sebastian De Deyne",
"email": "sebastian@spatie.be",
"homepage": "https://spatie.be",
"role": "Developer"
}
],
"description": "A trait to make an Eloquent model hold translations",
"homepage": "https://github.com/spatie/laravel-translatable",
"keywords": [
"eloquent",
"i8n",
"laravel-translatable",
"model",
"multilingual",
"spatie",
"translate"
],
"support": {
"source": "https://github.com/spatie/laravel-translatable/tree/6.1.0"
},
"funding": [
{
"url": "https://github.com/spatie",
"type": "github"
}
],
"time": "2022-10-21T08:44:08+00:00"
},
{ {
"name": "spatie/macroable", "name": "spatie/macroable",
"version": "2.0.0", "version": "2.0.0",
@@ -7100,6 +7373,72 @@
}, },
"time": "2021-03-26T22:39:02+00:00" "time": "2021-03-26T22:39:02+00:00"
}, },
{
"name": "spatie/nova-tags-field",
"version": "4.0.5",
"source": {
"type": "git",
"url": "https://github.com/spatie/nova-tags-field.git",
"reference": "c84473c626d70d78c02ee6253a9ff73765fb8ef4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/spatie/nova-tags-field/zipball/c84473c626d70d78c02ee6253a9ff73765fb8ef4",
"reference": "c84473c626d70d78c02ee6253a9ff73765fb8ef4",
"shasum": ""
},
"require": {
"laravel/nova": "^4.13",
"nova-kit/nova-packages-tool": "^1.2",
"php": "^8.0",
"spatie/laravel-tags": "^4.0"
},
"require-dev": {
"mockery/mockery": "^1.4",
"orchestra/testbench": "^6.24|^7.0",
"phpunit/phpunit": "^9.4"
},
"type": "library",
"extra": {
"laravel": {
"providers": [
"Spatie\\TagsField\\TagsFieldServiceProvider"
]
}
},
"autoload": {
"psr-4": {
"Spatie\\TagsField\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Freek Van der Herten",
"email": "freek@spatie.be",
"role": "Developer"
}
],
"description": "A tags field for Nova apps",
"homepage": "https://github.com/spatie/nova-tags-field",
"keywords": [
"laravel",
"nova"
],
"support": {
"source": "https://github.com/spatie/nova-tags-field/tree/4.0.5"
},
"funding": [
{
"url": "https://spatie.be/open-source/support-us",
"type": "custom"
}
],
"time": "2022-11-15T08:02:12+00:00"
},
{ {
"name": "spatie/once", "name": "spatie/once",
"version": "3.1.0", "version": "3.1.0",

15
config/tags.php Normal file
View File

@@ -0,0 +1,15 @@
<?php
return [
/*
* The given function generates a URL friendly "slug" from the tag name property before saving it.
* Defaults to Str::slug (https://laravel.com/docs/master/helpers#method-str-slug)
*/
'slugger' => null,
/*
* The fully qualified class name of the tag model.
*/
'tag_model' => \App\Models\Tag::class,
];

44
config/tags/tags.php Normal file
View File

@@ -0,0 +1,44 @@
<?php
return [
[
'de' => 'Hardware Wallet',
'en' => 'Hardware Wallet',
'icon' => 'wallet',
],
[
'de' => 'Software Wallet',
'en' => 'Software Wallet',
'icon' => 'message-code',
],
[
'de' => 'Lightning',
'en' => 'Lightning',
'icon' => 'bolt-lightning',
],
[
'de' => 'On-Chain',
'en' => 'On-Chain',
'icon' => 'link-horizontal',
],
[
'de' => 'Off-Chain',
'en' => 'Off-Chain',
'icon' => 'link-horizontal-slash',
],
[
'de' => 'Für Unternehmen',
'en' => 'For Businesses',
'icon' => 'buildings',
],
[
'de' => 'Mining',
'en' => 'Mining',
'icon' => 'pickaxe',
],
[
'de' => 'Datenschutz',
'en' => 'Privacy',
'icon' => 'shield-keyhole',
],
];

View File

@@ -0,0 +1,37 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateTagTables extends Migration
{
public function up()
{
Schema::create('tags', function (Blueprint $table) {
$table->id();
$table->json('name');
$table->json('slug');
$table->string('type')
->nullable();
$table->integer('order_column')
->nullable();
$table->string('icon')
->default('tag');
$table->timestamps();
});
Schema::create('taggables', function (Blueprint $table) {
$table->foreignId('tag_id')
->constrained()
->cascadeOnDelete();
$table->morphs('taggable');
$table->unique(['tag_id', 'taggable_id', 'taggable_type']);
});
}
}

View File

@@ -3,6 +3,7 @@
namespace Database\Seeders; namespace Database\Seeders;
// use Illuminate\Database\Console\Seeds\WithoutModelEvents; // use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use App\Console\Commands\Database\CreateTags;
use App\Models\Category; use App\Models\Category;
use App\Models\City; use App\Models\City;
use App\Models\Country; use App\Models\Country;
@@ -15,6 +16,7 @@ use App\Models\Team;
use App\Models\User; use App\Models\User;
use App\Models\Venue; use App\Models\Venue;
use Illuminate\Database\Seeder; use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Str; use Illuminate\Support\Str;
use Spatie\Permission\Models\Role; use Spatie\Permission\Models\Role;
@@ -26,6 +28,7 @@ class DatabaseSeeder extends Seeder
*/ */
public function run() public function run()
{ {
Artisan::call(CreateTags::class);
Role::create([ Role::create([
'name' => 'super-admin', 'name' => 'super-admin',
'guard_name' => 'web', 'guard_name' => 'web',
@@ -124,18 +127,21 @@ class DatabaseSeeder extends Seeder
'lecturer_id' => 1, 'lecturer_id' => 1,
'name' => 'Hands on Bitcoin', 'name' => 'Hands on Bitcoin',
]); ]);
$course->syncTagsWithType(['Hardware Wallet'],'search');
$course->categories() $course->categories()
->attach($category); ->attach($category);
$course = Course::create([ $course = Course::create([
'lecturer_id' => 1, 'lecturer_id' => 1,
'name' => 'Bitcoin <> Crypto', 'name' => 'Bitcoin <> Crypto',
]); ]);
$course->syncTagsWithType(['Lightning'],'search');
$course->categories() $course->categories()
->attach($categoryOnline); ->attach($categoryOnline);
$course = Course::create([ $course = Course::create([
'lecturer_id' => 2, 'lecturer_id' => 2,
'name' => 'Bitcoin Lightning Network', 'name' => 'Bitcoin Lightning Network',
]); ]);
$course->syncTagsWithType(['Für Unternehmen'],'search');
$course->categories() $course->categories()
->attach($categoryOnline); ->attach($categoryOnline);
Participant::create([ Participant::create([

View File

@@ -0,0 +1,3 @@
{
"/tool.js": "/tool.js"
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,7 @@
/*!
* vuex v4.0.2
* (c) 2021 Evan You
* @license MIT
*/
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,5 @@
<div class="flex items-center">
@foreach($row->tags as $tag)
<x-badge>{{ $tag->name }}</x-badge>
@endforeach
</div>

View File

@@ -8,6 +8,7 @@
<!-- Fonts --> <!-- Fonts -->
@googlefonts @googlefonts
<!-- Scripts --> <!-- Scripts -->
<script src="https://kit.fontawesome.com/03bc14bd1e.js" crossorigin="anonymous"></script>
<wireui:scripts/> <wireui:scripts/>
@vite(['resources/css/app.css', 'resources/js/app.js']) @vite(['resources/css/app.css', 'resources/js/app.js'])
<!-- Styles --> <!-- Styles -->

View File

@@ -8,6 +8,7 @@
<!-- Fonts --> <!-- Fonts -->
@googlefonts @googlefonts
<!-- Scripts --> <!-- Scripts -->
<script src="https://kit.fontawesome.com/03bc14bd1e.js" crossorigin="anonymous"></script>
<wireui:scripts/> <wireui:scripts/>
@vite(['resources/css/app.css', 'resources/js/app.js']) @vite(['resources/css/app.css', 'resources/js/app.js'])
<!-- Styles --> <!-- Styles -->

View File

@@ -20,15 +20,15 @@
</a> </a>
<nav <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"> 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('search.city', ['country' => $c]) }}" <a href="{{ route('search.city', ['country' => $c, '#table']) }}"
class="{{ request()->routeIs('search.city') ? 'text-amber-500 underline' : 'text-gray-400' }} mr-5 font-medium leading-6 hover:text-gray-300">Städte</a> class="{{ request()->routeIs('search.city') ? 'text-amber-500 underline' : 'text-gray-400' }} mr-5 font-medium leading-6 hover:text-gray-300">Städte</a>
<a href="{{ route('search.lecturer', ['country' => $c]) }}" <a href="{{ route('search.lecturer', ['country' => $c, '#table']) }}"
class="{{ request()->routeIs('search.lecturer') ? 'text-amber-500 underline' : 'text-gray-400' }} mr-5 font-medium leading-6 hover:text-gray-300">Dozenten</a> class="{{ request()->routeIs('search.lecturer') ? 'text-amber-500 underline' : 'text-gray-400' }} mr-5 font-medium leading-6 hover:text-gray-300">Dozenten</a>
<a href="{{ route('search.venue', ['country' => $c]) }}" <a href="{{ route('search.venue', ['country' => $c, '#table']) }}"
class="{{ request()->routeIs('search.venue') ? 'text-amber-500 underline' : 'text-gray-400' }} mr-5 font-medium leading-6 hover:text-gray-300">Veranstaltungs-Orte</a> class="{{ request()->routeIs('search.venue') ? 'text-amber-500 underline' : 'text-gray-400' }} mr-5 font-medium leading-6 hover:text-gray-300">Veranstaltungs-Orte</a>
<a href="{{ route('search.course', ['country' => $c]) }}" <a href="{{ route('search.course', ['country' => $c, '#table']) }}"
class="{{ request()->routeIs('search.course') ? 'text-amber-500 underline' : 'text-gray-400' }} mr-5 font-medium leading-6 hover:text-gray-300">Kurse</a> class="{{ request()->routeIs('search.course') ? 'text-amber-500 underline' : 'text-gray-400' }} mr-5 font-medium leading-6 hover:text-gray-300">Kurse</a>
<a href="{{ route('search.event', ['country' => $c]) }}" <a href="{{ route('search.event', ['country' => $c, '#table']) }}"
class="{{ request()->routeIs('search.event') ? 'text-amber-500 underline' : 'text-gray-400' }} mr-5 font-medium leading-6 hover:text-gray-300">Termine</a> class="{{ request()->routeIs('search.event') ? 'text-amber-500 underline' : 'text-gray-400' }} mr-5 font-medium leading-6 hover:text-gray-300">Termine</a>
</nav> </nav>
</div> </div>

View File

@@ -0,0 +1,52 @@
<div
class="flex overflow-auto relative flex-wrap gap-x-5 gap-y-6 justify-center p-0 mx-auto mt-8 mb-3 w-full font-normal leading-6 text-white align-baseline border-0 border-solid md:mx-auto md:mb-0 md:max-w-screen-md"
style="max-width: 1350px; font-size: 128%; background-position: 0px center; max-height: 500px; list-style: outside;"
>
@foreach($tags->sortBy('name') as $tag)
<div
class="flex flex-1 justify-center p-0 m-0 leading-6 text-center align-baseline border-0 border-solid"
style="font-size: 128%; background-position: 0px center; list-style: outside;"
>
<a
class="flex relative flex-col flex-shrink-0 justify-between py-1 px-3 w-full h-20 text-white hover:text-amber-500 bg-blue-50 border-0 border-solid duration-300 ease-in-out cursor-pointer bg-opacity-[0.07]"
href="{{ route('search.course', ['country' => $country, 'table' => ['filters' => ['tag' => [$tag->name]]], '#table']) }}"
>
<div
class="flex flex-1 items-center p-0 m-0 text-center align-baseline border-0 border-solid"
>
<div
class="flex flex-shrink-0 justify-center p-0 my-0 mr-4 ml-0 align-baseline border-0 border-solid"
>
<i class="fa fa-thin fa-{{ $tag->icon }} text-4xl"></i>
</div>
<div
class="flex justify-between p-0 m-0 w-full align-baseline border-0 border-solid md:block lg:w-auto"
>
<h2
class="p-0 m-0 font-sans text-base font-semibold tracking-wide leading-tight text-left align-baseline border-0 border-solid"
style="background-position: 0px center; list-style: outside;"
>
{{ $tag->name }}
</h2>
<div
class="hidden p-0 m-0 text-sm leading-3 text-left text-blue-100 align-baseline border-0 border-solid md:block md:text-blue-100 whitespace-nowrap"
>
@php
$lecturerCount = $tag->courses->pluck('lecturer.name')->unique()->count();
@endphp
{{ $lecturerCount > 0 ? $lecturerCount : 'kein' }}
Dozent{{ $lecturerCount > 1 ? 'en' : '' }}
<span
class="inline-block relative top-px py-0 px-1 m-0 text-xs leading-4 align-baseline border-0 border-solid"
>
</span>
{{ $tag->courses_count }} Kurs{{ $tag->courses_count > 1 ? 'e' : '' }}
</div>
</div>
</div>
</a
>
</div>
@endforeach
</div>

View File

@@ -4,6 +4,7 @@
{{-- MAIN --}} {{-- MAIN --}}
<section class="w-full mb-12"> <section class="w-full mb-12">
<div class="max-w-screen-2xl mx-auto px-2 sm:px-10" id="table"> <div class="max-w-screen-2xl mx-auto px-2 sm:px-10" id="table">
<livewire:frontend.search-by-tag :country="$country->code"/>
<livewire:frontend.search-tabs :country="$country->code"/> <livewire:frontend.search-tabs :country="$country->code"/>
<livewire:tables.city-table :country="$country->code"/> <livewire:tables.city-table :country="$country->code"/>
</div> </div>

View File

@@ -4,6 +4,7 @@
{{-- MAIN --}} {{-- MAIN --}}
<section class="w-full mb-12"> <section class="w-full mb-12">
<div class="max-w-screen-2xl mx-auto px-2 sm:px-10" id="table"> <div class="max-w-screen-2xl mx-auto px-2 sm:px-10" id="table">
<livewire:frontend.search-by-tag :country="$country->code"/>
<livewire:frontend.search-tabs :country="$country->code"/> <livewire:frontend.search-tabs :country="$country->code"/>
<livewire:tables.course-table :country="$country->code"/> <livewire:tables.course-table :country="$country->code"/>
</div> </div>

View File

@@ -4,6 +4,7 @@
{{-- MAIN --}} {{-- MAIN --}}
<section class="w-full mb-12"> <section class="w-full mb-12">
<div class="max-w-screen-2xl mx-auto px-2 sm:px-10" id="table"> <div class="max-w-screen-2xl mx-auto px-2 sm:px-10" id="table">
<livewire:frontend.search-by-tag :country="$country->code"/>
<livewire:frontend.search-tabs :country="$country->code"/> <livewire:frontend.search-tabs :country="$country->code"/>
<livewire:tables.event-table :country="$country->code"/> <livewire:tables.event-table :country="$country->code"/>
</div> </div>

View File

@@ -4,6 +4,7 @@
{{-- MAIN --}} {{-- MAIN --}}
<section class="w-full mb-12"> <section class="w-full mb-12">
<div class="max-w-screen-2xl mx-auto px-2 sm:px-10" id="table"> <div class="max-w-screen-2xl mx-auto px-2 sm:px-10" id="table">
<livewire:frontend.search-by-tag :country="$country->code"/>
<livewire:frontend.search-tabs :country="$country->code"/> <livewire:frontend.search-tabs :country="$country->code"/>
<livewire:tables.lecturer-table :country="$country->code"/> <livewire:tables.lecturer-table :country="$country->code"/>
</div> </div>

View File

@@ -4,6 +4,7 @@
{{-- MAIN --}} {{-- MAIN --}}
<section class="w-full mb-12"> <section class="w-full mb-12">
<div class="max-w-screen-2xl mx-auto px-2 sm:px-10" id="table"> <div class="max-w-screen-2xl mx-auto px-2 sm:px-10" id="table">
<livewire:frontend.search-by-tag :country="$country->code"/>
<livewire:frontend.search-tabs :country="$country->code"/> <livewire:frontend.search-tabs :country="$country->code"/>
<livewire:tables.venue-table :country="$country->code"/> <livewire:tables.venue-table :country="$country->code"/>
</div> </div>