mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig-portal.git
synced 2025-12-11 06:46:47 +00:00
autors overview
This commit is contained in:
@@ -13,6 +13,12 @@ class ArticleOverview extends Component
|
|||||||
use Actions;
|
use Actions;
|
||||||
use NostrTrait;
|
use NostrTrait;
|
||||||
|
|
||||||
|
public array $filters = [];
|
||||||
|
|
||||||
|
protected $queryString = [
|
||||||
|
'filters' => ['except' => ''],
|
||||||
|
];
|
||||||
|
|
||||||
public function nostr($id)
|
public function nostr($id)
|
||||||
{
|
{
|
||||||
$libraryItem = LibraryItem::query()
|
$libraryItem = LibraryItem::query()
|
||||||
@@ -56,6 +62,11 @@ class ArticleOverview extends Component
|
|||||||
$this->emit('$refresh');
|
$this->emit('$refresh');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function resetFiltering()
|
||||||
|
{
|
||||||
|
return to_route('article.overview');
|
||||||
|
}
|
||||||
|
|
||||||
public function render()
|
public function render()
|
||||||
{
|
{
|
||||||
return view('livewire.news.article-overview', [
|
return view('livewire.news.article-overview', [
|
||||||
@@ -65,6 +76,11 @@ class ArticleOverview extends Component
|
|||||||
'lecturer',
|
'lecturer',
|
||||||
'tags',
|
'tags',
|
||||||
])
|
])
|
||||||
|
->when(
|
||||||
|
isset($this->filters['author']),
|
||||||
|
fn($query) => $query->whereHas('lecturer',
|
||||||
|
fn($query) => $query->where('lecturers.slug',
|
||||||
|
$this->filters['author'])))
|
||||||
->where('type', 'markdown_article')
|
->where('type', 'markdown_article')
|
||||||
->where('news', true)
|
->where('news', true)
|
||||||
->orderByDesc('created_at')
|
->orderByDesc('created_at')
|
||||||
|
|||||||
23
app/Http/Livewire/News/AuthorsOverview.php
Normal file
23
app/Http/Livewire/News/AuthorsOverview.php
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Livewire\News;
|
||||||
|
|
||||||
|
use App\Models\Lecturer;
|
||||||
|
use Livewire\Component;
|
||||||
|
|
||||||
|
class AuthorsOverview extends Component
|
||||||
|
{
|
||||||
|
public function render()
|
||||||
|
{
|
||||||
|
return view('livewire.news.authors-overview', [
|
||||||
|
'authors' => Lecturer::query()
|
||||||
|
->whereHas('libraryItems', function ($query) {
|
||||||
|
$query->where('library_items.news', true);
|
||||||
|
})
|
||||||
|
->withCount([
|
||||||
|
'libraryItems' => fn($query) => $query->where('library_items.news', true),
|
||||||
|
])
|
||||||
|
->get(),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -849,5 +849,10 @@
|
|||||||
"Videos": "Videos",
|
"Videos": "Videos",
|
||||||
"Bücher": "Bücher",
|
"Bücher": "Bücher",
|
||||||
"Embed code for the map copied!": "Embed-Code für die Karte kopiert!",
|
"Embed code for the map copied!": "Embed-Code für die Karte kopiert!",
|
||||||
"Copy embed code for the map": "Kopiere Embed-Code für die Karte"
|
"Copy embed code for the map": "Kopiere Embed-Code für die Karte",
|
||||||
|
"Authors": "News-Autoren",
|
||||||
|
"Reset filtering": "Filter zurücksetzen",
|
||||||
|
"News articles writer": "News-Artikel-Autoren",
|
||||||
|
"Click on any of the authors to see their articles.": "Klicke auf einen der Autoren, um die Artikel zu lesen.",
|
||||||
|
"articles": "Artikel"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -847,5 +847,10 @@
|
|||||||
"Videos": "",
|
"Videos": "",
|
||||||
"Bücher": "",
|
"Bücher": "",
|
||||||
"Embed code for the map copied!": "",
|
"Embed code for the map copied!": "",
|
||||||
"Copy embed code for the map": ""
|
"Copy embed code for the map": "",
|
||||||
|
"Authors": "",
|
||||||
|
"Reset filtering": "",
|
||||||
|
"News articles writer": "",
|
||||||
|
"Click on any of the authors to see their articles.": "",
|
||||||
|
"articles": ""
|
||||||
}
|
}
|
||||||
@@ -847,5 +847,10 @@
|
|||||||
"Videos": "",
|
"Videos": "",
|
||||||
"Bücher": "",
|
"Bücher": "",
|
||||||
"Embed code for the map copied!": "",
|
"Embed code for the map copied!": "",
|
||||||
"Copy embed code for the map": ""
|
"Copy embed code for the map": "",
|
||||||
|
"Authors": "",
|
||||||
|
"Reset filtering": "",
|
||||||
|
"News articles writer": "",
|
||||||
|
"Click on any of the authors to see their articles.": "",
|
||||||
|
"articles": ""
|
||||||
}
|
}
|
||||||
@@ -848,5 +848,10 @@
|
|||||||
"Videos": "",
|
"Videos": "",
|
||||||
"Bücher": "",
|
"Bücher": "",
|
||||||
"Embed code for the map copied!": "",
|
"Embed code for the map copied!": "",
|
||||||
"Copy embed code for the map": ""
|
"Copy embed code for the map": "",
|
||||||
|
"Authors": "",
|
||||||
|
"Reset filtering": "",
|
||||||
|
"News articles writer": "",
|
||||||
|
"Click on any of the authors to see their articles.": "",
|
||||||
|
"articles": ""
|
||||||
}
|
}
|
||||||
@@ -848,5 +848,10 @@
|
|||||||
"Videos": "",
|
"Videos": "",
|
||||||
"Bücher": "",
|
"Bücher": "",
|
||||||
"Embed code for the map copied!": "",
|
"Embed code for the map copied!": "",
|
||||||
"Copy embed code for the map": ""
|
"Copy embed code for the map": "",
|
||||||
|
"Authors": "",
|
||||||
|
"Reset filtering": "",
|
||||||
|
"News articles writer": "",
|
||||||
|
"Click on any of the authors to see their articles.": "",
|
||||||
|
"articles": ""
|
||||||
}
|
}
|
||||||
@@ -848,5 +848,10 @@
|
|||||||
"Videos": "",
|
"Videos": "",
|
||||||
"Bücher": "",
|
"Bücher": "",
|
||||||
"Embed code for the map copied!": "",
|
"Embed code for the map copied!": "",
|
||||||
"Copy embed code for the map": ""
|
"Copy embed code for the map": "",
|
||||||
|
"Authors": "",
|
||||||
|
"Reset filtering": "",
|
||||||
|
"News articles writer": "",
|
||||||
|
"Click on any of the authors to see their articles.": "",
|
||||||
|
"articles": ""
|
||||||
}
|
}
|
||||||
@@ -848,5 +848,10 @@
|
|||||||
"Videos": "",
|
"Videos": "",
|
||||||
"Bücher": "",
|
"Bücher": "",
|
||||||
"Embed code for the map copied!": "",
|
"Embed code for the map copied!": "",
|
||||||
"Copy embed code for the map": ""
|
"Copy embed code for the map": "",
|
||||||
|
"Authors": "",
|
||||||
|
"Reset filtering": "",
|
||||||
|
"News articles writer": "",
|
||||||
|
"Click on any of the authors to see their articles.": "",
|
||||||
|
"articles": ""
|
||||||
}
|
}
|
||||||
@@ -848,5 +848,10 @@
|
|||||||
"Videos": "",
|
"Videos": "",
|
||||||
"Bücher": "",
|
"Bücher": "",
|
||||||
"Embed code for the map copied!": "",
|
"Embed code for the map copied!": "",
|
||||||
"Copy embed code for the map": ""
|
"Copy embed code for the map": "",
|
||||||
|
"Authors": "",
|
||||||
|
"Reset filtering": "",
|
||||||
|
"News articles writer": "",
|
||||||
|
"Click on any of the authors to see their articles.": "",
|
||||||
|
"articles": ""
|
||||||
}
|
}
|
||||||
@@ -848,5 +848,10 @@
|
|||||||
"Videos": "",
|
"Videos": "",
|
||||||
"Bücher": "",
|
"Bücher": "",
|
||||||
"Embed code for the map copied!": "",
|
"Embed code for the map copied!": "",
|
||||||
"Copy embed code for the map": ""
|
"Copy embed code for the map": "",
|
||||||
|
"Authors": "",
|
||||||
|
"Reset filtering": "",
|
||||||
|
"News articles writer": "",
|
||||||
|
"Click on any of the authors to see their articles.": "",
|
||||||
|
"articles": ""
|
||||||
}
|
}
|
||||||
@@ -810,5 +810,10 @@
|
|||||||
"Videos": "",
|
"Videos": "",
|
||||||
"Bücher": "",
|
"Bücher": "",
|
||||||
"Embed code for the map copied!": "",
|
"Embed code for the map copied!": "",
|
||||||
"Copy embed code for the map": ""
|
"Copy embed code for the map": "",
|
||||||
|
"Authors": "",
|
||||||
|
"Reset filtering": "",
|
||||||
|
"News articles writer": "",
|
||||||
|
"Click on any of the authors to see their articles.": "",
|
||||||
|
"articles": ""
|
||||||
}
|
}
|
||||||
@@ -822,5 +822,10 @@
|
|||||||
"Videos": "",
|
"Videos": "",
|
||||||
"Bücher": "",
|
"Bücher": "",
|
||||||
"Embed code for the map copied!": "",
|
"Embed code for the map copied!": "",
|
||||||
"Copy embed code for the map": ""
|
"Copy embed code for the map": "",
|
||||||
|
"Authors": "",
|
||||||
|
"Reset filtering": "",
|
||||||
|
"News articles writer": "",
|
||||||
|
"Click on any of the authors to see their articles.": "",
|
||||||
|
"articles": ""
|
||||||
}
|
}
|
||||||
@@ -33,6 +33,12 @@
|
|||||||
{{ __('News Article') }}
|
{{ __('News Article') }}
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
|
<a href="{{ route('authors.overview') }}"
|
||||||
|
class="flex gap-x-4 py-2 text-sm font-semibold leading-6 text-gray-900">
|
||||||
|
<i class="fa-thin fa-pen-nib flex-none text-gray-400 w-6 h-5 mr-2 -ml-1"></i>
|
||||||
|
{{ __('Authors') }}
|
||||||
|
</a>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -12,7 +12,12 @@
|
|||||||
<div>
|
<div>
|
||||||
<img class="h-32 object-cover" src="{{ asset('img/einundzwanzig-news-colored.png') }}" alt="">
|
<img class="h-32 object-cover" src="{{ asset('img/einundzwanzig-news-colored.png') }}" alt="">
|
||||||
</div>
|
</div>
|
||||||
<div class="space-y-2 sm:space-y-0">
|
<div class="flex flex-col space-y-2">
|
||||||
|
@if(isset($filters['author']))
|
||||||
|
<x-button wire:click="resetFiltering"
|
||||||
|
xs>{{ __('Reset filtering') }}
|
||||||
|
</x-button>
|
||||||
|
@endif
|
||||||
@auth
|
@auth
|
||||||
<x-button
|
<x-button
|
||||||
class="whitespace-nowrap"
|
class="whitespace-nowrap"
|
||||||
|
|||||||
50
resources/views/livewire/news/authors-overview.blade.php
Normal file
50
resources/views/livewire/news/authors-overview.blade.php
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
<div class="bg-21gray flex flex-col h-screen justify-between">
|
||||||
|
{{-- HEADER --}}
|
||||||
|
<livewire:frontend.header :country="null"/>
|
||||||
|
|
||||||
|
<div class="bg-21gray py-24 sm:py-32">
|
||||||
|
<div class="mx-auto grid max-w-7xl gap-y-20 gap-x-8 px-6 lg:px-8 xl:grid-cols-3">
|
||||||
|
<div class="max-w-2xl">
|
||||||
|
<h2 class="text-3xl font-bold tracking-tight text-gray-200 sm:text-4xl">{{ __('News articles writer') }}</h2>
|
||||||
|
<p class="mt-6 text-lg leading-8 text-gray-300">
|
||||||
|
{{ __('Click on any of the authors to see their articles.') }}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<ul role="list" class="grid gap-x-8 gap-y-12 sm:grid-cols-2 sm:gap-y-16 xl:col-span-2">
|
||||||
|
|
||||||
|
@foreach($authors as $author)
|
||||||
|
<a href="{{ route('article.overview', ['filters' => ['author' => $author->slug]]) }}"
|
||||||
|
wire:key="author_{{ $author->id }}">
|
||||||
|
<li>
|
||||||
|
<div class="flex items-center gap-x-6">
|
||||||
|
<img class="h-16 w-16 rounded-full"
|
||||||
|
src="{{ $author->getFirstMediaUrl('avatar') }}"
|
||||||
|
alt="{{ $author->name }}">
|
||||||
|
<div>
|
||||||
|
<h3 class="text-base font-semibold leading-7 tracking-tight text-gray-200">
|
||||||
|
{{ $author->name }}
|
||||||
|
</h3>
|
||||||
|
<p class="text-sm font-semibold leading-6 text-amber-600">
|
||||||
|
{{ $author->library_items_count }} {{ __('articles') }}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
</a>
|
||||||
|
@endforeach
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div wire:ignore class="z-50">
|
||||||
|
<script
|
||||||
|
src="{{ asset('dist/einundzwanzig.chat.js') }}"
|
||||||
|
data-website-owner-pubkey="daf83d92768b5d0005373f83e30d4203c0b747c170449e02fea611a0da125ee6"
|
||||||
|
data-chat-type="GLOBAL"
|
||||||
|
data-chat-tags="#einundzwanzig_portal_news_authors"
|
||||||
|
data-relays="wss://nostr.einundzwanzig.space,wss://nostr.easify.de,wss://nostr.mom,wss://relay.damus.io,wss://relay.snort.social"
|
||||||
|
></script>
|
||||||
|
<link rel="stylesheet" href="{{ asset('dist/einundzwanzig.chat.css') }}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@@ -26,6 +26,10 @@ Route::middleware([])
|
|||||||
->get('/news', \App\Http\Livewire\News\ArticleOverview::class)
|
->get('/news', \App\Http\Livewire\News\ArticleOverview::class)
|
||||||
->name('article.overview');
|
->name('article.overview');
|
||||||
|
|
||||||
|
Route::middleware([])
|
||||||
|
->get('/news/authors', \App\Http\Livewire\News\AuthorsOverview::class)
|
||||||
|
->name('authors.overview');
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* News
|
* News
|
||||||
* */
|
* */
|
||||||
|
|||||||
Reference in New Issue
Block a user