* Strip leading group name from repositories page.
* Put topbars on all pages.
* Properly sort repositories in all locations.
* White Gitblit logo.
-.topbar{\r
+body, input, select {\r
+ color: #202020;\r
+}\r
+\r
+ul, ol {\r
+ margin:0 !important;\r
+}\r
+\r
+hr {\r
+ margin-top: 10px;\r
+ margin-bottom: 10px;\r
+}\r
+\r
+.page-header h1, .page-header h2 {\r
+ color: #0069D6;\r
+}\r
+\r
+.topbar {\r
height:40px !important;\r
}\r
\r
+.topbar a {\r
+ color: white; \r
+ text-shadow: none;\r
+}\r
+\r
+.nav a:hover {\r
+ color: #abd4ff !important;\r
+}\r
+\r
.topbar-inner,.topbar .fill{\r
height:40px !important;\r
background-color:#000050;\r
\r
a.list {\r
text-decoration: none;\r
- color: #000000;\r
+ color: inherit;\r
}\r
\r
a.list.subject {\r
color: black;\r
background-color: #ddd;\r
padding-left: 5px;\r
- border-top: 1px solid #ccc;\r
- border-bottom: 1px solid #ccc;\r
+ border-top: 1px solid #aaa; \r
+ border-bottom: 1px solid #aaa; \r
}\r
\r
table.palette { border:0; width: 0 !important; }\r
}\r
\r
table.annotated {\r
- width: 100%;\r
- border: 1px solid #bbb;\r
}\r
\r
table.annotated tr.even {\r
}\r
\r
table.annotated tr.odd {\r
- background-color: #fdfbdf;\r
+ background-color: #f5f5f5;\r
}\r
\r
table.annotated td {\r
border: 0;\r
}\r
\r
+tr th a { background-position: right; padding-right: 15px; background-repeat:no-repeat; }\r
+tr th.wicket_orderDown a {background-image: url(arrow_down.png); }\r
+tr th.wicket_orderUp a { background-image: url(arrow_up.png); }\r
+tr th.wicket_orderNone a { background-image: url(arrow_off.png); }\r
+\r
tr.light {\r
background-color: #ffffff;\r
}\r
\r
.feedbackPanelERROR, .feedbackPanelINFO { \r
list-style: none;\r
+ line-height: 35px;\r
}\r
\r
.feedbackPanelINFO span, .feedbackPanelERROR span {\r
import com.gitblit.Constants.FederationToken;\r
import com.gitblit.models.FederationModel;\r
import com.gitblit.models.FederationProposal;\r
-import com.gitblit.models.RepositoryModel;\r
import com.gitblit.models.UserModel;\r
import com.gitblit.utils.FederationUtils;\r
import com.gitblit.utils.HttpUtils;\r
@Override\r
public int compareTo(RepositoryStatus o) {\r
if (status.equals(o.status)) {\r
- // sort root repositories first, alphabetically\r
- // then sort grouped repositories, alphabetically\r
- int s1 = name.indexOf('/');\r
- int s2 = o.name.indexOf('/');\r
- if (s1 == -1 && s2 == -1) {\r
- // neither grouped\r
- return name.compareTo(o.name);\r
- } else if (s1 > -1 && s2 > -1) {\r
- // both grouped\r
- return name.compareTo(o.name);\r
- } else if (s1 == -1) {\r
- return -1;\r
- } else if (s2 == -1) {\r
- return 1;\r
- }\r
- return 0;\r
+ return StringUtils.compareRepositoryNames(name, o.name);\r
}\r
return status.compareTo(o.status);\r
}\r
\r
import com.gitblit.Constants.AccessRestrictionType;\r
import com.gitblit.Constants.FederationStrategy;\r
+import com.gitblit.utils.StringUtils;\r
\r
/**\r
* RepositoryModel is a serializable model class that represents a Gitblit\r
\r
@Override\r
public int compareTo(RepositoryModel o) {\r
- return name.compareTo(o.name);\r
+ return StringUtils.compareRepositoryNames(name, o.name);\r
}\r
}
\ No newline at end of file
}\r
list.addAll(getRepositoryList(repositoriesFolder.getAbsolutePath(), repositoriesFolder,\r
exportAll, searchSubfolders));\r
- Collections.sort(list);\r
+ StringUtils.sortRepositorynames(list);\r
return list;\r
}\r
\r
import java.security.MessageDigest;\r
import java.security.NoSuchAlgorithmException;\r
import java.util.ArrayList;\r
+import java.util.Collections;\r
+import java.util.Comparator;\r
import java.util.List;\r
import java.util.regex.PatternSyntaxException;\r
\r
}\r
return false;\r
}\r
+\r
+ /**\r
+ * Compare two repository names for proper group sorting.\r
+ * \r
+ * @param r1\r
+ * @param r2\r
+ * @return\r
+ */\r
+ public static int compareRepositoryNames(String r1, String r2) {\r
+ // sort root repositories first, alphabetically\r
+ // then sort grouped repositories, alphabetically\r
+ int s1 = r1.indexOf('/');\r
+ int s2 = r2.indexOf('/');\r
+ if (s1 == -1 && s2 == -1) {\r
+ // neither grouped\r
+ return r1.compareTo(r2);\r
+ } else if (s1 > -1 && s2 > -1) {\r
+ // both grouped\r
+ return r1.compareTo(r2);\r
+ } else if (s1 == -1) {\r
+ return -1;\r
+ } else if (s2 == -1) {\r
+ return 1;\r
+ }\r
+ return 0;\r
+ }\r
+\r
+ /**\r
+ * Sort grouped repository names.\r
+ * \r
+ * @param list\r
+ */\r
+ public static void sortRepositorynames(List<String> list) {\r
+ Collections.sort(list, new Comparator<String>() {\r
+ @Override\r
+ public int compare(String o1, String o2) {\r
+ return compareRepositoryNames(o1, o2);\r
+ }\r
+ });\r
+ }\r
}\r
}\r
\r
public static void setAlternatingBackground(Component c, int i) {\r
- String clazz = i % 2 == 0 ? "dark" : "light";\r
+ String clazz = i % 2 == 0 ? "light" : "dark";\r
setCssClass(c, clazz);\r
}\r
\r
<!-- page footer -->\r
<div class="page_footer">\r
<div style="float:right">\r
- <span wicket:id="gbVersion"></span> \r
+ <a title="gitblit homepage" href="http://gitblit.com/">\r
+ <span wicket:id="gbVersion"></span>\r
+ </a> \r
</div>\r
<div wicket:id="userPanel">[user panel]</div>\r
</div>\r
import org.apache.wicket.markup.html.WebPage;\r
import org.apache.wicket.markup.html.basic.Label;\r
import org.apache.wicket.markup.html.link.BookmarkablePageLink;\r
+import org.apache.wicket.markup.html.link.ExternalLink;\r
import org.apache.wicket.markup.html.panel.FeedbackPanel;\r
import org.apache.wicket.markup.html.panel.Fragment;\r
import org.apache.wicket.protocol.http.WebRequest;\r
import com.gitblit.Keys;\r
import com.gitblit.models.UserModel;\r
import com.gitblit.wicket.GitBlitWebSession;\r
+import com.gitblit.wicket.WicketUtils;\r
import com.gitblit.wicket.panels.LinkPanel;\r
\r
public abstract class BasePage extends WebPage {\r
add(new Label("title", getServerName()));\r
}\r
\r
+ ExternalLink rootLink = new ExternalLink("rootLink", urlFor(RepositoriesPage.class, null).toString());\r
+ WicketUtils.setHtmlTooltip(rootLink, GitBlit.getString(Keys.web.siteName, Constants.NAME));\r
+ add(rootLink);\r
+\r
// Feedback panel for info, warning, and non-fatal error messages\r
add(new FeedbackPanel("feedback"));\r
\r
<div wicket:id="breadcrumbs">[breadcrumbs]</div>\r
\r
<!-- blame content -->\r
- <table class="annotated" style="border-top: 0px; margin-bottom:5px;">\r
+ <table class="annotated" style="margin-bottom:5px;">\r
<tbody>\r
<tr>\r
<th>Commit</th>\r
<th>Line</th>\r
- <th>Data</th>\r
+ <th>Content</th>\r
</tr>\r
<tr wicket:id="annotation">\r
<td><span class="sha1" wicket:id="commit"></span></td>\r
xml:lang="en" \r
lang="en"> \r
\r
- <!-- Head with Wicket-controlled resources in this package -->\r
- <wicket:head>\r
- <title wicket:id="title">[page title]</title>\r
- <link rel="stylesheet" type="text/css" href="gitblit.css"/>\r
- <link rel="shortcut icon" href="gitblt-favicon.png" type="image/png" />\r
- </wicket:head>\r
- \r
+ <wicket:extend>\r
<body onload="document.getElementById('password').focus();">\r
<div>\r
- <div style="padding-top: 10px;text-align:center;">\r
- <img src="gitblt_25.png" alt="Gitblit"/><br/>\r
- <div style="padding-top:30px;font-weight:bold;" wicket:id="name"></div>\r
- </div>\r
- <p/>\r
<form style="text-align:center;" wicket:id="passwordForm">\r
<center>\r
<table class="plain">\r
<td class="edit"><input type="password" wicket:id="confirmPassword" size="30" tabindex="2" /></td>\r
</tr>\r
</table>\r
- <input type="submit" wicket:message="value:gb.save" wicket:id="save" tabindex="3" />\r
- <input type="submit" wicket:message="value:gb.cancel" wicket:id="cancel" tabindex="4" />\r
- <div style="padding-top:10px;" wicket:id="feedback"></div>\r
+ <input class="btn" type="submit" wicket:message="value:gb.cancel" wicket:id="cancel" tabindex="3" />\r
+ <input class="btn primary" type="submit" wicket:message="value:gb.save" wicket:id="save" tabindex="4" />\r
</center>\r
</form> \r
</div>\r
</body>\r
+ </wicket:extend>\r
</html>
\ No newline at end of file
import java.text.MessageFormat;\r
\r
import org.apache.wicket.RestartResponseException;\r
-import org.apache.wicket.markup.html.WebPage;\r
-import org.apache.wicket.markup.html.basic.Label;\r
import org.apache.wicket.markup.html.form.Button;\r
import org.apache.wicket.markup.html.form.PasswordTextField;\r
import org.apache.wicket.markup.html.form.StatelessForm;\r
-import org.apache.wicket.markup.html.panel.FeedbackPanel;\r
import org.apache.wicket.model.IModel;\r
import org.apache.wicket.model.Model;\r
import org.apache.wicket.protocol.http.WebResponse;\r
\r
-import com.gitblit.Constants;\r
import com.gitblit.GitBlit;\r
import com.gitblit.GitBlitException;\r
import com.gitblit.Keys;\r
import com.gitblit.utils.StringUtils;\r
import com.gitblit.wicket.GitBlitWebSession;\r
\r
-public class ChangePasswordPage extends WebPage {\r
+public class ChangePasswordPage extends StandardPage {\r
\r
IModel<String> password = new Model<String>("");\r
IModel<String> confirmPassword = new Model<String>("");\r
// no authentication enabled\r
throw new RestartResponseException(getApplication().getHomePage());\r
}\r
-\r
- add(new Label("title", GitBlit.getString(Keys.web.siteName, Constants.NAME)));\r
- add(new Label("name", getString("gb.changePassword") + ": "\r
- + GitBlitWebSession.get().getUser().username));\r
+ setupPage(getString("gb.changePassword"), GitBlitWebSession.get().getUser().username);\r
\r
StatelessForm<Void> form = new StatelessForm<Void>("passwordForm") {\r
\r
confirmPassword);\r
confirmPasswordField.setResetPassword(false);\r
form.add(confirmPasswordField);\r
- form.add(new FeedbackPanel("feedback"));\r
\r
form.add(new Button("save"));\r
Button cancel = new Button("cancel") {\r
<tbody>\r
<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>\r
<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>\r
- <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>\r
+ <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>\r
<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>\r
<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>\r
<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>\r
<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>\r
<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>\r
<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>\r
- <tr><td style="padding-top:10px;" colspan="2"><hr></hr></td></tr>\r
+ <tr><td colspan="2"><hr></hr></td></tr>\r
<tr><th><wicket:message key="gb.accessRestriction"></wicket:message></th><td class="edit"><select class="span6" wicket:id="accessRestriction" tabindex="10" /></td></tr> \r
<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>\r
- <tr><td style="padding-top:10px;" colspan="2"><hr></hr></td></tr> \r
+ <tr><td colspan="2"><hr></hr></td></tr> \r
<tr><th><wicket:message key="gb.federationStrategy"></wicket:message></th><td class="edit"><select class="span6" wicket:id="federationStrategy" tabindex="11" /></td></tr>\r
- <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> \r
+ <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>\r
<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>\r
</tbody>\r
</table>\r
public class RepositoriesPage extends RootPage {\r
\r
public RepositoriesPage() {\r
- super(); \r
+ super();\r
\r
// Load the markdown welcome message\r
String messageSource = GitBlit.getString(Keys.web.repositoriesMessage, "gitblit");\r
- String message = "<br/>";\r
+ String message = "";\r
if (messageSource.equalsIgnoreCase("gitblit")) {\r
// Read default welcome message\r
try {\r
}\r
}\r
Component repositoriesMessage = new Label("repositoriesMessage", message)\r
- .setEscapeModelStrings(false);\r
+ .setEscapeModelStrings(false).setVisible(message.length() > 0);\r
add(repositoriesMessage);\r
- add(new RepositoriesPanel("repositoriesPanel", showAdmin, null, getAccessRestrictions())); \r
+ RepositoriesPanel repositories = new RepositoriesPanel("repositoriesPanel", showAdmin,\r
+ null, getAccessRestrictions());\r
+ // push the panel down if we are hiding the admin controls and the\r
+ // welcome message\r
+ if (!showAdmin && !repositoriesMessage.isVisible()) {\r
+ WicketUtils.setCssStyle(repositories, "padding-top:5px;");\r
+ }\r
+ add(repositories);\r
}\r
}\r
<div class="topbar">\r
<div class="fill">\r
<div class="container">\r
- <a class="brand" title="gitblit homepage" href="http://gitblit.com/">\r
- <img src="gitblt_25.png" width="79" height="25" alt="gitblit" class="logo"/>\r
+ <a class="brand" wicket:id="rootLink">\r
+ <img src="gitblt_25_white.png" width="79" height="25" alt="gitblit" class="logo"/>\r
</a>\r
<ul class="nav"> \r
<li><a wicket:id="repositories"><wicket:message key="gb.repositories"></wicket:message></a></li>\r
PageRegistration pageReg = registeredPages.get(extra);\r
item.add(new LinkPanel("extraLink", null, getString(pageReg.translationKey),\r
pageReg.pageClass, WicketUtils.newRepositoryParameter(repositoryName))\r
- .setEnabled(!extra.equals(pageWicketId)));\r
+ /*.setEnabled(!extra.equals(pageWicketId))*/);\r
}\r
};\r
add(extrasView);\r
if (!StringUtils.isEmpty(wicketId)) {\r
Component c = get(wicketId);\r
if (c != null) {\r
- //c.setEnabled(false);\r
- WicketUtils.setCssClass(c, "active");\r
+// c.setEnabled(false);\r
+// WicketUtils.setCssClass(c, "selected");\r
}\r
}\r
}\r
<div class="topbar">\r
<div class="fill">\r
<div class="container">\r
- <a class="brand" title="gitblit homepage" href="http://gitblit.com/">\r
- <img src="gitblt_25.png" width="79" height="25" alt="gitblit" class="logo"/> \r
+ <a class="brand" wicket:id="rootLink">\r
+ <img src="gitblt_25_white.png" width="79" height="25" alt="gitblit" class="logo"/>\r
</a>\r
\r
<ul class="nav"> \r
<div class="topbar">\r
<div class="fill">\r
<div class="container">\r
- <a class="brand" title="gitblit homepage" href="http://gitblit.com/">\r
- <img src="gitblt_25.png" width="79" height="25" alt="gitblit" class="logo"/> \r
- </a> \r
+ <a class="brand" wicket:id="rootLink">\r
+ <img src="gitblt_25_white.png" width="79" height="25" alt="gitblit" class="logo"/>\r
+ </a>\r
</div>\r
</div>\r
</div>\r
import org.apache.wicket.PageParameters;\r
import org.apache.wicket.markup.html.basic.Label;\r
\r
+import com.gitblit.utils.StringUtils;\r
+\r
public abstract class StandardPage extends BasePage {\r
\r
public StandardPage() {\r
\r
protected void setupPage(String pageName, String subName) { \r
add(new Label("pageName", pageName));\r
- add(new Label("pageSubName", "/ " + subName));\r
+ if (!StringUtils.isEmpty(subName)) {\r
+ subName = "/ " + subName;\r
+ }\r
+ add(new Label("pageSubName", subName));\r
super.setupPage("", pageName);\r
}\r
}\r
</wicket:fragment>\r
\r
<wicket:fragment wicket:id="repositoryRow">\r
- <td class="left"><div class="list" wicket:id="repositoryName">[repository name]</div></td>\r
+ <td class="left" style="padding-left:10px;" ><div class="list" wicket:id="repositoryName">[repository name]</div></td>\r
<td><div class="list" wicket:id="repositoryDescription">[repository description]</div></td>\r
<td class="author"><span wicket:id="repositoryOwner">[repository owner]</span></td>\r
<td style="text-align: right;padding-right:10px;"><img class="inlineIcon" wicket:id="ticketsIcon" /><img class="inlineIcon" wicket:id="docsIcon" /><img class="inlineIcon" wicket:id="frozenIcon" /><img class="inlineIcon" wicket:id="federatedIcon" /><img class="inlineIcon" wicket:id="accessRestrictionIcon" /></td>\r
} else {\r
dp = new SortableRepositoriesProvider(models);\r
}\r
- \r
+\r
final String baseUrl = WicketUtils.getGitblitURL(getRequest());\r
\r
DataView<RepositoryModel> dataView = new DataView<RepositoryModel>("row", dp) {\r
private static final long serialVersionUID = 1L;\r
int counter;\r
+ String currGroupName;\r
\r
@Override\r
protected void onBeforeRender() {\r
public void populateItem(final Item<RepositoryModel> item) {\r
final RepositoryModel entry = item.getModelObject();\r
if (entry instanceof GroupRepositoryModel) {\r
+ currGroupName = entry.name;\r
Fragment row = new Fragment("rowContent", "groupRepositoryRow", this);\r
item.add(row);\r
row.add(new Label("groupName", entry.toString()));\r
WicketUtils.setCssClass(item, "group");\r
+ // reset counter so that first row is light background\r
+ counter = 0;\r
return;\r
}\r
Fragment row = new Fragment("rowContent", "repositoryRow", this);\r
item.add(row);\r
+ \r
+ // try to strip group name for less cluttered list\r
+ String repoName = entry.name;\r
+ if (!StringUtils.isEmpty(currGroupName) && (repoName.indexOf('/') > -1)) {\r
+ repoName = repoName.substring(currGroupName.length() + 1);\r
+ }\r
+ \r
if (entry.hasCommits && linksActive) {\r
PageParameters pp = WicketUtils.newRepositoryParameter(entry.name);\r
- row.add(new LinkPanel("repositoryName", "list", entry.name, SummaryPage.class,\r
- pp));\r
+ row.add(new LinkPanel("repositoryName", "list", repoName, SummaryPage.class, pp));\r
row.add(new LinkPanel("repositoryDescription", "list", entry.description,\r
SummaryPage.class, pp));\r
} else {\r
// new/empty repository OR proposed repository\r
- row.add(new Label("repositoryName", entry.name));\r
+ row.add(new Label("repositoryName", repoName));\r
row.add(new Label("repositoryDescription", entry.description));\r
}\r
\r