Permalink
Browse files

start out with something simple: creating simple table of italian and…

… english verbs.
  • Loading branch information...
1 parent 96281e4 commit 6c56abcdd5d6ccfcc4307951a8804413712c0a2c @ekoontz committed Feb 6, 2011
Showing with 41 additions and 5 deletions.
  1. +6 −5 src/index.clj
  2. +35 −0 src/table.clj
View
@@ -16,7 +16,7 @@
;; colors
site-color* "blue"
- important-color* "red"
+ important-color* "lightgreen"
;; ids
logo-id* "#logo"
@@ -29,8 +29,8 @@
;; mixins
rounded-corners* (list :-moz-border-radius :5px
:-webkit-border-radius :5px)
- big-text* (list :font-size "300%")
- special-button* (list rounded-corners* big-text*))
+ big-text* (list :font-size "100%")
+ special-button* (list rounded-corners*))
(slice awesome-effect
jquery
@@ -71,17 +71,18 @@
;;; impure slices and slices that use impure slices aren't memoized
(slice ^{:impure true} random-number
- (html [:p (rand-int 100)]))
+ (html [:p "Welcome user: " (rand-int 100)]))
(slice app-section
(header app-name*)
+ verb-table
download-button)
(slice main-page
(title company-name*)
site-header
- subscribe-button
app-section
+ subscribe-button
random-number)
(defroutes app
View
@@ -0,0 +1,35 @@
+(ns slice.example
+ (:use slice.core
+ slice.compojure5 ; make slices render automatically
+ uteal.core ; defs FTW
+ compojure.core ; slice isn't tied to a web "framework"
+ ring.adapter.jetty
+ hiccup.form-helpers))
+
+(slice verb-row [italian]
+ (html
+ [:tr
+ [:td italian] [:td (get lexicon italian)]
+ ]))
+
+;; figure out differences between hash-map and hash-set
+(def lexicon (hash-map))
+
+(defn add-verb [italian english]
+ (def lexicon (assoc lexicon italian english)))
+
+(add-verb "dire" "to say")
+(add-verb "fare" "to do")
+(add-verb "scrivere" "to write")
+(add-verb "correggere" "to correct")
+(add-verb "leggere" "to read")
+(add-verb "parlere" "to speak")
+
+(slice verb-table
+ (html [:table
+ (verb-row "dire")
+ (verb-row "fare")
+ (verb-row "scrivere")
+ (verb-row "correggere")
+ (verb-row "leggere")
+ (verb-row "parlere")]))

0 comments on commit 6c56abc

Please sign in to comment.