Ideenbox-Moderation und Wochenüberblick per E-Mail (0.36.0)
Some checks failed
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 6m49s
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 7m19s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 7m29s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 7m39s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 9m38s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 9m25s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 7m57s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 8m4s
CI / Bekannte Sicherheitslücken in Paketen (pull_request) Successful in 46s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m9s
Some checks failed
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 6m49s
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 7m19s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 7m29s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 7m39s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 9m38s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 9m25s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 7m57s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 8m4s
CI / Bekannte Sicherheitslücken in Paketen (pull_request) Successful in 46s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m9s
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
11c5ef5baf
commit
f9922f7308
172 changed files with 1524 additions and 363 deletions
33
resources/js/pages/DigestUnsubscribe.vue
Normal file
33
resources/js/pages/DigestUnsubscribe.vue
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
<script setup>
|
||||
import { router } from '@inertiajs/vue3';
|
||||
import { ref } from 'vue';
|
||||
import { CircleCheck, LoaderCircle } from '@lucide/vue';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import GuestLayout from '@/layouts/GuestLayout.vue';
|
||||
|
||||
/**
|
||||
* Wochenüberblick abbestellen – über den Link in der E-Mail, ohne Anmeldung.
|
||||
*/
|
||||
const props = defineProps({
|
||||
done: { type: Boolean, default: false },
|
||||
action: { type: String, required: true },
|
||||
});
|
||||
|
||||
const finished = ref(props.done);
|
||||
const busy = ref(false);
|
||||
|
||||
function unsubscribe() {
|
||||
busy.value = true;
|
||||
router.post(props.action, {}, { preserveState: true, onSuccess: () => (finished.value = true), onFinish: () => (busy.value = false) });
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<GuestLayout title="Wochenüberblick" :description="finished ? '' : 'Möchten Sie den Wochenüberblick per E-Mail abbestellen?'">
|
||||
<p v-if="finished" class="flex items-start gap-2.5 rounded-md bg-brand-soft p-4 text-sm text-brand-text">
|
||||
<CircleCheck class="mt-0.5 size-4 shrink-0" />
|
||||
Abbestellt. Sie bekommen keinen Wochenüberblick mehr. Im Profil lässt er sich jederzeit wieder einschalten.
|
||||
</p>
|
||||
<Button v-else class="h-10 w-full" :disabled="busy" @click="unsubscribe"><LoaderCircle v-if="busy" class="animate-spin" /> Abbestellen</Button>
|
||||
</GuestLayout>
|
||||
</template>
|
||||
|
|
@ -2,10 +2,11 @@
|
|||
import { pluginComponent } from '@/lib/pluginComponents';
|
||||
import { defineAsyncComponent, ref } from 'vue';
|
||||
import { router, useForm } from '@inertiajs/vue3';
|
||||
import { Camera, Image as ImageIcon, LoaderCircle, Trash2 } from '@lucide/vue';
|
||||
import { Camera, Image as ImageIcon, LoaderCircle, Mail, Trash2 } from '@lucide/vue';
|
||||
import { toast } from 'vue-sonner';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Input } from '@/components/ui/input';
|
||||
import { Switch } from '@/components/ui/switch';
|
||||
import { Textarea } from '@/components/ui/textarea';
|
||||
import FormField from '@/components/FormField.vue';
|
||||
import Panel from '@/components/Panel.vue';
|
||||
|
|
@ -21,8 +22,14 @@ const props = defineProps({
|
|||
customFields: { type: Array, default: () => [] },
|
||||
sections: { type: Array, default: () => [] },
|
||||
tokens: { type: Array, default: () => [] },
|
||||
digest: { type: Object, default: null },
|
||||
});
|
||||
|
||||
// Wochenüberblick per E-Mail
|
||||
function setDigest(enabled) {
|
||||
router.put('/profil/wochenueberblick', { enabled }, { preserveScroll: true, onSuccess: () => toast.success(enabled ? 'Wochenüberblick eingeschaltet' : 'Wochenüberblick ausgeschaltet') });
|
||||
}
|
||||
|
||||
// Abschnitte aus Plugins (App\Profile\ProfileSections): „<plugin>::Name“ aus plugins-core/<plugin>/resources/js/profile
|
||||
const sectionLoaders = import.meta.glob('../../../../plugins-core/*/resources/js/profile/*.vue');
|
||||
const sectionComponents = Object.fromEntries(Object.entries(sectionLoaders).map(([path, loader]) => [
|
||||
|
|
@ -196,6 +203,19 @@ function savePassword() {
|
|||
<p class="mt-3 text-[13px] text-muted-foreground">Erscheint oben in Ihrem Profil und in der Begrüßung auf der Startseite – mit einer Fläche in der Hausfarbe darüber. Querformat, höchstens 8 MB.</p>
|
||||
</Panel>
|
||||
|
||||
<Panel v-if="digest" title="Wochenüberblick" class="mt-6">
|
||||
<label class="flex items-start justify-between gap-4 text-sm">
|
||||
<span class="flex gap-3">
|
||||
<Mail class="mt-0.5 size-4 shrink-0 text-muted-foreground" />
|
||||
<span>
|
||||
<span class="font-medium">Per E-Mail zusammenfassen</span>
|
||||
<span class="block text-[13px] text-muted-foreground">Neuigkeiten, Termine und mehr aus der letzten Woche – {{ digest.schedule }} an {{ profile.email }}.</span>
|
||||
</span>
|
||||
</span>
|
||||
<Switch :model-value="digest.enabled" aria-label="Wochenüberblick per E-Mail" @update:model-value="setDigest" />
|
||||
</label>
|
||||
</Panel>
|
||||
|
||||
<DevicesPanel :tokens="tokens" class="mt-6" />
|
||||
</div>
|
||||
|
||||
|
|
|
|||
40
resources/views/mail/weekly-digest.blade.php
Normal file
40
resources/views/mail/weekly-digest.blade.php
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
<!doctype html>
|
||||
<html lang="de">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width"><title>Wochenüberblick</title></head>
|
||||
<body style="margin:0;background:#f4f5f7;font-family:-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif;color:#1a1d21">
|
||||
<div style="max-width:640px;margin:0 auto;padding:24px">
|
||||
@php($branding = app(\App\Support\Branding::class))
|
||||
@php($logo = $branding->logoUrl() && ! str_ends_with(strtolower($branding->logoUrl()), '.svg') ? $branding->logoUrl() : null)
|
||||
<p style="margin:0 0 16px;font-size:15px;font-weight:700;color:{{ $color }}">
|
||||
@if ($logo)<img src="{{ $logo }}" alt="{{ $portalName }}" style="max-height:40px;max-width:200px;border:0">@else{{ $portalName }}@endif
|
||||
</p>
|
||||
<div style="background:#fff;border:1px solid #e3e5e8;border-radius:8px;padding:24px">
|
||||
<h1 style="margin:0 0 4px;font-size:20px">Hallo {{ $user->first_name ?: $user->name }},</h1>
|
||||
<p style="margin:0 0 8px;font-size:14px;color:#5f6670">das war neu im Portal ({{ $period }}).</p>
|
||||
|
||||
@foreach ($sections as $section)
|
||||
<h2 style="margin:24px 0 8px;padding-bottom:6px;border-bottom:2px solid {{ $color }};font-size:16px">{{ $section['label'] }}</h2>
|
||||
<table role="presentation" style="width:100%;border-collapse:collapse;font-size:14px">
|
||||
@foreach ($section['items'] as $item)
|
||||
<tr>
|
||||
<td style="padding:10px 0;border-bottom:1px solid #eef0f2">
|
||||
<a href="{{ $item['url'] }}" style="color:{{ $color }};font-weight:600;text-decoration:none">{{ $item['title'] }}</a>
|
||||
@if (! empty($item['meta']))<div style="margin-top:2px;font-size:12px;color:#5f6670">{{ $item['meta'] }}</div>@endif
|
||||
@if (! empty($item['text']))<div style="margin-top:4px;color:#3d434a">{{ \Illuminate\Support\Str::limit($item['text'], 180) }}</div>@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</table>
|
||||
@endforeach
|
||||
|
||||
<p style="margin:24px 0 0">
|
||||
<a href="{{ $portalUrl }}" style="display:inline-block;background:{{ $color }};color:#fff;padding:10px 18px;border-radius:6px;text-decoration:none;font-weight:600;font-size:14px">Zum Portal</a>
|
||||
</p>
|
||||
</div>
|
||||
<p style="margin:16px 0 0;font-size:12px;color:#5f6670;line-height:1.5">
|
||||
Sie erhalten diese E-Mail, weil Sie den Wochenüberblick in Ihrem Profil eingeschaltet haben.
|
||||
<a href="{{ $unsubscribeUrl }}" style="color:#5f6670">Abbestellen</a> · <a href="{{ $profileUrl }}" style="color:#5f6670">Profil</a>
|
||||
</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue