summaryrefslogtreecommitdiff
path: root/lisp/webapps
diff options
context:
space:
mode:
authorckonstanski <kostcarl@isu.edu>2026-08-07 19:11:49 -0600
committerckonstanski <kostcarl@isu.edu>2026-08-07 19:11:49 -0600
commit44f7a0a4da7cc45d638e4b64fbf47cb1afc51292 (patch)
treed2fa16893166cd0768ef738fbc37406b94b1aa41 /lisp/webapps
parent2fc46b8c30d92352ca2df49b001ec38817868905 (diff)
lots of react migration
Diffstat (limited to 'lisp/webapps')
-rw-r--r--lisp/webapps/generics.lisp12
-rw-r--r--lisp/webapps/resume/clojurescript/resume/src/resume/core.clj14
-rw-r--r--lisp/webapps/resume/clojurescript/resume/src/resume/core.cljs745
-rw-r--r--lisp/webapps/resume/site.lisp167
-rw-r--r--lisp/webapps/resume/static/css/stylesheet.css4
-rw-r--r--lisp/webapps/webapp-loader.lisp5
6 files changed, 443 insertions, 504 deletions
diff --git a/lisp/webapps/generics.lisp b/lisp/webapps/generics.lisp
deleted file mode 100644
index 33145ba..0000000
--- a/lisp/webapps/generics.lisp
+++ /dev/null
@@ -1,12 +0,0 @@
-;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10 -*-
-(declaim (optimize (speed 0) (safety 3) (debug 3)))
-
-(in-package :resume)
-
-(defgeneric get-site-file-path (webapp)
- (:documentation "Builds a full filesystem path to a webapp's site
-file."))
-
-(defgeneric get-pages-file-paths (webapp)
- (:documentation ""))
-
diff --git a/lisp/webapps/resume/clojurescript/resume/src/resume/core.clj b/lisp/webapps/resume/clojurescript/resume/src/resume/core.clj
index 54d3237..907021e 100644
--- a/lisp/webapps/resume/clojurescript/resume/src/resume/core.clj
+++ b/lisp/webapps/resume/clojurescript/resume/src/resume/core.clj
@@ -33,16 +33,16 @@
(defn ~(symbol (str "render-" component)) []
(ajax.core/GET ~(str "/resume/" component) {:handler ~(symbol (str "handler-" component))}))
- (hiccups/defhtml ~(symbol (str "template-" component "-view")) [jsonobj#]
- [:div {:style "text-align: right"}
- [:img {:src "/static/images/add.png"
- :style "cursor:pointer; cursor:hand"
- :onclick ~(str (namespace ::x) ".on_" component "_add_clicked()")}]]
- (generic-table ~component jsonobj#))
+ (defn ~(symbol (str "template-" component "-view")) [jsonobj#]
+ [:div
+ [:div {:style {:text-align "right"}}
+ [:img {:src "/static/images/add.png"
+ :onclick ~(str (namespace ::x) ".on_" component "_add_clicked()")}]]
+ (component-results-table ~component jsonobj#)])
(defn ~(symbol (str "handler-" component "-view")) [response#]
(let [jsonobj# (cljs.core/js->clj (js/JSON.parse response#))]
- (dommy/set-html! (dommy/sel1 :#content) (~(symbol (str "template-" component "-view")) jsonobj#))))
+ (-> (jquery "#content") (.html (~(symbol (str "template-" component "-view")) jsonobj#)))))
(defn ~(symbol (str "render-" component "-view")) []
(ajax.core/GET ~(str "/resume/" component "/view")
diff --git a/lisp/webapps/resume/clojurescript/resume/src/resume/core.cljs b/lisp/webapps/resume/clojurescript/resume/src/resume/core.cljs
index a569f6a..b399962 100644
--- a/lisp/webapps/resume/clojurescript/resume/src/resume/core.cljs
+++ b/lisp/webapps/resume/clojurescript/resume/src/resume/core.cljs
@@ -15,16 +15,37 @@
;; declarations
+(declare start-location)
+(declare reset-location)
+(declare reset-login-state)
+(declare reset-profile-state)
+(declare reset-profile-view-state)
+(declare reset-profile-modify-state)
+(declare reset-about-us-category-state)
+(declare reset-about-us-state)
+(declare reset-about-us-view-state)
+(declare reset-about-us-modify-state)
+(declare reset-contact-us-state)
+(declare reset-contact-us-view-state)
+(declare reset-messages-state)
+(declare reset-messages-results-state)
+(declare reset-users-state)
+(declare reset-users-view-state)
+(declare reset-users-add-state)
+(declare reset-users-register-state)
+(declare reset-users-register-form-state)
+(declare reset-users-register-submit-state)
+(declare reset-users-modify-state)
+(declare reset-resume-state)
(declare date-sql-to-pretty)
(declare markdown-to-html)
(declare reduce-checkboxes)
(declare form-fields-to-map)
(declare generic-component-add-modify)
-(declare generic-table)
+(declare highlight-row)
+(declare component-results-table)
(declare comp-app)
(declare start-render)
-(declare start-location)
-(declare reset-location)
(declare start)
(declare notifications)
(declare auth-notifications)
@@ -34,7 +55,7 @@
(declare handler-menu-user)
(declare render-menu)
(declare render-home)
-(declare template-login)
+(declare comp-login)
(declare handler-login)
(declare render-login)
(declare on-login-submit-clicked)
@@ -42,83 +63,83 @@
(declare render-login-authenticate)
(declare handler-logout)
(declare render-logout)
-(declare template-profile)
+(declare comp-profile)
(declare handler-profile)
(declare render-profile)
-(declare template-profile-view)
+(declare comp-profile-view)
(declare handler-profile-view)
(declare render-profile-view)
(declare on-profile-modify-clicked)
-(declare template-profile-modify)
+(declare comp-profile-modify)
(declare handler-profile-modify)
(declare render-profile-modify)
(declare on-profile-modify-submit-clicked)
(declare handler-profile-modify-submit)
(declare render-profile-modify-submit)
-(declare template-password)
+(declare comp-password)
(declare handler-password)
(declare render-password)
(declare on-password-submit-clicked)
(declare handler-password-submit)
(declare render-password-submit)
-(declare template-about-us)
+(declare comp-about-us)
(declare handler-about-us)
(declare render-lessons)
-(declare template-about-us-view)
+(declare comp-about-us-view)
(declare handler-about-us-view)
(declare render-about-us-view)
(declare on-about-us-modify-clicked)
-(declare template-about-us-modify)
+(declare comp-about-us-modify)
(declare handler-about-us-modify)
(declare render-about-us-modify)
(declare on-about-us-modify-submit-clicked)
(declare handler-about-us-modify-submit)
(declare render-about-us-modify-submit)
-(declare template-contact-us)
+(declare comp-contact-us)
(declare handler-contact-us)
(declare render-contact-us)
-(declare template-contact-us-view)
+(declare comp-contact-us-view)
(declare handler-contact-us-view)
(declare render-contact-us-view)
(declare on-contact-us-email-submit-clicked)
(declare handler-contact-us-email-submit)
(declare render-contact-us-email-submit)
-(declare template-messages)
+(declare comp-messages)
(declare handler-messages)
(declare render-messages)
(declare on-messages-mode-clicked)
-(declare template-messages-results)
+(declare comp-messages-results)
(declare handler-messages-results)
(declare render-messages-results)
(declare on-messages-mark)
(declare handler-messages-mark)
(declare render-messages-mark)
-(declare template-users)
+(declare comp-users)
(declare handler-users)
(declare render-users)
-(declare template-users-view)
+(declare comp-users-view)
(declare handler-users-view)
(declare render-users-view)
(declare on-users-add-clicked)
-(declare template-users-add)
+(declare comp-users-add)
(declare handler-users-add)
(declare render-users-add)
(declare on-users-add-submit-clicked)
(declare handler-users-add-submit)
(declare render-users-add-submit)
-(declare template-users-register)
+(declare comp-users-register)
(declare handler-users-register)
(declare render-users-register)
-(declare template-users-register-form)
+(declare comp-users-register-form)
(declare handler-users-register-form)
(declare handler-users-register-form-impl)
(declare render-users-register-form)
(declare on-users-register-submit-clicked)
-(declare template-users-register-submit)
+(declare comp-users-register-submit)
(declare handler-users-register-submit)
(declare render-users-register-submit)
(declare on-users-modify-clicked)
-(declare template-users-modify)
+(declare comp-users-modify)
(declare handler-users-modify)
(declare render-users-modify)
(declare on-users-modify-submit-clicked)
@@ -143,10 +164,96 @@
(def sql-formatter (time-format/formatter "yyyy-MM-dd HH:mm:ss"))
(def pretty-formatter (time-format/formatters :rfc822))
(def location-state (r/atom "/home"))
-(def about-us-category-state (r/atom "home"))
(def menu-main-state (r/atom []))
(def menu-user-state (r/atom []))
(def menu-user-label (r/atom "Guest User"))
+(def login-state (r/atom {}))
+(def profile-state (r/atom {}))
+(def profile-view-state (r/atom {}))
+(def profile-modify-state (r/atom {}))
+(def password-state (r/atom {}))
+(def about-us-category-state (r/atom "home"))
+(def about-us-state (r/atom {}))
+(def about-us-view-state (r/atom {}))
+(def about-us-modify-state (r/atom {}))
+(def contact-us-state (r/atom {}))
+(def contact-us-view-state (r/atom {}))
+(def messages-state (r/atom {}))
+(def messages-results-state (r/atom {}))
+(def users-state (r/atom {}))
+(def users-view-state (r/atom {}))
+(def users-add-state (r/atom {}))
+(def users-register-state (r/atom {}))
+(def users-register-form-state (r/atom {}))
+(def users-register-submit-state (r/atom {}))
+(def users-modify-state (r/atom {}))
+(def resume-state (r/atom {}))
+
+(defn reset-location [url]
+ (reset! location-state url))
+
+(defn reset-login-state [jsonobj]
+ (reset! login-state jsonobj))
+
+(defn reset-profile-state [jsonobj]
+ (reset! profile-state jsonobj))
+
+(defn reset-profile-view-state [jsonobj]
+ (reset! profile-view-state jsonobj))
+
+(defn reset-profile-modify-state [jsonobj]
+ (reset! profile-modify-state jsonobj))
+
+(defn reset-password-state [jsonobj]
+ (reset! password-state jsonobj))
+
+(defn reset-about-us-category-state [category]
+ (reset! about-us-category-state category))
+
+(defn reset-about-us-state [jsonobj]
+ (reset! about-us-state jsonobj))
+
+(defn reset-about-us-view-state [jsonobj]
+ (reset! about-us-view-state jsonobj))
+
+(defn reset-about-us-modify-state [jsonobj]
+ (reset! about-us-modify-state jsonobj))
+
+(defn reset-contact-us-state [jsonobj]
+ (reset! contact-us-state jsonobj))
+
+(defn reset-contact-us-view-state [jsonobj]
+ (reset! contact-us-view-state jsonobj))
+
+(defn reset-messages-state [jsonobj]
+ (reset! messages-state jsonobj))
+
+(defn reset-messages-results-state [jsonobj]
+ (reset! messages-results-state jsonobj))
+
+(defn reset-users-state [jsonobj]
+ (reset! users-state jsonobj))
+
+(defn reset-users-view-state [jsonobj]
+ (reset! users-view-state jsonobj))
+
+(defn reset-users-add-state [jsonobj]
+ (reset! users-add-state jsonobj))
+
+(defn reset-users-register-state [jsonobj]
+ (reset! users-register-state jsonobj))
+
+(defn reset-users-register-form-state [jsonobj]
+ (reset! users-register-form-state jsonobj))
+
+(defn reset-users-register-submit-state [jsonobj]
+ (reset! users-register-submit-state jsonobj))
+
+(defn reset-users-modify-state [jsonobj]
+ (reset! users-modify-state jsonobj))
+
+(defn reset-resume-state [component rec]
+ (swap! resume-state assoc (keyword component) rec))
;; helper functions
@@ -182,13 +289,13 @@
(hiccups/defhtml generic-component-add-modify [jsonobj]
(ck-form/template-generic-form (get jsonobj "form") (namespace ::x)))
-(defn generic-table [component jsonobj & [reverse-p]]
+(defn component-results-table [component jsonobj & [reverse-p]]
(let [results (get jsonobj "components")
keys (remove (fn [x]
(not (get (first results) x)))
(sort #(if reverse-p (compare %2 %1) (compare %1 %2)) (keys (first results))))]
(cond (empty? results)
- [:h5 {:style "text-align: center"} (str "No " component "s found.")]
+ [:h5 {:style {:text-align "center"}} (str "No " component "s found.")]
:else
[:div
[:p (str (count results) " " component "s.")]
@@ -196,20 +303,30 @@
[:thead
[:tr
(for [key (filter #(not (str/includes? % "_id")) keys)]
- [:th {:scope "col"} key])
+ [:th {:id (str "th-" component "-" key)
+ :key (str "th-" component "-" key)
+ :scope "col"}
+ key])
[:th {:scope "col"} "Mod"]
[:th {:scope "col"} "Del"]]]
- [:tbody
+ [:tbody {:id (str "tbody-" component)}
(for [rec results]
- [:tr
- (for [key (filter #(not (str/includes? % "_id")) keys)]
- [:td (str (get rec key))])
- [:td {:width "30"}
- [:img {:src "/static/images/modify.png"
- :onclick (str (namespace ::x) ".on_" component "_modify_clicked(" (get rec "id") ")")}]]
- [:td {:width "30"}
- [:img {:src "/static/images/delete.png"
- :onclick (str (namespace ::x) ".on_" component "_delete_clicked(" (get rec "id") ")")}]]])]]])))
+ (let [tr-attributes (atom {:id (str "tr-" component "-" (get rec "id"))
+ :key (str "tr-" component "-" (get rec "id"))
+ :on-click #(reset-resume-state component rec)})
+ selected-p (= (str (get rec "id"))
+ (str (get (get @resume-state (keyword component)) "id")))]
+ (when selected-p
+ (swap! tr-attributes assoc :class "selected"))
+ [:tr @tr-attributes
+ (for [key (filter #(not (str/includes? % "_id")) keys)]
+ [:td (str (get rec key))])
+ [:td {:width "30"}
+ [:img {:src "/static/images/edit.png"
+ :onclick (str (namespace ::x) ".on_" component "_modify_clicked(" (get rec "id") ")")}]]
+ [:td {:width "30"}
+ [:img {:src "/static/images/delete.png"
+ :onclick (str (namespace ::x) ".on_" component "_delete_clicked(" (get rec "id") ")")}]]]))]]])))
;; body
@@ -226,7 +343,18 @@
[comp-menu-main]
[ck-notifications/comp-errormsg]
[ck-notifications/comp-message]
- [:div {:id "body"}]
+ [comp-login]
+ [comp-about-us]
+ [comp-profile]
+ [comp-password]
+ ;; [comp-contactinfo]
+ ;; [comp-education]
+ ;; [comp-language]
+ ;; [comp-skills]
+ ;; [comp-jobs]
+ [comp-contact-us]
+ [comp-messages]
+ [comp-users]
[:div {:id "footer"}
[:hr]
"Carlos Konstanski (970) 294-9708"
@@ -247,12 +375,6 @@
:else
(goto-location @location-state)))
-(defn reset-location [url]
- (reset! location-state url))
-
-(defn reset-about-us-category [category]
- (reset! about-us-category-state category))
-
(defn ^:dev/after-load start
([]
(start-render)
@@ -324,16 +446,17 @@
;; login
-(hiccups/defhtml template-login [jsonobj]
- [:h3 {:style "text-align: center"} (get jsonobj "title")]
- (ck-form/template-generic-form (get jsonobj "form") (namespace ::x))
- [:div {:style "text-align: center"}
- [:a {:href ""} "Forgot password?"]])
+(defn comp-login []
+ [:div {:style {:display (cond (or (= @location-state "/login")) "block" :else "none")}}
+ [:h3 {:style {:text-align "center"}} (get @login-state "title")]
+ [:div {:dangerouslySetInnerHTML (r/unsafe-html (ck-form/template-generic-form (get @login-state "form") (namespace ::x)))}]
+ [:div {:style {:text-align "center"}}
+ [:a {:href ""} "Forgot password?"]]])
(defn handler-login [response]
(let [jsonobj (js->clj (js/JSON.parse response))]
- (notifications jsonobj)
- (dommy/set-html! (dommy/sel1 :#body) (template-login jsonobj))))
+ (reset-login-state jsonobj)
+ (notifications jsonobj)))
(defn render-login []
(GET "/login" {:handler handler-login}))
@@ -366,45 +489,45 @@
;; logout
(defn handler-logout [response]
- (let [jsonobj (js->clj (js/JSON.parse response))]
- (render-home "You are now logged out" "")
- (reset-location "/home")
- (render-menu)))
+ (render-home "You are now logged out" "")
+ (reset-location "/home")
+ (render-menu))
(defn render-logout []
(GET "/logout" {:handler handler-logout}))
;; profile
-(hiccups/defhtml template-profile [jsonobj]
- [:h3 {:style "text-align: center"} (get jsonobj "title")]
- [:div {:id "content"}]
- [:div {:id "modify"
- :class "modal fade"
- :role "dialog"
- :tabindex "-1"}
- [:div {:class "modal-dialog modal-lg"}
- [:div {:class "modal-content"}
- [:div {:class "modal-header"}
- [:h5 {:class "modal-title"} "Profile - Modify"]
- [:button {:type "button"
- :class "close"
- :data-dismiss "modal"}
- "&times;"]]
- [:div {:id "modify-body"
- :class "modal-body"
- :style "height: 460px;"}]
- [:div {:class "modal-footer"}
- [:button {:type "submit"
- :class "btn btn-danger btn-default"
- :data-dismiss "modal"}
- [:span {:class "glyphicon glyphicon-remove"}]
- "Cancel"]]]]])
+(defn comp-profile []
+ [:div {:style {:display (cond (or (= @location-state "/profile")) "block" :else "none")}}
+ [:h3 {:style {:text-align "center"}} (get @profile-state "title")]
+ [comp-profile-view]
+ [:div {:id "modify-profile"
+ :class "modal fade"
+ :role "dialog"
+ :tab-index "-1"}
+ [:div {:class "modal-dialog modal-lg"}
+ [:div {:class "modal-content"}
+ [:div {:class "modal-header"}
+ [:h5 {:class "modal-title"} "Profile - Modify"]
+ [:button {:type "button"
+ :class "close"
+ :data-dismiss "modal"}
+ "&times;"]]
+ [:div {:class "modal-body"
+ :style {:height "460px"}}
+ [comp-profile-modify]]
+ [:div {:class "modal-footer"}
+ [:button {:type "submit"
+ :class "btn btn-danger btn-default"
+ :data-dismiss "modal"}
+ [:span {:class "glyphicon glyphicon-remove"}]
+ "Cancel"]]]]]])
(defn handler-profile [response]
(let [jsonobj (js->clj (js/JSON.parse response))]
+ (reset-profile-state jsonobj)
(notifications jsonobj)
- (dommy/set-html! (dommy/sel1 :#body) (template-profile jsonobj))
(render-profile-view)))
(defn render-profile []
@@ -412,31 +535,43 @@
;; profile-view
-(hiccups/defhtml template-profile-view [jsonobj]
- [:div {:style "text-align: right"}
- [:img {:src "/static/images/edit.png"
- :style "cursor:pointer; cursor:hand"
- :onclick (str (namespace ::x) ".on_profile_modify_clicked()")}]]
- [:div {:class "container"}
- [:div {:class "row"}
- [:div {:class "col" :style "text-align: right"} "Username:"]
- [:div {:class "col-10"} (get jsonobj "username")]]
- [:div {:class "row"}
- [:div {:class "col" :style "text-align: right"} "First Name:"]
- [:div {:class "col-10"} (get jsonobj "first_name")]]
- [:div {:class "row"}
- [:div {:class "col" :style "text-align: right"} "Last Name:"]
- [:div {:class "col-10"} (get jsonobj "last_name")]]
- [:div {:class "row"}
- [:div {:class "col" :style "text-align: right"} "Email:"]
- [:div {:class "col-10"} (get jsonobj "email")]]
- [:div {:class "row"}
- [:div {:class "col" :style "text-align: right"} "Phone:"]
- [:div {:class "col-10"} (get jsonobj "phone")]]])
+(defn comp-profile-view []
+ [:div
+ [:div {:style {:text-align "right"}}
+ [:img {:src "/static/images/edit.png"
+ :on-click #(on-profile-modify-clicked)}]]
+ (for [item (get @profile-view-state "items")]
+ [:div {:class "container"}
+ [:div {:class "row"}
+ [:div {:class "col" :style {:text-align "right"}} "Username:"]
+ [:div {:class "col-10"
+ :key (str "profile-view-username-" (get item "id"))}
+ (get item "username")]]
+ [:div {:class "row"}
+ [:div {:class "col" :style {:text-align "right"}} "First Name:"]
+ [:div {:class "col-10"
+ :key (str "profile-view-first_name-" (get item "id"))}
+ (get item "first_name")]]
+ [:div {:class "row"}
+ [:div {:class "col" :style {:text-align "right"}} "Last Name:"]
+ [:div {:class "col-10"
+ :key (str "profile-view-last_name-" (get item "id"))}
+ (get item "last_name")]]
+ [:div {:class "row"}
+ [:div {:class "col" :style {:text-align "right"}} "Email:"]
+ [:div {:class "col-10"
+ :key (str "profile-view-email-" (get item "id"))}
+ (get item "email")]]
+ [:div {:class "row"}
+ [:div {:class "col" :style {:text-align "right"}} "Phone:"]
+ [:div {:class "col-10"
+ :key (str "profile-view-phone-" (get item "id"))}
+ (get item "phone")]]])])
(defn handler-profile-view [response]
(let [jsonobj (js->clj (js/JSON.parse response))]
- (dommy/set-html! (dommy/sel1 :#content) (template-profile-view jsonobj))))
+ (reset-profile-view-state jsonobj)
+ (auth-notifications jsonobj)))
(defn render-profile-view []
(GET "/profile/view" {:handler handler-profile-view}))
@@ -446,14 +581,14 @@
(defn on-profile-modify-clicked []
(render-profile-modify))
-(hiccups/defhtml template-profile-modify [jsonobj]
- (ck-form/template-generic-form (get jsonobj "form") (namespace ::x)))
+(defn comp-profile-modify []
+ [:div {:dangerouslySetInnerHTML (r/unsafe-html (ck-form/template-generic-form (get @profile-modify-state "form") (namespace ::x)))}])
(defn handler-profile-modify [response]
(let [jsonobj (js->clj (js/JSON.parse response))]
(auth-notifications jsonobj)
- (dommy/set-html! (dommy/sel1 :#modify-body) (template-profile-modify jsonobj))
- (.modal (jquery "#modify"))))
+ (reset-profile-modify-state jsonobj)
+ (.modal (jquery "#modify-profile"))))
(defn render-profile-modify []
(POST "/profile/modify" {:handler handler-profile-modify}))
@@ -464,7 +599,7 @@
(when (-> (jquery "#profile-modify-form")
(.get "0")
(.checkValidity))
- (.modal (jquery "#modify") "hide")
+ (.modal (jquery "#modify-profile") "hide")
(render-profile-modify-submit)))
(defn handler-profile-modify-submit [response]
@@ -475,24 +610,20 @@
(defn render-profile-modify-submit []
(POST "/profile/modify/submit"
{:format :raw
- :params {:id (dommy/value (dommy/sel1 :#id))
- :username (dommy/value (dommy/sel1 :#username))
- :first_name (dommy/value (dommy/sel1 :#first_name))
- :last_name (dommy/value (dommy/sel1 :#last_name))
- :email (dommy/value (dommy/sel1 :#email))
- :phone (dommy/value (dommy/sel1 :#phone))}
+ :params (form-fields-to-map "#profile-modify-form :input")
:handler handler-profile-modify-submit}))
;; password
-(hiccups/defhtml template-password [jsonobj]
- [:h3 {:style "text-align: center"} (get jsonobj "title")]
- (ck-form/template-generic-form (get jsonobj "form") (namespace ::x)))
+(defn comp-password [jsonobj]
+ [:div {:style {:display (cond (or (= @location-state "/password")) "block" :else "none")}}
+ [:h3 {:style {:text-align "center"}} (get @password-state "title")]
+ [:div {:dangerouslySetInnerHTML (r/unsafe-html (ck-form/template-generic-form (get @password-state "form") (namespace ::x)))}]])
(defn handler-password [response]
(let [jsonobj (js->clj (js/JSON.parse response))]
(notifications jsonobj)
- (dommy/set-html! (dommy/sel1 :#body) (template-password jsonobj))))
+ (reset-password-state jsonobj)))
(defn render-password []
(GET "/password" {:handler handler-password}))
@@ -513,44 +644,43 @@
(defn render-password-submit []
(POST "/password/submit"
{:format :raw
- :params {:id (dommy/value (dommy/sel1 :#id))
- :pwd (dommy/value (dommy/sel1 :#pwd))
- :pwd2 (dommy/value (dommy/sel1 :#pwd2))}
+ :params (form-fields-to-map "#password-form :input")
:handler handler-password-submit}))
;; about-us (home)
-(hiccups/defhtml template-about-us [jsonobj]
- [:h1 {:style "text-align: center"}
- (cond (= @about-us-category-state "home") "Home")]
- [:div {:id "content"}]
- [:div {:id "modify"
- :class "modal fade"
- :role "dialog"
- :tabindex "-1"}
- [:div {:class "modal-dialog modal-lg"}
- [:div {:class "modal-content"}
- [:div {:class "modal-header"}
- [:h5 [:span {:id "modify-title"}]]
- [:button {:type "button"
- :class "close"
- :data-dismiss "modal"}
- "&times;"]]
- [:div {:id "modify-body"
- :class "modal-body"
- :style "height: 460px;"}]
- [:div {:class "modal-footer"}
- [:button {:type "submit"
- :class "btn btn-danger btn-default"
- :data-dismiss "modal"}
- [:span {:class "glyphicon glyphicon-remove"}]
- "Cancel"]]]]])
+(defn comp-about-us []
+ [:div {:style {:display (cond (or (= @location-state "/home")) "block" :else "none")}}
+ [:h1 {:style {:text-align "center"}}
+ (cond (= @about-us-category-state "home") "Home")]
+ [comp-about-us-view]
+ [:div {:id "modify-about-us"
+ :class "modal fade"
+ :role "dialog"
+ :tab-index "-1"}
+ [:div {:class "modal-dialog modal-lg"}
+ [:div {:class "modal-content"}
+ [:div {:class "modal-header"}
+ [:h5 (str (str (cond (= @about-us-category-state "home") "Home") " - Modify"))]
+ [:button {:type "button"
+ :class "close"
+ :data-dismiss "modal"}
+ "&times;"]]
+ [:div {:class "modal-body"
+ :style {:height "460px"}}
+ [comp-about-us-modify]]
+ [:div {:class "modal-footer"}
+ [:button {:type "submit"
+ :class "btn btn-danger btn-default"
+ :data-dismiss "modal"}
+ [:span {:class "glyphicon glyphicon-remove"}]
+ "Cancel"]]]]]])
(defn handler-about-us [response]
(let [jsonobj (js->clj (js/JSON.parse response))]
- (reset-about-us-category (get jsonobj "category"))
+ (reset-about-us-category-state (get jsonobj "category"))
+ (reset-about-us-state jsonobj)
(notifications jsonobj)
- (dommy/set-html! (dommy/sel1 :#body) (template-about-us jsonobj))
(render-about-us-view)))
(defn render-home
@@ -565,18 +695,17 @@
;; about-us-view
-(hiccups/defhtml template-about-us-view [jsonobj]
- (when (get jsonobj "adminP")
- [:div {:style "text-align: right;"}
- [:img {:src "/static/images/edit.png"
- :style "cursor:pointer; cursor:hand"
- :onclick (str (namespace ::x) ".on_about_us_modify_clicked()")}]])
- [:div {:id "markdown"}])
+(defn comp-about-us-view []
+ [:div
+ (when (get @about-us-view-state "adminP")
+ [:div {:style {:text-align "right"}}
+ [:img {:src "/static/images/edit.png"
+ :on-click #(on-about-us-modify-clicked)}]])
+ [:div {:dangerouslySetInnerHTML (r/unsafe-html (markdown-to-html (get @about-us-view-state "content")))}]])
(defn handler-about-us-view [response]
(let [jsonobj (js->clj (js/JSON.parse response))]
- (dommy/set-html! (dommy/sel1 :#content) (template-about-us-view jsonobj))
- (dommy/set-html! (dommy/sel1 :#markdown) (markdown-to-html (get jsonobj "content")))))
+ (reset-about-us-view-state jsonobj)))
(defn render-about-us-view []
(GET (str "/" @about-us-category-state "/view")
@@ -587,17 +716,14 @@
(defn on-about-us-modify-clicked []
(render-about-us-modify))
-(hiccups/defhtml template-about-us-modify [jsonobj]
- (ck-form/template-generic-form (get jsonobj "form") (namespace ::x)))
+(defn comp-about-us-modify []
+ [:div {:dangerouslySetInnerHTML (r/unsafe-html (ck-form/template-generic-form (get @about-us-modify-state "form") (namespace ::x)))}])
(defn handler-about-us-modify [response]
(let [jsonobj (js->clj (js/JSON.parse response))]
(auth-notifications jsonobj)
- (dommy/set-html! (dommy/sel1 :#modify-title)
- (str (cond (= @about-us-category-state "home") "Home")
- " - Modify"))
- (dommy/set-html! (dommy/sel1 :#modify-body) (template-about-us-modify jsonobj))
- (.modal (jquery "#modify"))))
+ (reset-about-us-modify-state jsonobj)
+ (.modal (jquery "#modify-about-us"))))
(defn render-about-us-modify []
(POST (str "/" @about-us-category-state "/modify")
@@ -609,14 +735,13 @@
(when (-> (jquery "#about-us-modify-form")
(.get "0")
(.checkValidity))
- (.modal (jquery "#modify") "hide")
+ (.modal (jquery "#modify-about-us") "hide")
(render-about-us-modify-submit)))
(defn handler-about-us-modify-submit [response]
(let [jsonobj (js->clj (js/JSON.parse response))]
- (auth-notifications jsonobj)
- (dommy/set-html! (dommy/sel1 :#content) (template-about-us-view jsonobj))
- (dommy/set-html! (dommy/sel1 :#markdown) (markdown-to-html (get jsonobj "content")))))
+ (reset-about-us-view-state jsonobj)
+ (auth-notifications jsonobj)))
(defn render-about-us-modify-submit []
(POST (str "/" @about-us-category-state "/modify/submit")
@@ -626,25 +751,30 @@
;; contact-us
-(hiccups/defhtml template-contact-us [jsonobj]
- [:h1 {:style "text-align: center"} "Reach out to me by filling out the form."]
- [:div {:id "content"}]
- [:table {:width "100%"}
- [:tr
- [:td {:style "width: 100%; text-align: center;"}
- [:h3 "Located on the edge of the ISU campus!"]]]
- [:tr
- [:td {:style "width: 100%; text-align: center;"}
- [:iframe {:src "https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3225.263770603599!2d-112.4266916!3d42.8635091!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x53554f343c440407%3A0xf13bf897ecb4f7e0!2sBogenherr%20Violin%20and%20Viola%20Studio!5e1!3m2!1sen!2sus!4v1783097048097!5m2!1sen!2sus"
- :style "width: 600px; height: 450px; border: 0px;"
- :allowfullscreen ""
- :loading "lazy"
- :referrerpolicy "strict-origin-when-cross-origin"}]]]])
+(defn comp-contact-us []
+ [:div {:style {:display (cond (or (= @location-state "/contact-us")) "block" :else "none")}}
+ [:h3 {:style {:text-align "center"}} "Reach out to me by filling out the form."]
+ [comp-contact-us-view]
+ [:table {:width "100%"}
+ [:tr
+ [:td {:style {:width "100%"
+ :text-align "center"}}
+ [:h3 "Located on the edge of the ISU campus!"]]]
+ [:tr
+ [:td {:style {:width "100%"
+ :text-align "center"}}
+ [:iframe {:src "https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3225.263770603599!2d-112.4266916!3d42.8635091!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x53554f343c440407%3A0xf13bf897ecb4f7e0!2sBogenherr%20Violin%20and%20Viola%20Studio!5e1!3m2!1sen!2sus!4v1783097048097!5m2!1sen!2sus"
+ :style {:width "600px"
+ :height "450px"
+ :border "0px"}
+ :allowfullscreen ""
+ :loading "lazy"
+ :referrerpolicy "strict-origin-when-cross-origin"}]]]]])
(defn handler-contact-us [response]
(let [jsonobj (js->clj (js/JSON.parse response))]
(notifications jsonobj)
- (dommy/set-html! (dommy/sel1 :#body) (template-contact-us jsonobj))
+ (reset-contact-us-state jsonobj)
(render-contact-us-view)))
(defn render-contact-us []
@@ -652,13 +782,13 @@
;; contact-us-view
-(hiccups/defhtml template-contact-us-view [jsonobj]
- (ck-form/template-generic-form (get jsonobj "form") (namespace ::x)))
+(defn comp-contact-us-view []
+ [:div {:dangerouslySetInnerHTML (r/unsafe-html (ck-form/template-generic-form (get @contact-us-view-state "form") (namespace ::x)))}])
(defn handler-contact-us-view [response]
(let [jsonobj (js->clj (js/JSON.parse response))]
(notifications jsonobj)
- (dommy/set-html! (dommy/sel1 :#content) (template-contact-us-view jsonobj))))
+ (reset-contact-us-view-state jsonobj)))
(defn render-contact-us-view []
(GET "/contact-us/view" {:handler handler-contact-us-view}))
@@ -677,26 +807,21 @@
(defn render-contact-us-email-submit []
(POST "/contact-us/email"
{:format :raw
- :params {:first_name (dommy/value (dommy/sel1 :#first_name))
- :last_name (dommy/value (dommy/sel1 :#last_name))
- :email (dommy/value (dommy/sel1 :#email))
- :phone (dommy/value (dommy/sel1 :#phone))
- :comments (dommy/value (dommy/sel1 :#comments))}
+ :params (form-fields-to-map "#contact-us-form :input")
:handler handler-contact-us-email-submit}))
;; messages
-(hiccups/defhtml template-messages [jsonobj]
- [:h3 {:style "text-align: center"} (get jsonobj "title")]
- (ck-form/template-generic-form (get jsonobj "form") (namespace ::x))
- [:div {:id "results"}])
+(defn comp-messages []
+ [:div {:style {:display (cond (or (= @location-state "/messages")) "block" :else "none")}}
+ [:h3 {:style {:text-align "center"}} (get @messages-state "title")]
+ [:div {:dangerouslySetInnerHTML (r/unsafe-html (ck-form/template-generic-form (get @messages-state "form") (namespace ::x)))}]
+ [comp-messages-results]])
(defn handler-messages [response]
(let [jsonobj (js->clj (js/JSON.parse response))]
(notifications jsonobj)
- (dommy/set-html! (dommy/sel1 :#body) (template-messages jsonobj))
- (when (not (empty? (dommy/value (dommy/sel1 :#read))))
- (render-messages-results))))
+ (reset-messages-state jsonobj)))
(defn render-messages []
(GET "/messages" {:handler handler-messages}))
@@ -707,53 +832,51 @@
(dommy/set-value! (dommy/sel1 :#read) read)
(render-messages-results))
-(hiccups/defhtml template-messages-results [jsonobj]
- (let [results (get jsonobj "results")
+(defn comp-messages-results []
+ (let [results (get @messages-results-state "results")
keys (remove (fn [x]
(not (get (first results) x)))
(keys (first results)))]
- (cond (empty? results)
- [:h5 {:style "text-align: center"} "No results found."]
- :else
- [:table {:class "table table-hover"}
- [:thead
- [:tr
- (for [key keys]
- [:th key])
- [:th
- (str "Mark " (cond (= (dommy/value (dommy/sel1 :#read)) "read")
- "unread"
- :else
- "read"))]]]
- [:tbody
- (for [rec results]
- (let [onclick "void()"]
- [:tr
- (for [key keys]
- [:td {:onclick onclick} (get rec key)])
- [:td [:img {:src (str "/static/images/"
- (cond (= (dommy/value (dommy/sel1 :#read)) "read")
- "edit-undo.png"
- :else
- "edit-redo.png"))
- :style "cursor: pointer; cursor: hand"
- :onclick (str (namespace ::x)
- ".on_messages_mark("
- (cond (= (dommy/value (dommy/sel1 :#read)) "read")
- "'unread'"
- :else
- "'read'")
- "," (get rec "id") ")")}]]]))]])))
+ [:div
+ (cond (empty? results)
+ [:h5 {:style {:text-align "center"}} "No results found."]
+ :else
+ [:table {:class "table table-hover"}
+ [:thead
+ [:tr
+ (for [key keys]
+ [:th key])
+ [:th
+ (str "Mark " (cond (= (dommy/value (dommy/sel1 :#read)) "read")
+ "unread"
+ :else
+ "read"))]]]
+ [:tbody
+ (for [rec results]
+ (let [onclick "void()"]
+ [:tr
+ (for [key keys]
+ [:td {:onclick onclick} (get rec key)])
+ [:td [:img {:src (str "/static/images/"
+ (cond (= (dommy/value (dommy/sel1 :#read)) "read")
+ "edit-undo.png"
+ :else
+ "edit-redo.png"))
+ :on-click #(on-messages-mark((cond (= (dommy/value (dommy/sel1 :#read)) "read")
+ "'unread'"
+ :else
+ "'read'")
+ (get rec "id")))}]]]))]])]))
(defn handler-messages-results [response]
(let [jsonobj (js->clj (js/JSON.parse response))]
(auth-notifications jsonobj)
- (dommy/set-html! (dommy/sel1 :#results) (template-messages-results jsonobj))))
+ (reset-messages-results-state jsonobj)))
(defn render-messages-results []
(POST "/messages/results"
{:format :raw
- :params {:read (dommy/value (dommy/sel1 :#read))}
+ :params (form-fields-to-map "#messages-select-mode-form :input")
:handler handler-messages-results}))
;; messages-mark
@@ -769,41 +892,42 @@
(defn render-messages-mark [read id]
(POST "/messages/mark"
{:format :raw
- :params {:read read
- :id id}
+ :params (form-fields-to-map "#messages-select-mode-form :input")
:handler handler-messages-mark}))
;; users
-(hiccups/defhtml template-users [jsonobj]
- [:h3 {:style "text-align: center"} (get jsonobj "title")]
- [:div {:id "content"}]
- [:div {:id "modify"
- :class "modal fade"
- :role "dialog"
- :tabindex "-1"}
- [:div {:class "modal-dialog modal-lg"}
- [:div {:class "modal-content"}
- [:div {:class "modal-header"}
- [:h5 [:span {:id "modify-title"}]]
- [:button {:type "button"
- :class "close"
- :data-dismiss "modal"}
- "&times;"]]
- [:div {:id "modify-body"
- :class "modal-body"
- :style "height: 450px;"}]
- [:div {:class "modal-footer"}
- [:button {:type "submit"
- :class "btn btn-danger btn-default"
- :data-dismiss "modal"}
- [:span {:class "glyphicon glyphicon-remove"}]
- "Cancel"]]]]])
+(defn comp-users []
+ [:div {:style {:display (cond (or (= @location-state "/users")) "block" :else "none")}}
+ [:h3 {:style {:text-align "center"}} (get @users-state "title")]
+ [comp-users-view]
+ [:div {:id "modify-users"
+ :class "modal fade"
+ :role "dialog"
+ :tab-index "-1"}
+ [:div {:class "modal-dialog modal-lg"}
+ [:div {:class "modal-content"}
+ [:div {:class "modal-header"}
+ [:h5 "Users - Modify"]
+ [:button {:type "button"
+ :class "close"
+ :data-dismiss "modal"}
+ "&times;"]]
+ [:div {:class "modal-body"
+ :style {:height "460px"}}
+ ;;[comp-users-modify]
+ ]
+ [:div {:class "modal-footer"}
+ [:button {:type "submit"
+ :class "btn btn-danger btn-default"
+ :data-dismiss "modal"}
+ [:span {:class "glyphicon glyphicon-remove"}]
+ "Cancel"]]]]]])
(defn handler-users [response]
(let [jsonobj (js->clj (js/JSON.parse response))]
(notifications jsonobj)
- (dommy/set-html! (dommy/sel1 :#body) (template-users jsonobj))
+ (reset-users-state jsonobj)
(render-users-view)))
(defn render-users []
@@ -811,42 +935,46 @@
;; users-view
-(hiccups/defhtml template-users-view [jsonobj]
- [:div {:style "text-align: right"}
- [:img {:src "/static/images/add.png"
- :style "cursor:pointer; cursor:hand"
- :onclick (str (namespace ::x) ".on_users_add_clicked()")}]]
- [:table {:class "table table-striped table-hover table-sm"}
- [:thead
- [:tr
- [:th {:scope "col"} "Active?"]
- [:th {:scope "col"} "Last Name"]
- [:th {:scope "col"} "First Name"]
- [:th {:scope "col"} "Username"]
- [:th {:scope "col"} "Email"]
- [:th {:scope "col"} "Phone"]
- [:th {:scope "col"} "Del"]]]
- [:tbody
- (for [user (get jsonobj "users")]
- (let [onclick (str (namespace ::x) ".on_users_modify_clicked(" (get user "id") ")")
- toggle-active (str (namespace ::x) ".on_users_toggle_active_clicked(" (get user "id") ")")]
- [:tr
- [:td [:img {:src (cond (get user "active")
- "/static/images/yes.png"
- :else
- "/static/images/no.png")
- :onclick toggle-active}]]
- [:td {:onclick onclick} (get user "last_name")]
- [:td {:onclick onclick} (get user "first_name")]
- [:td {:onclick onclick} (get user "username")]
- [:td {:onclick onclick} (get user "email")]
- [:td {:onclick onclick} (get user "phone")]
- [:td [:img {:src "/static/images/delete.png"
- :onclick (str (namespace ::x) ".on_users_delete_clicked(" (get user "id") ", '" (get user "first_name") "', '" (get user "last_name") "')")}]]]))]])
+(defn comp-users-view []
+ [:div
+ [:div {:style {:text-align "right"}}
+ [:img {:src "/static/images/add.png"
+ :on-click #(on-users-add-clicked)}]]
+ [:table {:class "table table-striped table-hover table-sm"}
+ [:thead
+ [:tr
+ [:th {:scope "col"} "Active?"]
+ [:th {:scope "col"} "Last Name"]
+ [:th {:scope "col"} "First Name"]
+ [:th {:scope "col"} "Username"]
+ [:th {:scope "col"} "Email"]
+ [:th {:scope "col"} "Phone"]
+ [:th {:scope "col"} "Mod"]
+ [:th {:scope "col"} "Del"]]]
+ [:tbody
+ (for [user (get @users-view-state "users")]
+ [:tr
+ [:td [:img {:src (cond (get user "active")
+ "/static/images/yes.png"
+ :else
+ "/static/images/no.png")
+ :on-click #(on-users-toggle-active-clicked (get user "id"))}]]
+ [:td (get user "last_name")]
+ [:td (get user "first_name")]
+ [:td (get user "username")]
+ [:td (get user "email")]
+ [:td (get user "phone")]
+ [:td {:width "30"}
+ [:img {:src "/static/images/edit.png"
+ :on-click #(on-users-modify-clicked (get user "id"))}]]
+ [:td {:width "30"}
+ [:img {:src "/static/images/delete.png"
+ :on-click #(on-users-delete-clicked (get user "id"))}]]])]]])
(defn handler-users-view [response]
(let [jsonobj (js->clj (js/JSON.parse response))]
- (dommy/set-html! (dommy/sel1 :#content) (template-users-view jsonobj))))
+ (notifications jsonobj)
+ (reset-users-view-state jsonobj)))
(defn render-users-view []
(GET "/users/view" {:handler handler-users-view}))
@@ -856,15 +984,14 @@
(defn on-users-add-clicked []
(render-users-add))
-(hiccups/defhtml template-users-add [jsonobj]
- (ck-form/template-generic-form (get jsonobj "form") (namespace ::x)))
+(defn comp-users-add []
+ [:div {:dangerouslySetInnerHTML (r/unsafe-html (ck-form/template-generic-form (get @users-add-state "form") (namespace ::x)))}])
(defn handler-users-add [response]
(let [jsonobj (js->clj (js/JSON.parse response))]
(auth-notifications jsonobj)
- (dommy/set-html! (dommy/sel1 :#modify-title) (get jsonobj "title"))
- (dommy/set-html! (dommy/sel1 :#modify-body) (template-users-add jsonobj))
- (.modal (jquery "#modify"))))
+ (reset-users-add-state jsonobj)
+ (.modal (jquery "#modify-users"))))
(defn render-users-add []
(POST "/users/add" {:handler handler-users-add}))
@@ -875,7 +1002,7 @@
(when (-> (jquery "#users-add-form")
(.get "0")
(.checkValidity))
- (.modal (jquery "#modify") "hide")
+ (.modal (jquery "#modify-users") "hide")
(render-users-add-submit)))
(defn handler-users-add-submit [response]
@@ -895,7 +1022,7 @@
;; users-register
(hiccups/defhtml template-users-register [jsonobj]
- [:h3 {:style "text-align: center"} (get jsonobj "title")]
+ [:h3 {:style {:style "text-align: center"}} (get jsonobj "title")]
[:div {:id "content"}])
(defn handler-users-register [response]
@@ -979,7 +1106,7 @@
(auth-notifications jsonobj)
(dommy/set-html! (dommy/sel1 :#modify-title) (get jsonobj "title"))
(dommy/set-html! (dommy/sel1 :#modify-body) (template-users-modify jsonobj))
- (.modal (jquery "#modify"))))
+ (.modal (jquery "#modify-users"))))
(defn render-users-modify [id]
(POST "/users/modify"
@@ -993,7 +1120,7 @@
(when (-> (jquery "#users-modify-form")
(.get "0")
(.checkValidity))
- (.modal (jquery "#modify") "hide")
+ (.modal (jquery "#modify-users") "hide")
(render-users-modify-submit)))
(defn handler-users-modify-submit [response]
@@ -1004,13 +1131,7 @@
(defn render-users-modify-submit []
(POST "/users/modify/submit"
{:format :raw
- :params {:id (dommy/value (dommy/sel1 :#id))
- :role_groups (reduce-checkboxes "[id^='chk_']")
- :username (dommy/value (dommy/sel1 :#username))
- :first_name (dommy/value (dommy/sel1 :#first_name))
- :last_name (dommy/value (dommy/sel1 :#last_name))
- :email (dommy/value (dommy/sel1 :#email))
- :phone (dommy/value (dommy/sel1 :#phone))}
+ :params (form-fields-to-map "#users-modify-form :input")
:handler handler-users-modify-submit}))
;; users-toggle-active
@@ -1031,8 +1152,8 @@
;; users-delete
-(defn on-users-delete-clicked [id first-name last-name]
- (when (js/confirm (str "Are you sure you want to delete " first-name " " last-name "? This action cannot be undone."))
+(defn on-users-delete-clicked [id]
+ (when (js/confirm (str "Are you sure you want to delete " id "? This action cannot be undone."))
(render-users-delete id)))
(defn handler-users-delete [response]
@@ -1050,7 +1171,7 @@
(hiccups/defhtml template-resume [jsonobj]
[:h3 {:style "text-align: center"} (get jsonobj "title")]
[:div {:id "content"}]
- [:div {:id "modify"
+ [:div {:id "modify-resume"
:class "modal fade"
:role "dialog"
:tabindex "-1"}
@@ -1072,8 +1193,6 @@
[:span {:class "glyphicon glyphicon-remove"}]
"Cancel"]]]]])
-;; components
-
(define-resume-component "resume")
(define-resume-component "contactinfo")
(define-resume-component "education")
diff --git a/lisp/webapps/resume/site.lisp b/lisp/webapps/resume/site.lisp
deleted file mode 100644
index d5954a4..0000000
--- a/lisp/webapps/resume/site.lisp
+++ /dev/null
@@ -1,167 +0,0 @@
-;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10 -*-
-(declaim (optimize (speed 0) (safety 3) (debug 3)))
-
-(in-package :resume)
-
-(defmacro .location ()
- `(location-json location))
-
-(defmacro .home-get ()
- `(about-us-json "home"))
-
-(defmacro .home-post ()
- `(about-us-json "home" message errormsg))
-
-(defmacro .home-view ()
- `(about-us-view-json "home"))
-
-(defmacro .home-modify ()
- `(about-us-modify-json "home"))
-
-(defmacro .home-modify-submit ()
- `(about-us-modify-submit-json "home" content))
-
-(defmacro .menu ()
- `(menu-json))
-
-(defmacro .menu-user ()
- `(menu-user-json))
-
-(defmacro .login ()
- `(login-json))
-
-(defmacro .login-authenticate ()
- `(login-authenticate-json username pwd))
-
-(defmacro .login-forgot ()
- `(login-forgot-json))
-
-(defmacro .logout ()
- `(logout-json))
-
-(defmacro .profile ()
- `(profile-json))
-
-(defmacro .profile-view ()
- `(profile-view-json))
-
-(defmacro .profile-modify ()
- `(profile-modify-json))
-
-(defmacro .profile-modify-submit ()
- `(profile-modify-submit-json id username first_name last_name email phone))
-
-(defmacro .password ()
- `(password-json))
-
-(defmacro .password-submit ()
- `(password-submit-json id pwd pwd2))
-
-(defmacro .contact-us ()
- `(contact-us-json))
-
-(defmacro .contact-us-view ()
- `(contact-us-view-json))
-
-(defmacro .contact-us-email ()
- `(contact-us-email-json first_name last_name email phone comments))
-
-(defmacro .messages ()
- `(messages-json))
-
-(defmacro .messages-results ()
- `(messages-results-json read))
-
-(defmacro .messages-mark ()
- `(messages-mark-json read id))
-
-(defmacro .users ()
- `(users-json))
-
-(defmacro .users-view ()
- `(users-view-json))
-
-(defmacro .users-add ()
- `(users-add-json))
-
-(defmacro .users-add-submit ()
- `(users-add-submit-json role_groups first_name last_name email))
-
-(defmacro .users-register ()
- `(users-register-json hash))
-
-(defmacro .users-register-form ()
- `(users-register-form-json hash))
-
-(defmacro .users-register-submit ()
- `(users-register-submit-json hash username pwd pwd2 phone))
-
-(defmacro .users-modify ()
- `(users-modify-json id))
-
-(defmacro .users-modify-submit ()
- `(users-modify-submit-json id role_groups username first_name last_name email phone))
-
-(defmacro .users-toggle-active ()
- `(users-toggle-active-json id))
-
-(defmacro .users-delete ()
- `(users-delete-json id))
-
-(defmacro .resume ()
- `(resume-json))
-
-(defmacro .resume-view ()
- `(resume-view-json))
-
-(defmacro .resume-add ()
- `(resume-add-json))
-
-(defmacro .resume-add-submit ()
- `(resume-add-submit-json name))
-
-(defmacro .resume-modify ()
- `(resume-modify-json id))
-
-(defmacro .resume-modify-submit ()
- `(resume-modify-submit-json id name))
-
-(defmacro .resume-delete ()
- `(resume-delete-json id))
-
-(define-endpoint ("/location" :method :post) (&post (location :parameter-type 'string)) .location)
-(define-endpoint ("/home" :method :get) () .home-get)
-(define-endpoint ("/home" :method :post) (&post (message :parameter-type 'string) (errormsg :parameter-type 'string)) .home-post)
-(define-endpoint ("/home/view" :method :get) () .home-view)
-(define-endpoint ("/home/modify" :method :post) () .home-modify)
-(define-endpoint ("/home/modify/submit" :method :post) (&post (content :parameter-type 'string)) .home-modify-submit)
-(define-endpoint ("/menu" :method :get) () .menu)
-(define-endpoint ("/menu/user" :method :get) () .menu-user)
-(define-endpoint ("/login" :method :get) () .login)
-(define-endpoint ("/login/authenticate" :method :post) (&post (username :parameter-type 'string) (pwd :parameter-type 'string)) .login-authenticate)
-(define-endpoint ("/login/forgot" :method :get) () .login-forgot)
-(define-endpoint ("/logout" :method :get) () .logout)
-(define-endpoint ("/profile" :method :get) () .profile)
-(define-endpoint ("/profile/view" :method :get) () .profile-view)
-(define-endpoint ("/profile/modify" :method :post) () .profile-modify)
-(define-endpoint ("/profile/modify/submit" :method :post) (&post (id :parameter-type 'integer) (username :parameter-type 'string) (first_name :parameter-type 'string) (last_name :parameter-type 'string) (email :parameter-type 'string) (phone :parameter-type 'string)) .profile-modify-submit)
-(define-endpoint ("/password" :method :get) () .password)
-(define-endpoint ("/password/submit" :method :post) (&post (id :parameter-type 'integer) (pwd :parameter-type 'string) (pwd2 :parameter-type 'string)) .password-submit)
-(define-endpoint ("/contact-us" :method :get) () .contact-us)
-(define-endpoint ("/contact-us/view" :method :get) () .contact-us-view)
-(define-endpoint ("/contact-us/email" :method :post) (&post (first_name :parameter-type 'string) (last_name :parameter-type 'string) (email :parameter-type 'string) (phone :parameter-type 'string) (comments :parameter-type 'string)) .contact-us-email)
-(define-endpoint ("/messages" :method :get) () .messages)
-(define-endpoint ("/messages/results" :method :post) (&post (read :parameter-type 'string)) .messages-results)
-(define-endpoint ("/messages/mark" :method :post) (&post (read :parameter-type 'string) (id :parameter-type 'integer)) .messages-mark)
-(define-endpoint ("/users" :method :get) () .users)
-(define-endpoint ("/users/view" :method :get) () .users-view)
-(define-endpoint ("/users/add" :method :post) () .users-add)
-(define-endpoint ("/users/add/submit" :method :post) (&post (role_groups :parameter-type 'string) (first_name :parameter-type 'string) (last_name :parameter-type 'string) (email :parameter-type 'string)) .users-add-submit)
-(define-endpoint ("/register/:hash" :method :get) (&path (hash 'string)) base (format nil "/register/~a" hash))
-(define-endpoint ("/users/register" :method :post) (&post (hash :parameter-type 'string)) .users-register)
-(define-endpoint ("/users/register/form" :method :post) (&post (hash :parameter-type 'string)) .users-register-form)
-(define-endpoint ("/users/register/submit" :method :post) (&post (hash :parameter-type 'string) (username :parameter-type 'string) (pwd :parameter-type 'string) (pwd2 :parameter-type 'string) (phone :parameter-type 'string)) .users-register-submit)
-(define-endpoint ("/users/modify" :method :post) (&post (id :parameter-type 'integer)) .users-modify)
-(define-endpoint ("/users/modify/submit" :method :post) (&post (id :parameter-type 'integer) (role_groups :parameter-type 'string) (username :parameter-type 'string) (first_name :parameter-type 'string) (last_name :parameter-type 'string) (email :parameter-type 'string) (phone :parameter-type 'string)) .users-modify-submit)
-(define-endpoint ("/users/toggle-active" :method :post) (&post (id :parameter-type 'integer)) .users-toggle-active)
-(define-endpoint ("/users/delete/:id" :method :delete) (&path (id 'integer)) .users-delete)
diff --git a/lisp/webapps/resume/static/css/stylesheet.css b/lisp/webapps/resume/static/css/stylesheet.css
index 0589853..0157806 100644
--- a/lisp/webapps/resume/static/css/stylesheet.css
+++ b/lisp/webapps/resume/static/css/stylesheet.css
@@ -9,6 +9,10 @@ hr {
width: 200px;
}
+tr.selected {
+ background-color: lightblue;
+}
+
a {
color: lightblue;
}
diff --git a/lisp/webapps/webapp-loader.lisp b/lisp/webapps/webapp-loader.lisp
deleted file mode 100644
index 1fb7d2e..0000000
--- a/lisp/webapps/webapp-loader.lisp
+++ /dev/null
@@ -1,5 +0,0 @@
-;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10 -*-
-(declaim (optimize (speed 0) (safety 3) (debug 3)))
-
-(in-package :resume)
-