events werden nun erfolgreich gespeichert, branding wird nun erfolgreich gespeichert, emotionen können nun angelegt werden. Task Ansicht im Event admin verbessert, Buttons in FAB umgewandelt und vereinheitlicht. Teilen-Link Guest PWA schicker gemacht, SynGoogleFonts ausgebaut (mit Einzel-Family-Download).
This commit is contained in:
@@ -23,7 +23,7 @@ class TaskCollectionController extends Controller
|
||||
$query = TaskCollection::query()
|
||||
->forTenant($tenantId)
|
||||
->with('eventType')
|
||||
->withCount('tasks')
|
||||
->withCount(['tasks', 'events'])
|
||||
->orderBy('position')
|
||||
->orderBy('id');
|
||||
|
||||
@@ -46,6 +46,27 @@ class TaskCollectionController extends Controller
|
||||
$query->where('tenant_id', $tenantId);
|
||||
}
|
||||
|
||||
if ($request->boolean('top_picks')) {
|
||||
if ($eventTypeSlug = $request->query('event_type')) {
|
||||
$query->where(function ($inner) use ($eventTypeSlug) {
|
||||
$inner->whereNull('event_type_id')
|
||||
->orWhereHas('eventType', fn ($q) => $q->where('slug', $eventTypeSlug));
|
||||
});
|
||||
}
|
||||
|
||||
$query->whereHas('tasks')
|
||||
->orderByDesc('events_count')
|
||||
->orderByDesc('updated_at')
|
||||
->orderBy('position')
|
||||
->orderBy('id');
|
||||
|
||||
$limit = $request->integer('limit', 3);
|
||||
|
||||
return TaskCollectionResource::collection(
|
||||
$query->limit($limit)->get()
|
||||
);
|
||||
}
|
||||
|
||||
$perPage = $request->integer('per_page', 15);
|
||||
|
||||
return TaskCollectionResource::collection(
|
||||
@@ -57,7 +78,8 @@ class TaskCollectionController extends Controller
|
||||
{
|
||||
$this->authorizeAccess($request, $collection);
|
||||
|
||||
$collection->load(['eventType', 'tasks' => fn ($query) => $query->with('assignedEvents')]);
|
||||
$collection->load(['eventType', 'tasks' => fn ($query) => $query->with('assignedEvents')])
|
||||
->loadCount(['tasks', 'events']);
|
||||
|
||||
return response()->json(new TaskCollectionResource($collection));
|
||||
}
|
||||
@@ -81,7 +103,11 @@ class TaskCollectionController extends Controller
|
||||
|
||||
return response()->json([
|
||||
'message' => __('Task-Collection erfolgreich importiert.'),
|
||||
'collection' => new TaskCollectionResource($result['collection']->load('eventType')->loadCount('tasks')),
|
||||
'collection' => new TaskCollectionResource(
|
||||
$result['collection']
|
||||
->load('eventType')
|
||||
->loadCount(['tasks', 'events'])
|
||||
),
|
||||
'created_task_ids' => $result['created_task_ids'],
|
||||
'attached_task_ids' => $result['attached_task_ids'],
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user