Created
December 1, 2011 18:55
-
-
Save ckirkendall/1418965 to your computer and use it in GitHub Desktop.
This file contains 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
(em/defsnippit snippit1 "templates/template1.html" [:tbody :> 'first-child] | |
[fruit quantity] | |
[:tr :> 'first-child] (ef/content fruit) | |
[:tr :> 'last-child] (ef/content (str quantity))) | |
(em/deftemplate template1 "/templates/template1.html" [fruit-data] | |
[:#heading1] (ef/content "fruit") | |
[:thead :tr :> 'last-child] (ef/content "quantity") | |
[:tbody] (ef/content | |
(map #(snippit1 % (fruit-data %)) (keys fruit-data)))) | |
(em/defaction action1 [] | |
[:.cool (ef/attr= :foo "false")] (ef/content (template1 {"apple" 5 "pear" 6}))) | |
(em/defsnippit snippit2 "templates/template1.html" ["tbody > *:first-child"] | |
[fruit quantity] | |
["tr > *:first-child"] (ef/content fruit) | |
["tr > *:last-child"] (ef/content (str quantity))) | |
(em/deftemplate template2 "/templates/template1.html" [fruit-data] | |
["#heading1"] (ef/content "fruit") | |
["thead tr > *:last-child"] (ef/content "quantity") | |
["tbody"] (ef/content | |
(map #(snippit1 % (fruit-data %)) (keys fruit-data)))) | |
(em/defaction action2 [] | |
[".cool[foo=false]"] (ef/content (template1 {"bannan" 5 "pineapple" 10}))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment