summaryrefslogtreecommitdiff
path: root/webapps/ldapadmin
diff options
context:
space:
mode:
authorckonstanski <ckonstanski@pippiandcarlos.com>2020-12-22 09:19:28 -0700
committerckonstanski <ckonstanski@pippiandcarlos.com>2020-12-22 09:19:28 -0700
commite5947122bae1115b024be354ace6885cb360037e (patch)
tree0384007798115997a8e04517b1763685303253f6 /webapps/ldapadmin
parent0ed1cba1b39daaf8eef693233f081b455c88dece (diff)
updated to latest bootstrap
Diffstat (limited to 'webapps/ldapadmin')
-rw-r--r--webapps/ldapadmin/clojurescript/ldapadmin/src/core.cljs27
-rw-r--r--webapps/ldapadmin/site.lisp2
2 files changed, 13 insertions, 16 deletions
diff --git a/webapps/ldapadmin/clojurescript/ldapadmin/src/core.cljs b/webapps/ldapadmin/clojurescript/ldapadmin/src/core.cljs
index e7ef977..d7ac618 100644
--- a/webapps/ldapadmin/clojurescript/ldapadmin/src/core.cljs
+++ b/webapps/ldapadmin/clojurescript/ldapadmin/src/core.cljs
@@ -2,7 +2,8 @@
(:require-macros [hiccups.core :as hiccups :refer [html]])
(:require [ajax.core :refer [GET POST]]
[dommy.core :as dommy]
- [hiccups.runtime :as hiccupsrt]))
+ [hiccups.runtime :as hiccupsrt]
+ [clojure.string :as str]))
;; declarations
@@ -106,7 +107,7 @@
;; forms
-(hiccups/defhtml template-generic-form
+(hiccups/defhtml template-generic-form [jsonobj]
[:div {:id "form-errormsg"}]
[:form {:name (get jsonobj "name")
:id (get jsonobj "name")
@@ -207,8 +208,8 @@
[:ul {:class "nav nav-pills"}
(for [menuitem menuitems]
[:li {:class "nav-item"}
- [:a {:class (cond (= (clojure.string/upper-case (get menuitem "handler"))
- (clojure.string/upper-case (dommy/html (dommy/sel1 :#location))))
+ [:a {:class (cond (= (str/upper-case (get menuitem "handler"))
+ (str/upper-case (dommy/html (dommy/sel1 :#location))))
"nav-link active"
:else
"nav-link")
@@ -233,7 +234,7 @@
(notifications jsonobj)
(dommy/set-html! (dommy/sel1 :#body) (template-home jsonobj))))
-(defn render-home []
+(defn render-home
([]
(GET "/home" {:handler handler-home}))
([message errormsg]
@@ -279,8 +280,8 @@
(defn render-login-authenticate []
(POST "/login/authenticate" {:format :raw
- :params {:username (dommy/value (dommy/sel1 :#username))
- :pwd (dommy/value (dommy/sel1 :#pwd))}
+ :params {:dn (dommy/value (dommy/sel1 :#dn))
+ :password (dommy/value (dommy/sel1 :#password))}
:handler handler-login-authenticate}))
;; logout
@@ -426,10 +427,7 @@
;; inetorg-modify
(defn on-inetorg-modify-clicked [cn]
- (when (-> (jquery "#inetorg-modify-form")
- (.get "0")
- (.checkValidity))
- (render-inetorg-modify cn))
+ (render-inetorg-modify cn))
(hiccups/defhtml template-inetorg-modify [jsonobj]
(template-generic-form (get jsonobj "form")))
@@ -438,7 +436,7 @@
(let [jsonobj (js->clj (js/JSON.parse response))
jquery (js* "$")]
(auth-notifications jsonobj)
- (dommy/set-html! (dommy/sel1 :#modify-body) (template-inetrog-modify jsonobj))
+ (dommy/set-html! (dommy/sel1 :#modify-body) (template-inetorg-modify jsonobj))
(doseq [[name value] (get jsonobj "ldapUserValues")]
(dommy/set-value! (dommy/sel1 (keyword (str "#modify-" name))) value))
(.modal (jquery "#modify"))))
@@ -451,12 +449,12 @@
;; inetorg-modify-submit
(defn on-inetorg-modify-submit-clicked []
+ (.modal (jquery "#modify") "hide")
(render-inetorg-modify-submit))
(defn handler-inetorg-modify-submit [response]
(let [jsonobj (js->clj (js/JSON.parse response))]
(auth-notifications jsonobj)
- (notifications jsonobj)
(on-menu-clicked "/inetorg/view")))
(defn render-inetorg-modify-submit []
@@ -506,7 +504,6 @@
(defn handler-inetorg-delete-submit [response]
(let [jsonobj (js->clj (js/JSON.parse response))]
(auth-notifications jsonobj)
- (notifications jsonobj)
(on-menu-clicked "/inetorg/view")))
(defn render-inetorg-delete-submit [cn]
@@ -572,7 +569,7 @@
(on-menu-clicked (get jsonobj "location"))
(notifications jsonobj)))
-(defn goto-location []
+(defn goto-location [location]
(POST "/location" {:format :raw
:params {:location location}
:handler handler-location}))
diff --git a/webapps/ldapadmin/site.lisp b/webapps/ldapadmin/site.lisp
index 126c479..5deddf5 100644
--- a/webapps/ldapadmin/site.lisp
+++ b/webapps/ldapadmin/site.lisp
@@ -19,7 +19,7 @@
(:src "https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" :integrity "sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" :crossorigin "anonymous")
(:src "https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" :integrity "sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" :crossorigin "anonymous")))
((script :type "text/javascript" :src "/static/js/cljs/main.js")))
- ((body :onload ,(format nil "hworch.core.~a" ,onload-fn))
+ ((body :onload ,(format nil "ldapadmin.core.~a" ,onload-fn))
((div :class "container-fluid")
((div :class "row")
((div :class "col") "&nbsp;")