]> www.vanbest.org Git - lootjes-play/commitdiff
Add link to party page
authorJP <jp@here>
Tue, 14 Feb 2012 10:53:43 +0000 (11:53 +0100)
committerJP <jp@here>
Tue, 14 Feb 2012 10:53:43 +0000 (11:53 +0100)
app/controllers/Application.java
app/views/Application/showParty.html [new file with mode: 0644]
app/views/main.html
app/views/tags/display_party.html
conf/application.conf
conf/routes

index 1e40507b8446bd5223aa71c196f84d891c4653e6..080785a8b61c4f4fe3ff5a046f1560fc692869fa 100644 (file)
@@ -15,6 +15,11 @@ public class Application extends Controller {
         renderArgs.put("blogBaseline", Play.configuration.getProperty("blog.baseline"));
     }
 
+    public static void showParty(Long id) {
+        Party party = Party.findById(id);
+        render(party);
+    }
+
     public static void index() {
         List<Party> parties = Party.find(
             "order by date desc"
diff --git a/app/views/Application/showParty.html b/app/views/Application/showParty.html
new file mode 100644 (file)
index 0000000..d9efbe6
--- /dev/null
@@ -0,0 +1,4 @@
+#{extends 'main.html' /}
+#{set title:party.description/}
+#{display_party party:party, as:'full' /}
index 16855b23d47f391cf50f61bf99da576eceac8c8d..79d4d34df90b66bd82ef21439e9c347bd12b00bf 100644 (file)
                 </li>
             </ul>
             <div id="title">
-                <span class="about">About this blog</span>
-                <h1><a href="#">${blogTitle}</a></h1>
+                <span class="about">About this application</span>
+                <h1><a href="@{Application.index()}">${blogTitle}</a></h1>
                 <h2>${blogBaseline}</h2>
-            </div>
+            </div>        
         </div>
         
         <div id="main">
@@ -35,6 +35,6 @@
             <a href="http://www.playframework.org">Play framework</a>
             as a tutorial application.
         </p>
-        
+
     </body>
 </html>
index cd8342ef4cc55ca8058d88310dc938246804752a..a4731187e8b4548c5d6c5424d0b81c02060a3ccd 100644 (file)
@@ -2,7 +2,7 @@
  
 <div class="post ${_as == 'teaser' ? 'teaser' : ''}">
                     <h2 class="post-title">
-                        <a href="#">${_party.description}</a>
+                        <a href="@{Application.showParty(_party.id)}">${_party.description}</a>
                     </h2>
 
                     <div class="post-metadata">
index 6ccb8580ea6a37a8af4cde5d1e2e11eafe99477a..56bc829263e25292202a29ce7988de6411cf5a10 100644 (file)
@@ -219,3 +219,6 @@ mail.smtp=mock
 # ~~~~~
 blog.title=Yet another blog
 blog.baseline=We will write about nothing
+
+# Import the secure module
+module.secure=${play.path}/modules/secure
index c6c0b27de4eb5fc00c937c276e6107c808d1fde2..5ec7a3ecef589fe9dc1539a2b5c8100017462193 100644 (file)
@@ -5,6 +5,12 @@
 # Home page
 GET     /                                       Application.index
 
+# Party page
+GET     /party/{id}                           Application.showParty
+
+# Import Secure routes
+*       /                                       module:secure
+
 # Ignore favicon requests
 GET     /favicon.ico                            404