Audit tweaks

This commit is contained in:
Evert Prants 2024-06-11 17:01:52 +03:00
parent 4d19e6809d
commit 2724c77b55
Signed by: evert
GPG Key ID: 1688DA83D222D0B5
2 changed files with 15 additions and 6 deletions

View File

@ -11,8 +11,8 @@
<div class="audit-log{expanded ? ' expanded' : ''}{audit.flagged ? ' flagged' : ''}">
<div class="audit-log-title">
<span class="audit-action">{audit.action}</span>
<span class="audit-stamp"><AdminDateTime date={audit.created_at} /></span>
<span class="audit-log-action">{audit.action}</span>
<span class="audit-log-stamp"><AdminDateTime date={audit.created_at} /></span>
<Button on:click={() => (expanded = !expanded)}><Icon icon="ChevronDown" /></Button>
</div>
@ -76,6 +76,15 @@
align-items: center;
justify-content: space-between;
flex-grow: 1;
gap: 1rem;
}
.audit-log-stamp {
margin-left: auto;
@media screen and (max-width: 768px) {
display: none;
}
}
.audit-log.expanded :global(svg) {

View File

@ -12,10 +12,10 @@ export const themeMode = writable<ThemeModeType>('light', (set) => {
});
/**
* Send a theme to the server so that it can be saved as a cookie.
* @param theme - theme to send to server
* Save theme as a cookie.
* @param theme - theme to save
*/
export const setThemeCookie = async (theme: ThemeModeType) =>
export const setThemeCookie = (theme: ThemeModeType) =>
(document.cookie = `themeMode=${theme}; path=/; SameSite=Lax; Max-Age=${THEME_COOKIE_MAX_AGE}`);
export const forwardInitialTheme = () =>
@ -34,7 +34,7 @@ export const forwardInitialTheme = () =>
const unsubscribeForward = themeMode.subscribe(async (theme) => {
document.documentElement.setAttribute('theme-base', theme);
await setThemeCookie(theme);
setThemeCookie(theme);
});
uaTheme?.addEventListener?.('change', uaSetter);