Membership: UI Rework
Change-Id: I8d1da12fd764972dc810846afd70760bdb450fe8
diff --git a/core/auth/memberships/static/main.css b/core/auth/memberships/static/main.css
index 7d4e759..17c09f8 100644
--- a/core/auth/memberships/static/main.css
+++ b/core/auth/memberships/static/main.css
@@ -1,13 +1,142 @@
-.headline {
- margin-bottom: 6px;
+[data-theme="light"],
+:root:not([data-theme="dark"]) {
+ --pico-font-family: Hack, monospace;
+ --pico-font-size: 14px;
+ --pico-header-height: 56px;
+ --pico-border-radius: 0;
+ --pico-background-color: #d6d6d6;
+ --pico-form-element-border-color: #3a3a3a;
+ --pico-form-element-active-border-color: #7f9f7f;
+ --pico-form-element-focus-color: #7f9f7f;
+ --pico-form-element-background-color: #d6d6d6;
+ --pico-form-element-active-background-color: #d6d6d6;
+ --pico-form-element-selected-background-color: #d6d6d6;
+ --pico-primary: #7f9f7f;
+ --pico-primary-background: #7f9f7f;
+ --pico-primary-hover: #d4888d;
+ --pico-primary-hover-background: #d4888d;
+ --pico-grid-spacing-horizontal: 0;
+ --search-background-color: #d6d6d6;
+ --pico-color: #3a3a3a;
+ --pico-form-element-color: #3a3a3a;
+ --pico-primary-inverse: #3a3a3a;
+ --pico-tooltip-background-color: #3a3a3a;
+ --pico-tooltip-color: #d6d6d6;
+ --pico-icon-color: #3a3a3a;
+ --pico-group-box-shadow-focus-with-button: 0 0 0 0;
+ --pico-card-background-color: var(--pico-card-sectioning-background-color);
+ p {
+ --pico-color: #3a3a3a;
+ }
+ h1 {
+ font-size: 20px;
+ --pico-color: #3a3a3a;
+ }
+ h2 {
+ font-size: 18px;
+ --pico-color: #3a3a3a;
+ }
+ h3 {
+ font-size: 16px;
+ --pico-color: #3a3a3a;
+ }
+ h4 {
+ font-size: 14px;
+ --pico-color: #3a3a3a;
+ }
+ label {
+ color: var(--pico-color);
+ }
+ input:is([type="checkbox"]) {
+ --pico-form-element-focus-color: none;
+ --pico-border-color: var(--pico-color);
+ }
+ [data-tooltip]:not(a, button, input) {
+ text-decoration: none;
+ cursor: pointer;
+ }
+ hr {
+ border-top: 1px solid var(--pico-color);
+ }
+ :is(button, [type="submit"], [type="button"], [role="button"]).secondary,
+ [type="file"]::file-selector-button,
+ [type="reset"] {
+ --pico-background-color: var(--pico-primary-hover-background);
+ --pico-border-color: var(--pico-primary-hover);
+ --pico-color: var(--pico-color);
+ cursor: pointer;
+ }
+ #confirm-button:hover {
+ background-color: var(--pico-primary);
+ border-color: var(--pico-primary);
+ }
}
-.description {
- margin-left: 1px;
- margin-bottom: 6px;
+@media (min-width: 768px) {
+ .grid.first {
+ grid-template-columns: 1fr 1fr 200px;
+ }
+
+ .grid.twoone {
+ grid-template-columns: 2fr 200px;
+ align-items: center;
+ grid-row-gap: 0;
+ }
+}
+
+.grid-header,
+.grid-row {
+ display: contents;
+}
+
+.headline {
+ margin-top: 15px;
}
.divider {
- margin-top: 10px;
- margin-bottom: 10px;
+ margin-top: 10px;
+ margin-bottom: 10px;
+}
+
+.remove {
+ margin-bottom: 0;
+ background-color: var(--pico-primary-hover);
+ /* border-top-right-radius: 0.25rem;
+ border-bottom-right-radius: 0.25rem; */
+ border: none;
+ outline: none;
+ padding: 0;
+ height: 100%;
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+}
+
+.remove svg {
+ height: 20px;
+ width: 20px;
+}
+
+.test {
+ margin-right: 3rem;
+}
+
+.link-button {
+ /* border-top-left-radius: 0.25rem;
+ border-bottom-left-radius: 0.25rem; */
+}
+
+.user-remove {
+ display: flex;
+ flex-direction: row;
+ gap: 5px;
+ flex-wrap: wrap;
+}
+
+a[role="button"],
+a[role="button"]:hover,
+a[role="button"]:focus {
+ background-color: var(--pico-primary);
+ border: none;
+ outline: none;
}
diff --git a/core/auth/memberships/static/main.js b/core/auth/memberships/static/main.js
index 52dd1d8..ba58654 100644
--- a/core/auth/memberships/static/main.js
+++ b/core/auth/memberships/static/main.js
@@ -2,7 +2,30 @@
const cancelButton = document.getElementById("cancel-button");
const confirmButton = document.getElementById("confirm-button");
+const errorCancelButton = document.getElementById("error-cancel-button");
+const errorMessageDialog = document.getElementById("error-message");
+
+let activeModalStatus = false;
+let activeModal = '';
+
+function keydownHandler(event) {
+ if (event.key === "Escape" && activeModalStatus && activeModal === "confirmation") {
+ hideConfirmationDialog();
+ }
+}
+
+function oustideModalHandler(event) {
+ if (activeModalStatus && confirmationDialog === event.target) {
+ hideConfirmationDialog();
+ errorMessageDialog.close();
+ }
+}
+
function showConfirmationDialog(form) {
+ activeModalStatus = true;
+ activeModal = "confirmation";
+ document.addEventListener("keydown", keydownHandler);
+ document.addEventListener("click", oustideModalHandler);
const message = form.dataset.confirmationMessage;
document.getElementById("confirmation-message").innerHTML = message;
confirmationDialog.showModal();
@@ -21,6 +44,10 @@
}
function hideConfirmationDialog() {
+ activeModalStatus = false;
+ activeModal = '';
+ document.removeEventListener("keydown", keydownHandler);
+ document.removeEventListener("click", oustideModalHandler);
confirmationDialog.close();
}
@@ -44,12 +71,19 @@
}
});
});
-});
-document.addEventListener("DOMContentLoaded", function () {
- var errorCancelButton = document.getElementById("error-cancel-button");
- var errorMessageDialog = document.getElementById("error-message");
errorCancelButton.addEventListener("click", function () {
errorMessageDialog.close();
});
+
+ document.addEventListener("keydown", function (event) {
+ if (event.key === "Escape") {
+ errorMessageDialog.close();
+ }
+ });
+ document.addEventListener("click", function (event) {
+ if (errorMessageDialog === event.target) {
+ errorMessageDialog.close();
+ }
+ });
});