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"]]
:plugins [[lein-less "1.7.5"]]}}
: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]
[hiccup.form :as hform]
[wanijo.view :as view]
[wanijo.neo4j :as neo4j]))
[wanijo.domain.user :as domain-user]))
(defn- login-check! [req]
(let [{{:keys [uname pw]} :params} req
unode (neo4j/find-user! uname)
unode (domain-user/find! uname)
pwmatch (when-let [hash (:pw unode)]
(hashers/check pw hash))]
(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
(:require [wanijo.view :as view]))
(:require [wanijo.view.page :as page]))
(defn root! [req]
(view/layout! :session (:session req)))
(page/layout! :session (:session req)))

@ -28,12 +28,3 @@
(cypher/tquery (conn!) query params)
(map #(get % alias))
(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.response :as resp]
[hiccup.form :as hform]
[wanijo.domain.schema :as domain-schemas]
[wanijo.view :as view]
[wanijo.forms :as forms]))
[wanijo.domain.schema :as domain-schema]
[wanijo.view.page :as page]
[wanijo.view.forms :as forms]))
(def new-schema-form
{:fields {:schema-name {:label "Nimi"
@ -15,8 +15,8 @@
(defn- overview! [req]
(let [session (:session req)
ident (:ident session)
schemas (domain-schemas/all-created-by! ident)]
(view/layout!
schemas (domain-schema/all-created-by! ident)]
(page/layout!
:session session
:content
[[:h1 "Ali jaki ijo"]

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

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