Josha von Gizycki 5 years ago
parent 26cb212462
commit daa8d11c4d

@ -81,6 +81,16 @@ body {
padding-left: 2rem; padding-left: 2rem;
} }
.content {
grid-column: 2;
}
.breadcrumb {
margin-left: 4vw;
margin-right: 4vw;
margin-top: 1.5rem;
}
.landing-container, .main { .landing-container, .main {
grid-column: 2; grid-column: 2;
padding: 3rem; padding: 3rem;

@ -24,3 +24,13 @@
(neo4j/exec-query! roles-of-coc (neo4j/exec-query! roles-of-coc
{:coc_uuid (get coc-instance-uuids coc-key) {:coc_uuid (get coc-instance-uuids coc-key)
:roleschema_uuid (:role schema-uuids)}))) :roleschema_uuid (:role schema-uuids)})))
(neo4j/defquery coc
"MATCH (coc:instance {uuid:{uuid}})
RETURN coc")
(defn coc! [coc-key]
(-> (neo4j/exec-query! coc
{:uuid (get coc-instance-uuids coc-key)})
first
:coc
(assoc :key coc-key)))

@ -7,10 +7,10 @@
(defn index [] (defn index []
(view-public/index)) (view-public/index))
(defn show-coc [coc] (defn show-roles [coc-key]
(view-public/show-coc coc (view-public/show-coc (db-public/coc! coc-key)
(db-public/roles-of-coc! coc))) (db-public/roles-of-coc! coc-key)))
(defroutes routes (defroutes routes
(GET (register! :public-index "/public") [] (index)) (GET (register! :public-index "/public") [] (index))
(GET (register! :public-coc "/public/:coc") [coc] (show-coc coc))) (GET (register! :public-coc "/public/:coc") [coc] (show-roles coc)))

@ -38,7 +38,7 @@
[:li.global-nav__card-nav-item [:li.global-nav__card-nav-item
[:a.global-nav__link {:href (path :public-coc {:coc "req"})} [:a.global-nav__link {:href (path :public-coc {:coc "req"})}
"Req. Eng."]]]] "Req. Eng."]]]]
(into [:main.main] content)]])) (into [:div.content] content)]]))
(defn index [] (defn index []
(layout (layout
@ -52,7 +52,8 @@
(defn show-coc [coc roles] (defn show-coc [coc roles]
(layout (layout
[[:h1 "CoC " coc] [[:main.main
[:h1 "CoC " (h (:name coc))]
[:table.table [:table.table
[:thead [:thead
[:tr [:tr
@ -60,4 +61,7 @@
[:tbody [:tbody
(for [role roles] (for [role roles]
[:tr [:tr
[:td (h (:name role))]])]]])) [:td (h (:name role))]])]]]
[:nav
[:ol.breadcrumb
[:li.breadcrumb-item.active (h (:name coc))]]]]))

Loading…
Cancel
Save