UX: Privater-Header mit Zwingername + Logo auf allen Züchter-Seiten (SW by-v910)
This commit is contained in:
parent
a577e6d8d9
commit
ccf5a8b7ba
8 changed files with 117 additions and 57 deletions
|
|
@ -11,7 +11,8 @@ window.Page_zuchthunde = (() => {
|
|||
let _hunde = []; // geladene Hunde
|
||||
let _query = ''; // Suchtext
|
||||
let _openSections = {}; // { <hundId>: 'health'|'genetic'|'titles'|null }
|
||||
let _breederId = null; // ID des Züchter-Profils
|
||||
let _breederId = null; // ID des Züchter-Profils
|
||||
let _breederInfo = null; // { zwingername, logo_url }
|
||||
|
||||
// ----------------------------------------------------------
|
||||
// Hilfsfunktionen
|
||||
|
|
@ -99,23 +100,35 @@ window.Page_zuchthunde = (() => {
|
|||
// Grundstruktur
|
||||
// ----------------------------------------------------------
|
||||
function _privateHeader() {
|
||||
const zwinger = _breederInfo?.zwingername || '';
|
||||
const logoUrl = _breederInfo?.logo_url || null;
|
||||
const logoHtml = logoUrl
|
||||
? `<img src="${_esc(logoUrl)}" alt="Logo"
|
||||
style="width:40px;height:40px;border-radius:50%;object-fit:cover;
|
||||
border:2px solid rgba(196,132,58,.5);flex-shrink:0"
|
||||
onerror="this.style.display='none'">`
|
||||
: `<div style="width:40px;height:40px;border-radius:50%;background:rgba(196,132,58,.15);
|
||||
border:2px solid rgba(196,132,58,.3);display:flex;align-items:center;
|
||||
justify-content:center;flex-shrink:0">
|
||||
<svg style="width:20px;height:20px;color:var(--c-primary)" viewBox="0 0 256 256">
|
||||
<use href="/icons/phosphor.svg#paw-print"></use>
|
||||
</svg>
|
||||
</div>`;
|
||||
return `
|
||||
<div style="background:linear-gradient(135deg,#1a1208,#2d1f0e);
|
||||
border-bottom:1px solid rgba(196,132,58,.25);
|
||||
padding:var(--space-3) var(--space-4);
|
||||
display:flex;align-items:center;gap:var(--space-3)">
|
||||
<div style="background:rgba(196,132,58,.15);border:1px solid rgba(196,132,58,.3);
|
||||
border-radius:var(--radius-md);padding:var(--space-2) var(--space-3);
|
||||
display:flex;align-items:center;gap:var(--space-2);flex-shrink:0">
|
||||
<svg style="width:14px;height:14px;color:var(--c-primary)" viewBox="0 0 256 256">
|
||||
<use href="/icons/phosphor.svg#lock-key"></use>
|
||||
</svg>
|
||||
<span style="font-size:var(--text-xs);font-weight:700;color:var(--c-primary);white-space:nowrap">
|
||||
Privater Bereich
|
||||
</span>
|
||||
</div>
|
||||
<div style="font-size:var(--text-xs);color:rgba(196,132,58,.6)">
|
||||
Nur du siehst das — nicht öffentlich
|
||||
${logoHtml}
|
||||
<div style="flex:1;min-width:0">
|
||||
${zwinger ? `<div style="font-size:var(--text-sm);font-weight:700;color:rgba(255,255,255,.9);
|
||||
white-space:nowrap;overflow:hidden;text-overflow:ellipsis">${_esc(zwinger)}</div>` : ''}
|
||||
<div style="display:flex;align-items:center;gap:var(--space-2);margin-top:1px">
|
||||
<svg style="width:11px;height:11px;color:var(--c-primary);flex-shrink:0" viewBox="0 0 256 256">
|
||||
<use href="/icons/phosphor.svg#lock-key"></use>
|
||||
</svg>
|
||||
<span style="font-size:var(--text-xs);color:rgba(196,132,58,.7)">Privater Bereich · Nur du siehst das</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>`;
|
||||
}
|
||||
|
|
@ -182,7 +195,10 @@ window.Page_zuchthunde = (() => {
|
|||
try {
|
||||
[_hunde] = await Promise.all([
|
||||
API.zuchthunde.list(),
|
||||
API.breeder.status().then(s => { _breederId = s?.profile?.id || null; }).catch(() => {}),
|
||||
API.breeder.status().then(s => {
|
||||
_breederId = s?.profile?.id || null;
|
||||
_breederInfo = s?.profile ? { zwingername: s.profile.zwingername, logo_url: s.profile.logo_url } : null;
|
||||
}).catch(() => {}),
|
||||
]);
|
||||
_renderList();
|
||||
} catch (err) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue