   (.preventDefault event)
   (session/remove! :movement-session))
 
-(defn generate-movement-session [event activity]
-  (.preventDefault event)
-  (let [type (:title activity)
-        old-session (session/get :movement-session)
-        movements (vec (take 3 data/all-movements))
-        new-session {:parts [movements] :activity type}]
+(defn reset-session [e]
+  (session/put! :movement-session {:title "ABC" :parts [[]] :activity "Styrketrening"}))
+
+(defn generate-session [e]
+  (.preventDefault e)
+  (let [n (inc (rand-int 8))
+        movements (vec (take n (shuffle data/all-movements)))
+        new-session {:title "ABC" :parts [movements] :activity "Styrketrening"}]
     (session/put! :movement-session new-session)))
 
 (defn create-session-from-activity [event activity]

        [add-movement-component movements i title]]])))

(defn session-page []
  (let []
    (fn []
      [:div
       (if-let [session (session/get :movement-session)]

         [:div.content {:style {:margin-top 0}}
          [:a {:style      {:float 'right :margin-right 20 :margin-top 20
                            :color (:graphic (:activity session)) :opacity 1}
               :onClick    #(remove-session %)
               :onTouchEnd #(remove-session %)}
           [:i.fa.fa-times.fa-4x]]

          [:div.pure-g
           (when (or (= "Naturlig bevegelse" (:activity session))
                     (= "Styrketrening" (:activity session))
                     (= "Mobilitet" (:activity session)))
             [:span.pure-u
              {:onClick #(generate-movement-session % (:activity session))}
              "LAG ØKT"])
           (when-let [description (:description session)]
             [:div.pure-u (first (shuffle description))])]

          [:div
           (when-let [parts (:parts session)]
             [:article.session
              (doall
                (for [i (range (count parts))]
                  ^{:key i} [part-component (get parts i) i (:title session)]))])]]


         [:div.content {:style {:margin-top 0}}
          [:a {:on-click #(session/put! :movement-session {:parts [[]] :activity "Styrketrening"})} "Klikk!"]])])))

                           (.preventDefault e)
                           (let [part (session/get-in [:movement-session :parts part-number])
                                 categories (shuffle (seq (apply clojure.set/union (map :slot-category part))))]
                             (add-movement (first categories) part-number)))
             :style      {:margin-right '50 :cursor 'pointer}}])
         [:i.fa.fa-search-plus.fa-3x
          {:onClick    #(all-movements % show-search-input?)
           :style      {:cursor 'pointer}}]]
        (when @show-search-input?
          (let [id (str "mtags" part-number)
                all-movement-names (mapv :name data/all-movements)
                movements-ac-comp (with-meta text-input-component
                                             {:component-did-mount #(auto-complete-did-mount (str "#" id) all-movement-names)})]
            [movements-ac-comp {:style       {:font-size "100%" :margin-top 20}
                                :id          id
                                :class       "edit"
