Fehlerprotokoll im Systemzustand, Bilder in Stellen- und Terminbeschreibungen (0.28.1)
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 4m40s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 4m27s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 5m6s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 5m14s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 6m55s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 6m54s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 6m59s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 6m57s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m43s
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 4m40s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 4m27s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 5m6s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 5m14s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 6m55s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 6m54s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 6m59s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 6m57s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m43s
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
c0595d42dd
commit
cf5b71cdd9
131 changed files with 601 additions and 323 deletions
|
|
@ -119,7 +119,7 @@ function remove() {
|
|||
</div>
|
||||
|
||||
<FormField id="ev-description" label="Beschreibung" :error="form.errors.description">
|
||||
<RichTextEditor v-model="form.description" bordered min-height="12rem" placeholder="Worum geht es? Programm, Anmeldung, Mitbringen …" />
|
||||
<RichTextEditor v-model="form.description" bordered min-height="12rem" placeholder="Worum geht es? Programm, Anmeldung, Mitbringen …" :upload-image="async (file) => (await upload(file)).url" :pick-image="(options) => picker.pick(options)" />
|
||||
</FormField>
|
||||
</div>
|
||||
</Panel>
|
||||
|
|
|
|||
|
|
@ -11,6 +11,9 @@ import Panel from '@/components/Panel.vue';
|
|||
import PersonPicker from '@/components/PersonPicker.vue';
|
||||
import RichTextEditor from '@/components/RichTextEditor.vue';
|
||||
import AppLayout from '@/layouts/AppLayout.vue';
|
||||
import MediaPickerHost from '@/components/media/MediaPickerHost.vue';
|
||||
import { uploadWithProgress } from '@/components/media/api';
|
||||
import { useMediaPicker } from '@/components/media/useMediaPicker';
|
||||
|
||||
/**
|
||||
* Stelle ausschreiben oder bearbeiten.
|
||||
|
|
@ -43,6 +46,10 @@ const form = useForm({
|
|||
remove_pdf: false,
|
||||
});
|
||||
|
||||
// Bilder in der Beschreibung: hochladen oder aus der Mediathek wählen
|
||||
const uploadImage = async (file) => (await uploadWithProgress('/redaktion/stellen/bilder', file)).url;
|
||||
const mediaPicker = useMediaPicker({ upload: (file, onProgress) => uploadWithProgress('/redaktion/stellen/bilder', file, { onProgress }), contextLabel: 'In dieser Stelle' });
|
||||
|
||||
const pdfInput = ref(null);
|
||||
const pdfName = computed(() => form.pdf?.name ?? (form.remove_pdf ? null : p?.pdf_name));
|
||||
|
||||
|
|
@ -113,7 +120,7 @@ function remove() {
|
|||
</FormField>
|
||||
</div>
|
||||
<FormField id="job-description" label="Beschreibung" :error="form.errors.description" hint="Zum Beispiel: Ihre Aufgaben, Ihr Profil, Wir bieten.">
|
||||
<RichTextEditor v-model="form.description" bordered min-height="16rem" />
|
||||
<RichTextEditor v-model="form.description" bordered min-height="16rem" :upload-image="uploadImage" :pick-image="(options) => mediaPicker.pick(options)" />
|
||||
</FormField>
|
||||
<FormField id="job-pdf" label="Ausschreibung als PDF (optional)" :error="form.errors.pdf">
|
||||
<div class="flex flex-wrap items-center gap-2">
|
||||
|
|
@ -159,5 +166,7 @@ function remove() {
|
|||
</Panel>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<MediaPickerHost :picker="mediaPicker" />
|
||||
</AppLayout>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ Route::middleware('auth')->group(function () {
|
|||
Route::prefix('redaktion/stellen')->name('jobs.')->where(['posting' => '[0-9]+', 'application' => '[0-9]+'])->controller(JobEditorController::class)->group(function () {
|
||||
Route::get('/neu', 'create')->name('create');
|
||||
Route::post('/', 'store')->name('store');
|
||||
Route::post('/bilder', 'uploadImage')->name('images');
|
||||
Route::get('/{posting}', 'edit')->name('edit');
|
||||
Route::post('/{posting}', 'update')->name('update'); // POST wegen PDF-Upload
|
||||
Route::delete('/{posting}', 'destroy')->name('destroy');
|
||||
|
|
|
|||
|
|
@ -3,11 +3,14 @@
|
|||
namespace Inhaus\Plugins\Stellen\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Media\MediaLibrary;
|
||||
use App\Notifications\PortalNotification;
|
||||
use App\Pagebuilder\Blocks;
|
||||
use App\Pagebuilder\Field;
|
||||
use App\Support\Audit;
|
||||
use App\Support\RichText;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
|
@ -62,6 +65,19 @@ class JobEditorController extends Controller
|
|||
return to_route('jobs.show', $posting)->with('status', 'Stelle gespeichert.');
|
||||
}
|
||||
|
||||
/**
|
||||
* Bild für die Beschreibung – landet zugleich in der Mediathek.
|
||||
*/
|
||||
public function uploadImage(Request $request, MediaLibrary $library): JsonResponse
|
||||
{
|
||||
$this->authorizeManage($request);
|
||||
$request->validate(['image' => ['required', File::image()->types(['jpg', 'jpeg', 'png', 'webp', 'gif'])->max(15 * 1024)]]);
|
||||
|
||||
$media = $library->store($request->file('image'), 'stellen', $request->user());
|
||||
|
||||
return response()->json(['path' => $media->path, 'url' => Blocks::imageUrl($media->path), 'media' => $media->toLibraryArray()]);
|
||||
}
|
||||
|
||||
public function destroy(Request $request, JobPosting $posting): RedirectResponse
|
||||
{
|
||||
$this->authorizeManage($request);
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@
|
|||
namespace Inhaus\Plugins\Stellen;
|
||||
|
||||
use App\Editorial\Editorial;
|
||||
use App\Media\ImagePaths;
|
||||
use App\Media\MediaUsages;
|
||||
use App\Models\User;
|
||||
use App\Plugins\Plugin;
|
||||
use App\Search\GlobalSearch;
|
||||
|
|
@ -21,6 +23,13 @@ class StellenPlugin extends Plugin
|
|||
$abilities->define('jobs.manage', 'Stellen ausschreiben und bearbeiten', 'Stellen', portal: true);
|
||||
$abilities->define('jobs.applications', 'Bewerbungen aller Stellen einsehen und bearbeiten', 'Stellen', portal: true);
|
||||
|
||||
// Mediathek „Eingebunden in“: Bilder in der Beschreibung
|
||||
$usages = $this->app->make(MediaUsages::class);
|
||||
$usages->add('stellen', 'Stellen', fn (JobPosting $p) => [
|
||||
['context' => ImagePaths::HTML_CONTEXT, 'label' => $p->title, 'url' => route('jobs.edit', $p, false), 'draft' => $p->published_at === null, 'paths' => ImagePaths::fromHtml($p->description)],
|
||||
], fn (callable $each) => JobPosting::query()->chunkById(100, fn ($postings) => $postings->each($each)));
|
||||
$usages->watch('stellen', JobPosting::class, ['description', 'title', 'published_at']);
|
||||
|
||||
$this->app->make(GlobalSearch::class)->add('stellen', 'Stellen', 'briefcase', fn (...$args) => app(JobSearch::class)(...$args), sort: 55);
|
||||
|
||||
$this->app->make(Editorial::class)->add('stellen', 'Stellen', 'stellen::EditorialJobs', 35,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue