91 lines
3.7 KiB
Clojure
91 lines
3.7 KiB
Clojure
(ns auto-ap.ssr.ui
|
|
(:require
|
|
[hiccup2.core :as hiccup]))
|
|
|
|
(defn html-page [hiccup]
|
|
{:status 200
|
|
:headers {"Content-Type" "text/html"}
|
|
:body (str
|
|
"<!DOCTYPE html>"
|
|
(hiccup/html
|
|
{}
|
|
hiccup))})
|
|
|
|
(defn base-page [request contents page-name]
|
|
(html-page
|
|
[:html.has-navbar-fixed-top
|
|
[:head
|
|
[:meta {:charset "utf-8"}]
|
|
[:meta {:http-equiv "X-UA-Compatible", :content "IE=edge"}]
|
|
[:meta {:name "viewport", :content "width=device-width, initial-scale=1"}]
|
|
[:title (str "Integreat | " page-name)]
|
|
[:link {:href "/css/font.min.css", :rel "stylesheet"}]
|
|
[:link {:rel "icon" :type "image/png" :href "/favicon.png"}]
|
|
[:link {:rel "stylesheet", :href "/output.css"}]
|
|
|
|
[:script {:src "https://unpkg.com/hyperscript.org@0.9.7/dist/_hyperscript.min.js"}]
|
|
[:script {:src "https://unpkg.com/@popperjs/core@2.11.8/dist/umd/popper.min.js"}]
|
|
[:script {:src "https://cdn.plaid.com/link/v2/stable/link-initialize.js"}]
|
|
[:script {:src "https://unpkg.com/htmx.org@1.9.6/dist/htmx.min.js"
|
|
:crossorigin= "anonymous"}]
|
|
[:script {:src "https://unpkg.com/htmx.org/dist/ext/debug.js"}]
|
|
[:script {:src "/js/htmx-disable.js"}]
|
|
[:script {:type "text/javascript", :src "https://cdn.yodlee.com/fastlink/v4/initialize.js", :async "async"}]]
|
|
[:link {:rel "stylesheet" :href "https://cdn.jsdelivr.net/npm/vanillajs-datepicker@1.1.4/dist/css/datepicker.min.css"}]
|
|
|
|
[:script {:type "text/javascript" :src "https://cdn.jsdelivr.net/npm/vanillajs-datepicker@1.1.4/dist/js/datepicker-full.min.js"}]
|
|
|
|
|
|
[:link {:rel "stylesheet" :href "https://cdn.jsdelivr.net/npm/choices.js@9.0.1/public/assets/styles/choices.min.css"}]
|
|
[:script {:src "https://cdn.jsdelivr.net/npm/choices.js@9.0.1/public/assets/scripts/choices.min.js"}]
|
|
[:script {:src "https://unpkg.com/htmx.org/dist/ext/response-targets.js"}]
|
|
|
|
[:script {:src "https://unpkg.com/dropzone@5.9.3/dist/min/dropzone.min.js"}]
|
|
[:link {:rel "stylesheet" :href "https://unpkg.com/dropzone@5/dist/min/dropzone.min.css" :type "text/css"}]
|
|
#_[:script {:defer true :src "https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js"}]
|
|
[:style
|
|
"
|
|
input::-webkit-outer-spin-button,
|
|
input::-webkit-inner-spin-button {
|
|
/* display: none; <- Crashes Chrome on hover */
|
|
-webkit-appearance: none;
|
|
margin: 0; /* <-- Apparently some margin are still there even though it's hidden */
|
|
}
|
|
input[type=number] {
|
|
-moz-appearance:textfield; /* Firefox */
|
|
}
|
|
|
|
"
|
|
|
|
]
|
|
[:body {:hx-ext "disable-submit"}
|
|
contents
|
|
[:script {:src "/js/flowbite.min.js"}]
|
|
[:div [:div#modal-holder
|
|
{ :tabindex "-1", :class "fixed top-0 left-0 right-0 z-50 w-full p-4 overflow-x-hidden overflow-y-auto md:inset-0 h-[calc(100%-1rem)] max-h-full flex justify-center hidden"
|
|
:aria-hidden true
|
|
"_" (hiccup/raw "on \"modalClosed\" remove my children
|
|
on \"modalOpening\" from <body /> call curModal.show()
|
|
on \"modalClosing\" from <body /> call curModal.hide()")
|
|
}]
|
|
[:script {:lang "text/javascript"}
|
|
(hiccup/raw "
|
|
var modal_element = document.getElementById('modal-holder');
|
|
var modal_options = {
|
|
placement: 'center',
|
|
backdrop: 'dynamic',
|
|
backdropClasess: 'bg-gray-900 bg-opacity-50 dark:bg-opacity-80 fixed inset-0 z-40',
|
|
closable: true,
|
|
onOpen: function() {
|
|
htmx.trigger(document.getElementById('modal-holder'), 'modalOpened', {});
|
|
|
|
},
|
|
onHide: function() {
|
|
htmx.trigger(document.getElementById('modal-holder'), 'modalClosed', {});
|
|
},
|
|
};
|
|
var curModal = new Modal(modal_element, modal_options);
|
|
")
|
|
|
|
]]]]))
|