# Control if email addresses are shown in web ui\r
web.showEmailAddresses = true\r
\r
+# Shows a combobox in the page links header with commit, committer, and author\r
+# search selection. Default search is commit.\r
+web.showSearchTypeSelection = false\r
+\r
# Generates a line graph of repository activity over time on the Summary page.\r
# This is a real-time graph so generation may be expensive. \r
web.generateActivityGraph = true\r
# Value must exceed 0 else default of 5 is used\r
web.summaryRefsCount = 5\r
\r
-# The number of commits to show on each page of a Log\r
-# Value must exceed 0 else default of 50 is used\r
-web.logPageCommitCount = 50\r
+# The number of items to show on a page before showing the first, prev, next\r
+# pagination links. A default if 50 is used for any invalid value.\r
+web.itemsPerPage = 50\r
\r
# Registered extensions for google-code-prettify\r
web.prettyPrintExtensions = c cpp cs css htm html java js php pl prefs properties py rb sh sql xml vb\r
# Example per-repository regex substitutions overrides global\r
#regex.myrepository.bug = \\b(Bug:)(\\s*[#]?|-){0,1}(\\d+)\\b!!!<a href="http://elsewhere/bug/$3">Bug-Id: $3</a>\r
\r
-# Enable tickets pages for all repositories (if ticgit branch is present)\r
-tickets.global = false\r
-\r
-# Enable tickets pages for specified repository (if ticgit branch is present)\r
-#tickets.myrepository = true\r
-\r
#\r
# Server Settings\r
#\r
JGitUtils.setRepositoryOwner(r, repository.owner);\r
JGitUtils.setRepositoryUseTickets(r, repository.useTickets);\r
JGitUtils.setRepositoryUseDocs(r, repository.useDocs);\r
- JGitUtils.setRepositoryUseNamedUsers(r, repository.useNamedUsers);\r
+ JGitUtils.setRepositoryRestrictedAccess(r, repository.useRestrictedAccess);\r
}\r
\r
public List<String> getRepositoryList() {\r
Repository r = getRepository(repo);\r
String description = JGitUtils.getRepositoryDescription(r);\r
String owner = JGitUtils.getRepositoryOwner(r);\r
+ String group = JGitUtils.getRepositoryGroup(r);\r
Date lastchange = JGitUtils.getLastChange(r);\r
+ RepositoryModel model = new RepositoryModel(repo, description, owner, lastchange);\r
+ model.group = group;\r
+ model.useTickets = JGitUtils.getRepositoryUseTickets(r);\r
+ model.useDocs = JGitUtils.getRepositoryUseDocs(r);\r
+ model.useRestrictedAccess = JGitUtils.getRepositoryRestrictedAccess(r);\r
r.close();\r
- repositories.add(new RepositoryModel(repo, description, owner, lastchange));\r
+ repositories.add(model);\r
}\r
return repositories;\r
}\r
setRepositoryConfigString(r, "owner", owner);\r
}\r
\r
+ public static String getRepositoryGroup(Repository r) {\r
+ return getRepositoryConfigString(r, "group");\r
+ }\r
+ \r
+ public static void setRepositoryGroup(Repository r, String group) {\r
+ setRepositoryConfigString(r, "group", group);\r
+ } \r
+ \r
public static boolean getRepositoryUseTickets(Repository r) {\r
return getRepositoryConfigBoolean(r, "useTickets", false);\r
}\r
setRepositoryConfigBoolean(r, "useDocs", value);\r
}\r
\r
- public static boolean getRepositoryUseNamedUsers(Repository r) {\r
- return getRepositoryConfigBoolean(r, "useNamedUsers", false);\r
+ public static boolean getRepositoryRestrictedAccess(Repository r) {\r
+ return getRepositoryConfigBoolean(r, "restrictedAccess", false);\r
}\r
\r
- public static void setRepositoryUseNamedUsers(Repository r, boolean value) {\r
- setRepositoryConfigBoolean(r, "useNamedUsers", value);\r
+ public static void setRepositoryRestrictedAccess(Repository r, boolean value) {\r
+ setRepositoryConfigBoolean(r, "restrictedAccess", value);\r
} \r
\r
public static String getRepositoryConfigString(Repository r, String field) {\r
metrics.add(0, total);\r
return metrics;\r
}\r
+ \r
+ public static RefModel getDocumentsBranch(Repository r) {\r
+ return getTicketsBranch(r);\r
+ }\r
\r
public static RefModel getTicketsBranch(Repository r) {\r
RefModel ticgitBranch = null;\r
gb.missingUsername = Missing Username\r
gb.edit = edit\r
gb.searchTypeTooltip = Select Search Type\r
-gb.searchTooltip = Search Git:Blit
\ No newline at end of file
+gb.searchTooltip = Search Git:Blit\r
+gb.rename = rename\r
+gb.delete = delete\r
+gb.docs = docs\r
+gb.restrictedAccess = restricted access
\ No newline at end of file
\r
protected void setPersonSearchTooltip(Component component, String value, SearchType searchType) {\r
if (searchType.equals(SearchType.AUTHOR)) {\r
- WicketUtils.setHtmlTitle(component, getString("gb.searchForAuthor") + " " + value);\r
+ WicketUtils.setHtmlTooltip(component, getString("gb.searchForAuthor") + " " + value);\r
} else if (searchType.equals(SearchType.COMMITTER)) {\r
- WicketUtils.setHtmlTitle(component, getString("gb.searchForCommitter") + " " + value);\r
+ WicketUtils.setHtmlTooltip(component, getString("gb.searchForCommitter") + " " + value);\r
}\r
}\r
\r
protected void setChangeTypeTooltip(Component container, ChangeType type) {\r
switch (type) {\r
case ADD:\r
- WicketUtils.setHtmlTitle(container, getString("gb.addition"));\r
+ WicketUtils.setHtmlTooltip(container, getString("gb.addition"));\r
break;\r
case COPY:\r
case RENAME:\r
- WicketUtils.setHtmlTitle(container, getString("gb.rename"));\r
+ WicketUtils.setHtmlTooltip(container, getString("gb.rename"));\r
break;\r
case DELETE:\r
- WicketUtils.setHtmlTitle(container, getString("gb.deletion"));\r
+ WicketUtils.setHtmlTooltip(container, getString("gb.deletion"));\r
break;\r
case MODIFY:\r
- WicketUtils.setHtmlTitle(container, getString("gb.modification"));\r
+ WicketUtils.setHtmlTooltip(container, getString("gb.modification"));\r
break;\r
}\r
}\r
import org.apache.wicket.PageParameters;\r
import org.apache.wicket.behavior.SimpleAttributeModifier;\r
import org.apache.wicket.markup.html.basic.Label;\r
+import org.apache.wicket.markup.html.image.ContextImage;\r
+import org.apache.wicket.resource.ContextRelativeResource;\r
import org.eclipse.jgit.diff.DiffEntry.ChangeType;\r
import org.eclipse.jgit.lib.Constants;\r
\r
container.add(new SimpleAttributeModifier("style", value));\r
}\r
\r
- public static void setHtmlTitle(Component container, String value) {\r
+ public static void setHtmlTooltip(Component container, String value) {\r
container.add(new SimpleAttributeModifier("title", value));\r
}\r
\r
\r
public static Label createAuthorLabel(String wicketId, String author) {\r
Label label = new Label(wicketId, author);\r
- WicketUtils.setHtmlTitle(label, author);\r
+ WicketUtils.setHtmlTooltip(label, author);\r
return label;\r
}\r
\r
+ public static ContextImage newClearPixel(String wicketId) {\r
+ return newImage(wicketId, "pixel.png");\r
+ }\r
+ \r
+ public static ContextImage newBlankImage(String wicketId) {\r
+ return newImage(wicketId, "blank.png");\r
+ }\r
+\r
+ public static ContextImage newImage(String wicketId, String file) {\r
+ return newImage(wicketId, file, null);\r
+ }\r
+\r
+ public static ContextImage newImage(String wicketId, String file, String tooltip) {\r
+ ContextImage img = new ContextImage(wicketId, "/com/gitblit/wicket/resources/" + file);\r
+ if (!StringUtils.isEmpty(tooltip)) {\r
+ setHtmlTooltip(img, tooltip);\r
+ }\r
+ return img;\r
+ }\r
+ \r
+ public static ContextRelativeResource getResource(String file) {\r
+ return new ContextRelativeResource("/com/gitblit/wicket/resources/" + file);\r
+ }\r
+\r
public static PageParameters newRepositoryParameter(String repositoryName) {\r
return new PageParameters("r=" + repositoryName);\r
}\r
}\r
Label label = new Label(wicketId, dateString);\r
WicketUtils.setCssClass(label, TimeUtils.timeAgoCss(date));\r
- WicketUtils.setHtmlTitle(label, title);\r
+ WicketUtils.setHtmlTooltip(label, title);\r
return label;\r
}\r
\r
String dateString = df.format(date);\r
String title = TimeUtils.timeAgo(date);\r
Label label = new Label(wicketId, dateString);\r
- WicketUtils.setHtmlTitle(label, title);\r
+ WicketUtils.setHtmlTooltip(label, title);\r
return label;\r
}\r
}\r
public String name;\r
public String description;\r
public String owner;\r
+ public String group;\r
public Date lastChange;\r
public boolean useTickets;\r
public boolean useDocs;\r
- public boolean useNamedUsers;\r
+ public boolean useRestrictedAccess;\r
\r
public RepositoryModel(String name, String description, String owner, Date lastchange) {\r
this.name = name;\r
<form wicket:id="editForm">\r
<table class="plain">\r
<tbody>\r
- <tr><th>Name</th><td><input type="text" wicket:id="name" size="30" /></td></tr>\r
- <tr><th>Description</th><td><input type="text" wicket:id="description" size="80" /></td></tr>\r
- <tr><th>Owner</th><td><input type="text" wicket:id="owner" size="30" /></td></tr>\r
- <tr><th>Use Git:Blit Tickets</th><td><input type="checkbox" wicket:id="useTickets"/>distributed Git:Blit ticketing</td></tr>\r
- <tr><th>Use Git:Blit Docs</th><td><input type="checkbox" wicket:id="useDocs"/>distributed Git:Blit documentation</td></tr>\r
- <tr><th>Named User Access</th><td><input type="checkbox" wicket:id="useNamedUsers"/>not implemented</td></tr>\r
- <tr><td colspan="2"><input type="submit" value="Submit"/></td></tr>\r
+ <tr><th>Name</th><td class="edit"><input type="text" wicket:id="name" size="30" tabindex="1" /></td></tr>\r
+ <tr><th>Description</th><td class="edit"><input type="text" wicket:id="description" size="80" tabindex="2" /></td></tr>\r
+ <tr><th>Owner</th><td class="edit"><input type="text" wicket:id="owner" size="30" tabindex="3" /></td></tr>\r
+ <tr><th>Group</th><td class="edit"><input type="text" wicket:id="group" size="30" tabindex="4" /></td></tr>\r
+ <tr><th>Enable Tickets</th><td class="edit"><input type="checkbox" wicket:id="useTickets" tabindex="5" /> <i>distributed Ticgit ticketing</i></td></tr>\r
+ <tr><th>Enable Docs</th><td class="edit"><input type="checkbox" wicket:id="useDocs" tabindex="6" /> <i>distributed Markdown documentation</i></td></tr>\r
+ <tr><td class="edit" colspan="2"><input type="submit" value="Submit" tabindex="7" /></td></tr>\r
</tbody>\r
</table>\r
</form> \r
import org.apache.wicket.markup.html.form.Form;\r
import org.apache.wicket.markup.html.form.TextField;\r
import org.apache.wicket.model.CompoundPropertyModel;\r
+import org.eclipse.jgit.lib.Repository;\r
\r
import com.gitblit.GitBlit;\r
+import com.gitblit.utils.JGitUtils;\r
import com.gitblit.wicket.AdminPage;\r
import com.gitblit.wicket.BasePage;\r
import com.gitblit.wicket.WicketUtils;\r
// edit constructor\r
super(params);\r
isCreate = false;\r
- String repositoryName = WicketUtils.getRepositoryName(params);\r
- setupPage(new RepositoryModel(repositoryName, "", "", new Date()));\r
+ String name = WicketUtils.getRepositoryName(params);\r
+ Repository r = GitBlit.self().getRepository(name);\r
+ String description = JGitUtils.getRepositoryDescription(r);\r
+ String owner = JGitUtils.getRepositoryOwner(r);\r
+ String group = JGitUtils.getRepositoryGroup(r);\r
+ RepositoryModel model = new RepositoryModel(name, description, owner, new Date());\r
+ model.group = group;\r
+ model.useTickets = JGitUtils.getRepositoryUseTickets(r);\r
+ model.useDocs = JGitUtils.getRepositoryUseDocs(r);\r
+ model.useRestrictedAccess = JGitUtils.getRepositoryRestrictedAccess(r);\r
+ setupPage(model);\r
}\r
\r
protected void setupPage(final RepositoryModel repository) {\r
form.add(new TextField<String>("name").setEnabled(isCreate));\r
form.add(new TextField<String>("description"));\r
form.add(new TextField<String>("owner"));\r
+ form.add(new TextField<String>("group"));\r
form.add(new CheckBox("useTickets"));\r
form.add(new CheckBox("useDocs"));\r
- form.add(new CheckBox("useNamedUsers"));\r
\r
add(form);\r
}\r
<th wicket:id="orderByRepository"><wicket:message key="gb.repository">Repository</wicket:message></th>\r
<th wicket:id="orderByDescription"><wicket:message key="gb.description">Description</wicket:message></th>\r
<th wicket:id="orderByOwner"><wicket:message key="gb.owner">Owner</wicket:message></th>\r
+ <th></th>\r
<th wicket:id="orderByDate"><wicket:message key="gb.lastChange">Last Change</wicket:message></th>\r
<th></th>\r
</tr>\r
<td><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 class="icon"><img wicket:id="ticketsIcon" /><img wicket:id="docsIcon" /><img wicket:id="restrictedAccessIcon" /></td>\r
<td><span wicket:id="repositoryLastChange">[last change]</span></td>\r
- <td><a wicket:id="repositoryLinks"><wicket:message key="gb.edit">[edit]</wicket:message></a></td>\r
+ <td class="rightAlign"><span wicket:id="repositoryLinks"></span></td>\r
</tr>\r
</tbody>\r
</table>\r
<a wicket:id="newRepository"><wicket:message key="gb.newRepository"></wicket:message></a> | <a wicket:id="newUser"><wicket:message key="gb.newUser"></wicket:message></a>\r
</div> \r
</wicket:fragment>\r
+ \r
+ <wicket:fragment wicket:id="repositoryAdminLinks">\r
+ <span class="link"><a wicket:id="editRepository"><wicket:message key="gb.edit">[edit]</wicket:message></a> | <a wicket:id="renameRepository"><wicket:message key="gb.rename">[rename]</wicket:message></a> | <a wicket:id="deleteRepository"><wicket:message key="gb.delete">[delete]</wicket:message></a></span>\r
+ </wicket:fragment>\r
</wicket:extend>\r
</body>\r
</html>
\ No newline at end of file
} else {\r
showAdmin = GitBlit.self().settings().getBoolean(Keys.web.allowAdministration, false);\r
}\r
- \r
+\r
Fragment adminLinks = new Fragment("adminPanel", "adminLinks", this);\r
adminLinks.add(new BookmarkablePageLink<Void>("newRepository", EditRepositoryPage.class));\r
adminLinks.add(new BookmarkablePageLink<Void>("newUser", RepositoriesPage.class));\r
if (messageSource.equalsIgnoreCase("gitblit")) {\r
// Read default welcome message\r
try {\r
- ContextRelativeResource res = new ContextRelativeResource("/com/gitblit/wicket/resources/welcome.mkd");\r
+ ContextRelativeResource res = WicketUtils.getResource("welcome.mkd");\r
InputStream is = res.getResourceStream().getInputStream();\r
InputStreamReader reader = new InputStreamReader(is);\r
StringWriter writer = new StringWriter();\r
PageParameters pp = WicketUtils.newRepositoryParameter(entry.name);\r
item.add(new LinkPanel("repositoryName", "list", entry.name, SummaryPage.class, pp));\r
item.add(new LinkPanel("repositoryDescription", "list", entry.description, SummaryPage.class, pp));\r
+\r
+ if (entry.useTickets) {\r
+ item.add(WicketUtils.newImage("ticketsIcon", "bug_16x16.png", getString("gb.tickets")));\r
+ } else {\r
+ item.add(WicketUtils.newClearPixel("ticketsIcon"));\r
+ }\r
+ \r
+ if (entry.useDocs) {\r
+ item.add(WicketUtils.newImage("docsIcon", "book_16x16.png", getString("gb.docs")));\r
+ } else {\r
+ item.add(WicketUtils.newClearPixel("docsIcon"));\r
+ }\r
+ \r
+ if (entry.useRestrictedAccess) {\r
+ item.add(WicketUtils.newImage("restrictedAccessIcon", "lock_16x16.png", getString("gb.restrictedAccess")));\r
+ } else {\r
+ item.add(WicketUtils.newClearPixel("restrictedAccessIcon"));\r
+ }\r
+ \r
item.add(new Label("repositoryOwner", entry.owner));\r
\r
String lastChange = TimeUtils.timeAgo(entry.lastChange);\r
item.add(lastChangeLabel);\r
WicketUtils.setCssClass(lastChangeLabel, TimeUtils.timeAgoCss(entry.lastChange));\r
\r
- item.add(new BookmarkablePageLink<Void>("repositoryLinks", EditRepositoryPage.class, WicketUtils.newRepositoryParameter(entry.name)).setVisible(showAdmin));\r
- \r
+ if (showAdmin) {\r
+ Fragment repositoryLinks = new Fragment("repositoryLinks", "repositoryAdminLinks", this);\r
+ repositoryLinks.add(new BookmarkablePageLink<Void>("editRepository", EditRepositoryPage.class, WicketUtils.newRepositoryParameter(entry.name)));\r
+ repositoryLinks.add(new BookmarkablePageLink<Void>("renameRepository", EditRepositoryPage.class, WicketUtils.newRepositoryParameter(entry.name)).setEnabled(false));\r
+ repositoryLinks.add(new BookmarkablePageLink<Void>("deleteRepository", EditRepositoryPage.class, WicketUtils.newRepositoryParameter(entry.name)).setEnabled(false));\r
+ item.add(repositoryLinks);\r
+ } else {\r
+ item.add(new Label("repositoryLinks"));\r
+ }\r
WicketUtils.setAlternatingBackground(item, counter);\r
counter++;\r
}\r
\r
import org.apache.wicket.PageParameters;\r
import org.apache.wicket.markup.html.basic.Label;\r
-import org.apache.wicket.markup.html.image.ContextImage;\r
import org.eclipse.jgit.lib.Repository;\r
import org.wicketstuff.googlecharts.AbstractChartData;\r
import org.wicketstuff.googlecharts.Chart;\r
\r
add(new Chart("commitsChart", provider));\r
} else {\r
- add(new ContextImage("commitsChart", "blank.png"));\r
+ add(WicketUtils.newBlankImage("commitsChart"));\r
}\r
}\r
\r
<!-- changed paths --> \r
<table style="width:100%" class="pretty">\r
<tr wicket:id="changedPath">\r
+ <td class="icon"><img wicket:id="pathIcon" /></td>\r
<td><span wicket:id="pathName"></span></td> \r
<td class="size"><span wicket:id="pathSize">[path size]</span></td>\r
<td class="mode"><span wicket:id="pathPermissions">[path permissions]</span></td>\r
item.add(new Label("pathPermissions", JGitUtils.getPermissionsFromMode(entry.mode)));\r
if (entry.isParentPath) {\r
// parent .. path\r
+ item.add(WicketUtils.newBlankImage("pathIcon"));\r
item.add(new Label("pathSize", ""));\r
item.add(new LinkPanel("pathName", null, entry.name, TreePage.class, newPathParameter(entry.path)));\r
item.add(new Label("pathLinks", ""));\r
} else {\r
if (entry.isTree()) {\r
// folder/tree link\r
+ item.add(WicketUtils.newImage("pathIcon", "folder_16x16.png"));\r
item.add(new Label("pathSize", ""));\r
item.add(new LinkPanel("pathName", null, entry.name, TreePage.class, newPathParameter(entry.path)));\r
\r
item.add(links);\r
} else {\r
// blob link\r
+ item.add(WicketUtils.newImage("pathIcon", "file_16x16.png"));\r
item.add(new Label("pathSize", byteFormat.format(entry.size)));\r
item.add(new LinkPanel("pathName", "list", entry.name, BlobPage.class, newPathParameter(entry.path)));\r
\r
\r
protected void setPersonSearchTooltip(Component component, String value, SearchType searchType) {\r
if (searchType.equals(SearchType.AUTHOR)) {\r
- WicketUtils.setHtmlTitle(component, getString("gb.searchForAuthor") + " " + value);\r
+ WicketUtils.setHtmlTooltip(component, getString("gb.searchForAuthor") + " " + value);\r
} else if (searchType.equals(SearchType.COMMITTER)) {\r
- WicketUtils.setHtmlTitle(component, getString("gb.searchForCommitter") + " " + value);\r
+ WicketUtils.setHtmlTooltip(component, getString("gb.searchForCommitter") + " " + value);\r
}\r
}\r
}\r
import java.util.Map;\r
\r
import org.apache.wicket.markup.html.basic.Label;\r
-import org.apache.wicket.markup.html.image.ContextImage;\r
import org.apache.wicket.markup.html.link.BookmarkablePageLink;\r
import org.apache.wicket.markup.html.panel.Fragment;\r
import org.apache.wicket.markup.repeater.Item;\r
public HistoryPanel(String wicketId, final String repositoryName, final String objectId, final String path, Repository r, int limit, int pageOffset) {\r
super(wicketId);\r
boolean pageResults = limit <= 0;\r
- int itemsPerPage = GitBlit.self().settings().getInteger(Keys.web.logPageCommitCount, 50);\r
+ int itemsPerPage = GitBlit.self().settings().getInteger(Keys.web.itemsPerPage, 50);\r
if (itemsPerPage <= 1) {\r
itemsPerPage = 50;\r
}\r
\r
// merge icon\r
if (entry.getParentCount() > 1) {\r
- item.add(new ContextImage("commitIcon", "/com/gitblit/wicket/resources/commit_merge_16x16.png"));\r
+ item.add(WicketUtils.newImage("commitIcon", "commit_merge_16x16.png"));\r
} else {\r
- item.add(new ContextImage("commitIcon", "/com/gitblit/wicket/resources/blank.png"));\r
+ item.add(WicketUtils.newBlankImage("commitIcon"));\r
}\r
\r
String shortMessage = entry.getShortMessage();\r
String trimmedMessage = StringUtils.trimShortLog(shortMessage);\r
LinkPanel shortlog = new LinkPanel("commitShortMessage", "list subject", trimmedMessage, CommitPage.class, WicketUtils.newObjectParameter(repositoryName, entry.getName()));\r
if (!shortMessage.equals(trimmedMessage)) {\r
- WicketUtils.setHtmlTitle(shortlog, shortMessage);\r
+ WicketUtils.setHtmlTooltip(shortlog, shortMessage);\r
}\r
item.add(shortlog);\r
\r
import java.util.Map;\r
\r
import org.apache.wicket.markup.html.basic.Label;\r
-import org.apache.wicket.markup.html.image.ContextImage;\r
import org.apache.wicket.markup.html.link.BookmarkablePageLink;\r
import org.apache.wicket.markup.repeater.Item;\r
import org.apache.wicket.markup.repeater.data.DataView;\r
public LogPanel(String wicketId, final String repositoryName, final String objectId, Repository r, int limit, int pageOffset) {\r
super(wicketId);\r
boolean pageResults = limit <= 0;\r
- int itemsPerPage = GitBlit.self().settings().getInteger(Keys.web.logPageCommitCount, 50);\r
+ int itemsPerPage = GitBlit.self().settings().getInteger(Keys.web.itemsPerPage, 50);\r
if (itemsPerPage <= 1) {\r
itemsPerPage = 50;\r
}\r
\r
// merge icon\r
if (entry.getParentCount() > 1) {\r
- item.add(new ContextImage("commitIcon", "/com/gitblit/wicket/resources/commit_merge_16x16.png"));\r
+ item.add(WicketUtils.newImage("commitIcon", "commit_merge_16x16.png"));\r
} else {\r
- item.add(new ContextImage("commitIcon", "/com/gitblit/wicket/resources/blank.png"));\r
+ item.add(WicketUtils.newBlankImage("commitIcon"));\r
}\r
\r
// short message\r
String trimmedMessage = StringUtils.trimShortLog(shortMessage);\r
LinkPanel shortlog = new LinkPanel("commitShortMessage", "list subject", trimmedMessage, CommitPage.class, WicketUtils.newObjectParameter(repositoryName, entry.getName()));\r
if (!shortMessage.equals(trimmedMessage)) {\r
- WicketUtils.setHtmlTitle(shortlog, shortMessage);\r
+ WicketUtils.setHtmlTooltip(shortlog, shortMessage);\r
}\r
item.add(shortlog);\r
\r
<form wicket:id="searchForm">\r
<div class="search">\r
<select wicket:id="searchType"/> \r
- <input type="text" id="searchBox" wicket:id="searchBox" value=""/>\r
+ <input type="text" id="searchBox" wicket:id="searchBox" size="25" value=""/>\r
</div>\r
</form>\r
\r
package com.gitblit.wicket.panels;\r
\r
-import java.text.MessageFormat;\r
import java.util.ArrayList;\r
import java.util.Arrays;\r
import java.util.HashMap;\r
add(new BookmarkablePageLink<Void>("tags", TagsPage.class, WicketUtils.newRepositoryParameter(repositoryName)));\r
add(new BookmarkablePageLink<Void>("tree", TreePage.class, WicketUtils.newRepositoryParameter(repositoryName)));\r
\r
- // Get the repository tickets setting\r
- boolean checkTicgit = GitBlit.self().settings().getBoolean(Keys.tickets.global, false);\r
- checkTicgit |= GitBlit.self().settings().getBoolean(MessageFormat.format(Keys.tickets._ROOT + ".{0}", repositoryName), false);\r
-\r
- // Add dynamic repository extras\r
List<String> extras = new ArrayList<String>();\r
- if (checkTicgit && JGitUtils.getTicketsBranch(r) != null) {\r
+\r
+ // Get the repository tickets setting\r
+ boolean checkTickets = JGitUtils.getRepositoryUseTickets(r);\r
+ if (checkTickets && JGitUtils.getTicketsBranch(r) != null) {\r
extras.add("tickets");\r
}\r
\r
+ // Get the repository docs setting\r
+ boolean checkDocs = JGitUtils.getRepositoryUseDocs(r);\r
+ if (checkDocs && JGitUtils.getDocumentsBranch(r) != null) {\r
+ extras.add("docs");\r
+ }\r
+\r
ListDataProvider<String> extrasDp = new ListDataProvider<String>(extras);\r
DataView<String> extrasView = new DataView<String>("extra", extrasDp) {\r
private static final long serialVersionUID = 1L;\r
String extra = item.getModelObject();\r
if (extra.equals("tickets")) {\r
item.add(new Label("extraSeparator", " | "));\r
- item.add(new LinkPanel("extraLink", null, "tickets", TicketsPage.class, WicketUtils.newRepositoryParameter(repositoryName)));\r
+ item.add(new LinkPanel("extraLink", null, getString("gb.tickets"), TicketsPage.class, WicketUtils.newRepositoryParameter(repositoryName)));\r
+ } else if (extra.equals("docs")) {\r
+ item.add(new Label("extraSeparator", " | "));\r
+ item.add(new LinkPanel("extraLink", null, getString("gb.docs"), TicketsPage.class, WicketUtils.newRepositoryParameter(repositoryName)));\r
}\r
}\r
};\r
private final String repositoryName;\r
\r
private final IModel<String> searchBoxModel = new Model<String>("");\r
- \r
+\r
private final IModel<SearchType> searchTypeModel = new Model<SearchType>(SearchType.COMMIT);\r
\r
public SearchForm(String id, String repositoryName) {\r
this.repositoryName = repositoryName;\r
DropDownChoice<SearchType> searchType = new DropDownChoice<SearchType>("searchType", Arrays.asList(SearchType.values()));\r
searchType.setModel(searchTypeModel);\r
- WicketUtils.setHtmlTitle(searchType, getString("gb.searchTypeTooltip"));\r
- add(searchType);\r
+ WicketUtils.setHtmlTooltip(searchType, getString("gb.searchTypeTooltip"));\r
+ add(searchType.setVisible(GitBlit.self().settings().getBoolean(Keys.web.showSearchTypeSelection, false)));\r
TextField<String> searchBox = new TextField<String>("searchBox", searchBoxModel);\r
add(searchBox);\r
- WicketUtils.setHtmlTitle(searchBox, getString("gb.searchTooltip"));\r
+ WicketUtils.setHtmlTooltip(searchBox, getString("gb.searchTooltip"));\r
WicketUtils.setInputPlaceholder(searchBox, getString("gb.search"));\r
}\r
\r
public void onSubmit() {\r
SearchType searchType = searchTypeModel.getObject();\r
String searchString = searchBoxModel.getObject();\r
+ for (SearchType type : SearchType.values()) {\r
+ if (searchString.toLowerCase().startsWith(type.name().toLowerCase() + ":")) {\r
+ searchType = type;\r
+ searchString = searchString.substring(type.name().toLowerCase().length() + 1).trim();\r
+ break;\r
+ }\r
+ }\r
setResponsePage(SearchPage.class, WicketUtils.newSearchParameter(repositoryName, null, searchString, searchType));\r
}\r
}\r
c = new LinkPanel("refName", null, entry, CommitPage.class, WicketUtils.newObjectParameter(repositoryName, entry));\r
WicketUtils.setCssClass(c, "otherRef");\r
}\r
- WicketUtils.setHtmlTitle(c, entry);\r
+ WicketUtils.setHtmlTooltip(c, entry);\r
item.add(c);\r
}\r
};\r
import java.util.List;\r
import java.util.Map;\r
\r
-import org.apache.wicket.markup.html.image.ContextImage;\r
import org.apache.wicket.markup.html.link.BookmarkablePageLink;\r
import org.apache.wicket.markup.repeater.Item;\r
import org.apache.wicket.markup.repeater.data.DataView;\r
public SearchPanel(String wicketId, final String repositoryName, final String objectId, final String value, SearchType searchType, Repository r, int limit, int pageOffset) {\r
super(wicketId);\r
boolean pageResults = limit <= 0;\r
- int itemsPerPage = GitBlit.self().settings().getInteger(Keys.web.logPageCommitCount, 50);\r
+ int itemsPerPage = GitBlit.self().settings().getInteger(Keys.web.itemsPerPage, 50);\r
if (itemsPerPage <= 1) {\r
itemsPerPage = 50;\r
}\r
\r
// merge icon\r
if (entry.getParentCount() > 1) {\r
- item.add(new ContextImage("commitIcon", "/com/gitblit/wicket/resources/commit_merge_16x16.png"));\r
+ item.add(WicketUtils.newImage("commitIcon", "commit_merge_16x16.png"));\r
} else {\r
- item.add(new ContextImage("commitIcon", "/com/gitblit/wicket/resources/blank.png"));\r
+ item.add(WicketUtils.newBlankImage("commitIcon"));\r
}\r
\r
String shortMessage = entry.getShortMessage();\r
// TODO highlight matches\r
LinkPanel shortlog = new LinkPanel("commitShortMessage", "list subject", trimmedMessage, CommitPage.class, WicketUtils.newObjectParameter(repositoryName, entry.getName()));\r
if (!shortMessage.equals(trimmedMessage)) {\r
- WicketUtils.setHtmlTitle(shortlog, shortMessage);\r
+ WicketUtils.setHtmlTooltip(shortlog, shortMessage);\r
}\r
item.add(shortlog);\r
\r
import java.util.List;\r
\r
import org.apache.wicket.markup.html.basic.Label;\r
-import org.apache.wicket.markup.html.image.ContextImage;\r
import org.apache.wicket.markup.html.link.BookmarkablePageLink;\r
import org.apache.wicket.markup.html.panel.Fragment;\r
import org.apache.wicket.markup.repeater.Item;\r
\r
// tag icon\r
if (entry.isAnnotatedTag()) {\r
- item.add(new ContextImage("tagIcon", "/com/gitblit/wicket/resources/tag_16x16.png"));\r
+ item.add(WicketUtils.newImage("tagIcon", "tag_16x16.png"));\r
} else {\r
- item.add(new ContextImage("tagIcon", "/com/gitblit/wicket/resources/blank.png"));\r
+ item.add(WicketUtils.newBlankImage("tagIcon"));\r
}\r
\r
item.add(new LinkPanel("tagName", "list name", entry.getDisplayName(), CommitPage.class, WicketUtils.newObjectParameter(repositoryName, entry.getCommitId().getName())));\r
color:yellow;\r
text-align:right;\r
float:right;\r
- padding:4px 4px 3px 3px; \r
+ padding:4px 4px 3px 3px;\r
+ border-left: 1px solid #8080f0;\r
+ margin: 0px;\r
+ height: 23px;\r
}\r
\r
div.search input {\r
+ vertical-align: top;\r
background: url(/com/gitblit/wicket/resources/search-icon.png) no-repeat 4px center;\r
color: #ddd;\r
background-color: #000070;\r
border: 1px solid transparent;\r
- padding: 0px 2px 2px 22px; \r
+ padding: 2px 2px 2px 22px;\r
+ margin: 0px;\r
}\r
\r
div.search input:hover, div.search input:focus {\r
float: right;\r
padding: 0.4em;\r
vertical-align:top;\r
+ margin: 0px;\r
}\r
\r
div.commitLegend span {\r
padding: 8px;\r
}\r
\r
+table.plain td.edit {\r
+ padding: 3px;\r
+}\r
+\r
+table.plain td.edit input {\r
+ margin: 0px;\r
+ outline: 1px solid transparent;\r
+ border: 1px solid #ccc; \r
+ padding-left:5px;\r
+}\r
+\r
+table.plain td.edit input:focus, table.plain td.edit input:hover{\r
+ border: 1px solid orange;\r
+}\r
+\r
table.pretty, table.repositories, table.comments {\r
margin-bottom:5px;\r
border-spacing: 0px;\r
}\r
\r
table.pretty td.icon {\r
- padding: 0px;\r
- width: 20px;\r
+ padding: 0px 0px 0px 2px; \r
+ width: 18px;\r
}\r
\r
table.pretty td.icon img {\r
table.repositories th {\r
background-color:#D2C3AF;\r
padding: 4px;\r
+ border-top: 1px solid #808080;\r
border-bottom: 1px solid #808080;\r
}\r
\r
table.repositories td {\r
- padding: 4px;\r
+ padding: 2px;\r
+}\r
+\r
+table.repositories td.icon img {\r
+ vertical-align: top;\r
}\r
\r
table.repositories th a {\r