       (actions/update-collection db id new-items)
       (redirect (format "/collections/%s%s" id (if is-json "?json=1" ""))))))
 
+
+
 (def submit-form "$(this).parent('form').submit();return false;")
 
+(defn render-delete-action-button 
+  [id item]
+  [:form {:method "POST" :action (format "/collections/%s/delete" id)}
+    [:input {:type "hidden" :name :project :value item}]
+    [:a.btn.btn-default.btn-xs.pull-right {:href "#" :onclick submit-form }
+      [:i.fa.fa-minus-circle.red]]])
+
 (defhtml render-collection
-  [c]
+  [c projects detailed]
     [:div.panel.panel-default
       [:div.panel-heading
         [:h3 {:style "display:inline;"}
-          [:a {:href (str "/collections/" (:id c))}(:name c)]
+          [:a {:href (str "/collections/" (:id c))} (:name c)]
         [:div.button-group.pull-right.actions
           [:form { :action (str "/collections/" (:id c) "/star") :data-remote "true"  :method "POST" }
             [:a.gh-btn {:href "#" :onclick submit-form}

    [clojure.tools.logging :as log]
    [hiccup.def                   :refer [defhtml]]
    [hsm.actions :as actions]
    [hsm.views :refer [layout panel render-user left-menu]]
    [hsm.ring :refer [json-resp html-resp redirect]]
    [hsm.utils :refer :all]))


      [:div.panel-body
        [:p (:description c)]
        (for [item (keys (:items c))]
          (let [el (get item (:items c)) 
                proj (get projects item)]
            [:div.row.coll-row
              [:div.col-lg-12
                [:h4
                  [:a.pull-left.gray {:href (str "/p/" (str item el))} (str item el) ]]
                  (render-delete-action-button (:id c) item)]
            [:div.col-lg-8
                [:p [:b (:watchers proj)] " follows this project"]
                [:p (:description proj)]
                [:hr]
                ]
                  ))]
        [:div.panel-footer
          [:a.green {:href "#" :onclick "$(this).parent().find('form').toggle()"} "Add New"]
          [:form {:method "POST" :action (format "/collections/%s/add" (:id c)) :style "display:none;"}
