Skip to content
Browse files

added missing pages from demo :)

  • Loading branch information...
1 parent 6e3d8f4 commit 1c8ca7d0fbff7a62f2dcd8f82173cbcb17cdaaad @jstrachan jstrachan committed Jun 17, 2011
View
20 samples/scalate-example/src/main/scala/MyTransform.scala
@@ -0,0 +1,20 @@
+import org.fusesource.scalate.scuery._
+
+case class Person(name: String, location: String)
+
+
+object MyTransform extends Transformer {
+ val people = List(Person("James", "Beckington"), Person("Hiram", "Tampa"))
+
+ $(".people").contents {
+ node =>
+ people.flatMap {
+ p =>
+ transform(node.$("li:first-child")) {
+ $ =>
+ $("a.person").contents = p.name
+ $("a.person").attribute("href").value = "http://acme.com/bookstore/" + p.name
+ }
+ }
+ }
+}
View
3 samples/scalate-example/src/main/webapp/myLayout.jade
@@ -1,5 +1,6 @@
-@ val body: String
-@ val title: String = "Default Title"
+
- response.setContentType("text/html")
!!!
html
@@ -18,7 +19,9 @@ html
#content
.wrapper
+ h1 Start of MyLayout...
!~~ body
+ h1 End of MyLayout
#footer
.wrapper
View
8 samples/scalate-example/src/main/webapp/tableScuery.html
@@ -0,0 +1,8 @@
+<ul class="people">
+ <li>
+ <a href="#" class="person">A person</a>
+ </li>
+ <li>
+ <a href="#" class="person">Another person</a>
+ </li>
+</ul>

0 comments on commit 1c8ca7d

Please sign in to comment.
Something went wrong with that request. Please try again.