Compare commits

..

No commits in common. '57d2f8230e3351364ef69d5ff1210644bf559c4c' and '26cb21246239934319988ed4078d9ba0586c6c74' have entirely different histories.

@ -3,15 +3,6 @@
--height-navbar: 4.5rem; --height-navbar: 4.5rem;
} }
@font-face {
font-family: 'jetbrains-mono';
src: url('../JetBrainsMono-Regular.ttf');
}
a {
color: var(--ci-primary);
}
html { html {
background: url("../img/dust-background.png") no-repeat fixed bottom; background: url("../img/dust-background.png") no-repeat fixed bottom;
background-size: contain; background-size: contain;
@ -90,24 +81,6 @@ body {
padding-left: 2rem; padding-left: 2rem;
} }
.content {
grid-column: 2;
}
.breadcrumb {
margin-left: 4vw;
margin-right: 4vw;
margin-top: 1.5rem;
background: rgba(250, 250, 250, 0.8);
border-radius: 2rem;
border: 1px solid #ccc;
font-family: 'jetbrains-mono';
}
.breadcrumb-item + .breadcrumb-item::before {
content: "//";
}
.landing-container, .main { .landing-container, .main {
grid-column: 2; grid-column: 2;
padding: 3rem; padding: 3rem;

@ -13,39 +13,14 @@
"req" "44b02979-7e78-491c-8631-fc49a47b799d" "req" "44b02979-7e78-491c-8631-fc49a47b799d"
"prk" "318ee72d-8a8b-42c5-aa90-d5efc1787d22"}) "prk" "318ee72d-8a8b-42c5-aa90-d5efc1787d22"})
(neo4j/defquery roles-with-levels-of-coc (neo4j/defquery roles-of-coc
"MATCH (coc:instance {uuid:{coc_uuid}}), "MATCH (coc:instance {uuid:{coc_uuid}}),
(rschema:schema {uuid:{roleschema_uuid}}), (coc)--(:link)--(role:instance),
(role:instance)-[:of]->(rschema), (role)-[:of]->(rschema:schema {uuid:{roleschema_uuid}})
(coc)--(:link)--(role:instance) RETURN role
OPTIONAL MATCH ORDER BY role.name")
(lschema:schema {uuid:{levelschema_uuid}}), (defn roles-of-coc! [coc-key]
(level:instance)-[:of]->(lschema), (map :role
(role)--(:link)-->(level) (neo4j/exec-query! roles-of-coc
RETURN role, level")
(defn roles-with-levels-of-coc! [coc-key]
(->> (neo4j/exec-query! roles-with-levels-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)})))
:levelschema_uuid (:level schema-uuids)})
(group-by :role)
(map (fn [[role rows]]
{:role role
:levels (filter some? (map :level rows))}))))
(comment
(roles-with-levels-of-coc! "dev")
(neo4j/exec-query! roles-with-levels-of-coc!
{:coc_uuid (get coc-instance-uuids "dev")
:roleschema_uuid (:role schema-uuids)
:levelschema_uuid (:level 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-roles [coc-key] (defn show-coc [coc]
(view-public/show-coc (db-public/coc! coc-key) (view-public/show-coc coc
(db-public/roles-with-levels-of-coc! coc-key))) (db-public/roles-of-coc! coc)))
(defroutes routes (defroutes routes
(GET (register! :public-index "/public") [] (index)) (GET (register! :public-index "/public") [] (index))
(GET (register! :public-coc "/public/:coc") [coc] (show-roles coc))) (GET (register! :public-coc "/public/:coc") [coc] (show-coc coc)))

@ -38,41 +38,26 @@
[: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 [:div.content] content)]])) (into [:main.main] content)]]))
(defn index [] (defn index []
(layout (layout
[[:main.main [[:h1 "Schön, dass du da bist!"]
[:h1 "Schön, dass du da bist!"]
[:h2 "Willkommen auf der TRIO-Wissensplattform"] [:h2 "Willkommen auf der TRIO-Wissensplattform"]
[:p "Hier findest du das gesammelte Wissen unserer Kollegen."] [:p "Hier findest du das gesammelte Wissen unserer Kollegen."]
[:p "Schau dich um. Vermisst du etwas? Dann sprich mit deinem CoC!"] [:p "Schau dich um. Vermisst du etwas? Dann sprich mit deinem CoC!"]
[:p "Du möchtest dich weiterentwickeln?" [:p "Du möchtest dich weiterentwickeln?"
"Dann gestalte selbst deinen Weg bei der TRIO und sprich" "Dann gestalte selbst deinen Weg bei der TRIO und sprich"
"deinen Vorgesetzten an"]]])) "deinen Vorgesetzten an"]]))
(defn show-coc [coc roles-with-levels] (defn show-coc [coc roles]
(layout (layout
[[:main.main [[:h1 "CoC " coc]
[:h1 "CoC " (h (:name coc))]
[:table.table [:table.table
[:thead [:thead
[:tr [:tr
[:th "Rolle"] [:th "Name"]]]
[:th "Erfahrungsstufe"]]]
[:tbody [:tbody
(for [row roles-with-levels (for [role roles]
:let [{:keys [role levels]} row
rest-levels (rest levels)]]
(list
[:tr [:tr
[:td {:rowspan (max 1 (count levels))} (h (:name role))] [:td (h (:name role))]])]]]))
[:td (h (-> levels first :name))]]
(for [level rest-levels]
[:tr
[:td (h (:name level))]])))]]]
[:nav
[:ol.breadcrumb
[:li.breadcrumb-item
[:a {:href (path :public-index)} "Start"]]
[:li.breadcrumb-item.active (h (:name coc))]]]]))

Loading…
Cancel
Save