Redaktion mit Bereichsleiste und Übersicht (0.42.0)
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 6m51s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 6m48s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 7m16s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 7m21s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 9m30s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 9m44s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 8m49s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 8m37s
CI / Bekannte Sicherheitslücken in Paketen (pull_request) Successful in 44s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m8s
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 6m51s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 6m48s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 7m16s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 7m21s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 9m30s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 9m44s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 8m49s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 8m37s
CI / Bekannte Sicherheitslücken in Paketen (pull_request) Successful in 44s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m8s
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
b1209a0d33
commit
d5b7b1e0a8
146 changed files with 666 additions and 362 deletions
|
|
@ -68,6 +68,8 @@ class EventsPlugin extends Plugin
|
|||
'edit_url' => route('events.edit', $event),
|
||||
])->all(),
|
||||
]);
|
||||
$this->app->make(Editorial::class)->meta('events', icon: 'calendar-days',
|
||||
create: fn (User $user) => $user->can('events.manage') ? ['label' => 'Neuer Termin', 'href' => route('events.create')] : null);
|
||||
|
||||
$this->app->make(Widgets::class)->add('events.upcoming', 'events::Upcoming', 'aside', sort: 20, props: fn (User $user) => [
|
||||
'events' => EventResource::collection(Event::query()->upcoming()->visibleTo($user)->limit(4)->get())->resolve(),
|
||||
|
|
|
|||
|
|
@ -36,6 +36,12 @@ class FormsPlugin extends Plugin
|
|||
$this->app->make(Editorial::class)->add('forms', 'Formulare', 'forms::EditorialForms', 30,
|
||||
fn (User $user) => EditorialForms::visible($user),
|
||||
fn (User $user) => EditorialForms::props($user));
|
||||
$this->app->make(Editorial::class)->meta('forms', icon: 'clipboard-list',
|
||||
todo: function (User $user) {
|
||||
$count = (int) collect(EditorialForms::props($user)['forms'] ?? [])->sum('unread');
|
||||
|
||||
return ['count' => $count, 'label' => $count === 1 ? 'neue Einsendung' : 'neue Einsendungen'];
|
||||
});
|
||||
|
||||
$this->app->make(Blocks::class)->add(BlockType::make('forms.form', 'Formular', 'clipboard-list', 'dynamic', 'forms::FormBlock')
|
||||
->description('Ein Formular direkt auf der Seite ausfüllen lassen.')
|
||||
|
|
|
|||
|
|
@ -37,6 +37,12 @@ class IdeenPlugin extends Plugin
|
|||
->orderByRaw("status = 'new' DESC")->orderByDesc('supports_count')->latest()->limit(30)->get()
|
||||
->map(fn (Idea $idea) => Presenter::card($idea))->all(),
|
||||
]);
|
||||
$this->app->make(Editorial::class)->meta('ideen', icon: 'lightbulb',
|
||||
todo: function () {
|
||||
$count = Idea::query()->where('status', 'new')->count() + Idea::query()->whereHas('reports', fn ($q) => $q->whereNull('resolved_at'))->count();
|
||||
|
||||
return ['count' => $count, 'label' => $count === 1 ? 'Idee zu sichten' : 'Ideen zu sichten'];
|
||||
});
|
||||
|
||||
// Startseite: beliebteste offene Ideen
|
||||
$this->app->make(Widgets::class)->add('ideen.popular', 'ideen::Popular', 'aside', sort: 28, props: function () {
|
||||
|
|
|
|||
|
|
@ -117,6 +117,15 @@ class NewsPlugin extends Plugin
|
|||
fn (User $user) => app(NewsPostPolicy::class)->viewAny($user),
|
||||
fn (User $user) => EditorialNews::props($user),
|
||||
);
|
||||
$this->app->make(Editorial::class)->meta('news', icon: 'newspaper',
|
||||
todo: function (User $user) {
|
||||
$publishable = $user->can('news.manage') ? true : $user->permissions()->ids('news.post.publish', 'news_category');
|
||||
$count = $publishable === [] ? 0 : NewsPost::query()->where('status', NewsPost::PENDING)
|
||||
->when($publishable !== true, fn ($q) => $q->whereIn('category_id', $publishable))->count();
|
||||
|
||||
return ['count' => $count, 'label' => $count === 1 ? 'Beitrag wartet auf Freigabe' : 'Beiträge warten auf Freigabe'];
|
||||
},
|
||||
create: fn (User $user) => app(NewsPostPolicy::class)->create($user) ? ['label' => 'Neuer Beitrag', 'href' => route('news.editor.create')] : null);
|
||||
|
||||
$this->app->make(Blocks::class)->add(BlockType::make('news.latest', 'Neuigkeiten', 'newspaper', 'dynamic', 'news::LatestNews')
|
||||
->description('Die neuesten Beiträge – aus allen, ausgewählten oder allen außer bestimmten Kategorien.')
|
||||
|
|
|
|||
|
|
@ -114,6 +114,14 @@ class PagesPlugin extends Plugin
|
|||
fn (User $user) => $user->can('pages.manage'),
|
||||
fn (User $user) => $this->snippetList(),
|
||||
);
|
||||
$this->app->make(Editorial::class)->meta('pages', icon: 'file-text',
|
||||
todo: function (User $user) {
|
||||
// Eigene Entwürfe, die noch nicht veröffentlicht sind
|
||||
$count = Page::query()->whereNotNull('draft_updated_at')->whereNull('scheduled_at')->where('draft_updated_by', $user->id)->count();
|
||||
|
||||
return ['count' => $count, 'label' => $count === 1 ? 'Seite mit unveröffentlichten Änderungen' : 'Seiten mit unveröffentlichten Änderungen'];
|
||||
});
|
||||
$this->app->make(Editorial::class)->meta('pages.snippets', icon: 'blocks');
|
||||
|
||||
$this->app->singleton(Snippets::class);
|
||||
$this->registerBlocks($this->app->make(Blocks::class));
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ use App\Support\Abilities;
|
|||
use App\Support\Navigation;
|
||||
use Carbon\CarbonImmutable;
|
||||
use Illuminate\Support\Facades\Schedule;
|
||||
use Inhaus\Plugins\Stellen\Models\JobApplication;
|
||||
use Inhaus\Plugins\Stellen\Models\JobPosting;
|
||||
|
||||
class StellenPlugin extends Plugin
|
||||
|
|
@ -49,6 +50,13 @@ class StellenPlugin extends Plugin
|
|||
->map(fn (JobPosting $p) => [...Presenter::card($p), 'applications' => $p->applications_count, 'edit_url' => route('jobs.edit', $p), 'applications_url' => route('jobs.applications', $p)])->all(),
|
||||
'canCreate' => $user->can('jobs.manage'),
|
||||
]);
|
||||
$this->app->make(Editorial::class)->meta('stellen', icon: 'briefcase',
|
||||
todo: function (User $user) {
|
||||
$count = $user->can('jobs.applications') || $user->can('jobs.manage') ? JobApplication::query()->where('status', 'received')->whereNull('withdrawn_at')->count() : 0;
|
||||
|
||||
return ['count' => $count, 'label' => $count === 1 ? 'neue Bewerbung' : 'neue Bewerbungen'];
|
||||
},
|
||||
create: fn (User $user) => $user->can('jobs.manage') ? ['label' => 'Stelle ausschreiben', 'href' => route('jobs.create')] : null);
|
||||
}
|
||||
|
||||
public function boot(): void
|
||||
|
|
|
|||
|
|
@ -37,6 +37,8 @@ class UmfragenPlugin extends Plugin
|
|||
'polls' => Poll::query()->withCount('responses')->orderByRaw('published_at IS NULL DESC')->latest('published_at')->latest('id')->limit(50)->get()
|
||||
->map(fn (Poll $poll) => [...Presenter::card($poll), 'responses' => $poll->responses_count, 'edit_url' => route('polls.edit', $poll)])->all(),
|
||||
]);
|
||||
$this->app->make(Editorial::class)->meta('umfragen', icon: 'vote',
|
||||
create: fn () => ['label' => 'Neue Umfrage', 'href' => route('polls.create')]);
|
||||
|
||||
// Startseite: offene Umfragen, an denen die Person noch nicht teilgenommen hat
|
||||
$this->app->make(Widgets::class)->add('umfragen.open', 'umfragen::Open', 'aside', sort: 25, props: function (User $user) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue