From 66e4a930dcd8287b35f256eb13c8df9808efcf55 Mon Sep 17 00:00:00 2001
From: James Moger <james.moger@gitblit.com>
Date: Thu, 01 May 2014 19:58:44 -0400
Subject: [PATCH] Merged #15 "My Tickets page"

---
 src/main/java/com/gitblit/wicket/pages/RootPage.java |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/src/main/java/com/gitblit/wicket/pages/RootPage.java b/src/main/java/com/gitblit/wicket/pages/RootPage.java
index 5ccc3a4..c59c189 100644
--- a/src/main/java/com/gitblit/wicket/pages/RootPage.java
+++ b/src/main/java/com/gitblit/wicket/pages/RootPage.java
@@ -134,6 +134,8 @@
 		boolean authenticateView = app().settings().getBoolean(Keys.web.authenticateViewPages, false);
 		boolean authenticateAdmin = app().settings().getBoolean(Keys.web.authenticateAdminPages, true);
 		boolean allowAdmin = app().settings().getBoolean(Keys.web.allowAdministration, true);
+		boolean allowLucene = app().settings().getBoolean(Keys.web.allowLuceneIndexing, true);
+		boolean isLoggedIn = GitBlitWebSession.get().isLoggedIn();
 
 		if (authenticateAdmin) {
 			showAdmin = allowAdmin && GitBlitWebSession.get().canAdmin();
@@ -151,7 +153,7 @@
 		}
 
 		if (authenticateView || authenticateAdmin) {
-			if (GitBlitWebSession.get().isLoggedIn()) {
+			if (isLoggedIn) {
 				UserMenu userFragment = new UserMenu("userPanel", "userMenuFragment", RootPage.this);
 				add(userFragment);
 			} else {
@@ -167,13 +169,16 @@
 
 		// navigation links
 		List<PageRegistration> pages = new ArrayList<PageRegistration>();
-		if (!authenticateView || (authenticateView && GitBlitWebSession.get().isLoggedIn())) {
-			pages.add(new PageRegistration(GitBlitWebSession.get().isLoggedIn() ? "gb.myDashboard" : "gb.dashboard", MyDashboardPage.class,
+		if (!authenticateView || (authenticateView && isLoggedIn)) {
+			pages.add(new PageRegistration(isLoggedIn ? "gb.myDashboard" : "gb.dashboard", MyDashboardPage.class,
 					getRootPageParameters()));
+			if (isLoggedIn && app().tickets().isReady()) {
+				pages.add(new PageRegistration("gb.myTickets", MyTicketsPage.class));
+			}
 			pages.add(new PageRegistration("gb.repositories", RepositoriesPage.class,
 					getRootPageParameters()));
 			pages.add(new PageRegistration("gb.activity", ActivityPage.class, getRootPageParameters()));
-			if (app().settings().getBoolean(Keys.web.allowLuceneIndexing, true)) {
+			if (allowLucene) {
 				pages.add(new PageRegistration("gb.search", LuceneSearchPage.class));
 			}
 			if (showAdmin) {
@@ -183,7 +188,7 @@
 				pages.add(new PageRegistration("gb.federation", FederationPage.class));
 			}
 
-			if (!authenticateView || (authenticateView && GitBlitWebSession.get().isLoggedIn())) {
+			if (!authenticateView || (authenticateView && isLoggedIn)) {
 				addDropDownMenus(pages);
 			}
 		}

--
Gitblit v1.9.1