Skip to content

Commit

Permalink
Wip
Browse files Browse the repository at this point in the history
  • Loading branch information
dpp committed Feb 24, 2011
1 parent 0dd2453 commit d30bb71
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 1 deletion.
2 changes: 1 addition & 1 deletion samples/shopwithme/project/build/LiftProject.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class LiftProject(info: ProjectInfo) extends DefaultWebProject(info) {
val liftVersion = "2.3-SNAPSHOT"

// uncomment the following if you want to use the snapshot repo
// val scalatoolsSnapshot = ScalaToolsSnapshots
val scalatoolsSnapshot = ScalaToolsSnapshots

// The local maven repo to get immediate fixes
// val mavenLocal = "Local Maven Repository" at
Expand Down
25 changes: 25 additions & 0 deletions samples/shopwithme/src/main/scala/code/snippet/AllItemsPage.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package code
package snippet

import model.Item

import net.liftweb._
import http._
import sitemap._
import sitemap._
import util._
import Helpers._

object AllItemsPage {
lazy val menu = Menu.i("Items") / "all_items"

def render =
"tbody *" #> Item.items.map(
item => {
"@name" #> ("a *" #> item.name &
"a [href]" #> Menu.ParamMenuable.toLoc(AnItemPage.menu).calcHref(item)) &
"@description *" #> item.description &
"
})
}
17 changes: 17 additions & 0 deletions samples/shopwithme/src/main/scala/code/snippet/AnItemPage.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package code
package snippet

import model.Item

import net.liftweb._
import http._
import sitemap._

import scala.xml.Text

object AnItemPage {
// create a parameterized page
def menu = Menu.param[Item]("Item", Loc.LinkText(i => Text(i.name)),
Item.find _, _.id) / "item"
}

13 changes: 13 additions & 0 deletions samples/shopwithme/src/main/scala/code/snippet/SearchPage.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package code
package snippet

import model.Item

import net.liftweb._
import http._
import sitemap._

object SearchPage {
def menu = Menu.i("Woof") / "search"
}

25 changes: 25 additions & 0 deletions samples/shopwithme/src/main/webapp/all_items.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!DOCTYPE html>
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="content-type" />
<title>Home</title>
</head>
<body class="lift:content_id=main">
<div id="main" class="lift:surround?with=default;at=content">

<table class="lift:AllItemsPage">
<tbody>
<tr>
<td name="name"><a href="#">Name</a></td>
<td name="Description">Desc</td>
<td name="Price">$50.00</td>
<td><button name="add_to_cart">Add to Cart</button></td>
</tr>
</tbody>
</table>


</div>
</body>
</html>

0 comments on commit d30bb71

Please sign in to comment.