diff --git a/components/web/blueprints/profile.py b/components/web/blueprints/profile.py index b5be9a3..0447caa 100644 --- a/components/web/blueprints/profile.py +++ b/components/web/blueprints/profile.py @@ -60,6 +60,7 @@ async def user_profile_patch(): response_code=204, title="Profile updated", message="Your profile was updated", + additional_triggers={"profileUpdate": session["profile"]["tresor"]}, ) diff --git a/components/web/static_files/css/pico-custom.css b/components/web/static_files/css/pico-custom.css index 446e510..72b0b42 100644 --- a/components/web/static_files/css/pico-custom.css +++ b/components/web/static_files/css/pico-custom.css @@ -3188,17 +3188,17 @@ dialog article { margin: calc(var(--pico-spacing) / 2) auto; } -.grid-3-cols { +.grid-auto-cols { display: grid; - grid-template-columns: repeat(3, 1fr); + grid-template-columns: repeat(5, 1fr); gap: calc(var(--pico-spacing) / 2); } -.grid-3-cols .span-3 { - grid-column: span 3; +.grid-auto-cols .grid-span-all { + grid-column: 1/-1; } -.grid-3-cols > article { +.grid-auto-cols > article { margin-bottom: 0; padding-bottom: var(--pico-form-element-spacing-vertical); --pico-border-radius: .5rem; @@ -3220,28 +3220,6 @@ fieldset.vault-unlock { padding: var(--pico-spacing) 0; } -@media only screen and (max-width: 600px) { - #notification-container { - left: 0; - bottom: 0; - width: 100%; - } - dialog article { - max-width: 95%; - } - .grid-3-cols { - display: grid; - grid-template-columns: repeat(1, 1fr); - gap: calc(var(--pico-spacing) / 2); - } - .grid-3-cols .span-3 { - grid-column: span 1; - } - .grid-3-cols > article { - margin-bottom: 0; - --pico-border-radius: .5rem; - } -} @media (max-width: 1024px) { .split-grid.grid { gap: calc(var(--pico-spacing) / 2); @@ -3251,11 +3229,46 @@ fieldset.vault-unlock { background-color: transparent; box-shadow: none; } + .grid-auto-cols { + display: grid; + grid-template-columns: repeat(3, 1fr); + gap: calc(var(--pico-spacing) / 2); + } + .grid-auto-cols .grid-span-all { + grid-column: 1/-1; + } + .grid-auto-cols > article { + margin-bottom: 0; + padding-bottom: var(--pico-form-element-spacing-vertical); + --pico-border-radius: .5rem; + } th, td { --pico-spacing: 0.75rem; } } -.group { +@media only screen and (max-width: 576px) { + #notification-container { + left: 0; + bottom: 0; + width: 100%; + } + dialog article { + max-width: 95%; + } + .grid-auto-cols { + display: grid; + grid-template-columns: repeat(1, 1fr); + gap: calc(var(--pico-spacing) / 2); + } + .grid-auto-cols .grid-span-all { + grid-column: 1/-1; + } + .grid-auto-cols > article { + margin-bottom: 0; + --pico-border-radius: .5rem; + } +} +.user-group { opacity: 0; } @@ -3269,7 +3282,7 @@ fieldset.system-field label:before { content: "🔒 "; } -fieldset.keypair { +fieldset.keypair, fieldset.tresor { border: 1px solid var(--pico-form-element-border-color); padding: var(--pico-spacing); } diff --git a/components/web/static_files/css/pico-custom.scss b/components/web/static_files/css/pico-custom.scss index 2cee022..cfc53a2 100644 --- a/components/web/static_files/css/pico-custom.scss +++ b/components/web/static_files/css/pico-custom.scss @@ -98,6 +98,10 @@ --pico-line-height: 1.4; } +$sm-breakpoint: map-get(map-get($breakpoints, sm), breakpoint); +$md-breakpoint: map-get(map-get($breakpoints, md), breakpoint); +$lg-breakpoint: map-get(map-get($breakpoints, lg), breakpoint); + small { font-size: .875rem; color: var(--pico-muted-color); @@ -312,20 +316,21 @@ dialog article { justify-content: space-between; grid-auto-columns: max-content; grid-auto-flow: column; - gap: calc(var(--pico-spacing) /2); + gap: calc(var(--pico-spacing)/2); white-space: nowrap; align-items: baseline; margin: calc(var(--pico-spacing) /2) auto; } -.grid-3-cols { + +.grid-auto-cols { display: grid; - grid-template-columns: repeat(3, 1fr); - gap: calc(var(--pico-spacing) /2); + grid-template-columns: repeat(5, 1fr); + gap: calc(var(--pico-spacing)/2); } -.grid-3-cols .span-3 { - grid-column: span 3; +.grid-auto-cols .grid-span-all { + grid-column: 1 / -1; } -.grid-3-cols > article { +.grid-auto-cols > article { margin-bottom: 0; padding-bottom: var(--pico-form-element-spacing-vertical); --pico-border-radius: .5rem; @@ -347,7 +352,37 @@ fieldset.vault-unlock { padding: var(--pico-spacing) 0; } -@media only screen and (max-width: 600px) { +article.user-group { + +} + +@media (max-width: $lg-breakpoint) { + .split-grid.grid { + gap: calc(var(--pico-spacing)/2); + } + .split-grid.grid > article { + padding: 0; + background-color: transparent; + box-shadow: none; + } + .grid-auto-cols { + display: grid; + grid-template-columns: repeat(3, 1fr); + gap: calc(var(--pico-spacing)/2); + } + .grid-auto-cols .grid-span-all { + grid-column: 1 / -1; + } + .grid-auto-cols > article { + margin-bottom: 0; + padding-bottom: var(--pico-form-element-spacing-vertical); + --pico-border-radius: .5rem; + } + th, td { + --pico-spacing: 0.75rem; + } +} +@media only screen and (max-width: $sm-breakpoint) { #notification-container { left: 0; bottom: 0; @@ -356,35 +391,21 @@ fieldset.vault-unlock { dialog article { max-width: 95%; } - .grid-3-cols { + .grid-auto-cols { display: grid; grid-template-columns: repeat(1, 1fr); gap: calc(var(--pico-spacing)/2); } - .grid-3-cols .span-3 { - grid-column: span 1; + .grid-auto-cols .grid-span-all { + grid-column: 1 / -1; } - .grid-3-cols > article { + .grid-auto-cols > article { margin-bottom: 0; --pico-border-radius: .5rem; } } -@media (max-width: 1024px) { - .split-grid.grid { - gap: calc(var(--pico-spacing) /2); - } - .split-grid.grid > article { - padding: 0; - background-color: transparent; - box-shadow: none; - } - th, td { - --pico-spacing: 0.75rem; - } -} - -.group { +.user-group { opacity: 0; } @@ -398,7 +419,7 @@ fieldset.system-field label:before { content:"\1f512\0020"; } -fieldset.keypair { +fieldset.keypair, fieldset.tresor { border: 1px solid var(--pico-form-element-border-color); padding: var(--pico-spacing); } diff --git a/components/web/static_files/hyperscript/common._hs b/components/web/static_files/hyperscript/common._hs index b17e258..0a060a2 100644 --- a/components/web/static_files/hyperscript/common._hs +++ b/components/web/static_files/hyperscript/common._hs @@ -178,6 +178,11 @@ behavior tresorToggle end end end + on profileUpdate from body + exit unless #vault-unlock's @data-tresor == "" + set #vault-unlock's @data-tresor to (value of event.detail) + call setLocked() + end on keydown[keyCode == 13] from #vault-unlock-pin trigger click on #vault-unlock unless #vault-unlock-pin's value is empty end diff --git a/components/web/templates/includes/form_builder.html b/components/web/templates/includes/form_builder.html index bfdde3c..6e4e3d0 100644 --- a/components/web/templates/includes/form_builder.html +++ b/components/web/templates/includes/form_builder.html @@ -60,7 +60,7 @@ DATA FIELDS {% elif v.type == "tresor" %} {% if request.path == "/profile/" %} -