|
|
|
@ -2,7 +2,9 @@
|
|
|
|
|
(:require [hiccup.page :refer [html5 include-js include-css]]
|
|
|
|
|
[hiccup.core :refer [h]]
|
|
|
|
|
[markdown.core :as md]
|
|
|
|
|
[wanijo.infrastructure.routing :refer [path]]))
|
|
|
|
|
[clojure.string :as string]
|
|
|
|
|
[wanijo.infrastructure.routing :refer [path]]
|
|
|
|
|
[wanijo.infrastructure.time :refer [prettify-dt]]))
|
|
|
|
|
|
|
|
|
|
(defn breadcrumb [& links]
|
|
|
|
|
[:nav
|
|
|
|
@ -23,10 +25,11 @@
|
|
|
|
|
[:title title " - Moxie!"]
|
|
|
|
|
(include-css "/css/bootstrap.min.css"
|
|
|
|
|
"/css/public.css")
|
|
|
|
|
(include-js "/js/bootstrap.min.js"
|
|
|
|
|
(include-js "/js/jquery-3.4.1.min.js"
|
|
|
|
|
"/js/bootstrap.min.js"
|
|
|
|
|
"/js/scripts.js")]
|
|
|
|
|
[:body
|
|
|
|
|
[:nav.navbar.navbar-expand-lg.sticky-top
|
|
|
|
|
[:nav.navbar.navbar-expand-lg.sticky-top.navbar-light
|
|
|
|
|
[:a.navbar-brand {:href (path :public-index)}
|
|
|
|
|
[:img.navbar__logo {:src "/img/trio-logo.svg"
|
|
|
|
|
:alt "logo"}]]
|
|
|
|
@ -34,10 +37,15 @@
|
|
|
|
|
:data-toggle "collapse"
|
|
|
|
|
:data-target "#navbar-content"}
|
|
|
|
|
[:span.navbar-toggler-icon]]
|
|
|
|
|
[:div#navbar-content.collapse.navbar-collapse.text-right
|
|
|
|
|
[:div#navbar-nav.ml-auto
|
|
|
|
|
[:a {:href (path :auth-login)}
|
|
|
|
|
"Login"]]]]
|
|
|
|
|
[:div#navbar-content.collapse.navbar-collapse.justify-content-end
|
|
|
|
|
[:form.form-inline.mr-3.global-search
|
|
|
|
|
{:action (path :public-search)}
|
|
|
|
|
[:input.form-control {:type "search"
|
|
|
|
|
:placeholder "\uD83D\uDD0D ..."
|
|
|
|
|
:name "term"}]
|
|
|
|
|
[:button.global-search__submit {:type "submit"}]]
|
|
|
|
|
[:a {:href (path :auth-login)}
|
|
|
|
|
"Login"]]]
|
|
|
|
|
[:div.container-fluid.super-container
|
|
|
|
|
[:menu.global-nav
|
|
|
|
|
[:ol.global-nav__card-nav
|
|
|
|
@ -212,3 +220,25 @@
|
|
|
|
|
(h (:name module))]]
|
|
|
|
|
[:li.breadcrumb-item.active (h (:name comp))])]))
|
|
|
|
|
|
|
|
|
|
(defn replace-with-mark [s term]
|
|
|
|
|
(string/replace (h s)
|
|
|
|
|
(re-pattern (str "(?i)" term))
|
|
|
|
|
#(str "<mark>" % "</mark>")))
|
|
|
|
|
|
|
|
|
|
(defn show-search-result [term results]
|
|
|
|
|
(layout
|
|
|
|
|
(str "Suche nach \"" (h term) "\"")
|
|
|
|
|
[[:main.main
|
|
|
|
|
[:h1 "Suchergebnisse für " [:q (h term)]]
|
|
|
|
|
(when (empty? results)
|
|
|
|
|
[:p.mt-5 "Es konnten keine Ergebnisse gefunden werden"])
|
|
|
|
|
(when (seq results)
|
|
|
|
|
[:div.list-group.mt-5
|
|
|
|
|
(for [{:keys [name updated_at match]} results]
|
|
|
|
|
[:div.list-group-item.list-group-item-action
|
|
|
|
|
[:div.d-flex.w-100.justify-content-between
|
|
|
|
|
[:h5.mb-1 (replace-with-mark name term)]
|
|
|
|
|
[:small (prettify-dt updated_at)]]
|
|
|
|
|
(when (not= match name)
|
|
|
|
|
(list [:p [:pre (replace-with-mark match term)]]))])])]]))
|
|
|
|
|
|
|
|
|
|