 
 (defn field-labelling
   []
-  (let [id [:options :labels]
-        options [[:numeric "0-9"]
-                 [:alphabetic "A-Z"]]
-        click-fn (fn [e]
-                   (swap! app-state
-                          #(assoc-in % id (keyword (.. e -target -dataset -key)))))
-        btn-class-fn (partial join-by-space "btn" "btn-default")
-        button-fn (fn [current-id [id label]]
-                    [:button {:class (btn-class-fn (when (= id current-id) "active"))
-                              :data-key id
-                              :key id} 
-                     label])]
-    (fn []
-      (let [current (get-in @app-state id)]
-        [:div.form-group {:on-click click-fn}
-         [:label.col-sm-4.control-label (t :home/field-labelling)]
-         [:div.btn-group.col-sm-8 {:role "group"}
-          (doall (for [option options]
-                   (button-fn current option)))]]))))
+  (single-select [:options :labels]
+                 :home/field-labelling
+                 [[:numeric "0-9"]
+                  [:alphabetic "A-Z"]]))
 
 (defn language-picker
   []

; ----- Common components -----

(defn menu
  []
  [:div#info-menu.btn-group {:role "group"}
   [:a.btn.btn-default {:href "#"}
    [:span.glyphicon.glyphicon-home.glyphicon-start]
    (t :labels/home)]
   [:button.btn.btn-default {:on-click #(reagent-modals/modal! (modals/game-info)
                                                               {:size :lg})}
    [:span.glyphicon.glyphicon-info-sign.glyphicon-start]
    (t :labels/about)]])

(defn label-element
  "Label with text for input identified with for-id"
  [for-id text]
  [:label.col-sm-4.control-label {:for for-id} text])

; ----- Home page -----



(defn difficulty-picker
  []
  (single-select [:options :difficulty]
                 :home.difficulty/label
                 [[:easy :home.difficulty/easy]
                  [:normal :home.difficulty/normal]
                  [:hard :home.difficulty/hard]]))

(defn selector-picker
  []
  (multi-select [:options :selectors]
                :home.domains/label
                [[:persons :home.domains/persons]
                 [:places :home.domains/places]
                 [:works :home.domains/works]
                 [:born-in-brno :home.domains/born-in-brno]
                 [:ksc-members :home.domains/ksc-members]
                 [:uncertain-death :home.domains/uncertain-death]
                 [:artists :home.domains/artists]
                 [:politicians :home.domains/politicians]
                 [:musicians :home.domains/musicians]
                 [:films :home.domains/films]]))

(defn google-spreadsheet-options
  []
