Yi EungJun 2015-05-20
Fix error pages that don't work for anonymous
Error pages wasn't shown correctly for anonymous. The error pages used
a template in app/views/siteLayout.scala.html which ignored the given
content and rendered always the intro page if the current user is
anonymous.

Decide whether to show the intro page or not in index.scala.html not
siteLayout.scala.html.
@31c6c0736e54471ce5f359cc73043dca37727ed0
app/views/index/index.scala.html
--- app/views/index/index.scala.html
+++ app/views/index/index.scala.html
@@ -24,7 +24,9 @@
 @import utils.JodaDateUtil
 
 @siteLayout(utils.Config.getSiteName, utils.MenuType.SITE_HOME) {
-    @if(currentUser != User.anonymous){
+    @if(currentUser == User.anonymous){
+    @partial_intro()
+    } else {
     <div class="page-wrap-outer">
         <div class="page-wrap">
             <div class="site-guide-outer hide">
app/views/siteLayout.scala.html
--- app/views/siteLayout.scala.html
+++ app/views/siteLayout.scala.html
@@ -25,11 +25,7 @@
 @layout(Messages(title))(""){
     @common.navbar(menuType, null, null)
 
-    @if(menuType == utils.MenuType.SITE_HOME && UserApp.currentUser.isAnonymous){
-        @index.partial_intro()
-    } else {
-        @content
-    }
+    @content
 
     @common.footer()
 }
Add a comment
List