@ -198,3 +198,15 @@
(outgoing-links! uuid)
:links-in
(incoming-links! uuid)))
(neo4j/defquery is-starred
"MATCH (u:user {uuid:{user_uuid}}),
(i:instance {uuid:{uuid}})
RETURN EXISTS((i)-[:starred_by]->(u)) AS starred")
(defn is-starred! [uuid user-uuid]
(-> (neo4j/exec-query! is-starred
{:user_uuid user-uuid
:uuid uuid})
first
:starred))
@ -40,7 +40,12 @@
(domain/full-instance-by-uuid! uuid))
(defn show! [uuid req]
(view/show! (instance! uuid) req))
(let [user-uuid (-> req :session :uuid)
instance (assoc (instance! uuid)
:starred
(domain/is-starred! uuid
user-uuid))]
(view/show! instance req)))
(defn form! [uuid attrs]
(forms-inst/with-attributes attrs))
@ -44,6 +44,9 @@
:request req
:content
[[:h1
(if (:starred instance)
"★" "☆")
" "
(h (-> instance :schema :name))
[:small (h (:name instance))]]