ep_contentminds_freigabe 0.0.0-stage → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/mails.js ADDED
@@ -0,0 +1,338 @@
1
+ 'use strict';
2
+ // Erinnerungs- und Info-Mails an Kunden (Postausgang).
3
+ //
4
+ // Pro Kunde und Lauf entsteht höchstens EINE Mail mit bis zu drei Abschnitten:
5
+ // neu Texte, die neu (oder überarbeitet) zur Freigabe liegen
6
+ // erinnerung offene Texte, deren Frist am nächsten Werktag (oder heute) endet
7
+ // info Texte, die seit der letzten Mail automatisch freigegeben wurden
8
+ //
9
+ // Mails werden NICHT von selbst verschickt. Sie liegen im Postausgang (Status "entwurf"),
10
+ // bis jemand sie verschickt und als "gesendet" markiert (freigabe.mjs) oder ein Versandweg
11
+ // eingerichtet ist (FREIGABE_VERSAND=webhook + FREIGABE_WEBHOOK_URL, z. B. Make).
12
+ //
13
+ // Die Auto-Freigabe greift erst, wenn die Erinnerung für den Text gesendet wurde
14
+ // (index.js). Ist die Frist bei Erstellung der Erinnerung schon vorbei, wird sie auf den
15
+ // nächsten Werktag 12:00 verschoben, damit der Kunde echte Zeit bekommt.
16
+ //
17
+ // Ton: erkennbar automatisch (Absender „Content Minds Freigabe-Bot“), Du-Form, sachlich, kurz.
18
+ // Versand: FREIGABE_VERSAND=webhook schickt an ein Google Apps Script in einem Gmail-Konto
19
+ // (apps-script/freigabe-mailversand), das per GmailApp verschickt. Kostet keine Credits.
20
+
21
+ const crypto = require('crypto');
22
+ const db = require('ep_etherpad-lite/node/db/DB');
23
+
24
+ const ZONE = 'Europe/Berlin';
25
+ const POSTAUSGANG = 'freigabe-postausgang';
26
+ const mailSchluessel = (id) => `freigabe-mail:${id}`;
27
+ const jetzt = () => new Date().toISOString();
28
+
29
+ let ctx = null; // Hilfsfunktionen aus index.js
30
+ exports.init = (c) => { ctx = c; };
31
+
32
+ // ---------------------------------------------------------------- Zeit (Berlin)
33
+
34
+ const teile = (d) => {
35
+ const f = new Intl.DateTimeFormat('en-GB', {
36
+ timeZone: ZONE, year: 'numeric', month: '2-digit', day: '2-digit',
37
+ hour: '2-digit', minute: '2-digit', weekday: 'short', hour12: false,
38
+ });
39
+ const o = {};
40
+ for (const p of f.formatToParts(d)) o[p.type] = p.value;
41
+ return {j: +o.year, m: +o.month, t: +o.day, h: +o.hour % 24, min: +o.minute, wt: o.weekday};
42
+ };
43
+ const tagSchluessel = (d) => { const p = teile(d); return `${p.j}-${String(p.m).padStart(2, '0')}-${String(p.t).padStart(2, '0')}`; };
44
+ const istWerktag = (d) => !['Sat', 'Sun'].includes(teile(d).wt);
45
+
46
+ // Berliner Ortszeit → Date (berücksichtigt Sommer-/Winterzeit)
47
+ const berlin = (j, m, t, h, min) => {
48
+ let utc = Date.UTC(j, m - 1, t, h, min);
49
+ for (let i = 0; i < 2; i++) {
50
+ const p = teile(new Date(utc));
51
+ const alsUtc = Date.UTC(p.j, p.m - 1, p.t, p.h, p.min);
52
+ utc += Date.UTC(j, m - 1, t, h, min) - alsUtc;
53
+ }
54
+ return new Date(utc);
55
+ };
56
+
57
+ const naechsterWerktag = (d) => {
58
+ const p = teile(d);
59
+ let x = berlin(p.j, p.m, p.t, 12, 0);
60
+ do { x = new Date(x.getTime() + 24 * 3600 * 1000); } while (!istWerktag(x));
61
+ const q = teile(x);
62
+ return berlin(q.j, q.m, q.t, 12, 0);
63
+ };
64
+
65
+ const deDatum = (iso, mitZeit = true) => {
66
+ if (!iso) return '';
67
+ const opt = {timeZone: ZONE, weekday: 'short', day: '2-digit', month: '2-digit'};
68
+ if (mitZeit) Object.assign(opt, {hour: '2-digit', minute: '2-digit'});
69
+ return new Date(iso).toLocaleString('de-DE', opt).replace(',', '') + (mitZeit ? ' Uhr' : '');
70
+ };
71
+ const uhrzeit = (iso) => new Date(iso).toLocaleTimeString('de-DE', {timeZone: ZONE, hour: '2-digit', minute: '2-digit'});
72
+
73
+ // ---------------------------------------------------------------- Texte
74
+
75
+ const basisUrl = () => (process.env.FREIGABE_BASIS_URL || 'http://localhost:9001').replace(/\/+$/, '');
76
+ const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({'&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;'}[c]));
77
+ const anzahl = (n, eins, mehr) => (n === 1 ? `1 ${eins}` : `${n} ${mehr}`);
78
+
79
+ // Absender ist erkennbar ein Bot (kein persönlicher Ton von Franz)
80
+ const absenderName = () => process.env.FREIGABE_ABSENDER_NAME || 'Content Minds Freigabe-Bot';
81
+
82
+ // Betreff nach Wichtigkeit: Erinnerung > neu > Info
83
+ const betreffBauen = ({neu, erinnerung, info}) => {
84
+ if (erinnerung.length) {
85
+ // erinnerung ist nach Frist sortiert: die früheste zählt
86
+ const erste = erinnerung[0].frist;
87
+ const gleich = erinnerung.every((x) => x.frist === erste);
88
+ const tag = tagSchluessel(new Date(erste)) === tagSchluessel(new Date()) ? 'heute' : deDatum(erste, false);
89
+ const wann = `${gleich || erinnerung.length === 1 ? '' : 'ab '}${tag} um ${uhrzeit(erste)} Uhr`;
90
+ return erinnerung.length === 1
91
+ ? `Erinnerung: „${erinnerung[0].titel}“ wird ${wann} automatisch freigegeben`
92
+ : `Erinnerung: ${erinnerung.length} Texte werden ${wann} automatisch freigegeben`;
93
+ }
94
+ if (neu.length) return neu.length === 1 ? `Neuer Text zur Freigabe: „${neu[0].titel}“` : `${neu.length} neue Texte zur Freigabe`;
95
+ return info.length === 1 ? `Automatisch freigegeben: „${info[0].titel}“` : `${info.length} Texte automatisch freigegeben`;
96
+ };
97
+
98
+ const zeileText = (x, mitFrist) => `- ${x.titel}${x.ueberarbeitet ? ' (überarbeitet)' : ''}${mitFrist && x.frist ? ` (Frist: ${deDatum(x.frist)})` : ''}`;
99
+
100
+ const mailBauen = ({vorname, link, neu, erinnerung, info}) => {
101
+ const anrede = vorname ? `Hallo ${vorname},` : 'Hallo,';
102
+ const absaetze = [anrede, 'dies ist eine automatische Nachricht aus dem Freigabe-System von Content Minds.'];
103
+ const html = [`<p>${esc(anrede)}</p>`, '<p style="color:#5b6673">dies ist eine automatische Nachricht aus dem Freigabe-System von Content Minds.</p>'];
104
+ const ueberschrift = (t) => { absaetze.push(t.toUpperCase()); html.push(`<p style="margin:20px 0 4px;font-weight:600">${esc(t)}</p>`); };
105
+ const liste = (items, mitFrist) => {
106
+ absaetze.push(items.map((x) => zeileText(x, mitFrist)).join('\n'));
107
+ html.push(`<ul style="margin-top:4px">${items.map((x) => `<li>${esc(x.titel)}${x.ueberarbeitet ? ' (überarbeitet)' : ''}${mitFrist && x.frist ? ` <span style="color:#5b6673">(Frist: ${esc(deDatum(x.frist))})</span>` : ''}</li>`).join('')}</ul>`);
108
+ };
109
+ const absatz = (t) => { absaetze.push(t); html.push(`<p>${esc(t)}</p>`); };
110
+
111
+ if (erinnerung.length) {
112
+ ueberschrift('Erinnerung: Frist läuft bald ab');
113
+ absatz(erinnerung.length === 1
114
+ ? 'Dieser Text wird zur genannten Frist automatisch freigegeben, wenn bis dahin keine Rückmeldung kommt:'
115
+ : 'Diese Texte werden zur genannten Frist automatisch freigegeben, wenn bis dahin keine Rückmeldung kommt:');
116
+ liste(erinnerung, true);
117
+ if (erinnerung.some((x) => x.verlaengert)) absatz('Hinweis: Bei mindestens einem Text war die Frist schon abgelaufen. Sie wurde bis zum genannten Termin verlängert.');
118
+ }
119
+ if (neu.length) {
120
+ ueberschrift(neu.length === 1 ? 'Neu zur Freigabe' : `Neu zur Freigabe (${neu.length})`);
121
+ liste(neu, true);
122
+ }
123
+ if (info.length) {
124
+ ueberschrift('Automatisch freigegeben');
125
+ absatz(info.length === 1
126
+ ? 'Die Frist ist abgelaufen. Dieser Text gilt jetzt als freigegeben:'
127
+ : 'Die Frist ist abgelaufen. Diese Texte gelten jetzt als freigegeben:');
128
+ liste(info, false);
129
+ absatz('Falls doch noch etwas geändert werden soll: Antworte auf diese Mail, dann passt das Team es vor der Veröffentlichung an.');
130
+ }
131
+
132
+ if (neu.length || erinnerung.length) {
133
+ ueberschrift('So geht es');
134
+ absatz('Öffne die Übersicht, lies die Texte und ändere direkt im Text, markiere Stellen und kommentiere sie oder gib mit einem Klick frei. Passt alles, musst du nichts tun.');
135
+ }
136
+
137
+ absaetze.push(`Zur Übersicht:\n${link}`);
138
+ html.push(`<p style="margin:20px 0"><a href="${esc(link)}" style="display:inline-block;background:#1f2933;color:#ffffff;text-decoration:none;padding:10px 18px;border-radius:8px;font-weight:600">Zur Übersicht</a></p><p style="color:#5b6673;font-size:13px">Oder diesen Link öffnen: <a href="${esc(link)}">${esc(link)}</a></p>`);
139
+
140
+ absaetze.push(`Fragen? Einfach auf diese Mail antworten.\n\n${absenderName()}`);
141
+ html.push(`<p>Fragen? Einfach auf diese Mail antworten.</p><p style="color:#5b6673">${esc(absenderName())}</p>`);
142
+
143
+ return {
144
+ text: absaetze.join('\n\n'),
145
+ html: `<div style="font-family:Arial,Helvetica,sans-serif;font-size:15px;line-height:1.5;color:#1f2933;max-width:560px">${html.join('\n')}</div>`,
146
+ };
147
+ };
148
+
149
+ // ---------------------------------------------------------------- Erzeugen
150
+
151
+ const runde = (e) => `${e.versandRev ?? 0}`; // eine Freigabe-Runde = ein Versand (anlegen)
152
+
153
+ // Erzeugt für einen Kunden die fällige Mail (oder null, wenn nichts fällig ist)
154
+ const mailFuerKunde = async (kunde, {nun = new Date()} = {}) => {
155
+ const k = await ctx.kundeLaden(kunde);
156
+ if (!k) return null;
157
+ const neu = [];
158
+ const erinnerung = [];
159
+ const info = [];
160
+ const morgen12 = naechsterWerktag(nun);
161
+
162
+ for (const {padId, e} of await ctx.eintraegeVonKunde(kunde)) {
163
+ const m = (e.mails && e.mails.runde === runde(e)) ? e.mails : {runde: runde(e)};
164
+ const basis = {padId, titel: e.titel, frist: e.frist,
165
+ ueberarbeitet: (e.verlauf || []).some((v) => v.status === 'aenderung')};
166
+
167
+ if (e.status === 'offen') {
168
+ // Erinnerung: Frist endet heute (noch nicht vorbei) oder am nächsten Werktag, oder ist schon vorbei
169
+ const frist = e.frist ? new Date(e.frist) : null;
170
+ const faellig = frist && (frist.getTime() <= morgen12.getTime() + 60 * 1000);
171
+ if (faellig && !m.erinnerung) {
172
+ const verlaengert = frist.getTime() < nun.getTime() + 3 * 3600 * 1000; // vorbei oder in < 3 Std.
173
+ erinnerung.push({...basis, frist: verlaengert ? morgen12.toISOString() : e.frist, verlaengert});
174
+ } else if (!m.neu && !m.erinnerung) {
175
+ neu.push(basis);
176
+ }
177
+ } else if (e.status === 'auto' && !m.info) {
178
+ info.push(basis);
179
+ }
180
+ }
181
+ if (!neu.length && !erinnerung.length && !info.length) return null;
182
+ const nachFrist = (a, b) => String(a.frist || '9').localeCompare(String(b.frist || '9'));
183
+ erinnerung.sort(nachFrist);
184
+ neu.sort(nachFrist);
185
+
186
+ const id = `${tagSchluessel(nun)}-${kunde}-${crypto.randomBytes(3).toString('hex')}`;
187
+ const link = `${basisUrl()}/freigabe/k/${k.token}`;
188
+ const {text, html} = mailBauen({vorname: k.vorname, link, neu, erinnerung, info});
189
+ const mail = {
190
+ id, kunde, an: k.email || null, vorname: k.vorname || null,
191
+ betreff: betreffBauen({neu, erinnerung, info}),
192
+ text, html, link,
193
+ pads: {neu: neu.map((x) => x.padId), erinnerung: erinnerung.map((x) => x.padId), info: info.map((x) => x.padId)},
194
+ erstellt: jetzt(), status: 'entwurf', gesendet: null,
195
+ };
196
+
197
+ // Texte vermerken (diese Runde nicht noch einmal) und überfällige Fristen verlängern
198
+ for (const x of neu) await ctx.eintragAendern(x.padId, (e) => { e.mails = {...(e.mails?.runde === runde(e) ? e.mails : {runde: runde(e)}), neu: id}; return e; });
199
+ for (const x of info) await ctx.eintragAendern(x.padId, (e) => { e.mails = {...(e.mails?.runde === runde(e) ? e.mails : {runde: runde(e)}), info: id}; return e; });
200
+ for (const x of erinnerung) {
201
+ await ctx.eintragAendern(x.padId, (e) => {
202
+ e.mails = {...(e.mails?.runde === runde(e) ? e.mails : {runde: runde(e)}), erinnerung: id, neu: e.mails?.neu || id};
203
+ if (x.verlaengert) {
204
+ e.verlauf.push({status: 'offen', name: 'System', kommentar: `Frist verlängert auf ${deDatum(x.frist)} (Erinnerung kam zu spät)`, zeit: jetzt(), rev: e.versandRev});
205
+ e.frist = x.frist;
206
+ }
207
+ return e;
208
+ });
209
+ }
210
+
211
+ await db.set(mailSchluessel(id), mail);
212
+ await ctx.listeHinzu(POSTAUSGANG, id);
213
+ return mail;
214
+ };
215
+
216
+ // Alle Kunden (oder einen) durchgehen; danach ggf. automatisch versenden
217
+ exports.erzeugen = async ({kunde = null} = {}) => {
218
+ const kunden = kunde ? [kunde] : (await ctx.alleIndexe()).filter((x) => x !== '_ohne');
219
+ const neue = [];
220
+ for (const kd of kunden) {
221
+ const m = await mailFuerKunde(kd);
222
+ if (m) neue.push(m);
223
+ }
224
+ if (versandweg() === 'aus') return neue;
225
+ const ergebnis = [];
226
+ for (const m of neue) ergebnis.push(await exports.versenden(m.id));
227
+ return ergebnis;
228
+ };
229
+
230
+ // ---------------------------------------------------------------- Postausgang
231
+
232
+ exports.liste = async ({status = null} = {}) => {
233
+ const ids = (await db.get(POSTAUSGANG)) || [];
234
+ const mails = [];
235
+ for (const id of ids) {
236
+ const m = await db.get(mailSchluessel(id));
237
+ if (m && (!status || m.status === status)) mails.push(m);
238
+ }
239
+ return mails.sort((a, b) => String(b.erstellt).localeCompare(String(a.erstellt)));
240
+ };
241
+
242
+ exports.holen = (id) => db.get(mailSchluessel(id));
243
+
244
+ // Als gesendet markieren: ab jetzt darf die Auto-Freigabe für die erinnerten Texte greifen
245
+ exports.alsGesendet = async (id, {wie = 'von Hand'} = {}) => {
246
+ const m = await db.get(mailSchluessel(id));
247
+ if (!m) return null;
248
+ if (m.status === 'gesendet') return m;
249
+ m.status = 'gesendet';
250
+ m.gesendet = jetzt();
251
+ m.wie = wie;
252
+ await db.set(mailSchluessel(id), m);
253
+ for (const padId of m.pads.erinnerung) {
254
+ await ctx.eintragAendern(padId, (e) => {
255
+ if (e.mails && e.mails.erinnerung === id) e.mails.erinnerungGesendet = m.gesendet;
256
+ return e;
257
+ });
258
+ }
259
+ return m;
260
+ };
261
+
262
+ exports.verwerfen = async (id) => {
263
+ const m = await db.get(mailSchluessel(id));
264
+ if (!m) return null;
265
+ m.status = 'verworfen';
266
+ await db.set(mailSchluessel(id), m);
267
+ // Texte wieder freigeben, damit sie in die nächste Mail kommen
268
+ for (const art of ['neu', 'erinnerung', 'info']) {
269
+ for (const padId of m.pads[art]) {
270
+ await ctx.eintragAendern(padId, (e) => {
271
+ if (e.mails && e.mails[art] === id) delete e.mails[art];
272
+ return e;
273
+ });
274
+ }
275
+ }
276
+ return m;
277
+ };
278
+
279
+ // ---------------------------------------------------------------- Versand (optional)
280
+
281
+ const versandweg = () => (process.env.FREIGABE_VERSAND || 'aus').toLowerCase();
282
+
283
+ exports.versenden = async (id) => {
284
+ const m = await db.get(mailSchluessel(id));
285
+ if (!m || m.status !== 'entwurf') return m;
286
+ // Immer die aktuelle Adresse des Kunden nehmen (kann nach dem Erstellen nachgetragen worden sein)
287
+ const k = await ctx.kundeLaden(m.kunde);
288
+ if (k && k.email && k.email !== m.an) m.an = k.email;
289
+ delete m.fehler;
290
+ await db.set(mailSchluessel(id), m);
291
+ if (!m.an) { m.fehler = 'Keine E-Mail-Adresse beim Kunden hinterlegt'; await db.set(mailSchluessel(id), m); return m; }
292
+ if (['gmail', 'webhook'].includes(versandweg())) {
293
+ const url = process.env.FREIGABE_WEBHOOK_URL;
294
+ if (!url) { m.fehler = 'FREIGABE_WEBHOOK_URL fehlt'; await db.set(mailSchluessel(id), m); return m; }
295
+ try {
296
+ // Apps Script antwortet mit einer Weiterleitung; fetch folgt ihr und liest die Antwort
297
+ const r = await fetch(url, {
298
+ method: 'POST',
299
+ headers: {'Content-Type': 'text/plain;charset=utf-8'},
300
+ body: JSON.stringify({
301
+ token: process.env.FREIGABE_WEBHOOK_TOKEN || '',
302
+ an: m.an, betreff: m.betreff, text: m.text, html: m.html,
303
+ absenderName: absenderName(), id: m.id, kunde: m.kunde,
304
+ }),
305
+ redirect: 'follow',
306
+ });
307
+ const antwort = await r.text();
308
+ let j = {};
309
+ try { j = JSON.parse(antwort); } catch (e) { /* keine JSON-Antwort */ }
310
+ if (!r.ok || !j.ok) throw new Error(j.fehler || `HTTP ${r.status}`);
311
+ return exports.alsGesendet(id, {wie: 'gmail'});
312
+ } catch (err) {
313
+ m.fehler = `Versand fehlgeschlagen: ${err.message}`;
314
+ await db.set(mailSchluessel(id), m);
315
+ return m;
316
+ }
317
+ }
318
+ return m; // Versandweg "aus": bleibt Entwurf
319
+ };
320
+
321
+ // ---------------------------------------------------------------- Zeitplan
322
+
323
+ // Einmal pro Werktag zur Mail-Stunde (Standard 9 Uhr Berlin) erzeugen
324
+ exports.zeitplan = async () => {
325
+ if ((process.env.FREIGABE_MAILS || 'an').toLowerCase() === 'aus') return;
326
+ const nun = new Date();
327
+ if (!istWerktag(nun)) return;
328
+ const stunde = Number(process.env.FREIGABE_MAIL_STUNDE || 9);
329
+ if (teile(nun).h < stunde) return;
330
+ const heute = tagSchluessel(nun);
331
+ const meta = (await db.get('freigabe-mail-meta')) || {};
332
+ if (meta.letzterLauf === heute) return;
333
+ await db.set('freigabe-mail-meta', {...meta, letzterLauf: heute});
334
+ const neue = await exports.erzeugen();
335
+ if (neue.length) console.log(`[freigabe] ${neue.length} Mail(s) im Postausgang`);
336
+ };
337
+
338
+ exports._intern = {naechsterWerktag, berlin, teile, deDatum};
package/package.json CHANGED
@@ -1,6 +1,18 @@
1
1
  {
2
2
  "name": "ep_contentminds_freigabe",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "1.0.0",
4
+ "description": "Freigabe-Workflow für Etherpad: Freigabe-Leiste im Pad, Kunden-Übersicht, Fristen mit Auto-Freigabe, Erinnerungs-Mails, Export als Markdown",
5
+ "keywords": ["etherpad", "plugin", "ep", "approval", "freigabe"],
6
+ "author": "Content Minds GmbH",
7
+ "license": "UNLICENSED",
8
+ "type": "commonjs",
9
+ "main": "index.js",
10
+ "files": [
11
+ "ep.json",
12
+ "index.js",
13
+ "mails.js",
14
+ "static/"
15
+ ],
16
+ "engines": { "node": ">=18" },
17
+ "peerDependencies": { "ep_etherpad-lite": ">=3.3.2 <4" }
18
+ }
@@ -0,0 +1,134 @@
1
+ /* Freigabe-Leiste zwischen Werkzeugleiste und Text */
2
+ .freigabe-leiste {
3
+ --fg-gruen: #1f7a4d;
4
+ --fg-gruen-hell: #e7f5ee;
5
+ --fg-orange: #b45309;
6
+ --fg-orange-hell: #fff4e5;
7
+ --fg-rand: #d9dee5;
8
+ --fg-text: #1f2933;
9
+ --fg-leise: #5b6673;
10
+ background: #f7f9fb;
11
+ border-bottom: 1px solid var(--fg-rand);
12
+ color: var(--fg-text);
13
+ font-size: 15px;
14
+ line-height: 1.4;
15
+ padding: 8px 16px 10px;
16
+ flex: 0 0 auto;
17
+ }
18
+
19
+ /* Etherpad stapelt Werkzeugleiste, unsere Leiste und den Editor in einer Flex-Spalte.
20
+ Ohne min-height:0 darf der Editor nicht schrumpfen, die Seite wird höher als der
21
+ Bildschirm und der Browser scrollt beim Markieren alles nach oben (weißer Balken unten). */
22
+ #editorcontainerbox { min-height: 0; }
23
+ html.pad, html.pad body { overscroll-behavior: none; }
24
+
25
+ /* ---------- Werkzeugleiste ---------- */
26
+ /* Oben: Kommentieren groß und vorne */
27
+ #editbar .menu_left li.addComment > a {
28
+ display: inline-flex !important;
29
+ align-items: center;
30
+ gap: 6px;
31
+ width: auto !important;
32
+ height: 32px;
33
+ padding: 0 12px 0 10px !important;
34
+ margin-right: 8px;
35
+ border-radius: 8px;
36
+ background: #1d4ed8;
37
+ color: #fff !important;
38
+ font-weight: 600;
39
+ font-size: 14px;
40
+ cursor: pointer;
41
+ }
42
+ #editbar .menu_left li.addComment > a .buttonicon,
43
+ #editbar .menu_left li.addComment > a .buttonicon::before { color: #fff !important; }
44
+ #editbar .menu_left li.addComment,
45
+ #editbar .menu_left li.addComment > a { opacity: 1 !important; }
46
+ #editbar .menu_left li.addComment.comment-btn-disabled > a { background: #fff; border: 1.5px solid #1d4ed8; color: #1d4ed8 !important; }
47
+ #editbar .menu_left li.addComment.comment-btn-disabled > a .buttonicon,
48
+ #editbar .menu_left li.addComment.comment-btn-disabled > a .buttonicon::before { color: #1d4ed8 !important; }
49
+ #editbar .menu_left li.addComment .fg-label { line-height: 1; }
50
+
51
+ /* "Version speichern" brauchen Kunden nicht */
52
+ #editbar li[data-key="savedRevision"] { display: none !important; }
53
+
54
+ /* Unten: Formatierung + Bild als feste Leiste (auf allen Bildschirmgrößen) */
55
+ body.fg-leiste-unten #editbar .menu_right {
56
+ position: fixed !important;
57
+ left: 0;
58
+ right: 0;
59
+ bottom: 0;
60
+ top: auto !important;
61
+ z-index: 40;
62
+ display: flex !important;
63
+ justify-content: center;
64
+ align-items: center;
65
+ flex-wrap: nowrap;
66
+ overflow-x: auto;
67
+ gap: 2px;
68
+ height: auto !important;
69
+ margin: 0 !important;
70
+ padding: 6px 8px calc(6px + env(safe-area-inset-bottom)) !important;
71
+ background: #fff;
72
+ border-top: 1px solid #d9dee5;
73
+ box-shadow: 0 -2px 8px rgba(15, 23, 42, .06);
74
+ }
75
+ body.fg-leiste-unten #editbar .menu_right > li { flex: 0 0 auto; }
76
+ body.fg-leiste-unten #editorcontainerbox { margin-bottom: 52px; }
77
+
78
+ /* Breite Bildschirme: Text links, Knöpfe rechts in einer Zeile (spart Höhe) */
79
+ .freigabe-reihe { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
80
+ .freigabe-links { flex: 1 1 320px; min-width: 0; }
81
+ .freigabe-reihe .freigabe-info, .freigabe-reihe .freigabe-status { margin: 2px 0 0; }
82
+ .freigabe-leiste[hidden] { display: none; }
83
+ .freigabe-leiste[data-status="freigegeben"],
84
+ .freigabe-leiste[data-status="auto"] { background: var(--fg-gruen-hell); }
85
+ .freigabe-leiste[data-status="aenderung"] { background: var(--fg-orange-hell); }
86
+
87
+ .freigabe-zurueck { color: #1d4ed8; font-size: 14px; font-weight: 600; text-decoration: none; padding: 2px 0; margin-right: 4px; }
88
+ .freigabe-zurueck:hover { text-decoration: underline; }
89
+ .freigabe-kopf { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
90
+ .freigabe-titel { font-size: 15px; }
91
+ .freigabe-frist { color: var(--fg-leise); font-size: 13px; }
92
+ .freigabe-info, .freigabe-hinweis { margin: 6px 0 8px; color: var(--fg-leise); font-size: 14px; }
93
+ .freigabe-fehler { margin: 4px 0; color: #b42318; font-size: 14px; min-height: 0; }
94
+ .freigabe-fehler:empty { display: none; }
95
+
96
+ .freigabe-zeile { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-top: 6px; }
97
+ .freigabe-status { font-weight: 600; color: var(--fg-gruen); font-size: 14px; }
98
+
99
+ .freigabe-knoepfe { display: flex; flex-wrap: wrap; gap: 8px; }
100
+ .freigabe-btn {
101
+ appearance: none;
102
+ border: 1px solid transparent;
103
+ border-radius: 8px;
104
+ cursor: pointer;
105
+ font: inherit;
106
+ font-weight: 600;
107
+ min-height: 44px;
108
+ padding: 8px 16px;
109
+ }
110
+ .freigabe-btn:disabled { opacity: .6; cursor: wait; }
111
+ .freigabe-btn-ok { background: var(--fg-gruen); color: #fff; }
112
+ .freigabe-btn-aendern { background: #fff; border-color: var(--fg-orange); color: var(--fg-orange); }
113
+ .freigabe-btn-leise { background: transparent; border-color: var(--fg-rand); color: var(--fg-leise); font-weight: 500; }
114
+ .freigabe-btn:focus-visible { outline: 3px solid #2563eb; outline-offset: 2px; }
115
+
116
+ .freigabe-formular { display: grid; gap: 8px; margin-top: 8px; max-width: 560px; }
117
+ .freigabe-formular label { display: grid; gap: 4px; font-size: 13px; color: var(--fg-leise); }
118
+ .freigabe-formular input,
119
+ .freigabe-formular textarea {
120
+ border: 1px solid var(--fg-rand);
121
+ border-radius: 8px;
122
+ font: inherit;
123
+ font-size: 16px; /* verhindert Auto-Zoom auf iPhone */
124
+ padding: 8px 10px;
125
+ color: var(--fg-text);
126
+ background: #fff;
127
+ width: 100%;
128
+ box-sizing: border-box;
129
+ }
130
+
131
+ @media (max-width: 600px) {
132
+ .freigabe-knoepfe { width: 100%; }
133
+ .freigabe-knoepfe .freigabe-btn { flex: 1 1 auto; }
134
+ }
@@ -0,0 +1,82 @@
1
+ /* Übersicht der Freigaben, fürs Handy gebaut */
2
+ :root {
3
+ --gruen: #1f7a4d;
4
+ --gruen-hell: #e7f5ee;
5
+ --orange: #b45309;
6
+ --orange-hell: #fff4e5;
7
+ --blau: #1d4ed8;
8
+ --rand: #d9dee5;
9
+ --text: #1f2933;
10
+ --leise: #5b6673;
11
+ --flaeche: #ffffff;
12
+ --hintergrund: #f4f6f8;
13
+ }
14
+ * { box-sizing: border-box; }
15
+ body {
16
+ margin: 0;
17
+ background: var(--hintergrund);
18
+ color: var(--text);
19
+ font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
20
+ }
21
+ main { max-width: 720px; margin: 0 auto; padding: 20px 16px 40px; }
22
+
23
+ .ue-kopf h1 { font-size: 24px; line-height: 1.2; margin: 4px 0 6px; }
24
+ .ue-marke { margin: 0; color: var(--leise); font-size: 13px; letter-spacing: .02em; }
25
+ .ue-zusammenfassung { margin: 0 0 16px; color: var(--leise); }
26
+
27
+ .ue-filter { display: flex; gap: 6px; margin-bottom: 16px; }
28
+ .ue-filter button {
29
+ appearance: none; border: 1px solid var(--rand); background: var(--flaeche); color: var(--text);
30
+ border-radius: 999px; padding: 8px 14px; font: inherit; font-size: 15px; cursor: pointer; min-height: 40px;
31
+ }
32
+ .ue-filter button[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: #fff; }
33
+
34
+ .ue-gruppe { margin-bottom: 22px; }
35
+ .ue-gruppe h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .04em; color: var(--leise); margin: 0 0 8px; }
36
+ .ue-gruppe h2 span { font-weight: 400; }
37
+
38
+ .ue-karte {
39
+ background: var(--flaeche); border: 1px solid var(--rand); border-left: 4px solid var(--blau);
40
+ border-radius: 10px; padding: 14px 14px 12px; margin-bottom: 10px;
41
+ }
42
+ .ue-karte.ue-aenderung { border-left-color: var(--orange); }
43
+ .ue-karte.ue-frei { border-left-color: var(--gruen); }
44
+ .ue-karte-kopf { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; }
45
+ .ue-karte h3 { font-size: 17px; line-height: 1.3; margin: 0; }
46
+ .ue-chip { flex-shrink: 0; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 3px 9px; white-space: nowrap; }
47
+ .ue-chip-offen { background: #e8eefc; color: var(--blau); }
48
+ .ue-chip-aenderung { background: var(--orange-hell); color: var(--orange); }
49
+ .ue-chip-frei { background: var(--gruen-hell); color: var(--gruen); }
50
+ .ue-info { margin: 6px 0 0; color: var(--leise); font-size: 15px; }
51
+ .ue-extras { margin: 4px 0 0; color: var(--leise); font-size: 14px; }
52
+
53
+ .ue-knoepfe { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
54
+ .ue-btn {
55
+ appearance: none; display: inline-flex; align-items: center; justify-content: center;
56
+ border: 1px solid transparent; border-radius: 8px; font: inherit; font-weight: 600; font-size: 15px;
57
+ min-height: 44px; padding: 8px 16px; cursor: pointer; text-decoration: none;
58
+ }
59
+ .ue-btn:disabled { opacity: .6; cursor: wait; }
60
+ .ue-btn-haupt { background: var(--text); color: #fff; }
61
+ .ue-btn-ok { background: var(--gruen); color: #fff; }
62
+ .ue-btn-ok-leise { background: var(--flaeche); border-color: var(--gruen); color: var(--gruen); }
63
+ .ue-btn-leise { background: transparent; border-color: var(--rand); color: var(--leise); font-weight: 500; }
64
+ .ue-btn:focus-visible, .ue-filter button:focus-visible { outline: 3px solid var(--blau); outline-offset: 2px; }
65
+
66
+ .ue-formular { display: grid; gap: 8px; margin-top: 12px; }
67
+ .ue-formular label { display: grid; gap: 4px; font-size: 13px; color: var(--leise); }
68
+ .ue-formular input {
69
+ border: 1px solid var(--rand); border-radius: 8px; font: inherit; font-size: 16px;
70
+ padding: 9px 10px; width: 100%; color: var(--text); background: #fff;
71
+ }
72
+ .ue-fehler { margin: 0; color: #b42318; font-size: 14px; }
73
+ .ue-fehler:empty { display: none; }
74
+
75
+ .ue-leer { background: var(--flaeche); border: 1px dashed var(--rand); border-radius: 10px; padding: 24px; text-align: center; color: var(--leise); }
76
+ .ue-archiv { display: flex; width: 100%; margin-top: 4px; }
77
+ .ue-fuss { margin-top: 28px; color: var(--leise); font-size: 13px; text-align: center; }
78
+
79
+ @media (max-width: 480px) {
80
+ .ue-knoepfe .ue-btn { flex: 1 1 auto; }
81
+ .ue-kopf h1 { font-size: 21px; }
82
+ }