Pad admin cards so content isn't flush against the border

The admin views used bare .card, which has no padding; add card-pad.

Claude-Session: https://claude.ai/code/session_016mBLURvJoMuUEr9cB2RpUN
This commit is contained in:
Niklas Ye
2026-10-10 13:13:56 +02:00
parent 392eab4127
commit c67dc80a8f
3 changed files with 15 additions and 15 deletions
+4 -4
View File
@@ -76,7 +76,7 @@ async function load() {
function render() { function render() {
if (!state.me?.user?.is_admin) { if (!state.me?.user?.is_admin) {
clear(view(), h('div', { class: 'card' }, clear(view(), h('div', { class: 'card card-pad' },
h('p', { class: 'muted', text: 'Administration is for system administrators. Ask one for access.' }))); h('p', { class: 'muted', text: 'Administration is for system administrators. Ask one for access.' })));
return; return;
} }
@@ -152,7 +152,7 @@ function teamsCard() {
h('td', { class: 'num', text: String(t.open_incidents) }), h('td', { class: 'num', text: String(t.open_incidents) }),
)); ));
return h('div', { class: 'card' }, return h('div', { class: 'card card-pad' },
h('h2', { text: 'Teams' }), h('h2', { text: 'Teams' }),
h('p', { class: 'muted small' }, h('p', { class: 'muted small' },
'Open a team for who is in it, the invites into it, and renaming or ', 'Open a team for who is in it, the invites into it, and renaming or ',
@@ -229,7 +229,7 @@ function usersCard() {
); );
}); });
return h('div', { class: 'card' }, return h('div', { class: 'card card-pad' },
h('h2', { text: 'Users' }), h('h2', { text: 'Users' }),
h('p', { class: 'muted small' }, h('p', { class: 'muted small' },
'Disabling an account stops it signing in and stops its API keys, and keeps ', 'Disabling an account stops it signing in and stops its API keys, and keeps ',
@@ -368,7 +368,7 @@ function settingsCard() {
h('td', {}, h('code', { text: k })), h('td', {}, h('code', { text: k })),
h('td', { class: 'muted', text: v === '' ? '(unset)' : v }))); h('td', { class: 'muted', text: v === '' ? '(unset)' : v })));
return h('div', { class: 'card' }, return h('div', { class: 'card card-pad' },
h('h2', { text: 'Settings' }), h('h2', { text: 'Settings' }),
h('p', { class: 'muted small', text: 'Saved changes take effect on the next sweep — no restart.' }), h('p', { class: 'muted small', text: 'Saved changes take effect on the next sweep — no restart.' }),
form, form,
+6 -6
View File
@@ -72,7 +72,7 @@ export async function refresh() {
function render() { function render() {
const el = view(); const el = view();
if (!state.me?.user?.is_admin) { if (!state.me?.user?.is_admin) {
clear(el, backLink(), h('div', { class: 'card' }, clear(el, backLink(), h('div', { class: 'card card-pad' },
h('p', { class: 'muted', text: 'Administration is for system administrators. Ask one for access.' }))); h('p', { class: 'muted', text: 'Administration is for system administrators. Ask one for access.' })));
return; return;
} }
@@ -81,7 +81,7 @@ function render() {
return; return;
} }
if (!data.team) { if (!data.team) {
clear(el, backLink(), h('div', { class: 'card' }, clear(el, backLink(), h('div', { class: 'card card-pad' },
h('p', { class: 'muted', text: 'No such team. It may have just been deleted.' }))); h('p', { class: 'muted', text: 'No such team. It may have just been deleted.' })));
return; return;
} }
@@ -142,7 +142,7 @@ function identityCard() {
await refresh(); await refresh();
}); });
return h('div', { class: 'card' }, return h('div', { class: 'card card-pad' },
h('div', { class: 'user-head' }, h('h2', { text: t.name })), h('div', { class: 'user-head' }, h('h2', { text: t.name })),
h('dl', { class: 'user-facts' }, h('dl', { class: 'user-facts' },
fact('Created', when(t.created_at)), fact('Created', when(t.created_at)),
@@ -216,7 +216,7 @@ function membersCard() {
act(() => api.addTeamMember(teamID, Number(pick.value), role.value)); act(() => api.addTeamMember(teamID, Number(pick.value), role.value));
}); });
return h('div', { class: 'card' }, return h('div', { class: 'card card-pad' },
h('h2', { text: 'Members' }), h('h2', { text: 'Members' }),
data.members.length === 0 && h('p', { class: 'muted small' }, data.members.length === 0 && h('p', { class: 'muted small' },
'Nobody is in this team. Its queue has no one to work it and its ', 'Nobody is in this team. Its queue has no one to work it and its ',
@@ -275,7 +275,7 @@ function invitesCard() {
); );
}); });
return h('div', { class: 'card' }, return h('div', { class: 'card card-pad' },
h('h2', { text: 'Invites' }), h('h2', { text: 'Invites' }),
h('p', { class: 'muted small' }, h('p', { class: 'muted small' },
'An invite link puts somebody in this team and lets them choose their ', 'An invite link puts somebody in this team and lets them choose their ',
@@ -303,7 +303,7 @@ function inviteState(inv) {
function dangerCard() { function dangerCard() {
const t = data.team; const t = data.team;
const blocked = t.open_incidents > 0; const blocked = t.open_incidents > 0;
return h('div', { class: 'card' }, return h('div', { class: 'card card-pad' },
h('h2', { text: 'Delete' }), h('h2', { text: 'Delete' }),
h('p', { class: 'muted small' }, h('p', { class: 'muted small' },
'Its alerts, incidents, schedule and integrations go with it. This ', 'Its alerts, incidents, schedule and integrations go with it. This ',
+5 -5
View File
@@ -60,7 +60,7 @@ export async function refresh() {
function render() { function render() {
const el = view(); const el = view();
if (!state.me?.user?.is_admin) { if (!state.me?.user?.is_admin) {
clear(el, backLink(), h('div', { class: 'card' }, clear(el, backLink(), h('div', { class: 'card card-pad' },
h('p', { class: 'muted', text: 'Administration is for system administrators. Ask one for access.' }))); h('p', { class: 'muted', text: 'Administration is for system administrators. Ask one for access.' })));
return; return;
} }
@@ -69,7 +69,7 @@ function render() {
return; return;
} }
if (!data.user) { if (!data.user) {
clear(el, backLink(), h('div', { class: 'card' }, clear(el, backLink(), h('div', { class: 'card card-pad' },
h('p', { class: 'muted', text: 'No such user. They may have just been deleted.' }))); h('p', { class: 'muted', text: 'No such user. They may have just been deleted.' })));
return; return;
} }
@@ -94,7 +94,7 @@ function identityCard() {
const u = data.user; const u = data.user;
const self = u.id === myID(); const self = u.id === myID();
return h('div', { class: 'card' }, return h('div', { class: 'card card-pad' },
h('div', { class: 'user-head' }, h('div', { class: 'user-head' },
h('h2', { text: u.username }), h('h2', { text: u.username }),
u.is_admin && h('span', { class: 'row-team', text: 'admin' }), u.is_admin && h('span', { class: 'row-team', text: 'admin' }),
@@ -203,7 +203,7 @@ function teamsCard() {
act(() => api.addTeamMember(Number(pick.value), userID, role.value)); act(() => api.addTeamMember(Number(pick.value), userID, role.value));
}); });
return h('div', { class: 'card' }, return h('div', { class: 'card card-pad' },
h('h2', { text: 'Teams' }), h('h2', { text: 'Teams' }),
data.teams.length === 0 && h('p', { class: 'muted small' }, data.teams.length === 0 && h('p', { class: 'muted small' },
'In no team. They can sign in, but there is no queue for them to work ', 'In no team. They can sign in, but there is no queue for them to work ',
@@ -244,7 +244,7 @@ function accountCard() {
await refresh(); await refresh();
}); });
return h('div', { class: 'card' }, return h('div', { class: 'card card-pad' },
h('h2', { text: 'Account' }), h('h2', { text: 'Account' }),
h('p', { class: 'muted small' }, h('p', { class: 'muted small' },
'Setting a password here is how somebody gets their first one, or a new ', 'Setting a password here is how somebody gets their first one, or a new ',