Asked for: alliances ("Consilium Elyseum") with their own view, a member-list tab with the allied legions and their
members, an own raid area, a calendar that shows them only alliance entries, and live map sessions the legion can
share with them - watching only, or drawing only with an extra permission. There is one Discord role "Consilium
Elyseum" for all allies, so which legion each ally belongs to is stored on the website.
- Permissions consilium.view / consilium.draw / consilium.manage. An account with consilium.view but without
dashboard.view is a guest of the Consilium (consilium_only(), sql_is_consilium_only()) and sees only the alliance
area; raids, calendar and map stay restricted even with extra rights like raids.view or map.view.
- includes/consilium.php; consilium.php is the allies' start page instead of the dashboard (next raids and entries,
legions, running shared map sessions); admin/consilium.php: setup hints, allied legions, member assignment.
users.consilium_legion_id, table consilium_legions (schema 69); allies pick their legion under Mein Profil.
- Members: new tab "Consilium Elyseum" (legions with their members), the only tab allies see. Legion-only lists
(dues, Lumipunkte, member pickers, raid and activity points) leave allies out.
- Raids: two areas, legion and Consilium, told apart by the Discord channel ("Consilium-Raids" under Verwaltung ->
Discord-Bot, settings.consilium_raid_channel; the bot API returns channel_id). Allies only see and sign up for
Consilium raids, which give no Lumipunkte; raids created in the Consilium area are posted to its channel.
- Calendar: audience "Consilium Elyseum". Allies see only those entries and the Consilium raids (also in their iCal
subscription), their own entries are always Consilium entries; the public calendar shows no Consilium raids; the
legion sees them marked with 🤝.
- Map: whoever may edit a public tactic shares its running live session with the Consilium (consilium_share, logged).
The share lives in the bot's live relay and only for that session: it ends with "Freigabe beenden" or 60 s after
the last legion member left; making the tactic private or deleting it ends it as well. Allies see only running
shared sessions under Karte (and on their start page), join and watch; with consilium.draw they add strokes,
areas, points and text - no figures, nothing moved, erased or undone, no tactics, steps, copies or history.
Enforced in tactics_api.php (guest branch: shared tactics only, only live_token and shape_create) and in the relay
(guest tickets, event whitelist, guests are disconnected when the share ends). Needs the bot update (api.py,
database/db.py, live_tactics.py).
- Navigation, privacy page, patch note, README.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
58 lines
2.3 KiB
JavaScript
58 lines
2.3 KiB
JavaScript
/**
|
|
* Karte fuer Mitglieder verbuendeter Legionen (map.php, Consilium Elyseum): Die Liste der freigegebenen
|
|
* Live-Sitzungen aktualisiert sich von selbst - neue erscheinen, beendete verschwinden. Dieselbe Darstellung
|
|
* wie in map.php.
|
|
*/
|
|
(function () {
|
|
const list = document.getElementById('consilium-sessions');
|
|
const empty = document.getElementById('consilium-sessions-empty');
|
|
const error = document.getElementById('consilium-sessions-error');
|
|
if (!list || !empty) return;
|
|
|
|
const esc = text => String(text).replace(/[&<>"']/g, c => ({
|
|
'&': '&', '<': '<', '>': '>', '"': '"', "'": '''
|
|
}[c]));
|
|
const time = since => new Date(since * 1000).toLocaleTimeString('de-DE', { hour: '2-digit', minute: '2-digit' });
|
|
|
|
function render(sessions) {
|
|
list.innerHTML = sessions.map(s => {
|
|
const people = (s.members > 0 ? `${s.members} aus der Legion` : 'Legion gerade nicht verbunden')
|
|
+ (s.guests > 0 ? ` · ${s.guests} ${s.guests === 1 ? 'Gast' : 'Gäste'}` : '');
|
|
return `<li>
|
|
<a href="${esc(s.url)}">
|
|
<span class="consilium-upcoming-date">seit ${esc(time(s.since))} Uhr</span>
|
|
<strong>${esc(s.name)}</strong>
|
|
<span class="text-muted">${esc(s.map_name)} · ${esc(people)}</span>
|
|
<span class="consilium-session-join">Beitreten →</span>
|
|
</a>
|
|
</li>`;
|
|
}).join('');
|
|
empty.hidden = sessions.length > 0;
|
|
}
|
|
|
|
async function refresh() {
|
|
let ok = false;
|
|
try {
|
|
const response = await fetch(list.dataset.source, {
|
|
credentials: 'same-origin',
|
|
headers: { Accept: 'application/json' }
|
|
});
|
|
const data = await response.json();
|
|
if (data.status === 'success') {
|
|
render(data.sessions || []);
|
|
ok = true;
|
|
}
|
|
} catch (e) {
|
|
// dann beim naechsten Mal
|
|
}
|
|
if (error) error.hidden = ok;
|
|
}
|
|
|
|
// Alle 15 Sekunden - im Hintergrund-Tab nicht, beim Zurueckkehren sofort
|
|
setInterval(() => {
|
|
if (!document.hidden) refresh();
|
|
}, 15000);
|
|
document.addEventListener('visibilitychange', () => {
|
|
if (!document.hidden) refresh();
|
|
});
|
|
})();
|