# HG changeset patch # User one # Date 1347690873 -32400 # Node ID c8e930683c145e9454f74d8027bb93654b031632 # Parent 2cd590fc87bfaf880cc64be9a909b3a8c4b33be0 add Sample action diff -r 2cd590fc87bf -r c8e930683c14 app/controllers/Sample.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/controllers/Sample.java Sat Sep 15 15:34:33 2012 +0900 @@ -0,0 +1,19 @@ +package controllers; + +import java.util.List; + +import models.Post; +import play.mvc.Controller; + +public class Sample extends Controller { + + public static void index() { + Post frontPost = Post.find("order by postedAt desc").first(); + List olderPosts = Post.find("order by postedAt desc").from(1).fetch(10); +// render(frontPost,olderPosts); + String str = "{ \"data\" : \"5\"}"; + renderJSON(str); + } + + +} diff -r 2cd590fc87bf -r c8e930683c14 app/views/Sample/index.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/views/Sample/index.html Sat Sep 15 15:34:33 2012 +0900 @@ -0,0 +1,26 @@ +#{extends 'main.html' /} +#{set title:'Home' /} + +#{if frontPost} + + #{display post:frontPost, as:'home' /} + + #{if olderPosts.size()} + +
+

Older posts from this blog

+ + #{list items:olderPosts, as:'oldPost'} + #{display post:oldPost, as:'teaser' /} + #{/list} +
+ + #{/if} + +#{/if} + +#{else} +
+ There is currently nothing to read here. +
+#{/else} \ No newline at end of file diff -r 2cd590fc87bf -r c8e930683c14 conf/application.conf --- a/conf/application.conf Thu Sep 13 11:18:22 2012 +0900 +++ b/conf/application.conf Sat Sep 15 15:34:33 2012 +0900 @@ -212,7 +212,5 @@ %test.jpa.ddl=create %test.mail.smtp=mock -module.crud=${play.path}/modules/crud - blog.title=Yet another blog blog.baseline=We will write about nothing \ No newline at end of file diff -r 2cd590fc87bf -r c8e930683c14 conf/dependencies.yml --- a/conf/dependencies.yml Thu Sep 13 11:18:22 2012 +0900 +++ b/conf/dependencies.yml Sat Sep 15 15:34:33 2012 +0900 @@ -1,4 +1,4 @@ # Application dependencies require: - - play + - play -> crud diff -r 2cd590fc87bf -r c8e930683c14 eclipse/Connect JPDA to Tasks.launch --- a/eclipse/Connect JPDA to Tasks.launch Thu Sep 13 11:18:22 2012 +0900 +++ b/eclipse/Connect JPDA to Tasks.launch Sat Sep 15 15:34:33 2012 +0900 @@ -1,4 +1,4 @@ - + @@ -8,9 +8,9 @@ + - - \ No newline at end of file + diff -r 2cd590fc87bf -r c8e930683c14 tmp/bytecode/DEV/_app_views_main.html Binary file tmp/bytecode/DEV/_app_views_main.html has changed