Compare commits

..

No commits in common. 'ea8eed672c3db6a8f3eafdbdc541dcb020b7c7a8' and '6ab50078b989598259eba2b035066b3ae2c5fbbc' have entirely different histories.

@ -4,10 +4,6 @@ export SCHEMA_LEVEL=67bc62b7-77da-4a4e-9cdd-eeaa3061d0ee
export SCHEMA_MODULE=fbf30747-2fd3-4479-8e5b-e03b4509554b export SCHEMA_MODULE=fbf30747-2fd3-4479-8e5b-e03b4509554b
export SCHEMA_COMPONENT=f229b8c7-3794-4ded-8192-052dd7af3830 export SCHEMA_COMPONENT=f229b8c7-3794-4ded-8192-052dd7af3830
export ATTR_MODULE_DESC=0924be5a-9680-44e3-986f-54b5b59631ba
export ATTR_ROLE_DESC=39e467a5-9ed2-496b-bc98-a14e3b52a8d1
export ATTR_COMP_DESC=35646a07-5b48-4711-9211-54df9f13e815
export INST_DEV=73f69c1b-5106-44bb-b5e1-90c4f3847037 export INST_DEV=73f69c1b-5106-44bb-b5e1-90c4f3847037
export INST_REQ=1d155970-f211-4699-9b90-21ef748c6afd export INST_REQ=1d155970-f211-4699-9b90-21ef748c6afd
export INST_PRK=46dfa4e3-4223-4e76-9fb1-2fbdcec15f74 export INST_PRK=46dfa4e3-4223-4e76-9fb1-2fbdcec15f74

@ -186,17 +186,17 @@ table [data-sort="asc"]::after {
display: inline; display: inline;
} }
.markdown-content { .module-desc {
margin-top: 3rem; margin-top: 3rem;
padding-left: 1rem; padding-left: 1rem;
} }
.markdown-content h1 { .module-desc h1 {
font-size: 2rem; font-size: 2rem;
margin-left: -1rem; margin-left: -1rem;
} }
.markdown-content h1::before { .module-desc h1::before {
display: inline-block; display: inline-block;
content: " "; content: " ";
background-image: url('../img/klammer.svg'); background-image: url('../img/klammer.svg');
@ -208,19 +208,19 @@ table [data-sort="asc"]::after {
margin-right: .5rem; margin-right: .5rem;
} }
.markdown-content h2 { .module-desc h2 {
font-size: 1.7rem; font-size: 1.7rem;
} }
.markdown-content h3 { .module-desc h3 {
font-size: 1.5rem; font-size: 1.5rem;
} }
.markdown-content h4 { .module-desc h4 {
font-size: 1.3rem; font-size: 1.3rem;
} }
.markdown-content blockquote { .module-desc blockquote {
padding: 1rem .5rem 0 1rem; padding: 1rem .5rem 0 1rem;
background-color: rgba(230, 230, 230, .5); background-color: rgba(230, 230, 230, .5);
border: 1px solid transparent; border: 1px solid transparent;

@ -15,11 +15,7 @@
(def attribute-uuids (def attribute-uuids
{:module-desc (or (System/getenv "ATTR_MODULE_DESC") {:module-desc (or (System/getenv "ATTR_MODULE_DESC")
"0924be5a-9680-44e3-986f-54b5b59631ba") "0924be5a-9680-44e3-986f-54b5b59631ba")})
:role-desc (or (System/getenv "ATTR_ROLE_DESC")
"39e467a5-9ed2-496b-bc98-a14e3b52a8d1")
:comp-desc (or (System/getenv "ATTR_COMP_DESC")
"35646a07-5b48-4711-9211-54df9f13e815")})
(def coc-instance-uuids (def coc-instance-uuids
{"dev" (or (System/getenv "INST_DEV") {"dev" (or (System/getenv "INST_DEV")
@ -152,12 +148,6 @@
(modules-and-levels! "d97628f4-477d-49d7-a1c1-2fd643a0ee65") (modules-and-levels! "d97628f4-477d-49d7-a1c1-2fd643a0ee65")
(instance! "d97628f4-477d-49d7-a1c1-2fd643a0ee65")) (instance! "d97628f4-477d-49d7-a1c1-2fd643a0ee65"))
(defn propery-of-attribute [{:keys [properties]} attr-uuid]
(->> properties
(filter #(= attr-uuid (-> % :attr :uuid)))
first
:value))
(neo4j/defquery components-of-module (neo4j/defquery components-of-module
"MATCH (module:instance {uuid:{uuid}}), "MATCH (module:instance {uuid:{uuid}}),
(cschema:schema {uuid:{compschema_uuid}}), (cschema:schema {uuid:{compschema_uuid}}),
@ -167,25 +157,18 @@
ORDER BY comp.name") ORDER BY comp.name")
(defn module! [uuid] (defn module! [uuid]
(let [i (instance! uuid) (let [i (instance! uuid)
desc (->> (:properties i)
(filter #(= (:module-desc attribute-uuids)
(-> % :attr :uuid)))
first
:value)
comps (->> {:uuid uuid comps (->> {:uuid uuid
:compschema_uuid (:component schema-uuids)} :compschema_uuid (:component schema-uuids)}
(neo4j/exec-query! components-of-module) (neo4j/exec-query! components-of-module)
(map :comp))] (map :comp))]
(assoc i (assoc i
:desc (propery-of-attribute i (:module-desc attribute-uuids)) :desc desc
:components comps))) :components comps)))
(comment (comment
(module! "0b30521a-0727-4a6b-b69e-6f3c554a81b2")) (module! "0b30521a-0727-4a6b-b69e-6f3c554a81b2"))
(defn role! [uuid]
(let [i (instance! uuid)]
(assoc i
:desc (propery-of-attribute i (:role-desc attribute-uuids)))))
(comment
(role! "2c507f67-600d-4add-b648-2ea62d5a4ffc"))
(defn comp! [uuid]
(let [i (instance! uuid)]
(assoc i
:desc (propery-of-attribute i (:comp-desc attribute-uuids)))))

@ -20,7 +20,7 @@
(defn show-role [coc-key role-uuid] (defn show-role [coc-key role-uuid]
(view-public/show-role (view-public/show-role
(db-public/coc! coc-key) (db-public/coc! coc-key)
(db-public/role! role-uuid) (db-public/instance! role-uuid)
(db-public/modules-and-levels! role-uuid))) (db-public/modules-and-levels! role-uuid)))
(defn show-module [coc-key module-uuid] (defn show-module [coc-key module-uuid]
@ -28,12 +28,6 @@
(db-public/coc! coc-key) (db-public/coc! coc-key)
(db-public/module! module-uuid))) (db-public/module! module-uuid)))
(defn show-comp [coc-key module-uuid comp-uuid]
(view-public/show-comp
(db-public/coc! coc-key)
(db-public/module! module-uuid)
(db-public/comp! comp-uuid)))
(defroutes routes (defroutes routes
(GET (register! :public-index "/public") [] (index)) (GET (register! :public-index "/public") [] (index))
(GET (register! :public-coc "/public/:coc") (GET (register! :public-coc "/public/:coc")
@ -47,7 +41,4 @@
(show-role coc role)) (show-role coc role))
(GET (register! :public-module "/public/:coc/module/:module") (GET (register! :public-module "/public/:coc/module/:module")
[coc module] [coc module]
(show-module coc module)) (show-module coc module)))
(GET (register! :public-comp "/public/:coc/module/:module/comp/:comp")
[coc module comp]
(show-comp coc module comp)))

@ -138,8 +138,6 @@
(h (:name role)) (h (:name role))
[[:main.main [[:main.main
[:h1 "Rolle " (h (:name role))] [:h1 "Rolle " (h (:name role))]
[:div.markdown-content
(md/md-to-html-string (:desc role))]
[:div.table-responsive [:div.table-responsive
[:table.table [:table.table
[:thead [:thead
@ -170,7 +168,7 @@
(h (:name module)) (h (:name module))
[[:main.main [[:main.main
[:h1 "Modul " (h (:name module))] [:h1 "Modul " (h (:name module))]
[:div.markdown-content [:div.module-desc
(md/md-to-html-string (:desc module))] (md/md-to-html-string (:desc module))]
[:h2 "Komponenten"] [:h2 "Komponenten"]
[:table.table [:table.table
@ -180,12 +178,7 @@
[:tbody [:tbody
(for [comp (:components module)] (for [comp (:components module)]
[:tr [:tr
[:td [:td (h (:name comp))]])]]]
[:a {:href (path :public-comp
{:coc (:key coc)
:module (:uuid module)
:comp (:uuid comp)})}
(h (:name comp))]]])]]]
(breadcrumb (breadcrumb
[:li.breadcrumb-item [:li.breadcrumb-item
[:a {:href (path :public-coc {:coc (:key coc)})} [:a {:href (path :public-coc {:coc (:key coc)})}
@ -193,22 +186,3 @@
;; link to role not possible ;; link to role not possible
;; multiple roles could use this module ;; multiple roles could use this module
[:li.breadcrumb-item.active (h (:name module))])])) [:li.breadcrumb-item.active (h (:name module))])]))
(defn show-comp [coc module comp]
(layout
(h (:name comp))
[[:main.main
[:h1 "Komponente " (h (:name comp))]
[:div.markdown-content
(md/md-to-html-string (:desc comp))]]
(breadcrumb
[:li.breadcrumb-item
[:a {:href (path :public-coc {:coc (:key coc)})}
(h (:name coc))]]
[:li.breadcrumb-item
[:a {:href (path :public-module
{:coc (:key coc)
:module (:uuid module)})}
(h (:name module))]]
[:li.breadcrumb-item.active (h (:name comp))])]))

Loading…
Cancel
Save