From 4496e089bca542fc98bfad0e005469211e7cbc1e Mon Sep 17 00:00:00 2001 From: Pacien TRAN-GIRARD Date: Sun, 8 Feb 2015 20:06:39 +0100 Subject: Implement current sales listing --- app/controllers/Sale.scala | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 app/controllers/Sale.scala (limited to 'app/controllers') diff --git a/app/controllers/Sale.scala b/app/controllers/Sale.scala new file mode 100644 index 0000000..b5e4622 --- /dev/null +++ b/app/controllers/Sale.scala @@ -0,0 +1,37 @@ +package controllers + +import play.api._ +import play.api.data._ +import play.api.data.Forms._ +import play.api.mvc._ + +import play.api.db.slick._ +import play.api.db.slick.Config.driver.simple._ +import play.api.Play.current + +import scala.concurrent.Future + +import models._ + + +object Sale extends Controller { + + def sales = Auth { implicit request => + DB.withSession { implicit session => + val currentDateTime = new java.sql.Timestamp((new java.util.Date).getTime) + val sales = Views.Sales.filter(_.endDate > currentDateTime).sortBy(_.endDate.asc).run + + Ok(views.html.pages.sales.currentSales(sales)) + } + } + + def sell(itemUuid: String) = TODO + + + def item(itemUuid: String) = TODO + + def bids(itemUuid: String) = TODO + + def bidSubmit(itemUuid: String) = TODO + +} -- cgit v1.2.3