Skip to content

Commit

Permalink
added missing pages from demo :)
Browse files Browse the repository at this point in the history
  • Loading branch information
jstrachan committed Jun 17, 2011
1 parent 6e3d8f4 commit 1c8ca7d
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
20 changes: 20 additions & 0 deletions 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
}
}
}
}
3 changes: 3 additions & 0 deletions 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
Expand All @@ -18,7 +19,9 @@ html

#content
.wrapper
h1 Start of MyLayout...
!~~ body
h1 End of MyLayout

#footer
.wrapper
Expand Down
8 changes: 8 additions & 0 deletions 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.