Compare commits

...

2 Commits

Author SHA1 Message Date
Josha von Gizycki ea8eed672c component page
4 years ago
Josha von Gizycki 810f2ab657 descriptions for roles in public module
4 years ago

@ -4,6 +4,10 @@ export SCHEMA_LEVEL=67bc62b7-77da-4a4e-9cdd-eeaa3061d0ee
export SCHEMA_MODULE=fbf30747-2fd3-4479-8e5b-e03b4509554b
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_REQ=1d155970-f211-4699-9b90-21ef748c6afd
export INST_PRK=46dfa4e3-4223-4e76-9fb1-2fbdcec15f74

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

@ -15,7 +15,11 @@
(def attribute-uuids
{: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
{"dev" (or (System/getenv "INST_DEV")
@ -148,6 +152,12 @@
(modules-and-levels! "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
"MATCH (module:instance {uuid:{uuid}}),
(cschema:schema {uuid:{compschema_uuid}}),
@ -157,18 +167,25 @@
ORDER BY comp.name")
(defn module! [uuid]
(let [i (instance! uuid)
desc (->> (:properties i)
(filter #(= (:module-desc attribute-uuids)
(-> % :attr :uuid)))
first
:value)
comps (->> {:uuid uuid
:compschema_uuid (:component schema-uuids)}
(neo4j/exec-query! components-of-module)
(map :comp))]
(assoc i
:desc desc
:desc (propery-of-attribute i (:module-desc attribute-uuids))
:components comps)))
(comment
(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]
(view-public/show-role
(db-public/coc! coc-key)
(db-public/instance! role-uuid)
(db-public/role! role-uuid)
(db-public/modules-and-levels! role-uuid)))
(defn show-module [coc-key module-uuid]
@ -28,6 +28,12 @@
(db-public/coc! coc-key)
(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
(GET (register! :public-index "/public") [] (index))
(GET (register! :public-coc "/public/:coc")
@ -41,4 +47,7 @@
(show-role coc role))
(GET (register! :public-module "/public/:coc/module/: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,6 +138,8 @@
(h (:name role))
[[:main.main
[:h1 "Rolle " (h (:name role))]
[:div.markdown-content
(md/md-to-html-string (:desc role))]
[:div.table-responsive
[:table.table
[:thead
@ -168,7 +170,7 @@
(h (:name module))
[[:main.main
[:h1 "Modul " (h (:name module))]
[:div.module-desc
[:div.markdown-content
(md/md-to-html-string (:desc module))]
[:h2 "Komponenten"]
[:table.table
@ -178,7 +180,12 @@
[:tbody
(for [comp (:components module)]
[:tr
[:td (h (:name comp))]])]]]
[:td
[:a {:href (path :public-comp
{:coc (:key coc)
:module (:uuid module)
:comp (:uuid comp)})}
(h (:name comp))]]])]]]
(breadcrumb
[:li.breadcrumb-item
[:a {:href (path :public-coc {:coc (:key coc)})}
@ -186,3 +193,22 @@
;; link to role not possible
;; multiple roles could use this 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