Feature: Ratings, Lightbox, Forum-Standort, Notifications, Routen-Recording, Chat-Picker
- Bewertungssystem (ratings.py): Sterne für Sitter/Walks/Places/Routen - Admin: Server-Log-Viewer + OSM-Cache-Statistiken - Chat: "Neue Nachricht"-Button mit Freundesliste-Picker - Forum: 5 neue Kategorien, Standorteingabe (locationPicker), Absende-Toast, Lightbox - Freunde: Aktivitäts-Filter (Chips), Freundschaftsanfrage → In-App-Notification - Sitter: locationPicker statt manuelle Koordinateneingabe + ratingStars - Tagebuch: Bilder-Lightbox im Detail-View, iOS-Modal-Header-Fix (90svh) - Routen: Start/Stopp-Button wechselt Zustand, nutzt Page_map.isRecording() - Benachrichtigungen: Delete-Button sichtbar, typ-basierte Navigation, Toast-Feedback - OSM: globales Semaphore + 429-Retry-Logic; Scheduler: München-Umland, täglich - SW by-v225, APP_VER 202
This commit is contained in:
parent
aa70a838f2
commit
e56183b642
21 changed files with 648 additions and 175 deletions
|
|
@ -41,13 +41,18 @@ window.Page_chat = (() => {
|
|||
|
||||
_container.innerHTML = `
|
||||
<div style="background:var(--c-surface)">
|
||||
<div style="padding:var(--space-4) var(--space-4) var(--space-2)">
|
||||
<h2 style="font-size:var(--text-xl);font-weight:var(--weight-bold)">Nachrichten</h2>
|
||||
<div style="display:flex;align-items:center;justify-content:space-between;
|
||||
padding:var(--space-4) var(--space-4) var(--space-2)">
|
||||
<h2 style="font-size:var(--text-xl);font-weight:var(--weight-bold);margin:0">Nachrichten</h2>
|
||||
<button class="btn btn-primary btn-sm" id="chat-new-btn">
|
||||
${UI.icon('pencil-simple')} Neue Nachricht
|
||||
</button>
|
||||
</div>
|
||||
<div id="chat-list-body"></div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
document.getElementById('chat-new-btn')?.addEventListener('click', _showNewMessagePicker);
|
||||
await _loadList();
|
||||
await _updateChatBadge();
|
||||
}
|
||||
|
|
@ -396,6 +401,51 @@ window.Page_chat = (() => {
|
|||
.replace(/\n/g, '<br>');
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------
|
||||
// Neue Nachricht — Freundesliste als Picker
|
||||
// ----------------------------------------------------------
|
||||
async function _showNewMessagePicker() {
|
||||
let friends = [];
|
||||
try { friends = (await API.friends.list()).friends || []; } catch {}
|
||||
|
||||
if (!friends.length) {
|
||||
UI.toast.info('Du hast noch keine Freunde. Gehe zu Freunde um jemanden hinzuzufügen.');
|
||||
return;
|
||||
}
|
||||
|
||||
const items = friends.map(f => `
|
||||
<button class="btn btn-ghost" data-uid="${f.friend_id}" style="
|
||||
display:flex;align-items:center;gap:var(--space-3);
|
||||
width:100%;text-align:left;padding:var(--space-3)">
|
||||
<div style="width:40px;height:40px;border-radius:50%;
|
||||
background:var(--c-primary-subtle);display:flex;align-items:center;
|
||||
justify-content:center;font-weight:600;flex-shrink:0">
|
||||
${f.avatar_url
|
||||
? `<img src="${UI.escape(f.avatar_url)}" style="width:40px;height:40px;border-radius:50%;object-fit:cover">`
|
||||
: UI.escape((f.friend_name||'?')[0].toUpperCase())}
|
||||
</div>
|
||||
<span>${UI.escape(f.friend_name || '—')}</span>
|
||||
</button>`).join('');
|
||||
|
||||
UI.modal.open({
|
||||
title: 'Neue Nachricht',
|
||||
body: `<div style="display:flex;flex-direction:column;gap:2px">${items}</div>`,
|
||||
footer: `<button class="btn btn-ghost flex-1" id="chat-picker-cancel">Abbrechen</button>`,
|
||||
});
|
||||
|
||||
document.getElementById('chat-picker-cancel')?.addEventListener('click', UI.modal.close);
|
||||
document.querySelectorAll('[data-uid]').forEach(btn => {
|
||||
btn.addEventListener('click', async () => {
|
||||
UI.modal.close();
|
||||
const uid = parseInt(btn.dataset.uid);
|
||||
try {
|
||||
const { conversation_id } = await API.chat.start(uid);
|
||||
await _openThread(conversation_id);
|
||||
} catch (e) { UI.toast.error(e.message); }
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------
|
||||
return {
|
||||
init,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue