Compare commits

..

2 Commits

Author SHA1 Message Date
Josha von Gizycki 57d2f8230e niceigkeiten
5 years ago
Josha von Gizycki daa8d11c4d breadcrumb
5 years ago

@ -3,6 +3,15 @@
--height-navbar: 4.5rem;
}
@font-face {
font-family: 'jetbrains-mono';
src: url('../JetBrainsMono-Regular.ttf');
}
a {
color: var(--ci-primary);
}
html {
background: url("../img/dust-background.png") no-repeat fixed bottom;
background-size: contain;
@ -81,6 +90,24 @@ body {
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 {
grid-column: 2;
padding: 3rem;

@ -13,14 +13,39 @@
"req" "44b02979-7e78-491c-8631-fc49a47b799d"
"prk" "318ee72d-8a8b-42c5-aa90-d5efc1787d22"})
(neo4j/defquery roles-of-coc
(neo4j/defquery roles-with-levels-of-coc
"MATCH (coc:instance {uuid:{coc_uuid}}),
(coc)--(:link)--(role:instance),
(role)-[:of]->(rschema:schema {uuid:{roleschema_uuid}})
RETURN role
ORDER BY role.name")
(defn roles-of-coc! [coc-key]
(map :role
(neo4j/exec-query! roles-of-coc
(rschema:schema {uuid:{roleschema_uuid}}),
(role:instance)-[:of]->(rschema),
(coc)--(:link)--(role:instance)
OPTIONAL MATCH
(lschema:schema {uuid:{levelschema_uuid}}),
(level:instance)-[:of]->(lschema),
(role)--(:link)-->(level)
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)
: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 []
(view-public/index))
(defn show-coc [coc]
(view-public/show-coc coc
(db-public/roles-of-coc! coc)))
(defn show-roles [coc-key]
(view-public/show-coc (db-public/coc! coc-key)
(db-public/roles-with-levels-of-coc! coc-key)))
(defroutes routes
(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,26 +38,41 @@
[:li.global-nav__card-nav-item
[:a.global-nav__link {:href (path :public-coc {:coc "req"})}
"Req. Eng."]]]]
(into [:main.main] content)]]))
(into [:div.content] content)]]))
(defn index []
(layout
[[:h1 "Schön, dass du da bist!"]
[[:main.main
[:h1 "Schön, dass du da bist!"]
[:h2 "Willkommen auf der TRIO-Wissensplattform"]
[:p "Hier findest du das gesammelte Wissen unserer Kollegen."]
[:p "Schau dich um. Vermisst du etwas? Dann sprich mit deinem CoC!"]
[:p "Du möchtest dich weiterentwickeln?"
"Dann gestalte selbst deinen Weg bei der TRIO und sprich"
"deinen Vorgesetzten an"]]))
"deinen Vorgesetzten an"]]]))
(defn show-coc [coc roles]
(defn show-coc [coc roles-with-levels]
(layout
[[:h1 "CoC " coc]
[[:main.main
[:h1 "CoC " (h (:name coc))]
[:table.table
[:thead
[:tr
[:th "Name"]]]
[:th "Rolle"]
[:th "Erfahrungsstufe"]]]
[:tbody
(for [role roles]
(for [row roles-with-levels
:let [{:keys [role levels]} row
rest-levels (rest levels)]]
(list
[:tr
[:td (h (:name role))]])]]]))
[:td {:rowspan (max 1 (count levels))} (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