reordering of namespaces

integration-tests
Josha von Gizycki 7 years ago
parent 89166ad351
commit 39a183fa21

@ -17,4 +17,5 @@
[ring/ring-mock "0.3.0"]] [ring/ring-mock "0.3.0"]]
:plugins [[lein-less "1.7.5"]]}} :plugins [[lein-less "1.7.5"]]}}
:less {:source-paths ["resources/app/stylesheets"] :less {:source-paths ["resources/app/stylesheets"]
:target-path "resources/public/css"}) :target-path "resources/public/css"}
:hiera {:cluster-depth 2})

@ -5,11 +5,11 @@
[buddy.hashers :as hashers] [buddy.hashers :as hashers]
[hiccup.form :as hform] [hiccup.form :as hform]
[wanijo.view :as view] [wanijo.view :as view]
[wanijo.neo4j :as neo4j])) [wanijo.domain.user :as domain-user]))
(defn- login-check! [req] (defn- login-check! [req]
(let [{{:keys [uname pw]} :params} req (let [{{:keys [uname pw]} :params} req
unode (neo4j/find-user! uname) unode (domain-user/find! uname)
pwmatch (when-let [hash (:pw unode)] pwmatch (when-let [hash (:pw unode)]
(hashers/check pw hash))] (hashers/check pw hash))]
(if pwmatch (if pwmatch

@ -0,0 +1,11 @@
(ns wanijo.domain.user
(:require [wanijo.neo4j :as neo4j]))
(defn find! [ident]
(neo4j/query-rawdata!
:query
"MATCH (n:user)
WHERE n.ident = {ident}
RETURN n"
:alias "n"
:params {:ident ident}))

@ -1,5 +1,5 @@
(ns wanijo.home.view (ns wanijo.home.view
(:require [wanijo.view :as view])) (:require [wanijo.view.page :as page]))
(defn root! [req] (defn root! [req]
(view/layout! :session (:session req))) (page/layout! :session (:session req)))

@ -28,12 +28,3 @@
(cypher/tquery (conn!) query params) (cypher/tquery (conn!) query params)
(map #(get % alias)) (map #(get % alias))
(map :data))) (map :data)))
(defn find-user! [ident]
(query-rawdata!
:query
"MATCH (n:user)
WHERE n.ident = {ident}
RETURN n"
:alias "n"
:params {:ident ident}))

@ -3,9 +3,9 @@
[ring.util.anti-forgery :refer [anti-forgery-field]] [ring.util.anti-forgery :refer [anti-forgery-field]]
[ring.util.response :as resp] [ring.util.response :as resp]
[hiccup.form :as hform] [hiccup.form :as hform]
[wanijo.domain.schema :as domain-schemas] [wanijo.domain.schema :as domain-schema]
[wanijo.view :as view] [wanijo.view.page :as page]
[wanijo.forms :as forms])) [wanijo.view.forms :as forms]))
(def new-schema-form (def new-schema-form
{:fields {:schema-name {:label "Nimi" {:fields {:schema-name {:label "Nimi"
@ -15,8 +15,8 @@
(defn- overview! [req] (defn- overview! [req]
(let [session (:session req) (let [session (:session req)
ident (:ident session) ident (:ident session)
schemas (domain-schemas/all-created-by! ident)] schemas (domain-schema/all-created-by! ident)]
(view/layout! (page/layout!
:session session :session session
:content :content
[[:h1 "Ali jaki ijo"] [[:h1 "Ali jaki ijo"]

@ -1,10 +1,10 @@
(ns wanijo.forms (ns wanijo.view.forms
(:require [hiccup.form :as hform] (:require [hiccup.form :as hform]
[clojure.spec.alpha :as spec] [clojure.spec.alpha :as spec]
[wanijo.view :as view])) [wanijo.view.page :as page]))
(defn spec-to-errmsg [label spec-key field-value] (defn spec-to-errmsg [label spec-key field-value]
(view/flash-error (page/flash-error
(map (map
(fn [prob] (fn [prob]
[:p [:p

@ -1,6 +1,6 @@
(ns wanijo.view (ns wanijo.view.page
(:require [hiccup.page :refer [html5 (:require [hiccup.page :refer
include-css]])) [html5 include-css]]))
(defn btnlink (defn btnlink
([target caption] ([target caption]
Loading…
Cancel
Save