summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2013-05-31 23:26:47 -0400
committerJames Moger <james.moger@gitblit.com>2013-05-31 23:26:47 -0400
commit889d4875e846ac326fead6c6da4ccfc1ab9c25b8 (patch)
tree506b7c704d71319e6576039cd112b1750d5a31da
parent9b26b74d198aa4efbe4b25f6667b98eb5261e13d (diff)
downloadgitblit-889d4875e846ac326fead6c6da4ccfc1ab9c25b8.tar.gz
gitblit-889d4875e846ac326fead6c6da4ccfc1ab9c25b8.zip
Fixes for responsive layouts on phones and tablets
-rw-r--r--src/main/java/com/gitblit/wicket/PageRegistration.java12
-rw-r--r--src/main/java/com/gitblit/wicket/pages/DashboardPage.html4
-rw-r--r--src/main/java/com/gitblit/wicket/pages/RepositoryPage.java10
-rw-r--r--src/main/java/com/gitblit/wicket/pages/RootPage.html11
-rw-r--r--src/main/java/com/gitblit/wicket/panels/NavigationPanel.java3
-rw-r--r--src/main/java/com/gitblit/wicket/panels/PushesPanel.html2
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<? extends WebPage> pageClass;
public final PageParameters params;
+ public final boolean hiddenPhone;
public PageRegistration(String translationKey, Class<? extends WebPage> pageClass) {
this(translationKey, pageClass, null);
@@ -43,9 +44,15 @@ public class PageRegistration implements Serializable {
public PageRegistration(String translationKey, Class<? extends WebPage> pageClass,
PageParameters params) {
+ this(translationKey, pageClass, params, false);
+ }
+
+ public PageRegistration(String translationKey, Class<? extends WebPage> 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 @@
<body>
<wicket:extend>
<div class="container">
- <div class="markdown" style="padding-bottom:5px;" wicket:id="repositoriesMessage">[repositories message]</div>
+ <div class="hidden-phone markdown" style="padding-bottom:5px;" wicket:id="repositoriesMessage">[repositories message]</div>
<div class="row">
<div class="span7">
@@ -56,7 +56,7 @@
<wicket:fragment wicket:id="ownedListFragment">
<div ng-controller="ownedCtrl" style="border: 1px solid #ddd;border-radius: 4px;">
<div class="header" style="padding: 5px;border: none;"><i class="icon-user"></i> <wicket:message key="gb.myRepositories"></wicket:message> ({{owned.length}})
- <div class="pull-right">
+ <div class="hidden-phone pull-right">
<span wicket:id="create"></span>
</div>
<div style="padding: 5px 0px 0px;">
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 @@
<img src="gitblt_25_white.png" width="79" height="25" alt="gitblit" class="logo"/>
</a>
- <div class="nav-collapse" wicket:id="navPanel"></div>
-
- <ul class="nav pull-right">
- <span wicket:id="userPanel"></span>
- </ul>
+ <div class="nav-collapse">
+ <div wicket:id="navPanel"></div>
+ <ul class="nav pull-right">
+ <span wicket:id="userPanel"></span>
+ </ul>
+ </div>
</div>
</div>
</div>
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<PageRegistration> 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 @@
</td>
</tr>
<tr>
- <td></td>
+ <td class="hidden-phone"></td>
<td style="padding-left: 7px;">
<div>
<table>