Redaktion: Symbol, offene Freigaben und „Anzeige aufgeben“ (1.0.1)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
f05c44733f
commit
8b01a44f90
2 changed files with 15 additions and 1 deletions
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"slug": "kleinanzeigen",
|
||||
"name": "Kleinanzeigen",
|
||||
"version": "1.0.0",
|
||||
"version": "1.0.1",
|
||||
"description": "Kleinanzeigen von Kolleginnen und Kollegen für Kolleginnen und Kollegen: verkaufen, verschenken, suchen, tauschen – mit Fotos, Merkliste und Freigabe durch die Moderation. Kontakt über das Chat-Plugin oder per E-Mail.",
|
||||
"author": "Loheide",
|
||||
"namespace": "Inhaus\\Plugins\\Kleinanzeigen\\",
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ use App\Search\GlobalSearch;
|
|||
use App\Support\Abilities;
|
||||
use App\Support\Navigation;
|
||||
use Carbon\CarbonImmutable;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Schedule;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Inhaus\Plugins\Kleinanzeigen\Models\Listing;
|
||||
|
|
@ -49,6 +50,19 @@ class KleinanzeigenPlugin extends Plugin
|
|||
fn (User $user) => $user->can('kleinanzeigen.moderate'),
|
||||
fn () => ['pending' => Listing::query()->where('status', 'pending')->with('images')->oldest('updated_at')->limit(20)->get()->map(fn (Listing $l) => Presenter::card($l))->all()]);
|
||||
|
||||
// Ab Inhaus 0.42.0: Symbol, offene Freigaben als Zahl und „Neu anlegen“ in der Redaktion
|
||||
$editorial = $this->app->make(Editorial::class);
|
||||
|
||||
if (method_exists($editorial, 'meta')) {
|
||||
$editorial->meta('kleinanzeigen', icon: 'shopping-bag',
|
||||
todo: function () {
|
||||
$count = Listing::query()->where('status', 'pending')->count() + DB::table('kleinanzeigen_reports')->whereNull('resolved_at')->distinct()->count('listing_id');
|
||||
|
||||
return ['count' => $count, 'label' => $count === 1 ? 'Anzeige zu prüfen' : 'Anzeigen zu prüfen'];
|
||||
},
|
||||
create: fn () => ['label' => 'Anzeige aufgeben', 'href' => route('kleinanzeigen.create')]);
|
||||
}
|
||||
|
||||
if (class_exists(Digest::class)) {
|
||||
$this->app->make(Digest::class)->add('kleinanzeigen', 'Neue Kleinanzeigen', 60, fn (User $user, CarbonImmutable $since) => Listing::query()
|
||||
->visible()->where('published_at', '>=', $since)->latest('published_at')->limit(6)->get()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue