Skip to content
This repository has been archived by the owner on Sep 12, 2018. It is now read-only.

Commit

Permalink
Fix error pages that don't work for anonymous
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Yi EungJun committed May 20, 2015
1 parent 4d1e7f3 commit 31c6c07
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 3 additions & 1 deletion app/views/index/index.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down
6 changes: 1 addition & 5 deletions app/views/siteLayout.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}

0 comments on commit 31c6c07

Please sign in to comment.