# HG changeset patch # User Jaroslav Tulach # Date 1254731007 -7200 # Node ID 26685a525ec8520f5f438d4873f54dde854acb5c # Parent bbe71fd2f13bca3cb07b2492cd0de69d653f0729 By default show only ten games from each category on the main page diff -r bbe71fd2f13b -r 26685a525ec8 freemarkerdor/pom.xml --- a/freemarkerdor/pom.xml Thu Oct 01 10:50:29 2009 +0200 +++ b/freemarkerdor/pom.xml Mon Oct 05 10:23:27 2009 +0200 @@ -10,7 +10,7 @@ org.apidesign freemarkerdor freemarkerdor - 1.30 + 1.31 http://maven.apache.org diff -r bbe71fd2f13b -r 26685a525ec8 freemarkerdor/src/main/java/cz/xelfi/quoridor/freemarkerdor/UI.java --- a/freemarkerdor/src/main/java/cz/xelfi/quoridor/freemarkerdor/UI.java Thu Oct 01 10:50:29 2009 +0200 +++ b/freemarkerdor/src/main/java/cz/xelfi/quoridor/freemarkerdor/UI.java Mon Oct 05 10:23:27 2009 +0200 @@ -136,12 +136,12 @@ @GET @Produces(MediaType.TEXT_HTML) - public Viewable welcome() { + public Viewable welcome(@QueryParam("maxItems") @DefaultValue("10") int maxItems) { Viewable v = checkLogin(); if (v != null) { return v; } - return welcomeImpl(); + return welcomeImpl("maxItems", maxItems); } @GET @@ -340,7 +340,7 @@ ); Client client = new Client(); - base = client.resource(new URI("http://localhost:" + port + "/api/")); + base = client.resource(new URI("http://quoridor.xelfi.cz:" + 80 + "/api/")); final String baseUri = "http://localhost:" + port + "/"; final HttpServer server = HttpServerFactory.create(baseUri, rc); diff -r bbe71fd2f13b -r 26685a525ec8 freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/Bundle.properties --- a/freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/Bundle.properties Thu Oct 01 10:50:29 2009 +0200 +++ b/freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/Bundle.properties Mon Oct 05 10:23:27 2009 +0200 @@ -24,6 +24,7 @@ GAME_ALL=All games WHITE=White BLACK=Black +SEE_ALL=See all games NEXT=Next PREVIOUS=Prev diff -r bbe71fd2f13b -r 26685a525ec8 freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/Bundle_cs.properties --- a/freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/Bundle_cs.properties Thu Oct 01 10:50:29 2009 +0200 +++ b/freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/Bundle_cs.properties Mon Oct 05 10:23:27 2009 +0200 @@ -41,6 +41,7 @@ NEXT=Dal\u0161\u00ED PREVIOUS=P\u0159edchoz\u00ED LATEST=Posledn\u00ED +SEE_ALL=Seznam v\u0161ech her BOARD_VIEW=Pohled: BOARD_IMAGE=Obrovsk\u00FD diff -r bbe71fd2f13b -r 26685a525ec8 freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/index.fmt --- a/freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/index.fmt Thu Oct 01 10:50:29 2009 +0200 +++ b/freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/index.fmt Mon Oct 05 10:23:27 2009 +0200 @@ -4,6 +4,10 @@ <#assign toWait = 0/> <#assign toWon = 0/> <#assign toLost = 0/> + <#if ! maxItems??> + <#assign maxItems = 10/> + + <#assign seeAll = false/> <#list doc.gameIds.* as g> <#if (g.@white = user && g.@status = "whiteMove") || (g.@black = user && g.@status = "blackMove") @@ -51,6 +55,7 @@ <#macro game game> ${bundle("gameWhiteBlack", game.@white?string, game.@black?string)} <@before (now - game.@modified?number)?int/> + <#assign printed = printed + 1/> <#if message?? > @@ -63,6 +68,7 @@
${bundle.GAME_MOVE}
    + <#assign printed = 0/> <#list doc.gameIds.* as g> <#if (g.@white = user && g.@status = "whiteMove") || (g.@black = user && g.@status = "blackMove") @@ -70,6 +76,7 @@
  1. <@game g/>
  2. + <#if printed = maxItems><#assign seeAll=true/><#break/>
@@ -78,6 +85,7 @@ <#if (toWait > 0)>
${bundle.GAME_WAIT}
    + <#assign printed = 0/> <#list doc.gameIds.* as g> <#if (g.@white = user && g.@status = "blackMove") || (g.@black = user && g.@status = "whiteMove") @@ -85,6 +93,7 @@
  1. <@game g/>
  2. + <#if printed = maxItems><#assign seeAll=true/><#break/>
@@ -94,6 +103,7 @@
${bundle.GAME_WON}
    + <#assign printed = 0/> <#list doc.gameIds.* as g> <#if (g.@white = user && g.@status = "whiteWon") || @@ -102,6 +112,7 @@
  1. <@game g/>
  2. + <#if printed = maxItems><#assign seeAll=true/><#break/>
@@ -111,6 +122,7 @@
${bundle.GAME_LOST}
    + <#assign printed = 0/> <#list doc.gameIds.* as g> <#if (g.@white = user && g.@status = "blackWon") || @@ -119,6 +131,7 @@
  1. <@game g/>
  2. + <#if printed = maxItems><#assign seeAll=true/><#break/>
@@ -133,12 +146,21 @@
${bundle.GAME_ALL}
    + <#assign printed = 0/> <#list doc.gameIds.* as g>
  1. <@game g/>
  2. + <#if printed = maxItems><#assign seeAll=true/><#break/>
+ + <#if seeAll> +

+ ${bundle.SEE_ALL}... +

+ +
${bundle("copyright", version)}