diff --git a/resources/public/JetBrainsMono-Regular.ttf b/resources/public/JetBrainsMono-Regular.ttf new file mode 100644 index 0000000..91d4943 Binary files /dev/null and b/resources/public/JetBrainsMono-Regular.ttf differ diff --git a/resources/public/css/public.css b/resources/public/css/public.css index 342617d..2c5c6bf 100644 --- a/resources/public/css/public.css +++ b/resources/public/css/public.css @@ -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; @@ -89,6 +98,14 @@ body { 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 { diff --git a/src/wanijo/public/db.clj b/src/wanijo/public/db.clj index c997ace..d9a47f2 100644 --- a/src/wanijo/public/db.clj +++ b/src/wanijo/public/db.clj @@ -13,17 +13,32 @@ "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}}) diff --git a/src/wanijo/public/routes.clj b/src/wanijo/public/routes.clj index bd178fd..b930a85 100644 --- a/src/wanijo/public/routes.clj +++ b/src/wanijo/public/routes.clj @@ -9,7 +9,7 @@ (defn show-roles [coc-key] (view-public/show-coc (db-public/coc! coc-key) - (db-public/roles-of-coc! coc-key))) + (db-public/roles-with-levels-of-coc! coc-key))) (defroutes routes (GET (register! :public-index "/public") [] (index)) diff --git a/src/wanijo/public/view.clj b/src/wanijo/public/view.clj index 431e26a..6181fa0 100644 --- a/src/wanijo/public/view.clj +++ b/src/wanijo/public/view.clj @@ -42,26 +42,37 @@ (defn index [] (layout - [[: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"]])) + [[: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"]]])) -(defn show-coc [coc roles] +(defn show-coc [coc roles-with-levels] (layout [[:main.main [:h1 "CoC " (h (:name coc))] [:table.table [:thead [:tr - [:th "Name"]]] + [:th "Rolle"] + [:th "Erfahrungsstufe"]]] [:tbody - (for [role roles] - [:tr - [:td (h (:name role))]])]]] + (for [row roles-with-levels + :let [{:keys [role levels]} row + rest-levels (rest levels)]] + (list + [:tr + [: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))]]]]))