CalDAV-Konten
diff --git a/frontend/js/calendar.js b/frontend/js/calendar.js
index 700512b..2b6242f 100644
--- a/frontend/js/calendar.js
+++ b/frontend/js/calendar.js
@@ -2553,6 +2553,14 @@ function openSettingsModal() {
document.getElementById('cfg-private-visibility').value = s.private_event_visibility || 'busy';
renderGroupVisibleList(s.group_visible_calendar_id);
+ // Profile chapter: name (from cached user) + email (fresh from /profile).
+ const pu = JSON.parse(localStorage.getItem('user') || '{}');
+ document.getElementById('cfg-display-name').value = pu.display_name || pu.username || '';
+ document.getElementById('cfg-login-name').value = pu.username || '';
+ api.get('/profile/').then(p => {
+ document.getElementById('cfg-email').value = p.email || '';
+ }).catch(() => {});
+
// Set active contrast/hour-height buttons
[
{ id: 'cfg-text-contrast', val: s.text_contrast || 3 },
@@ -3003,6 +3011,29 @@ function bindSettingsModal() {
} catch (e) { showToast(e.message, true); }
};
+ // Profile chapter save (name/login/email → /profile, separate from settings).
+ const profileSaveBtn = document.getElementById('cfg-profile-save');
+ if (profileSaveBtn) profileSaveBtn.onclick = async () => {
+ const email = document.getElementById('cfg-email').value.trim();
+ const displayName = document.getElementById('cfg-display-name').value.trim();
+ const loginName = document.getElementById('cfg-login-name').value.trim();
+ const user = JSON.parse(localStorage.getItem('user') || '{}');
+ const body = { email: email || null };
+ if (displayName) body.display_name = displayName;
+ if (loginName && loginName.toLowerCase() !== (user.username || '')) body.username = loginName;
+ try {
+ const res = await api.put('/profile/', body);
+ if (res && res.access_token) localStorage.setItem('token', res.access_token);
+ const updated = { ...user };
+ if (displayName) updated.display_name = displayName;
+ if (body.username) updated.username = body.username.toLowerCase();
+ localStorage.setItem('user', JSON.stringify(updated));
+ const dd = document.getElementById('dropdown-username');
+ if (dd) dd.textContent = updated.display_name || updated.username || 'Benutzer';
+ showToast(t('profile_saved'));
+ } catch (e) { showToast(e.message, true); }
+ };
+
document.getElementById('settings-save').onclick = async () => {
const getActive = (id) => {
const btn = document.querySelector(`#${id} .contrast-btn.active`);
diff --git a/frontend/js/i18n.js b/frontend/js/i18n.js
index 186f139..1ce77f2 100644
--- a/frontend/js/i18n.js
+++ b/frontend/js/i18n.js
@@ -60,6 +60,9 @@ const translations = {
// Settings
settings_title: 'Einstellungen',
settings_nav_appearance: 'Darstellung',
+ settings_nav_profile: 'Profil',
+ settings_nav_view: 'Ansicht',
+ settings_nav_calendars: 'Kalender',
settings_nav_google: 'Google Konten',
settings_nav_users: 'Benutzerverwaltung',
settings_colors: 'Farben',
@@ -329,6 +332,9 @@ const translations = {
// Settings
settings_title: 'Settings',
settings_nav_appearance: 'Appearance',
+ settings_nav_profile: 'Profile',
+ settings_nav_view: 'View',
+ settings_nav_calendars: 'Calendars',
settings_nav_google: 'Google Accounts',
settings_nav_users: 'User Management',
settings_colors: 'Colors',
diff --git a/frontend/js/version.js b/frontend/js/version.js
index 44aaa9e..6f53b39 100644
--- a/frontend/js/version.js
+++ b/frontend/js/version.js
@@ -1,2 +1,2 @@
// Increment APP_VERSION with every code change
-export const APP_VERSION = 'v38';
+export const APP_VERSION = 'v39';