          [hiccup.page :only [html5 include-js include-css]]
          [foosball.util]))
 
-(defn- players-select [id players & [selected]]
+(defn- render-players-select [id players & [selected]]
   [:select.form-control {:id id :name id}
    [:option {:value "nil" :disabled "disabled" :selected "selected"} "Pick a player"]
    (->> players

(defn- filter-active-players [players]
  (filter :active players))

(defn form [players leagues selected-league-id & [{:keys [team1 team2 matchdate]}]]
  (let [active-players (filter-active-players players)]
    (html5

     [:h2 (str "Team " team-num ":")]
     [:div.form-group
      [:label.control-label.col-lg-4 {:for idp1} (str "Player " 1)]
      [:div.controls.col-lg-8 (render-players-select idp1 players player1)]]

     [:div.form-group
      [:label.control-label.col-lg-4 {:for idp2} (str "Player " 2)]
      [:div.controls.col-lg-8 (render-players-select idp2 players player2)]]

     [:div.form-group
      [:label.control-label.col-lg-4 {:for idscore} "Score"]
