Created
March 14, 2013 16:50
-
-
Save glucero/5162964 to your computer and use it in GitHub Desktop.
simple tabs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn build-tab | |
[index item] | |
[:li [:a {:href (str "#tab-link-" index) | |
:data-toggle "tab"} (str (:name item))]]) | |
(defn import-css | |
[location] | |
[:link {:type "text/css" :href location :rel "stylesheet"}]) | |
(defn import-js | |
[location] | |
[:script {:type "text/javascript", :src location}]) | |
(defn html5 | |
[body] | |
(html {:mode :html} "<!DOCTYPE html>\n" | |
[:html {:lang "en"} | |
(import-css (URL. "http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/css/bootstrap-combined.min.css")) | |
(import-js (URL. "http://code.jquery.com/jquery-1.9.1.min.js")) | |
(import-js (URL. "http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/js/bootstrap.min.js")) | |
body])) | |
(defn build-page | |
[data] | |
(html5 | |
[:body | |
[:div {:class "tabbable tabs-left"} | |
[:ul {:class "nav nav-tabs"} | |
(map-indexed build-tab (:items data))]]])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment