Point avatar and View Profile at own person page; drop the profile page

This commit is contained in:
Ian Gulliver
2026-08-16 14:13:54 -07:00
parent b9bb8629a8
commit 440b3f11de
4 changed files with 6 additions and 45 deletions
+4 -32
View File
@@ -609,9 +609,6 @@ function fromCrumbs() {
if (seg[0] === 'staff') {
return [['Staff', back]];
}
if (seg[0] === 'profile') {
return [['Profile', back]];
}
if (seg[0] === 'email-list') {
return [['Email List', back]];
}
@@ -1075,8 +1072,6 @@ function renderFamilyDetail(key) {
crumbs = [['People', back], [shortName, null], ['Family', null]];
} else if (rseg[0] === 'map') {
crumbs = [['Map', back], [shortName, null], ['Family', null]];
} else if (rseg[0] === 'profile') {
crumbs = [['Profile', back], ['Family', null]];
}
}
main.append(breadcrumbs(crumbs));
@@ -1946,30 +1941,6 @@ function pronounceEditor(target, key) {
return box;
}
function renderProfile() {
const main = document.querySelector('#main');
main.replaceChildren();
const me = byEmail[document.body.dataset.userEmail];
if (!me) {
main.append(el('div', 'empty', 'Not found.'));
return;
}
const content = el('div', 'container content');
const family = state.model.families[me.familyKey];
if (family) {
content.append(el('h1', 'profile-heading', 'Family Photo'));
content.append(listRow(thumbUrl(family.photoUrl), '', 'Family Photo', family.photoCaption || '', familyLink(me.familyKey)));
const kids = (family.kidEmails || []).map(e => byEmail[e]).filter(Boolean);
if (kids.length) {
content.append(el('h1', 'profile-heading', 'Students'));
for (const k of kids) {
content.append(listRow(thumbUrl(k.photoUrl), (k.pronouns || '').toUpperCase(), firstName(k.fullName), '', personLink(k)));
}
}
}
main.append(content);
}
function tabParam(fallback) {
return new URLSearchParams(location.search).get('tab') || fallback;
}
@@ -2037,7 +2008,6 @@ const sectionTitles = {
staff: 'Staff',
map: 'Map',
'email-list': 'Email List',
profile: 'Profile',
};
function render() {
@@ -2070,8 +2040,6 @@ function render() {
} else if (seg[0] === 'map') {
state.q = '';
renderMapPage();
} else if (seg[0] === 'profile') {
renderProfile();
}
}
@@ -2080,6 +2048,10 @@ document.querySelector('#user').addEventListener('click', e => {
e.stopPropagation();
userMenu.hidden = !userMenu.hidden;
});
document.querySelector('#user .user-avatar').addEventListener('click', e => {
e.stopPropagation();
location.href = withFrom('/people/' + encodeURIComponent(document.body.dataset.userEmail));
});
const drawer = document.querySelector('#drawer');
const drawerOverlay = document.querySelector('#drawer-overlay');
-10
View File
@@ -612,16 +612,6 @@ main {
fill: currentColor;
}
.profile-heading {
font-size: 24px;
font-weight: 700;
margin: 26px 0 10px;
}
.profile-heading:first-child {
margin-top: 4px;
}
.controls {
display: flex;
gap: 10px;