utf-8 shenanigans

integration-tests
Josha von Gizycki 6 years ago
parent e19376ad03
commit 144a071d85

@ -1,6 +1,7 @@
(ns wanijo.framework.view (ns wanijo.framework.view
(:require [hiccup.page :refer (:require [hiccup.page :refer
[html5 include-css include-js]] [html5 include-css include-js]]
[hiccup.form :as hform]
[wanijo.framework.routing :refer [path]])) [wanijo.framework.routing :refer [path]]))
(defn btnlink (defn btnlink
@ -11,6 +12,10 @@
[:button {:class clss} [:button {:class clss}
caption]])) caption]]))
(defn delete-btn []
(hform/submit-button {:class "delete-btn"}
"☒ Delete!"))
(defn layout! (defn layout!
[& {:keys [content title session] [& {:keys [content title session]
:or {content [] :or {content []
@ -39,7 +44,7 @@
(when authed? (when authed?
[:section.header-content [:section.header-content
(btnlink (path :schema-overview) (btnlink (path :schema-overview)
"Schemas" "Schemas"
"header-content__link") "header-content__link")
(btnlink (path :auth-logout) (btnlink (path :auth-logout)
"Logout!" "Logout!"
@ -47,11 +52,11 @@
[:nav [:nav
(when authed? (when authed?
[:section.schemas [:section.schemas
[:h2 "Created Schemas"] [:h2 "Created Schemas"]
[:ul [:ul
(for [schema (:created-schemas session)] (for [schema (:created-schemas session)]
[:li (:name schema)])] [:li (:name schema)])]
[:h2 "Other Schemas"] [:h2 "Other Schemas"]
[:ul [:ul
(for [schema (:other-schemas session)] (for [schema (:other-schemas session)]
[:li (:name schema)])]])] [:li (:name schema)])]])]

@ -62,7 +62,6 @@
(hform/submit-button "Create"))]))) (hform/submit-button "Create"))])))
(defn show-schema! [schema attrs access-form req] (defn show-schema! [schema attrs access-form req]
(println access-form)
(view/layout! (view/layout!
:session (:session req) :session (:session req)
:content :content
@ -73,7 +72,7 @@
(form/render-widgets form schema req) (form/render-widgets form schema req)
(hform/hidden-field "uuid" (:uuid schema)) (hform/hidden-field "uuid" (:uuid schema))
(hform/submit-button "Edit")) (hform/submit-button "Edit"))
[:h2 "Assign to users"] [:h3 "Assign to users"]
(hform/form-to [:post (path :schema-assign)] (hform/form-to [:post (path :schema-assign)]
(form/render-widgets access-form schema req) (form/render-widgets access-form schema req)
(hform/hidden-field "uuid" (:uuid schema)) (hform/hidden-field "uuid" (:uuid schema))
@ -100,4 +99,4 @@
(hform/form-to {:class "inline"} (hform/form-to {:class "inline"}
[:delete (path :schema-delete schema)] [:delete (path :schema-delete schema)]
(anti-forgery-field) (anti-forgery-field)
(hform/submit-button {:class "delete-btn"} "Delete!"))])) (view/delete-btn))]))

Loading…
Cancel
Save