                                                   :error-handler (fn [r] nil)}))
     (or (= :next kw)
         (= :previous kw)) (let [slot-category (:slot-category movement)
-                                    new-movement (first (shuffle (kw movement)))]
+                                new-movement (first (shuffle (kw movement)))]
                             (GET "movement" {:params        {:name new-movement}
                                              :handler       (fn [new-movement]
                                                               (let [new-movement (assoc new-movement :slot-category slot-category)

  [{:keys [name image slot-category measurement previous next
           rep set performed-sets distance duration weight rest] :as m}
   part-number]
  (let [parts  (session/get-in [:movement-session :parts])
        pos (positions #{m} (get parts part-number))
        expand (atom false)]
    (fn []

        (when @expand
          [:div
           [:div.pure-g
            [:div.pure-u {:style {:margin "5px 5px 5px 5px"}}
             [:label "Repetisjoner"]
             [:input {:style {:width 75}
                      :id    "rep-input" :type "number" :defaultValue rep :min 0}]]
            [:div.pure-u {:style {:margin "5px 5px 5px 5px"}}
             [:label "Avstand"]
             [:input {:style {:width 75}
                      :id    "distance-input" :type "number" :defaultValue distance :min 0}]]
            [:div.pure-u {:style {:margin "5px 5px 5px 5px"}}
             [:label "Tid"]
             [:input {:style {:width 75}
                      :id    "duration-input" :type "number" :defaultValue duration :min 0}]]
            [:div.pure-u {:style {:margin "5px 5px 5px 5px"}}
             [:label "Vekt"]
             [:input {:style {:width 75}
                      :id    "weight-input" :type "number" :defaultValue weight :min 0}]]
            [:div.pure-u {:style {:margin "5px 5px 5px 5px"}}
             [:label "Hvile"]
             [:input {:style {:width 75}
                      :id    "rest-input" :type "number" :defaultValue rest :min 0}]]
            [:a.pure-u-1-3.pure-button.pure-button-primary {:style    {:margin "5px 5px 5px 5px"}
                                                            :on-click #(let [rep-input (-> (.getElementById js/document "rep-input") .-value int)
                                                                             distance-input (-> (.getElementById js/document "distance-input") .-value int)
                                                                             duration-input (-> (.getElementById js/document "duration-input") .-value int)
                                                                             weight-input (-> (.getElementById js/document "weight-input") .-value int)
                                                                             rest-input (-> (.getElementById js/document "rest-input") .-value int)
                                                                             new-movement (assoc m :rep rep-input :distance distance-input :duration duration-input
                                                                                                   :weight weight-input :rest rest-input)
                                                                             new-part (assoc (get parts part-number) (int pos) new-movement)
                                                                             ;; todo: strategi for å bestemme hvilke data som har presedens når flere verdier sammen ikke gir mening.
                                                                             ]
                                                                        (session/assoc-in! [:movement-session :parts part-number] new-part))} "Oppdater"]]
           [:div.pure-g
            [:a.pure-u.pure-button {:style   {:margin "5px 5px 5px 5px"}
                                    :onClick #(remove-movement % m part-number) :onTouchEnd #(remove-movement % m part-number)
                                    :title   "Fjern øvelse"}
