Fix: P/Z-Badges nur im Welten-Einrichten-Modal für Admins (SW by-v922)
- Normale Welt-Views (JETZT/HUND/WELT): keine P/Z-Badges auf Chips - Config-Modal: P-Badge (Pro) und Z-Badge (Züchter) nur wenn isAdmin=true - isAdmin-Variable im _openConfigModal()-Scope ergänzt
This commit is contained in:
parent
108191b339
commit
0a28c68953
4 changed files with 8 additions and 6 deletions
|
|
@ -673,6 +673,7 @@ window.Worlds = (() => {
|
|||
let cfg = JSON.parse(JSON.stringify(_getConfig())); // deep copy
|
||||
let _drag = null; // { page, fromWorld, ghost }
|
||||
|
||||
const isAdmin = _state?.user?.rolle === 'admin';
|
||||
const worldColors = { jetzt:'rgba(196,132,58,0.6)', hund:'rgba(196,132,58,0.8)', welt:'rgba(99,130,220,0.6)' };
|
||||
const worldLabels = { jetzt:'JETZT', hund:'HUND', welt:'WELT', pool:'Nicht verwendet' };
|
||||
const allAssigned = () => new Set([...cfg.jetzt, ...cfg.hund, ...cfg.welt]);
|
||||
|
|
@ -776,7 +777,8 @@ window.Worlds = (() => {
|
|||
<use href="/icons/phosphor.svg#lock-simple"></use>
|
||||
</svg>
|
||||
</div>`}
|
||||
${c.pro && _isRoleBasedPro() ? `<span style="position:absolute;top:3px;left:4px;font-size:8px;font-weight:800;color:#fff;background:#92400e;border-radius:3px;padding:0 3px;line-height:14px;z-index:2">P</span>` : ''}
|
||||
${isAdmin && c.pro ? `<span style="position:absolute;top:3px;left:4px;font-size:8px;font-weight:800;color:#fff;background:#92400e;border-radius:3px;padding:0 3px;line-height:14px;z-index:2">P</span>` : ''}
|
||||
${isAdmin && c.role === 'breeder' ? `<span style="position:absolute;top:3px;left:4px;font-size:8px;font-weight:800;color:#fff;background:#1d4ed8;border-radius:3px;padding:0 3px;line-height:14px;z-index:2">Z</span>` : ''}
|
||||
<svg class="ph-icon" style="width:1.4rem;height:1.4rem;color:white;flex-shrink:0">
|
||||
<use href="/icons/phosphor.svg#${c.icon}"></use>
|
||||
</svg>
|
||||
|
|
@ -1448,7 +1450,7 @@ window.Worlds = (() => {
|
|||
` : ''}
|
||||
<div class="world-section-label">Alles über ${_esc(dog.name)}</div>
|
||||
<div class="world-chips-grid">
|
||||
${chips.map(c => _chip(c.icon, c.label, c.page, false, c.pro && _isRoleBasedPro(), c.role === 'breeder')).join('')}
|
||||
${chips.map(c => _chip(c.icon, c.label, c.page, false, false, false)).join('')}
|
||||
</div>
|
||||
<div class="world-footer-links">
|
||||
<span data-wnav="gruender">Die 100 Gründer</span>
|
||||
|
|
@ -1622,7 +1624,7 @@ window.Worlds = (() => {
|
|||
<div class="world-bottom">
|
||||
<div class="world-section-label">Die Welt da draußen</div>
|
||||
<div class="world-chips-grid">
|
||||
${chips.map(c => _chip(c.icon, c.label, c.page, false, c.pro && _isRoleBasedPro(), c.role === 'breeder')).join('')}
|
||||
${chips.map(c => _chip(c.icon, c.label, c.page, false, false, false)).join('')}
|
||||
</div>
|
||||
<div class="world-footer-links">
|
||||
<span data-wnav="datenschutz">Datenschutz</span>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue