       [:div
        [:div.pure-g
         [:h2.pure-u [:input {:type        "text"
-                             :placeholder "\"warmup\", \"repeat for 3 rounds\" "
+                             :placeholder "A title for this part"
                              :on-change   #(swap! template-state assoc-in [:parts i :title] (-> % .-target .-value))
                              :value       (get-in @template-state [:parts i :title])}]]]
 
        [:div.pure-g
-        (for [m (get-in @template-state [:parts i :specific-movements])]
-          ^{:key (str m (rand-int 1000))} [:div {:on-click #(let [movements (vec (remove #{m} (get-in @template-state [:parts i :specific-movements])))]
-                                       (swap! template-state assoc-in [:parts i :specific-movements] movements))}
-                     (movement-component (str m) (str "images/" (str/replace (str/lower-case m) " " "-") ".png"))])
-        (for [n (range (get-in @template-state [:parts i :n]))]
-          ^{:key (str n (rand-int 1000))} (movement-component "movement name" "images/push-up.png"))]
+        (let [r (get-in @template-state [:parts i :reps])
+              s (get-in @template-state [:parts i :sets])
+              di (get-in @template-state [:parts i :distance])
+              du (get-in @template-state [:parts i :duration])
+              data {:reps r :sets s :distance di :duration du :i i}]
+          (for [m (get-in @template-state [:parts i :specific-movements])]
+            ^{:key (str m (rand-int 1000))} [:div
+                                             (movement-component data
+                                               (str m) (str "images/" (str/replace (str/lower-case m) " " "-") ".png") m)])
+          (for [n (range (get-in @template-state [:parts i :n]))]
+            ^{:key (str n (rand-int 1000))} (movement-component data "movement name" "images/push-up.png")))]
 
 
        [:div.pure-g

  [:div.pure-g
  [:p.subtitle.pure-u
    [:input {:type        "text"
             :placeholder "A suitable description"
             :on-change   #(swap! template-state assoc :description (-> % .-target .-value))
             :value       (:description @template-state)}]]])


  [:div.pure-g
   [:div.pure-u "Movements belong to "
    [:span {:style {:color "red"}} (count (:parts @template-state))] " parts."]
   [:button.pure-u
    {:on-click #(swap! template-state update-in [:parts]
                       conj {:title    ""
                             :categories []
                             :n        0
                             :specific-movements []})} "+"]
   [:button.pure-u
    {:on-click #(when (> (count (:parts @template-state)) 0)
                 (swap! template-state update-in [:parts] pop))} "-"]])

(defn save-template-component [error-atom]
  [:div.pure-g
   [:button.pure-button
    {:on-click #(do
                 (swap! template-state assoc :user (session/get :user))
                 (let [title (:title @template-state)
                       parts (:parts @template-state)]
                   (cond
                     (nil? title) (reset! error-atom "The template needs a title.")
                     (empty? parts) (reset! error-atom "A session must have 1 or more parts.")
                     :else (print @template-state)
                     #_(POST "template"
                             {:params        @template-state
                              :handler       (fn [response] (print response))
                              :error-handler (fn [response] (reset! error-atom (:response response)))}))))}
    "Save"]])

(defn template-creator-component []
  (let [error (atom "")]
    (fn []
      [:div#layout {:class (str "" (when (session/get :active?) "active"))}
       [menu-component]
       [:div.content {:style {:background-image (str "url(" (:background @template-state) ")")}}
        (heading-component)
        (error-component error)
        (upload-background-component)
        (title-component)
        (description-component)
        (adjust-parts-component)
