Permalink
Browse files

Added GA

  • Loading branch information...
1 parent 9d4051b commit 955b55fe8550108c42b02b5bde6c9f51190646c4 @bbucko committed Mar 19, 2012
@@ -1,7 +1,7 @@
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
<application>confi-dev</application>
- <version>13</version>
+ <version>14</version>
<system-properties>
<property name="file.encoding" value="UTF-8"/>
@@ -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
@@ -28,9 +28,10 @@
<a href="/talk/${talk.id}">
<h3>${talk.title}</h3>
- <p><strong>${talk.presenter.fullName}</strong></p>
-
- <p>${talk.from.format("HH:mm")} - ${talk.to.format("HH:mm")} :: <strong>${talk.room}</strong></p>
+ <p>
+ ${talk.from.format("HH:mm")} - ${talk.to.format("HH:mm")} in <strong>${talk.room}</strong>
+ <span class="ui-li-aside"><strong>${talk.presenter.fullName}</strong></span>
+ </p>
</a>
</li>
<% }
@@ -14,6 +14,25 @@
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.css"/>
<link rel="stylesheet" type="text/css" href="/css/main.css"/>
<decorator:head/>
+
+ <script type="text/javascript">
+ var _gaq = _gaq || [];
+
+ (function () {
+ var ga = document.createElement('script');
+ ga.type = 'text/javascript';
+ ga.async = true;
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+ var s = document.getElementsByTagName('script')[0];
+ s.parentNode.insertBefore(ga, s);
+ })();
+
+
+ $(document).bind('mobileinit', function () {
+ $.mobile.touchOverflowEnabled = true;
+ });
+
+ </script>
</head>
<body>
<div data-role="page">
@@ -29,12 +48,29 @@
<div data-role="navbar">
<ul>
<c:set var="pageType"><decorator:getProperty property="meta.pageType"/></c:set>
- <li><a <c:if test="${pageType eq 'talks'}">class="ui-btn-active"</c:if> data-icon="info" href="/talks">Talks</a></li>
- <li><a <c:if test="${pageType eq 'home'}">class="ui-btn-active"</c:if> data-icon="grid" href="/">Home</a></li>
- <li><a <c:if test="${pageType eq 'presenters'}">class="ui-btn-active"</c:if> data-icon="star" href="/presenters">Presenters</a></li>
+ <li><a
+ <c:if test="${pageType eq 'talks'}">class="ui-btn-active"</c:if> data-icon="info" href="/talks">Talks</a></li>
+ <li><a
+ <c:if test="${pageType eq 'home'}">class="ui-btn-active"</c:if> data-icon="grid" href="/">Home</a></li>
+ <li><a
+ <c:if test="${pageType eq 'presenters'}">class="ui-btn-active"</c:if> data-icon="star" href="/presenters">Presenters</a></li>
</ul>
</div>
</div>
</div>
+<script type="text/javascript">
+ $('[data-role=page]').live('pageshow', function (event, ui) {
+ try {
+ _gaq.push(['_setAccount', 'UA-30154633-1']);
+ hash = location.hash;
+ if (hash) {
+ _gaq.push(['_trackPageview', hash.substr(1)]);
+ } else {
+ _gaq.push(['_trackPageview']);
+ }
+ } catch (err) {
+ }
+ });
+</script>
</body>
</html>
@@ -14,15 +14,15 @@
} else { %>
<ul data-role="listview" data-theme="g" data-filter="true">
<% request.talks.today.each {hour, talks -> %>
- <li data-role="list-divider">Today:: ${hour}</li>
+ <li data-role="list-divider">${new Date().format("DD-MM")} :: ${hour}</li>
<% talks.each {talk -> %>
<li>
<a href="/talk/${talk.id}">
<h3>${talk.title}</h3>
-
- <p><strong>${talk.presenter.fullName}</strong></p>
-
- <p>${talk.from.format("HH:mm")} - ${talk.to.format("HH:mm")} :: <strong>${talk.room}</strong></p>
+ <p>
+ ${talk.from.format("HH:mm")} - ${talk.to.format("HH:mm")} in <strong>${talk.room}</strong>
+ <span class="ui-li-aside"><strong>${talk.presenter.fullName}</strong></span>
+ </p>
</a>
</li>
<% }

0 comments on commit 955b55f

Please sign in to comment.