From 955b55fe8550108c42b02b5bde6c9f51190646c4 Mon Sep 17 00:00:00 2001 From: Blazej Bucko Date: Mon, 19 Mar 2012 14:14:28 +0100 Subject: [PATCH] Added GA --- src/main/webapp/WEB-INF/appengine-web.xml | 2 +- .../WEB-INF/groovy/WelcomeController.groovy | 11 ++++- src/main/webapp/WEB-INF/views/index.gtpl | 7 ++-- .../webapp/WEB-INF/views/layouts/mobile.jsp | 42 +++++++++++++++++-- src/main/webapp/WEB-INF/views/talks.gtpl | 10 ++--- 5 files changed, 59 insertions(+), 13 deletions(-) diff --git a/src/main/webapp/WEB-INF/appengine-web.xml b/src/main/webapp/WEB-INF/appengine-web.xml index 0d40bd4..82d420b 100644 --- a/src/main/webapp/WEB-INF/appengine-web.xml +++ b/src/main/webapp/WEB-INF/appengine-web.xml @@ -1,7 +1,7 @@ confi-dev - 13 + 14 diff --git a/src/main/webapp/WEB-INF/groovy/WelcomeController.groovy b/src/main/webapp/WEB-INF/groovy/WelcomeController.groovy index a1ac15c..9bf690c 100644 --- a/src/main/webapp/WEB-INF/groovy/WelcomeController.groovy +++ b/src/main/webapp/WEB-INF/groovy/WelcomeController.groovy @@ -14,7 +14,16 @@ if (!(cacheKey in memcache)) { } final nextTalks = Talk.search(filter: ["from >=": now], sort: ["from", "title"], limit: 5) -final nowTalking = memcache[cacheKey].findAll {Talk talk -> talk.from <= now && talk.to > now } +def nowTalking + +try { + nowTalking = memcache[cacheKey].findAll {Talk talk -> talk.from <= now && talk.to > now } +} catch (Exception ex) { + log.info("Exception occured while retrieving stuff from memcache") + memcache[cacheKey] = Talk.search(filter: ["from >=": today, "from <": tomorrow], sort: ["from", "title"]) + nowTalking = memcache[cacheKey].findAll {Talk talk -> talk.from <= now && talk.to > now } +} + request.nowTalking = nowTalking request.nextTalks = nextTalks diff --git a/src/main/webapp/WEB-INF/views/index.gtpl b/src/main/webapp/WEB-INF/views/index.gtpl index 701cdb7..21281fa 100644 --- a/src/main/webapp/WEB-INF/views/index.gtpl +++ b/src/main/webapp/WEB-INF/views/index.gtpl @@ -28,9 +28,10 @@

${talk.title}

-

${talk.presenter.fullName}

- -

${talk.from.format("HH:mm")} - ${talk.to.format("HH:mm")} :: ${talk.room}

+

+ ${talk.from.format("HH:mm")} - ${talk.to.format("HH:mm")} in ${talk.room} + ${talk.presenter.fullName} +

<% } diff --git a/src/main/webapp/WEB-INF/views/layouts/mobile.jsp b/src/main/webapp/WEB-INF/views/layouts/mobile.jsp index 5486f6e..5af6929 100644 --- a/src/main/webapp/WEB-INF/views/layouts/mobile.jsp +++ b/src/main/webapp/WEB-INF/views/layouts/mobile.jsp @@ -14,6 +14,25 @@ + + + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/talks.gtpl b/src/main/webapp/WEB-INF/views/talks.gtpl index 0617466..f41d405 100644 --- a/src/main/webapp/WEB-INF/views/talks.gtpl +++ b/src/main/webapp/WEB-INF/views/talks.gtpl @@ -14,15 +14,15 @@ } else { %>