diff options
author | James Moger <james.moger@gitblit.com> | 2011-09-30 17:20:15 -0400 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2011-09-30 17:20:15 -0400 |
commit | 94750e9faea7e383db64df6d2ac4290eaa267770 (patch) | |
tree | bde723962baf325c17f946374df2df609756ece2 /src/com/gitblit/wicket/pages | |
parent | fd6ac68c0b1136182b5d713ec88ea94e26c4a76d (diff) | |
download | gitblit-94750e9faea7e383db64df6d2ac4290eaa267770.tar.gz gitblit-94750e9faea7e383db64df6d2ac4290eaa267770.zip |
More Bootstrap improvements.
* Strip leading group name from repositories page.
* Put topbars on all pages.
* Properly sort repositories in all locations.
* White Gitblit logo.
Diffstat (limited to 'src/com/gitblit/wicket/pages')
-rw-r--r-- | src/com/gitblit/wicket/pages/BasePage.html | 4 | ||||
-rw-r--r-- | src/com/gitblit/wicket/pages/BasePage.java | 6 | ||||
-rw-r--r-- | src/com/gitblit/wicket/pages/BlamePage.html | 4 | ||||
-rw-r--r-- | src/com/gitblit/wicket/pages/ChangePasswordPage.html | 19 | ||||
-rw-r--r-- | src/com/gitblit/wicket/pages/ChangePasswordPage.java | 12 | ||||
-rw-r--r-- | src/com/gitblit/wicket/pages/EditRepositoryPage.html | 8 | ||||
-rw-r--r-- | src/com/gitblit/wicket/pages/RepositoriesPage.java | 15 | ||||
-rw-r--r-- | src/com/gitblit/wicket/pages/RepositoryPage.html | 4 | ||||
-rw-r--r-- | src/com/gitblit/wicket/pages/RepositoryPage.java | 6 | ||||
-rw-r--r-- | src/com/gitblit/wicket/pages/RootPage.html | 4 | ||||
-rw-r--r-- | src/com/gitblit/wicket/pages/StandardPage.html | 6 | ||||
-rw-r--r-- | src/com/gitblit/wicket/pages/StandardPage.java | 7 |
12 files changed, 48 insertions, 47 deletions
diff --git a/src/com/gitblit/wicket/pages/BasePage.html b/src/com/gitblit/wicket/pages/BasePage.html index 3fa1a4d5..a089e2a9 100644 --- a/src/com/gitblit/wicket/pages/BasePage.html +++ b/src/com/gitblit/wicket/pages/BasePage.html @@ -22,7 +22,9 @@ <!-- page footer -->
<div class="page_footer">
<div style="float:right">
- <span wicket:id="gbVersion"></span>
+ <a title="gitblit homepage" href="http://gitblit.com/">
+ <span wicket:id="gbVersion"></span>
+ </a>
</div>
<div wicket:id="userPanel">[user panel]</div>
</div>
diff --git a/src/com/gitblit/wicket/pages/BasePage.java b/src/com/gitblit/wicket/pages/BasePage.java index 0cb91d57..d31979dd 100644 --- a/src/com/gitblit/wicket/pages/BasePage.java +++ b/src/com/gitblit/wicket/pages/BasePage.java @@ -29,6 +29,7 @@ import org.apache.wicket.RestartResponseException; import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.link.BookmarkablePageLink;
+import org.apache.wicket.markup.html.link.ExternalLink;
import org.apache.wicket.markup.html.panel.FeedbackPanel;
import org.apache.wicket.markup.html.panel.Fragment;
import org.apache.wicket.protocol.http.WebRequest;
@@ -44,6 +45,7 @@ import com.gitblit.GitBlit; import com.gitblit.Keys;
import com.gitblit.models.UserModel;
import com.gitblit.wicket.GitBlitWebSession;
+import com.gitblit.wicket.WicketUtils;
import com.gitblit.wicket.panels.LinkPanel;
public abstract class BasePage extends WebPage {
@@ -92,6 +94,10 @@ public abstract class BasePage extends WebPage { add(new Label("title", getServerName()));
}
+ ExternalLink rootLink = new ExternalLink("rootLink", urlFor(RepositoriesPage.class, null).toString());
+ WicketUtils.setHtmlTooltip(rootLink, GitBlit.getString(Keys.web.siteName, Constants.NAME));
+ add(rootLink);
+
// Feedback panel for info, warning, and non-fatal error messages
add(new FeedbackPanel("feedback"));
diff --git a/src/com/gitblit/wicket/pages/BlamePage.html b/src/com/gitblit/wicket/pages/BlamePage.html index 2e20c189..ccbfcecb 100644 --- a/src/com/gitblit/wicket/pages/BlamePage.html +++ b/src/com/gitblit/wicket/pages/BlamePage.html @@ -19,12 +19,12 @@ <div wicket:id="breadcrumbs">[breadcrumbs]</div>
<!-- blame content -->
- <table class="annotated" style="border-top: 0px; margin-bottom:5px;">
+ <table class="annotated" style="margin-bottom:5px;">
<tbody>
<tr>
<th>Commit</th>
<th>Line</th>
- <th>Data</th>
+ <th>Content</th>
</tr>
<tr wicket:id="annotation">
<td><span class="sha1" wicket:id="commit"></span></td>
diff --git a/src/com/gitblit/wicket/pages/ChangePasswordPage.html b/src/com/gitblit/wicket/pages/ChangePasswordPage.html index 031352eb..938e0eca 100644 --- a/src/com/gitblit/wicket/pages/ChangePasswordPage.html +++ b/src/com/gitblit/wicket/pages/ChangePasswordPage.html @@ -4,20 +4,9 @@ xml:lang="en"
lang="en">
- <!-- Head with Wicket-controlled resources in this package -->
- <wicket:head>
- <title wicket:id="title">[page title]</title>
- <link rel="stylesheet" type="text/css" href="gitblit.css"/>
- <link rel="shortcut icon" href="gitblt-favicon.png" type="image/png" />
- </wicket:head>
-
+ <wicket:extend>
<body onload="document.getElementById('password').focus();">
<div>
- <div style="padding-top: 10px;text-align:center;">
- <img src="gitblt_25.png" alt="Gitblit"/><br/>
- <div style="padding-top:30px;font-weight:bold;" wicket:id="name"></div>
- </div>
- <p/>
<form style="text-align:center;" wicket:id="passwordForm">
<center>
<table class="plain">
@@ -30,11 +19,11 @@ <td class="edit"><input type="password" wicket:id="confirmPassword" size="30" tabindex="2" /></td>
</tr>
</table>
- <input type="submit" wicket:message="value:gb.save" wicket:id="save" tabindex="3" />
- <input type="submit" wicket:message="value:gb.cancel" wicket:id="cancel" tabindex="4" />
- <div style="padding-top:10px;" wicket:id="feedback"></div>
+ <input class="btn" type="submit" wicket:message="value:gb.cancel" wicket:id="cancel" tabindex="3" />
+ <input class="btn primary" type="submit" wicket:message="value:gb.save" wicket:id="save" tabindex="4" />
</center>
</form>
</div>
</body>
+ </wicket:extend>
</html>
\ No newline at end of file diff --git a/src/com/gitblit/wicket/pages/ChangePasswordPage.java b/src/com/gitblit/wicket/pages/ChangePasswordPage.java index 054b3430..660a8131 100644 --- a/src/com/gitblit/wicket/pages/ChangePasswordPage.java +++ b/src/com/gitblit/wicket/pages/ChangePasswordPage.java @@ -18,17 +18,13 @@ package com.gitblit.wicket.pages; import java.text.MessageFormat;
import org.apache.wicket.RestartResponseException;
-import org.apache.wicket.markup.html.WebPage;
-import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.form.Button;
import org.apache.wicket.markup.html.form.PasswordTextField;
import org.apache.wicket.markup.html.form.StatelessForm;
-import org.apache.wicket.markup.html.panel.FeedbackPanel;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.Model;
import org.apache.wicket.protocol.http.WebResponse;
-import com.gitblit.Constants;
import com.gitblit.GitBlit;
import com.gitblit.GitBlitException;
import com.gitblit.Keys;
@@ -36,7 +32,7 @@ import com.gitblit.models.UserModel; import com.gitblit.utils.StringUtils;
import com.gitblit.wicket.GitBlitWebSession;
-public class ChangePasswordPage extends WebPage {
+public class ChangePasswordPage extends StandardPage {
IModel<String> password = new Model<String>("");
IModel<String> confirmPassword = new Model<String>("");
@@ -54,10 +50,7 @@ public class ChangePasswordPage extends WebPage { // no authentication enabled
throw new RestartResponseException(getApplication().getHomePage());
}
-
- add(new Label("title", GitBlit.getString(Keys.web.siteName, Constants.NAME)));
- add(new Label("name", getString("gb.changePassword") + ": "
- + GitBlitWebSession.get().getUser().username));
+ setupPage(getString("gb.changePassword"), GitBlitWebSession.get().getUser().username);
StatelessForm<Void> form = new StatelessForm<Void>("passwordForm") {
@@ -115,7 +108,6 @@ public class ChangePasswordPage extends WebPage { confirmPassword);
confirmPasswordField.setResetPassword(false);
form.add(confirmPasswordField);
- form.add(new FeedbackPanel("feedback"));
form.add(new Button("save"));
Button cancel = new Button("cancel") {
diff --git a/src/com/gitblit/wicket/pages/EditRepositoryPage.html b/src/com/gitblit/wicket/pages/EditRepositoryPage.html index f9a0f793..7f09f75c 100644 --- a/src/com/gitblit/wicket/pages/EditRepositoryPage.html +++ b/src/com/gitblit/wicket/pages/EditRepositoryPage.html @@ -12,19 +12,19 @@ <tbody>
<tr><th><wicket:message key="gb.name"></wicket:message></th><td class="edit"><input class="span6" type="text" wicket:id="name" id="name" size="40" tabindex="1" /> <i><wicket:message key="gb.nameDescription"></wicket:message></i></td></tr>
<tr><th><wicket:message key="gb.description"></wicket:message></th><td class="edit"><input class="span6" type="text" wicket:id="description" size="40" tabindex="2" /></td></tr>
- <tr><th><wicket:message key="gb.origin"></wicket:message></th><td class="edit"><input class="span6" type="text" wicket:id="origin" size="80" tabindex="3" /></td></tr>
+ <tr><th><wicket:message key="gb.origin"></wicket:message></th><td class="edit"><input class="span7" type="text" wicket:id="origin" size="80" tabindex="3" /></td></tr>
<tr><th><wicket:message key="gb.owner"></wicket:message></th><td class="edit"><select wicket:id="owner" tabindex="4" /> <i><wicket:message key="gb.ownerDescription"></wicket:message></i></td></tr>
<tr><th><wicket:message key="gb.enableTickets"></wicket:message></th><td class="edit"><input type="checkbox" wicket:id="useTickets" tabindex="5" /> <i><wicket:message key="gb.useTicketsDescription"></wicket:message></i></td></tr>
<tr><th><wicket:message key="gb.enableDocs"></wicket:message></th><td class="edit"><input type="checkbox" wicket:id="useDocs" tabindex="6" /> <i><wicket:message key="gb.useDocsDescription"></wicket:message></i></td></tr>
<tr><th><wicket:message key="gb.showRemoteBranches"></wicket:message></th><td class="edit"><input type="checkbox" wicket:id="showRemoteBranches" tabindex="7" /> <i><wicket:message key="gb.showRemoteBranchesDescription"></wicket:message></i></td></tr>
<tr><th><wicket:message key="gb.showReadme"></wicket:message></th><td class="edit"><input type="checkbox" wicket:id="showReadme" tabindex="8" /> <i><wicket:message key="gb.showReadmeDescription"></wicket:message></i></td></tr>
<tr><th><wicket:message key="gb.isFrozen"></wicket:message></th><td class="edit"><input type="checkbox" wicket:id="isFrozen" tabindex="9" /> <i><wicket:message key="gb.isFrozenDescription"></wicket:message></i></td></tr>
- <tr><td style="padding-top:10px;" colspan="2"><hr></hr></td></tr>
+ <tr><td colspan="2"><hr></hr></td></tr>
<tr><th><wicket:message key="gb.accessRestriction"></wicket:message></th><td class="edit"><select class="span6" wicket:id="accessRestriction" tabindex="10" /></td></tr>
<tr><th style="vertical-align: top;"><wicket:message key="gb.permittedUsers"></wicket:message></th><td style="padding:2px;"><span wicket:id="users"></span></td></tr>
- <tr><td style="padding-top:10px;" colspan="2"><hr></hr></td></tr>
+ <tr><td colspan="2"><hr></hr></td></tr>
<tr><th><wicket:message key="gb.federationStrategy"></wicket:message></th><td class="edit"><select class="span6" wicket:id="federationStrategy" tabindex="11" /></td></tr>
- <tr><th style="vertical-align: top;"><wicket:message key="gb.federationSets"></wicket:message></th><td style="padding:2px;"><span wicket:id="federationSets"></span></td></tr>
+ <tr><th style="vertical-align: top;"><wicket:message key="gb.federationSets"></wicket:message></th><td style="padding:2px;"><span wicket:id="federationSets"></span></td></tr>
<tr><th></th><td class="editButton"><input class="btn" type="submit" value="Cancel" wicket:message="value:gb.cancel" wicket:id="cancel" tabindex="12" /> <input class="btn primary" type="submit" value="Save" wicket:message="value:gb.save" wicket:id="save" tabindex="13" /> </td></tr>
</tbody>
</table>
diff --git a/src/com/gitblit/wicket/pages/RepositoriesPage.java b/src/com/gitblit/wicket/pages/RepositoriesPage.java index ce532a76..5339760e 100644 --- a/src/com/gitblit/wicket/pages/RepositoriesPage.java +++ b/src/com/gitblit/wicket/pages/RepositoriesPage.java @@ -34,11 +34,11 @@ import com.gitblit.wicket.panels.RepositoriesPanel; public class RepositoriesPage extends RootPage {
public RepositoriesPage() {
- super();
+ super();
// Load the markdown welcome message
String messageSource = GitBlit.getString(Keys.web.repositoriesMessage, "gitblit");
- String message = "<br/>";
+ String message = "";
if (messageSource.equalsIgnoreCase("gitblit")) {
// Read default welcome message
try {
@@ -69,8 +69,15 @@ public class RepositoriesPage extends RootPage { }
}
Component repositoriesMessage = new Label("repositoriesMessage", message)
- .setEscapeModelStrings(false);
+ .setEscapeModelStrings(false).setVisible(message.length() > 0);
add(repositoriesMessage);
- add(new RepositoriesPanel("repositoriesPanel", showAdmin, null, getAccessRestrictions()));
+ RepositoriesPanel repositories = new RepositoriesPanel("repositoriesPanel", showAdmin,
+ null, getAccessRestrictions());
+ // push the panel down if we are hiding the admin controls and the
+ // welcome message
+ if (!showAdmin && !repositoriesMessage.isVisible()) {
+ WicketUtils.setCssStyle(repositories, "padding-top:5px;");
+ }
+ add(repositories);
}
}
diff --git a/src/com/gitblit/wicket/pages/RepositoryPage.html b/src/com/gitblit/wicket/pages/RepositoryPage.html index 8a8b177e..100016f1 100644 --- a/src/com/gitblit/wicket/pages/RepositoryPage.html +++ b/src/com/gitblit/wicket/pages/RepositoryPage.html @@ -12,8 +12,8 @@ <div class="topbar">
<div class="fill">
<div class="container">
- <a class="brand" title="gitblit homepage" href="http://gitblit.com/">
- <img src="gitblt_25.png" width="79" height="25" alt="gitblit" class="logo"/>
+ <a class="brand" wicket:id="rootLink">
+ <img src="gitblt_25_white.png" width="79" height="25" alt="gitblit" class="logo"/>
</a>
<ul class="nav">
<li><a wicket:id="repositories"><wicket:message key="gb.repositories"></wicket:message></a></li>
diff --git a/src/com/gitblit/wicket/pages/RepositoryPage.java b/src/com/gitblit/wicket/pages/RepositoryPage.java index af29f591..777401a1 100644 --- a/src/com/gitblit/wicket/pages/RepositoryPage.java +++ b/src/com/gitblit/wicket/pages/RepositoryPage.java @@ -137,7 +137,7 @@ public abstract class RepositoryPage extends BasePage { PageRegistration pageReg = registeredPages.get(extra);
item.add(new LinkPanel("extraLink", null, getString(pageReg.translationKey),
pageReg.pageClass, WicketUtils.newRepositoryParameter(repositoryName))
- .setEnabled(!extra.equals(pageWicketId)));
+ /*.setEnabled(!extra.equals(pageWicketId))*/);
}
};
add(extrasView);
@@ -182,8 +182,8 @@ public abstract class RepositoryPage extends BasePage { if (!StringUtils.isEmpty(wicketId)) {
Component c = get(wicketId);
if (c != null) {
- //c.setEnabled(false);
- WicketUtils.setCssClass(c, "active");
+// c.setEnabled(false);
+// WicketUtils.setCssClass(c, "selected");
}
}
}
diff --git a/src/com/gitblit/wicket/pages/RootPage.html b/src/com/gitblit/wicket/pages/RootPage.html index 59a0fe14..0fa6cfc6 100644 --- a/src/com/gitblit/wicket/pages/RootPage.html +++ b/src/com/gitblit/wicket/pages/RootPage.html @@ -8,8 +8,8 @@ <div class="topbar">
<div class="fill">
<div class="container">
- <a class="brand" title="gitblit homepage" href="http://gitblit.com/">
- <img src="gitblt_25.png" width="79" height="25" alt="gitblit" class="logo"/>
+ <a class="brand" wicket:id="rootLink">
+ <img src="gitblt_25_white.png" width="79" height="25" alt="gitblit" class="logo"/>
</a>
<ul class="nav">
diff --git a/src/com/gitblit/wicket/pages/StandardPage.html b/src/com/gitblit/wicket/pages/StandardPage.html index cb6dcd5c..14ec15c8 100644 --- a/src/com/gitblit/wicket/pages/StandardPage.html +++ b/src/com/gitblit/wicket/pages/StandardPage.html @@ -10,9 +10,9 @@ <div class="topbar">
<div class="fill">
<div class="container">
- <a class="brand" title="gitblit homepage" href="http://gitblit.com/">
- <img src="gitblt_25.png" width="79" height="25" alt="gitblit" class="logo"/>
- </a>
+ <a class="brand" wicket:id="rootLink">
+ <img src="gitblt_25_white.png" width="79" height="25" alt="gitblit" class="logo"/>
+ </a>
</div>
</div>
</div>
diff --git a/src/com/gitblit/wicket/pages/StandardPage.java b/src/com/gitblit/wicket/pages/StandardPage.java index ff16b631..45989317 100644 --- a/src/com/gitblit/wicket/pages/StandardPage.java +++ b/src/com/gitblit/wicket/pages/StandardPage.java @@ -18,6 +18,8 @@ package com.gitblit.wicket.pages; import org.apache.wicket.PageParameters;
import org.apache.wicket.markup.html.basic.Label;
+import com.gitblit.utils.StringUtils;
+
public abstract class StandardPage extends BasePage {
public StandardPage() {
@@ -34,7 +36,10 @@ public abstract class StandardPage extends BasePage { protected void setupPage(String pageName, String subName) {
add(new Label("pageName", pageName));
- add(new Label("pageSubName", "/ " + subName));
+ if (!StringUtils.isEmpty(subName)) {
+ subName = "/ " + subName;
+ }
+ add(new Label("pageSubName", subName));
super.setupPage("", pageName);
}
}
|