From 889d4875e846ac326fead6c6da4ccfc1ab9c25b8 Mon Sep 17 00:00:00 2001 From: James Moger Date: Fri, 31 May 2013 23:26:47 -0400 Subject: Fixes for responsive layouts on phones and tablets --- src/main/java/com/gitblit/wicket/PageRegistration.java | 12 ++++++++++++ src/main/java/com/gitblit/wicket/pages/DashboardPage.html | 4 ++-- src/main/java/com/gitblit/wicket/pages/RepositoryPage.java | 10 +++++----- src/main/java/com/gitblit/wicket/pages/RootPage.html | 11 ++++++----- src/main/java/com/gitblit/wicket/panels/NavigationPanel.java | 3 +++ src/main/java/com/gitblit/wicket/panels/PushesPanel.html | 2 +- 6 files changed, 29 insertions(+), 13 deletions(-) diff --git a/src/main/java/com/gitblit/wicket/PageRegistration.java b/src/main/java/com/gitblit/wicket/PageRegistration.java index e8eeabae..6cbd8626 100644 --- a/src/main/java/com/gitblit/wicket/PageRegistration.java +++ b/src/main/java/com/gitblit/wicket/PageRegistration.java @@ -36,6 +36,7 @@ public class PageRegistration implements Serializable { public final String translationKey; public final Class pageClass; public final PageParameters params; + public final boolean hiddenPhone; public PageRegistration(String translationKey, Class pageClass) { this(translationKey, pageClass, null); @@ -43,9 +44,15 @@ public class PageRegistration implements Serializable { public PageRegistration(String translationKey, Class pageClass, PageParameters params) { + this(translationKey, pageClass, params, false); + } + + public PageRegistration(String translationKey, Class pageClass, + PageParameters params, boolean hiddenPhone) { this.translationKey = translationKey; this.pageClass = pageClass; this.params = params; + this.hiddenPhone = hiddenPhone; } /** @@ -64,6 +71,11 @@ public class PageRegistration implements Serializable { super(translationKey, null); this.url = url; } + + public OtherPageLink(String translationKey, String url, boolean hiddenPhone) { + super(translationKey, null, null, hiddenPhone); + this.url = url; + } } /** diff --git a/src/main/java/com/gitblit/wicket/pages/DashboardPage.html b/src/main/java/com/gitblit/wicket/pages/DashboardPage.html index 16b1cf8f..544f79cf 100644 --- a/src/main/java/com/gitblit/wicket/pages/DashboardPage.html +++ b/src/main/java/com/gitblit/wicket/pages/DashboardPage.html @@ -7,7 +7,7 @@
-
[repositories message]
+
[repositories message]
@@ -56,7 +56,7 @@
({{owned.length}}) -
+
diff --git a/src/main/java/com/gitblit/wicket/pages/RepositoryPage.java b/src/main/java/com/gitblit/wicket/pages/RepositoryPage.java index 80a977f5..fe509274 100644 --- a/src/main/java/com/gitblit/wicket/pages/RepositoryPage.java +++ b/src/main/java/com/gitblit/wicket/pages/RepositoryPage.java @@ -196,22 +196,22 @@ public abstract class RepositoryPage extends RootPage { } pages.put("commits", new PageRegistration("gb.commits", LogPage.class, params)); pages.put("tree", new PageRegistration("gb.tree", TreePage.class, params)); - pages.put("compare", new PageRegistration("gb.compare", ComparePage.class, params)); + pages.put("compare", new PageRegistration("gb.compare", ComparePage.class, params, true)); if (GitBlit.getBoolean(Keys.web.allowForking, true)) { - pages.put("forks", new PageRegistration("gb.forks", ForksPage.class, params)); + pages.put("forks", new PageRegistration("gb.forks", ForksPage.class, params, true)); } // conditional links // per-repository extra page links if (model.useTickets && TicgitUtils.getTicketsBranch(r) != null) { - pages.put("tickets", new PageRegistration("gb.tickets", TicketsPage.class, params)); + pages.put("tickets", new PageRegistration("gb.tickets", TicketsPage.class, params, true)); } if (model.showReadme || model.useDocs) { - pages.put("docs", new PageRegistration("gb.docs", DocsPage.class, params)); + pages.put("docs", new PageRegistration("gb.docs", DocsPage.class, params, true)); } if (JGitUtils.getPagesBranch(r) != null) { OtherPageLink pagesLink = new OtherPageLink("gb.pages", PagesServlet.asLink( - getRequest().getRelativePathPrefixToContextRoot(), repositoryName, null)); + getRequest().getRelativePathPrefixToContextRoot(), repositoryName, null), true); pages.put("pages", pagesLink); } diff --git a/src/main/java/com/gitblit/wicket/pages/RootPage.html b/src/main/java/com/gitblit/wicket/pages/RootPage.html index 70251834..b93c4f53 100644 --- a/src/main/java/com/gitblit/wicket/pages/RootPage.html +++ b/src/main/java/com/gitblit/wicket/pages/RootPage.html @@ -17,11 +17,12 @@ - - - +
diff --git a/src/main/java/com/gitblit/wicket/panels/NavigationPanel.java b/src/main/java/com/gitblit/wicket/panels/NavigationPanel.java index 558cc716..436db37f 100644 --- a/src/main/java/com/gitblit/wicket/panels/NavigationPanel.java +++ b/src/main/java/com/gitblit/wicket/panels/NavigationPanel.java @@ -44,6 +44,9 @@ public class NavigationPanel extends Panel { public void populateItem(final Item item) { PageRegistration entry = item.getModelObject(); + if (entry.hiddenPhone) { + WicketUtils.setCssClass(item, "hidden-phone"); + } if (entry instanceof OtherPageLink) { // other link OtherPageLink link = (OtherPageLink) entry; diff --git a/src/main/java/com/gitblit/wicket/panels/PushesPanel.html b/src/main/java/com/gitblit/wicket/panels/PushesPanel.html index 1ba5ab2d..fb67cfc1 100644 --- a/src/main/java/com/gitblit/wicket/panels/PushesPanel.html +++ b/src/main/java/com/gitblit/wicket/panels/PushesPanel.html @@ -18,7 +18,7 @@ - +
-- cgit v1.2.3