mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig-portal.git
synced 2025-12-11 06:46:47 +00:00
$model->podcast->language_code
This commit is contained in:
@@ -6,7 +6,6 @@ use App\Models\Country;
|
|||||||
use App\Models\Library;
|
use App\Models\Library;
|
||||||
use App\Models\LibraryItem;
|
use App\Models\LibraryItem;
|
||||||
use App\Models\Tag;
|
use App\Models\Tag;
|
||||||
use Illuminate\Pagination\LengthAwarePaginator;
|
|
||||||
use Livewire\Component;
|
use Livewire\Component;
|
||||||
use RalphJSmit\Laravel\SEO\Support\SEOData;
|
use RalphJSmit\Laravel\SEO\Support\SEOData;
|
||||||
|
|
||||||
@@ -103,8 +102,10 @@ class LibraryTable extends Component
|
|||||||
->where('libraries.name', $this->currentTab)
|
->where('libraries.name', $this->currentTab)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
->when(count($this->filters) > 0, fn($query) => $query->whereHas('tags',
|
->when(isset($this->filters['tag']), fn($query) => $query->whereHas('tags',
|
||||||
fn($query) => $query->whereIn('tags.id', $this->filters)))
|
fn($query) => $query->whereIn('tags.id', $this->filters['tag'])))
|
||||||
|
->when(isset($this->filters['language']),
|
||||||
|
fn($query) => $query->whereIn('language_code', $this->filters['language']))
|
||||||
->whereHas('libraries',
|
->whereHas('libraries',
|
||||||
fn($query) => $query->where('libraries.is_public', $shouldBePublic))
|
fn($query) => $query->where('libraries.is_public', $shouldBePublic))
|
||||||
->orderByDesc('library_items.created_at')
|
->orderByDesc('library_items.created_at')
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Http\Livewire\Library;
|
namespace App\Http\Livewire\Library;
|
||||||
|
|
||||||
|
use App\Models\LibraryItem;
|
||||||
use App\Models\Tag;
|
use App\Models\Tag;
|
||||||
use Livewire\Component;
|
use Livewire\Component;
|
||||||
|
|
||||||
@@ -21,6 +22,15 @@ class SearchByTagComponent extends Component
|
|||||||
->getName() !== 'library.table.lecturer';
|
->getName() !== 'library.table.lecturer';
|
||||||
|
|
||||||
return view('livewire.library.search-by-tag-component', [
|
return view('livewire.library.search-by-tag-component', [
|
||||||
|
'languages' => LibraryItem::query()
|
||||||
|
->pluck('language_code')
|
||||||
|
->unique()
|
||||||
|
->sort()
|
||||||
|
->map(fn($item) => str($item)
|
||||||
|
->before('_')
|
||||||
|
->toString())
|
||||||
|
->values()
|
||||||
|
->toArray(),
|
||||||
'tags' => Tag::query()
|
'tags' => Tag::query()
|
||||||
->with([
|
->with([
|
||||||
'libraryItems.libraries',
|
'libraryItems.libraries',
|
||||||
@@ -30,7 +40,8 @@ class SearchByTagComponent extends Component
|
|||||||
'libraryItems',
|
'libraryItems',
|
||||||
])
|
])
|
||||||
->where('type', 'library_item')
|
->where('type', 'library_item')
|
||||||
->whereHas('libraryItems.libraries', fn($query) => $query->where('is_public', $shouldBePublic))
|
->whereHas('libraryItems.libraries',
|
||||||
|
fn($query) => $query->where('is_public', $shouldBePublic))
|
||||||
->orderByDesc('library_items_count')
|
->orderByDesc('library_items_count')
|
||||||
->orderBy('tags.id')
|
->orderBy('tags.id')
|
||||||
->get(),
|
->get(),
|
||||||
|
|||||||
@@ -53,7 +53,9 @@ class Episode extends Resource
|
|||||||
'episode_id' => $model->id,
|
'episode_id' => $model->id,
|
||||||
'name' => $model->data['title'],
|
'name' => $model->data['title'],
|
||||||
'type' => 'podcast_episode',
|
'type' => 'podcast_episode',
|
||||||
'language_code' => $model->podcast->language_code,
|
'language_code' => str($model->podcast->language_code)
|
||||||
|
->before('-')
|
||||||
|
->toString(),
|
||||||
'value' => null,
|
'value' => null,
|
||||||
'excerpt' => $model->data['description'],
|
'excerpt' => $model->data['description'],
|
||||||
'subtitle' => $model->data['description'],
|
'subtitle' => $model->data['description'],
|
||||||
|
|||||||
@@ -110,6 +110,7 @@
|
|||||||
option-value="language"
|
option-value="language"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@auth
|
@auth
|
||||||
<div></div>
|
<div></div>
|
||||||
@else
|
@else
|
||||||
@@ -128,16 +129,16 @@
|
|||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
<section class="h-auto">
|
<section class="h-auto">
|
||||||
<div class="px-10 py-2 sm:py-6 mx-auto max-w-7xl">
|
<div class="px-10 py-2 mx-auto max-w-7xl">
|
||||||
<div class="w-full mx-auto text-left md:text-center">
|
<div class="w-full mx-auto text-left md:text-center">
|
||||||
|
|
||||||
@if(str(request()->route()->getName())->contains('school.'))
|
@if(str(request()->route()->getName())->contains('school.'))
|
||||||
<div>
|
<div>
|
||||||
<h1 class="mb-6 text-5xl font-extrabold leading-none max-w-5xl mx-auto tracking-normal text-gray-200 sm:text-6xl md:text-6xl lg:text-7xl md:tracking-tight">
|
<h1 class="mb-2 text-5xl font-extrabold leading-none max-w-5xl mx-auto tracking-normal text-gray-200 sm:text-6xl md:text-6xl lg:text-7xl md:tracking-tight">
|
||||||
Bitcoin <span
|
Bitcoin <span
|
||||||
class="w-full text-transparent bg-clip-text bg-gradient-to-r from-amber-400 via-amber-500 to-amber-200 lg:inline">{{ __('Courses') }}</span>
|
class="w-full text-transparent bg-clip-text bg-gradient-to-r from-amber-400 via-amber-500 to-amber-200 lg:inline">{{ __('Courses') }}</span>
|
||||||
</h1>
|
</h1>
|
||||||
<p class="px-0 mb-6 text-lg text-gray-600 md:text-xl lg:px-24">
|
<p class="px-0 mb-2 text-lg text-gray-600 md:text-xl lg:px-24">
|
||||||
{{ __('Choose your city, search for courses in the surrounding area and select a topic that suits you.') }}
|
{{ __('Choose your city, search for courses in the surrounding area and select a topic that suits you.') }}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
@@ -145,11 +146,11 @@
|
|||||||
|
|
||||||
@if(str(request()->route()->getName())->contains('library.'))
|
@if(str(request()->route()->getName())->contains('library.'))
|
||||||
<div>
|
<div>
|
||||||
<h1 class="mb-6 text-5xl font-extrabold leading-none max-w-5xl mx-auto tracking-normal text-gray-200 sm:text-6xl md:text-6xl lg:text-7xl md:tracking-tight">
|
<h1 class="mb-2 text-5xl font-extrabold leading-none max-w-5xl mx-auto tracking-normal text-gray-200 sm:text-6xl md:text-6xl lg:text-7xl md:tracking-tight">
|
||||||
Bitcoin <span
|
Bitcoin <span
|
||||||
class="w-full text-transparent bg-clip-text bg-gradient-to-r from-amber-400 via-amber-500 to-amber-200 lg:inline">{{ __('Content') }}</span>
|
class="w-full text-transparent bg-clip-text bg-gradient-to-r from-amber-400 via-amber-500 to-amber-200 lg:inline">{{ __('Content') }}</span>
|
||||||
</h1>
|
</h1>
|
||||||
<p class="px-0 mb-6 text-lg text-gray-600 md:text-xl lg:px-24">
|
<p class="px-0 mb-2 text-lg text-gray-600 md:text-xl lg:px-24">
|
||||||
{{ __('Choose a topic that is right for you.') }}
|
{{ __('Choose a topic that is right for you.') }}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,3 +1,28 @@
|
|||||||
|
<div>
|
||||||
|
<div
|
||||||
|
class="flex overflow-auto relative flex-wrap gap-x-1 gap-y-1 justify-left p-0 mx-auto mt-2 mb-2 w-full font-normal text-white align-baseline border-0 border-solid md:mx-auto md:mb-0 md:max-w-screen-2xl"
|
||||||
|
>
|
||||||
|
@foreach($languages as $language)
|
||||||
|
<div
|
||||||
|
class="flex flex-wrap justify-left p-0 m-0 text-center align-baseline border-0 border-solid"
|
||||||
|
style="font-size: 128%; background-position: 0px center; list-style: outside;"
|
||||||
|
>
|
||||||
|
<a
|
||||||
|
href="{{ route(request()->route()->getName(), ['country' => $country, 'filters' => ['language' => [$language]]]) }}"
|
||||||
|
>
|
||||||
|
@if(in_array($language, $filters['language'] ?? [], false))
|
||||||
|
<x-badge squared amber>
|
||||||
|
{{ $language }}
|
||||||
|
</x-badge>
|
||||||
|
@else
|
||||||
|
<x-badge squared gray>
|
||||||
|
{{ $language }}
|
||||||
|
</x-badge>
|
||||||
|
@endif
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
@endforeach
|
||||||
|
</div>
|
||||||
<div
|
<div
|
||||||
class="flex overflow-auto relative flex-wrap gap-x-1 gap-y-1 justify-left p-0 mx-auto mt-2 mb-2 w-full font-normal text-white align-baseline border-0 border-solid md:mx-auto md:mb-0 md:max-w-screen-2xl"
|
class="flex overflow-auto relative flex-wrap gap-x-1 gap-y-1 justify-left p-0 mx-auto mt-2 mb-2 w-full font-normal text-white align-baseline border-0 border-solid md:mx-auto md:mb-0 md:max-w-screen-2xl"
|
||||||
>
|
>
|
||||||
@@ -24,3 +49,4 @@
|
|||||||
</div>
|
</div>
|
||||||
@endforeach
|
@endforeach
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|||||||
@@ -292,9 +292,9 @@ camelcase-css@^2.0.1:
|
|||||||
integrity sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA==
|
integrity sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA==
|
||||||
|
|
||||||
caniuse-lite@^1.0.30001400, caniuse-lite@^1.0.30001426:
|
caniuse-lite@^1.0.30001400, caniuse-lite@^1.0.30001426:
|
||||||
version "1.0.30001446"
|
version "1.0.30001449"
|
||||||
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001446.tgz#6d4ba828ab19f49f9bcd14a8430d30feebf1e0c5"
|
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001449.tgz#a8d11f6a814c75c9ce9d851dc53eb1d1dfbcd657"
|
||||||
integrity sha512-fEoga4PrImGcwUUGEol/PoFCSBnSkA9drgdkxXkJLsUBOnJ8rs3zDv6ApqYXGQFOyMPsjh79naWhF4DAxbF8rw==
|
integrity sha512-CPB+UL9XMT/Av+pJxCKGhdx+yg1hzplvFJQlJ2n68PyQGMz9L/E2zCyLdOL8uasbouTUgnPl+y0tccI/se+BEw==
|
||||||
|
|
||||||
chokidar@^3.5.3:
|
chokidar@^3.5.3:
|
||||||
version "3.5.3"
|
version "3.5.3"
|
||||||
|
|||||||
Reference in New Issue
Block a user