diff --git a/src/wanijo/instance/domain.clj b/src/wanijo/instance/domain.clj index 1b00d98..f37f4d7 100644 --- a/src/wanijo/instance/domain.clj +++ b/src/wanijo/instance/domain.clj @@ -145,7 +145,7 @@ (l)-[:link_to]->(t:instance), (t)-[:of]->(s:schema) RETURN i, l, t, s - ORDER BY l.created_at") + ORDER BY s.name, t.name, t.created_at") (defn outgoing-links! [uuid] (map (fn [row] diff --git a/src/wanijo/instance/view.clj b/src/wanijo/instance/view.clj index 060bf6a..cd56fd7 100644 --- a/src/wanijo/instance/view.clj +++ b/src/wanijo/instance/view.clj @@ -47,12 +47,12 @@ " " [:small (h (:name instance))]] [:p [:small - [:a {:href (path :instance-edit-form instance)} - "Edit Instance"] - " | " [:a {:href (path :instance-list {:schema-uuid (-> instance :schema :uuid)})} - "List Instances"]]] + "Back to List"] + " | " + [:a {:href (path :instance-edit-form instance)} + "Edit Instance"]]] (when-not (empty? (:properties instance)) [:section.properties [:h2 "Properties"] @@ -120,11 +120,17 @@ [:th "Created"] [:th]]] [:tbody - (for [{:keys [link target schema]} (:links-out instance)] + (for [{:keys [link target schema]} (:links-out instance) + :let [name (:name link) + empty (empty? name) + name (if empty [:i "empty"] (h name))]] [:tr - [:td (h (:name link))] - [:td (h (:name target))] - [:td (h (:name schema))] + [:td name] + [:td [:a {:href (path :instance-show target)} + (h (:name target))]] + [:td [:a {:href (path :instance-list + {:schema-uuid (:uuid schema)})} + (h (:name schema))]] [:td (prettify-dt (:created_at link))] [:td (hform/form-to [:delete (path :instance-link-delete {:uuid (:uuid instance)