From 784c9013eb6af9420a97ac5433020ad515b8beb2 Mon Sep 17 00:00:00 2001 From: Scarriffle Date: Sat, 4 Jul 2026 19:02:12 +0200 Subject: [PATCH] feat(web): mark read-only shared calendars and hide them from the event editor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Sidebar: a calendar shared with read access shows "· Nur lesen" next to the "shared with me · " label. - Event editor calendar picker: exclude read-only shared calendars (own + read_write, incl. group calendars, stay) so a save can't 403. Parity with the server/iOS/Android sharing changes. Co-Authored-By: Claude Opus 4.8 --- frontend/js/calendar.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/frontend/js/calendar.js b/frontend/js/calendar.js index 22b57ae..8939139 100644 --- a/frontend/js/calendar.js +++ b/frontend/js/calendar.js @@ -728,9 +728,10 @@ function renderCalendarList() { remove: { icon: TRASH, title: t('remove_cal') } }); }); state.localCalendars.filter(c => c.owned === false && !c.group).forEach(cal => { + const readOnly = cal.permission !== 'read_write'; entries.push({ key: `local:${cal.id}`, source: 'local', dataId: `data-cal-id="${cal.id}"`, name: cal.name, color: cal.color, enabled: cal.enabled, - sourceLabel: `${t('shared_with_me')} · ${cal.shared_by || ''}`, remove: null }); + sourceLabel: `${t('shared_with_me')} · ${cal.shared_by || ''}${readOnly ? ' · ' + t('perm_read') : ''}`, remove: null }); }); // Group calendars (owned by the creator or reached via membership) — shown so // they can be toggled/recoloured. Owned group calendars can also be muted @@ -1577,8 +1578,10 @@ function populateCalendarSelect(selectedId) { }); }); // Local calendars. Group calendars are collected under a "Groups" optgroup - // (no emoji — a native can't render the group icon SVG). Read-only + // shared calendars are excluded — a save would only 403. + const localCals = state.localCalendars.filter(c => + !c.sidebar_hidden && (c.owned !== false || c.permission === 'read_write')); const makeLocalOpt = cal => { const opt = document.createElement('option'); opt.value = `local-${cal.id}`;