submit buttons

This commit is contained in:
Bryce
2023-10-22 21:07:58 -07:00
parent fc0392a235
commit bd1d603eb6
3 changed files with 48 additions and 82 deletions

View File

@@ -1357,10 +1357,6 @@ input:checked + .toggle-bg {
height: min-content; height: min-content;
} }
.h-\[90vh\] {
height: 90vh;
}
.max-h-96 { .max-h-96 {
max-height: 24rem; max-height: 24rem;
} }
@@ -1373,10 +1369,6 @@ input:checked + .toggle-bg {
max-height: 90vh; max-height: 90vh;
} }
.max-h-\[100vh\] {
max-height: 100vh;
}
.max-h-\[80vh\] { .max-h-\[80vh\] {
max-height: 80vh; max-height: 80vh;
} }
@@ -1454,19 +1446,6 @@ input:checked + .toggle-bg {
width: 100vw; width: 100vw;
} }
.w-min {
width: -moz-min-content;
width: min-content;
}
.w-8\/12 {
width: 66.666667%;
}
.w-6\/12 {
width: 50%;
}
.w-1\/4 { .w-1\/4 {
width: 25%; width: 25%;
} }
@@ -1495,10 +1474,6 @@ input:checked + .toggle-bg {
max-width: 1024px; max-width: 1024px;
} }
.max-w-xs {
max-width: 20rem;
}
.flex-1 { .flex-1 {
flex: 1 1 0%; flex: 1 1 0%;
} }
@@ -1717,10 +1692,6 @@ input:checked + .toggle-bg {
place-items: center; place-items: center;
} }
.content-center {
align-content: center;
}
.items-start { .items-start {
align-items: flex-start; align-items: flex-start;
} }
@@ -3630,10 +3601,6 @@ input:checked + .toggle-bg {
padding: 1.5rem; padding: 1.5rem;
} }
.sm\:p-12 {
padding: 3rem;
}
.sm\:py-5 { .sm\:py-5 {
padding-top: 1.25rem; padding-top: 1.25rem;
padding-bottom: 1.25rem; padding-bottom: 1.25rem;

View File

@@ -296,7 +296,7 @@
"New override") "New override")
[:div#form-errors [:span.error-content]] [:div#form-errors [:span.error-content]]
] ]
(com/validated-save-button {:errors []} (com/validated-save-button {:errors []} ;; TODO
"Save account"))]])) "Save account"))]]))
(defn new-client-override [{ {:keys [index]} :query-params}] (defn new-client-override [{ {:keys [index]} :query-params}]

View File

@@ -270,54 +270,53 @@
(defn user-edit-dialog [request] (defn user-edit-dialog [request]
(let [user (some-> request (let [user (some-> request
:route-params :route-params
:db/id :db/id
(#(dc/pull (dc/db conn) default-read %)))] (#(dc/pull (dc/db conn) default-read %)))]
(html-response (html-response
(com/modal (com/modal
{} {}
[:form {:hx-ext "response-targets" [:form {:hx-ext "response-targets"
:hx-put (str (bidi/path-for ssr-routes/only-routes :hx-put (str (bidi/path-for ssr-routes/only-routes
:user-edit-save :user-edit-save
:request-method :put)) :request-method :put))
:hx-swap "outerHTML swap:300ms" :hx-swap "outerHTML swap:300ms"
:hx-target-400 "#form-errors .error-content" :hx-target-400 "#form-errors .error-content"
:class "w-full"} :class "w-full"}
[:fieldset {:class "hx-disable"} [:fieldset {:class "hx-disable"}
(com/modal-card (com/modal-card
{} {}
[:div.flex [:div.p-2 "User"] [:p.ml-2.rounded.bg-gray-200.p-2.dark:bg-gray-600 (:user/name user)]] [:div.flex [:div.p-2 "User"] [:p.ml-2.rounded.bg-gray-200.p-2.dark:bg-gray-600 (:user/name user)]]
[:div.space-y-6 [:div.space-y-6
(com/hidden {:name "db/id" (com/hidden {:name "db/id"
:value (:db/id user)}) :value (:db/id user)})
(com/field {:label "Role"} (com/field {:label "Role"}
(com/select {:name "user/role" (com/select {:name "user/role"
:class "w-36" :class "w-36"
:autofocus true :autofocus true
:id "role" :id "role"
:value (name (:user/role user)) :value (name (:user/role user))
:options [["none" "None"] :options [["none" "None"]
["power-user" "Power user"] ["power-user" "Power user"]
["manager" "Manager"] ["manager" "Manager"]
["admin" "Admin"] ["admin" "Admin"]
["user" "User"]]})) ["user" "User"]]}))
(com/field {:label "Clients"} (com/field {:label "Clients"}
(com/typeahead {:name "user/clients" (com/typeahead {:name "user/clients"
:class "w-full" :class "w-full"
:multiple "multiple" :multiple "multiple"
:url (bidi/path-for ssr-routes/only-routes :url (bidi/path-for ssr-routes/only-routes
:company-search) :company-search)
:id "clients" :id "clients"
:value (map :value (map
(fn [client] (fn [client]
[(:db/id client) (:client/name client)]) [(:db/id client) (:client/name client)])
(:user/clients user)) (:user/clients user))
:size :small})) :size :small}))
[:div#form-errors [:span.error-content]] [:div#form-errors [:span.error-content]]]
(com/button {:color :primary :type "submit"} (com/validated-save-button {:errors []} ;; TODO
"Save")] "Save user"))]])
[:div])]]) :headers {"hx-trigger" "modalopen"})))
:headers {"hx-trigger" "modalopen"})))
(def key->handler (def key->handler
(apply-middleware-to-all-handlers (apply-middleware-to-all-handlers