import java.text.ParseException;\r
import java.text.SimpleDateFormat;\r
import java.util.ArrayList;\r
+import java.util.Collection;\r
import java.util.Collections;\r
import java.util.Date;\r
import java.util.HashMap;\r
import org.eclipse.jgit.revwalk.filter.RevFilter;\r
import org.eclipse.jgit.treewalk.TreeWalk;\r
import org.eclipse.jgit.treewalk.filter.AndTreeFilter;\r
+import org.eclipse.jgit.treewalk.filter.OrTreeFilter;\r
import org.eclipse.jgit.treewalk.filter.PathFilter;\r
import org.eclipse.jgit.treewalk.filter.PathFilterGroup;\r
+import org.eclipse.jgit.treewalk.filter.PathSuffixFilter;\r
import org.eclipse.jgit.treewalk.filter.TreeFilter;\r
import org.eclipse.jgit.util.io.DisabledOutputStream;\r
import org.slf4j.Logger;\r
}\r
return list;\r
}\r
+ \r
+ public static List<PathModel> getDocuments(Repository r, List<String> extensions) {\r
+ List<PathModel> list = new ArrayList<PathModel>();\r
+ RevCommit commit = getCommit(r, Constants.HEAD); \r
+ final TreeWalk walk = new TreeWalk(r);\r
+ try {\r
+ walk.addTree(commit.getTree());\r
+ if (extensions != null && extensions.size() > 0) {\r
+ Collection<TreeFilter> suffixFilters = new ArrayList<TreeFilter>();\r
+ for (String extension:extensions) {\r
+ if (extension.charAt(0) == '.') {\r
+ suffixFilters.add(PathSuffixFilter.create(extension));\r
+ } else {\r
+ // escape the . since this is a regexp filter\r
+ suffixFilters.add(PathSuffixFilter.create("\\." + extension));\r
+ }\r
+ }\r
+ TreeFilter filter = OrTreeFilter.create(suffixFilters);\r
+ walk.setFilter(filter);\r
+ walk.setRecursive(true);\r
+ while (walk.next()) {\r
+ list.add(getPathModel(walk, null, commit));\r
+ }\r
+ } else {\r
+ while (walk.next()) {\r
+ list.add(getPathModel(walk, null, commit));\r
+ }\r
+ }\r
+ } catch (IOException e) {\r
+ LOGGER.error("Failed to get files for commit " + commit.getName(), e);\r
+ } finally {\r
+ walk.release();\r
+ }\r
+ Collections.sort(list);\r
+ return list;\r
+ }\r
\r
public static Map<ChangeType, AtomicInteger> getChangedPathsStats(List<PathChangeModel> paths) {\r
Map<ChangeType, AtomicInteger> stats = new HashMap<ChangeType, AtomicInteger>();\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
try {\r
<img src="resources/gitblt_25.png" width="79" height="25" alt="gitblit" class="logo"/>\r
</wicket:link>\r
</a>\r
- <a href="/"><span wicket:id="siteName">[site name]</span></a> / <span wicket:id="repositoryName">[repository name]</span> <span wicket:id="pageName">[page name]</span> \r
+ <a href="/"><span wicket:id="siteName">[site name]</span></a> / <span wicket:id="repositoryName">[repository name]</span> <span wicket:id="pageName">[page name]</span>\r
+ <div style="float:none;" wicket:id="feedback">[Feedback Panel]</div> \r
</div>\r
\r
<!-- page content -->\r
import org.apache.wicket.PageParameters;\r
import org.apache.wicket.markup.html.WebPage;\r
import org.apache.wicket.markup.html.basic.Label;\r
+import org.apache.wicket.markup.html.panel.FeedbackPanel;\r
import org.apache.wicket.protocol.http.servlet.ServletWebRequest;\r
import org.slf4j.Logger;\r
import org.slf4j.LoggerFactory;\r
add(new LinkPanel("repositoryName", null, repositoryName, SummaryPage.class, WicketUtils.newRepositoryParameter(repositoryName)));\r
add(new Label("pageName", pageName));\r
\r
+ // Feedback panel for info, warning, and non-fatal error messages\r
+ add(new FeedbackPanel("feedback"));\r
+\r
// footer\r
if (GitBlit.self().settings().getBoolean(Keys.web.authenticateViewPages, true)\r
|| GitBlit.self().settings().getBoolean(Keys.web.authenticateAdminPages, true)) {\r
import com.gitblit.wicket.pages.BranchesPage;\r
import com.gitblit.wicket.pages.CommitDiffPage;\r
import com.gitblit.wicket.pages.CommitPage;\r
+import com.gitblit.wicket.pages.DocsPage;\r
import com.gitblit.wicket.pages.HistoryPage;\r
import com.gitblit.wicket.pages.LogPage;\r
import com.gitblit.wicket.pages.MarkdownPage;\r
mount(new MixedParamUrlCodingStrategy("/ticket", TicketPage.class, new String[] { "r", "h", "f" }));\r
\r
// setup the markdown urls\r
+ mount(new MixedParamUrlCodingStrategy("/docs", DocsPage.class, new String[] { "r" }));\r
mount(new MixedParamUrlCodingStrategy("/markdown", MarkdownPage.class, new String[] { "r", "h", "f" }));\r
\r
// setup login/logout urls, if we are using authentication\r
gb.rename = rename\r
gb.delete = delete\r
gb.docs = docs\r
-gb.restrictedAccess = restricted access
\ No newline at end of file
+gb.restrictedAccess = restricted access\r
+gb.name = name\r
+gb.group = group\r
+gb.description = description\r
+gb.enableTickets = enable tickets\r
+gb.enableDocs = enable docs
\ No newline at end of file
import java.text.DateFormat;\r
import java.text.SimpleDateFormat;\r
import java.util.Date;\r
+import java.util.List;\r
import java.util.TimeZone;\r
\r
import org.apache.wicket.Component;\r
return label;\r
}\r
\r
+ public static ContextImage getFileImage(String wicketId, String filename) {\r
+ filename = filename.toLowerCase();\r
+ if (filename.endsWith(".java")) {\r
+ return newImage(wicketId, "file_java_16x16.png");\r
+ } else if (filename.endsWith(".rb")) {\r
+ return newImage(wicketId, "file_ruby_16x16.png");\r
+ } else if (filename.endsWith(".php")) {\r
+ return newImage(wicketId, "file_php_16x16.png");\r
+ } else if (filename.endsWith(".cs")) {\r
+ return newImage(wicketId, "file_cs_16x16.png");\r
+ } else if (filename.endsWith(".cpp")) {\r
+ return newImage(wicketId, "file_cpp_16x16.png");\r
+ } else if (filename.endsWith(".c")) {\r
+ return newImage(wicketId, "file_c_16x16.png");\r
+ } else if (filename.endsWith(".h")) {\r
+ return newImage(wicketId, "file_h_16x16.png");\r
+ } else if (filename.endsWith(".sln")) {\r
+ return newImage(wicketId, "file_vs_16x16.png");\r
+ } else if (filename.endsWith(".csv") || filename.endsWith(".xls") || filename.endsWith(".xlsx")) {\r
+ return newImage(wicketId, "file_excel_16x16.png");\r
+ } else if (filename.endsWith(".doc") || filename.endsWith(".docx")) {\r
+ return newImage(wicketId, "file_word_16x16.png");\r
+ } else if (filename.endsWith(".ppt")) {\r
+ return newImage(wicketId, "file_ppt_16x16.png");\r
+ } else if (filename.endsWith(".zip")) {\r
+ return newImage(wicketId, "file_zip_16x16.png");\r
+ } else if (filename.endsWith(".pdf")) {\r
+ return newImage(wicketId, "file_acrobat_16x16.png");\r
+ } else if (filename.endsWith(".htm") || filename.endsWith(".html")) {\r
+ return newImage(wicketId, "file_world_16x16.png");\r
+ } else if (filename.endsWith(".xml")) {\r
+ return newImage(wicketId, "file_code_16x16.png");\r
+ } else if (filename.endsWith(".properties")) {\r
+ return newImage(wicketId, "file_settings_16x16.png");\r
+ }\r
+\r
+ List<String> mdExtensions = GitBlit.self().settings().getStrings(Keys.web.markdownExtensions);\r
+ for (String ext : mdExtensions) {\r
+ if (filename.endsWith('.' + ext.toLowerCase())) {\r
+ return newImage(wicketId, "file_world_16x16.png");\r
+ }\r
+ }\r
+ return newImage(wicketId, "file_16x16.png");\r
+ }\r
+\r
public static ContextImage newClearPixel(String wicketId) {\r
return newImage(wicketId, "pixel.png");\r
}\r
- \r
+\r
public static ContextImage newBlankImage(String wicketId) {\r
return newImage(wicketId, "blank.png");\r
}\r
}\r
return img;\r
}\r
- \r
+\r
public static ContextRelativeResource getResource(String file) {\r
return new ContextRelativeResource("/com/gitblit/wicket/resources/" + file);\r
}\r
<span wicket:id="blameLink">[blame link]</span> | <a wicket:id="historyLink"><wicket:message key="gb.history"></wicket:message></a> | <a wicket:id="patchLink"><wicket:message key="gb.patch"></wicket:message></a> | <a wicket:id="commitLink"><wicket:message key="gb.commit"></wicket:message></a> | <a wicket:id="commitDiffLink"><wicket:message key="gb.commitdiff"></wicket:message></a>\r
</div> \r
\r
- <!-- shortlog header -->\r
- <div class="header" wicket:id="shortlog">[shortlog header]</div>\r
+ <!-- commit header -->\r
+ <div wicket:id="commitHeader">[commit header]</div>\r
\r
<!-- breadcrumbs -->\r
<div wicket:id="breadcrumbs">[breadcrumbs]</div>\r
import com.gitblit.utils.JGitUtils;\r
import com.gitblit.utils.JGitUtils.DiffOutputType;\r
import com.gitblit.utils.StringUtils;\r
-import com.gitblit.wicket.LinkPanel;\r
import com.gitblit.wicket.RepositoryPage;\r
import com.gitblit.wicket.WicketUtils;\r
+import com.gitblit.wicket.panels.CommitHeaderPanel;\r
import com.gitblit.wicket.panels.PathBreadcrumbsPanel;\r
\r
public class BlobDiffPage extends RepositoryPage {\r
add(new Label("blameLink", getString("gb.blame")));\r
add(new BookmarkablePageLink<Void>("historyLink", HistoryPage.class, WicketUtils.newPathParameter(repositoryName, objectId, blobPath)));\r
\r
- add(new LinkPanel("shortlog", "title", commit.getShortMessage(), CommitPage.class, newCommitParameter()));\r
+ add(new CommitHeaderPanel("commitHeader", repositoryName, commit));\r
\r
add(new PathBreadcrumbsPanel("breadcrumbs", repositoryName, blobPath, objectId));\r
\r
<span wicket:id="blameLink">[blame link]</span> | <a wicket:id="historyLink"><wicket:message key="gb.history"></wicket:message></a> | <a wicket:id="rawLink"><wicket:message key="gb.raw"></wicket:message></a> | <a wicket:id="headLink"><wicket:message key="gb.head"></wicket:message></a>\r
</div> \r
\r
- <!-- shortlog header -->\r
- <div class="header" wicket:id="shortlog">[shortlog header]</div>\r
+ <!-- commit header -->\r
+ <div wicket:id="commitHeader">[commit header]</div>\r
\r
<!-- breadcrumbs -->\r
<div wicket:id="breadcrumbs">[breadcrumbs]</div>\r
import com.gitblit.GitBlit;\r
import com.gitblit.Keys;\r
import com.gitblit.utils.JGitUtils;\r
-import com.gitblit.wicket.LinkPanel;\r
import com.gitblit.wicket.RepositoryPage;\r
import com.gitblit.wicket.WicketUtils;\r
+import com.gitblit.wicket.panels.CommitHeaderPanel;\r
import com.gitblit.wicket.panels.PathBreadcrumbsPanel;\r
\r
public class BlobPage extends RepositoryPage {\r
add(new BookmarkablePageLink<Void>("rawLink", RawPage.class, WicketUtils.newPathParameter(repositoryName, objectId, blobPath)));\r
add(new BookmarkablePageLink<Void>("headLink", BlobPage.class, WicketUtils.newPathParameter(repositoryName, Constants.HEAD, blobPath)));\r
\r
- add(new LinkPanel("shortlog", "title", commit.getShortMessage(), CommitPage.class, newCommitParameter()));\r
+ add(new CommitHeaderPanel("commitHeader", repositoryName, commit));\r
\r
add(new PathBreadcrumbsPanel("breadcrumbs", repositoryName, blobPath, objectId));\r
\r
<div class="page_nav2">\r
<wicket:message key="gb.parent"></wicket:message>: <span wicket:id="parentLink">[parent link]</span> | <a wicket:id="patchLink"><wicket:message key="gb.patch"></wicket:message></a> | <a wicket:id="commitLink"><wicket:message key="gb.commit"></wicket:message></a>\r
</div> \r
-\r
- <!-- commit legend -->\r
- <div style="text-align:right;" wicket:id="commitLegend"></div>\r
\r
- <!-- shortlog header -->\r
- <div class="header" wicket:id="shortlog">[shortlog header]</div>\r
+ <!-- commit header -->\r
+ <div wicket:id="commitHeader">[commit header]</div>\r
\r
<!-- changed paths -->\r
+ <div style="padding-top:15px;">\r
+ <!-- commit legend -->\r
+ <div style="text-align:right;" wicket:id="commitLegend"></div>\r
+ \r
+ <div class="header"><wicket:message key="gb.changedFiles">[changed files]</wicket:message></div>\r
+ </div>\r
<table class="pretty">\r
<tr wicket:id="changedPath">\r
<td class="changeType"><span wicket:id="changeType">[change type]</span></td> \r
import com.gitblit.wicket.RepositoryPage;\r
import com.gitblit.wicket.WicketUtils;\r
import com.gitblit.wicket.models.PathModel.PathChangeModel;\r
+import com.gitblit.wicket.panels.CommitHeaderPanel;\r
import com.gitblit.wicket.panels.CommitLegendPanel;\r
\r
public class CommitDiffPage extends RepositoryPage {\r
add(new BookmarkablePageLink<Void>("patchLink", PatchPage.class, WicketUtils.newObjectParameter(repositoryName, objectId)));\r
add(new BookmarkablePageLink<Void>("commitLink", CommitPage.class, WicketUtils.newObjectParameter(repositoryName, objectId)));\r
\r
- add(new LinkPanel("shortlog", "title", commit.getShortMessage(), CommitPage.class, newCommitParameter()));\r
+ add(new CommitHeaderPanel("commitHeader", repositoryName, commit));\r
\r
// changed paths list\r
List<PathChangeModel> paths = JGitUtils.getFilesInCommit(r, commit);\r
<wicket:message key="gb.parent"></wicket:message>: <span wicket:id="parentLink">[parent link]</span> | <a wicket:id="patchLink"><wicket:message key="gb.patch"></wicket:message></a> | <span wicket:id="commitdiffLink">[commitdiff link]</span>\r
</div> \r
\r
- <!-- shortlog header -->\r
- <div class="header" wicket:id="shortlog">[shortlog header]</div>\r
+ <!-- commit header -->\r
+ <div wicket:id="commitHeader">[commit header]</div>\r
\r
<!-- commit info -->\r
<table class="plain">\r
import com.gitblit.wicket.RepositoryPage;\r
import com.gitblit.wicket.WicketUtils;\r
import com.gitblit.wicket.models.PathModel.PathChangeModel;\r
+import com.gitblit.wicket.panels.CommitHeaderPanel;\r
import com.gitblit.wicket.panels.CommitLegendPanel;\r
\r
public class CommitPage extends RepositoryPage {\r
}\r
add(new BookmarkablePageLink<Void>("patchLink", PatchPage.class, WicketUtils.newObjectParameter(repositoryName, objectId)));\r
\r
- add(new LinkPanel("shortlog", "title", c.getShortMessage(), CommitDiffPage.class, WicketUtils.newObjectParameter(repositoryName, objectId)));\r
+ add(new CommitHeaderPanel("commitHeader", repositoryName, c));\r
\r
addRefs(r, c);\r
\r
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml" \r
+ xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.3-strict.dtd" \r
+ xml:lang="en" \r
+ lang="en"> \r
+\r
+<body>\r
+<wicket:extend>\r
+ \r
+ <!-- page nav links --> \r
+ <div wicket:id="pageLinks">[page links]</div>\r
+ \r
+ <!-- header -->\r
+ <div style="margin-top:5px;" class="header"><span wicket:id="header">[header]</span></div>\r
+ \r
+ <!-- documents --> \r
+ <table style="width:100%" class="pretty">\r
+ <tr wicket:id="document">\r
+ <td class="icon"><img wicket:id="docIcon" /></td>\r
+ <td><span wicket:id="docName"></span></td> \r
+ <td class="size"><span wicket:id="docSize">[doc size]</span></td>\r
+ <td class="treeLinks">\r
+ <span class="link">\r
+ <a wicket:id="view"><wicket:message key="gb.view"></wicket:message></a> | <a wicket:id="raw"><wicket:message key="gb.raw"></wicket:message></a> | <a wicket:id="blame"><wicket:message key="gb.blame"></wicket:message></a> | <a wicket:id="history"><wicket:message key="gb.history"></wicket:message></a>\r
+ </span> \r
+ </td>\r
+ </tr>\r
+ </table> \r
+</wicket:extend> \r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+package com.gitblit.wicket.pages;\r
+\r
+import java.util.List;\r
+\r
+import org.apache.wicket.PageParameters;\r
+import org.apache.wicket.markup.html.basic.Label;\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
+import org.apache.wicket.markup.repeater.data.ListDataProvider;\r
+import org.eclipse.jgit.lib.Repository;\r
+\r
+import com.gitblit.GitBlit;\r
+import com.gitblit.Keys;\r
+import com.gitblit.utils.ByteFormat;\r
+import com.gitblit.utils.JGitUtils;\r
+import com.gitblit.wicket.LinkPanel;\r
+import com.gitblit.wicket.RepositoryPage;\r
+import com.gitblit.wicket.WicketUtils;\r
+import com.gitblit.wicket.models.PathModel;\r
+\r
+public class DocsPage extends RepositoryPage {\r
+\r
+ public DocsPage(PageParameters params) {\r
+ super(params);\r
+\r
+ Repository r = getRepository();\r
+ List<String> extensions = GitBlit.self().settings().getStrings(Keys.web.markdownExtensions);\r
+ List<PathModel> paths = JGitUtils.getDocuments(r, extensions);\r
+\r
+ final ByteFormat byteFormat = new ByteFormat();\r
+\r
+ add(new Label("header", getString("gb.docs")));\r
+ \r
+ // documents list\r
+ ListDataProvider<PathModel> pathsDp = new ListDataProvider<PathModel>(paths);\r
+ DataView<PathModel> pathsView = new DataView<PathModel>("document", pathsDp) {\r
+ private static final long serialVersionUID = 1L;\r
+ int counter = 0;\r
+\r
+ public void populateItem(final Item<PathModel> item) {\r
+ PathModel entry = item.getModelObject();\r
+ item.add(WicketUtils.newImage("docIcon", "file_world_16x16.png"));\r
+ item.add(new Label("docSize", byteFormat.format(entry.size)));\r
+ item.add(new LinkPanel("docName", "list", entry.name, BlobPage.class, newPathParameter(entry.path)));\r
+\r
+ // links\r
+ item.add(new BookmarkablePageLink<Void>("view", BlobPage.class, WicketUtils.newPathParameter(repositoryName, entry.commitId, entry.path)));\r
+ item.add(new BookmarkablePageLink<Void>("raw", RawPage.class, WicketUtils.newPathParameter(repositoryName, entry.commitId, entry.path)));\r
+ item.add(new BookmarkablePageLink<Void>("blame", BlobPage.class).setEnabled(false));\r
+ item.add(new BookmarkablePageLink<Void>("history", HistoryPage.class, WicketUtils.newPathParameter(repositoryName, entry.commitId, entry.path))); \r
+ WicketUtils.setAlternatingBackground(item, counter);\r
+ counter++;\r
+ }\r
+ };\r
+ add(pathsView);\r
+ }\r
+\r
+ @Override\r
+ protected String getPageName() {\r
+ return getString("gb.docs");\r
+ }\r
+}\r
<form wicket:id="editForm">\r
<table class="plain">\r
<tbody>\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><th><wicket:message key="gb.name"></wicket:message></th><td class="edit"><input type="text" wicket:id="name" size="30" tabindex="1" /></td></tr>\r
+ <tr><th><wicket:message key="gb.description"></wicket:message></th><td class="edit"><input type="text" wicket:id="description" size="80" tabindex="2" /></td></tr>\r
+ <tr><th><wicket:message key="gb.owner"></wicket:message></th><td class="edit"><input type="text" wicket:id="owner" size="30" tabindex="3" /></td></tr>\r
+ <tr><th><wicket:message key="gb.group"></wicket:message></th><td class="edit"><input type="text" wicket:id="group" size="30" tabindex="4" /></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>distributed Ticgit issues</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>enumerates repository 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
<div wicket:id="pageLinks">[page links]</div>\r
\r
<!-- pager links -->\r
- <div style="padding-top:5px;padding-bottom:5px;">\r
+ <div style="padding-top:5px;">\r
<a wicket:id="firstPageTop"><wicket:message key="gb.pageFirst"></wicket:message></a> | <a wicket:id="prevPageTop"><wicket:message key="gb.pagePrevious"></wicket:message></a> | <a wicket:id="nextPageTop"><wicket:message key="gb.pageNext"></wicket:message></a> \r
</div>\r
\r
<div wicket:id="pageLinks">[page links]</div>\r
\r
<!-- pager links -->\r
- <div style="padding-top:5px;padding-bottom:5px;">\r
+ <div style="padding-top:5px;">\r
<a wicket:id="firstPageTop"><wicket:message key="gb.pageFirst"></wicket:message></a> | <a wicket:id="prevPageTop"><wicket:message key="gb.pagePrevious"></wicket:message></a> | <a wicket:id="nextPageTop"><wicket:message key="gb.pageNext"></wicket:message></a> \r
</div>\r
\r
<div wicket:id="pageLinks">[page links]</div>\r
\r
<!-- pager links -->\r
- <div style="padding-top:5px;padding-bottom:5px;">\r
+ <div style="padding-top:5px;">\r
<a wicket:id="firstPageTop"><wicket:message key="gb.pageFirst"></wicket:message></a> | <a wicket:id="prevPageTop"><wicket:message key="gb.pagePrevious"></wicket:message></a> | <a wicket:id="nextPageTop"><wicket:message key="gb.pageNext"></wicket:message></a> \r
</div>\r
\r
<a wicket:id="historyLink"><wicket:message key="gb.history"></wicket:message></a> | <a wicket:id="headLink"><wicket:message key="gb.head"></wicket:message></a>\r
</div> \r
\r
- <!-- shortlog header -->\r
- <div class="header" wicket:id="shortlog">[shortlog header]</div>\r
+ <!-- commit header -->\r
+ <div wicket:id="commitHeader">[commit header]</div>\r
\r
<!-- breadcrumbs -->\r
<div wicket:id="breadcrumbs">[breadcrumbs]</div>\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
- <td class="rightAlign"><span wicket:id="pathLinks">[path links]</span></td>\r
+ <td class="treeLinks"><span wicket:id="pathLinks">[path links]</span></td>\r
</tr>\r
</table>\r
\r
import com.gitblit.wicket.RepositoryPage;\r
import com.gitblit.wicket.WicketUtils;\r
import com.gitblit.wicket.models.PathModel;\r
+import com.gitblit.wicket.panels.CommitHeaderPanel;\r
import com.gitblit.wicket.panels.PathBreadcrumbsPanel;\r
\r
public class TreePage extends RepositoryPage {\r
add(new BookmarkablePageLink<Void>("historyLink", HistoryPage.class, WicketUtils.newPathParameter(repositoryName, objectId, path)));\r
add(new BookmarkablePageLink<Void>("headLink", TreePage.class, WicketUtils.newPathParameter(repositoryName, Constants.HEAD, path)));\r
\r
- add(new LinkPanel("shortlog", "title", commit == null ? "" : commit.getShortMessage(), CommitPage.class, newCommitParameter()));\r
+ add(new CommitHeaderPanel("commitHeader", repositoryName, commit));\r
\r
// breadcrumbs\r
add(new PathBreadcrumbsPanel("breadcrumbs", repositoryName, path, objectId));\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
+ item.add(new LinkPanel("pathName", "list", entry.name, TreePage.class, newPathParameter(entry.path)));\r
\r
// links\r
Fragment links = new Fragment("pathLinks", "treeLinks", this);\r
item.add(links);\r
} else {\r
// blob link\r
- item.add(WicketUtils.newImage("pathIcon", "file_16x16.png"));\r
+ item.add(WicketUtils.getFileImage("pathIcon", entry.name));\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
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml" \r
+ xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.3-strict.dtd" \r
+ xml:lang="en" \r
+ lang="en"> \r
+\r
+<wicket:panel> \r
+ <div class="commitHeader">\r
+ <div style="float:right;">\r
+ <span wicket:id="author">[author]</span> <span wicket:id="date">[date]</span>\r
+ </div>\r
+ <span wicket:id="shortmessage">[short message]</span> <span wicket:id="commitid">[commit id]</span>\r
+ </div>\r
+</wicket:panel>\r
+</html>
\ No newline at end of file
--- /dev/null
+package com.gitblit.wicket.panels;\r
+\r
+import java.util.Date;\r
+\r
+import org.apache.wicket.markup.html.basic.Label;\r
+import org.eclipse.jgit.revwalk.RevCommit;\r
+\r
+import com.gitblit.wicket.LinkPanel;\r
+import com.gitblit.wicket.WicketUtils;\r
+import com.gitblit.wicket.pages.CommitPage;\r
+\r
+public class CommitHeaderPanel extends BasePanel {\r
+\r
+ private static final long serialVersionUID = 1L;\r
+\r
+ public CommitHeaderPanel(String id, String repositoryName, RevCommit c) {\r
+ super(id);\r
+ add(new LinkPanel("shortmessage", "title", c == null ? "" : c.getShortMessage(), CommitPage.class, WicketUtils.newObjectParameter(repositoryName, c == null ? "" : c.getName())));\r
+ add(new Label("commitid", "(" + c.getName().substring(0, 8) + ")")); \r
+ add(new Label("author", c == null ? "" : c.getAuthorIdent().getName()));\r
+ add(WicketUtils.createDateLabel("date", c == null ? new Date(0) : c.getAuthorIdent().getWhen(), getTimeZone()));\r
+ }\r
+}
\ No newline at end of file
<body>\r
<wicket:panel>\r
\r
- <!-- header --> \r
- <div class="header" wicket:id="header">[history header]</div>\r
+ <!-- commit header -->\r
+ <div wicket:id="commitHeader">[commit header]</div>\r
\r
<!-- breadcrumbs -->\r
<div wicket:id="breadcrumbs">[breadcrumbs]</div>\r
import com.gitblit.wicket.pages.CommitDiffPage;\r
import com.gitblit.wicket.pages.CommitPage;\r
import com.gitblit.wicket.pages.HistoryPage;\r
-import com.gitblit.wicket.pages.LogPage;\r
import com.gitblit.wicket.pages.SearchPage;\r
import com.gitblit.wicket.pages.TreePage;\r
\r
// works unless commits.size() represents the exact end.\r
hasMore = commits.size() >= itemsPerPage;\r
\r
- // header\r
- if (pageResults) {\r
- // history page\r
- // show commit page link\r
- add(new LinkPanel("header", "title", commit == null ? "" : commit.getShortMessage(), CommitPage.class, WicketUtils.newObjectParameter(repositoryName, objectId)));\r
- } else {\r
- // summary page\r
- // show history page link\r
- add(new LinkPanel("header", "title", new StringResourceModel("gb.history", this, null), LogPage.class, WicketUtils.newRepositoryParameter(repositoryName)));\r
- }\r
+ add(new CommitHeaderPanel("commitHeader", repositoryName, commit));\r
\r
// breadcrumbs\r
add(new PathBreadcrumbsPanel("breadcrumbs", repositoryName, path, objectId));\r
import com.gitblit.wicket.LinkPanel;\r
import com.gitblit.wicket.WicketUtils;\r
import com.gitblit.wicket.pages.BranchesPage;\r
+import com.gitblit.wicket.pages.DocsPage;\r
import com.gitblit.wicket.pages.LogPage;\r
import com.gitblit.wicket.pages.SearchPage;\r
import com.gitblit.wicket.pages.SummaryPage;\r
\r
// Get the repository docs setting\r
boolean checkDocs = JGitUtils.getRepositoryUseDocs(r);\r
- if (checkDocs && JGitUtils.getDocumentsBranch(r) != null) {\r
+ if (checkDocs) {\r
extras.add("docs");\r
}\r
\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
+ item.add(new LinkPanel("extraLink", null, getString("gb.docs"), DocsPage.class, WicketUtils.newRepositoryParameter(repositoryName)));\r
}\r
}\r
};\r
line-height: inherit;\r
}\r
\r
-div.header {\r
+div.header, div.commitHeader {\r
background-color: #D2C3AF;\r
padding: 3px;\r
border: 1px solid #808080;\r
+}\r
+\r
+div.header {\r
border-radius: 3px 3px 0 0;\r
}\r
\r
-div.header a {\r
+div.commitHeader {\r
+ border-radius: 3px;\r
+}\r
+\r
+div.header a, div.commitHeader a {\r
color: black;\r
text-decoration: none;\r
font-weight: bold;\r
}\r
\r
-div.header a:hover {\r
+div.header a:hover, div.commitHeader a:hover {\r
text-decoration: underline;\r
}\r
\r
}\r
\r
td.mode {\r
+ text-align: right;\r
font-family: monospace;\r
- width:90px;\r
+ width: 8em;\r
padding-right:15px;\r
}\r
\r
td.size {\r
text-align: right;\r
- width:100px; \r
+ width: 8em; \r
padding-right:15px;\r
}\r
\r
text-align: right;\r
}\r
\r
+td.treeLinks {\r
+ text-align: right;\r
+ width: 13em;\r
+}\r
+\r
span .tagRef, span .headRef, span .remoteRef, span .otherRef { \r
padding: 0px 3px;\r
margin-right:2px;\r
\r
A quick and easy way to host your own Git repositories.\r
\r
-Built with [JGit](http://eclipse.org/jgit) [Wicket](http://wicket.apache.org) [WicketStuff GoogleCharts](https://github.com/wicketstuff/core/wiki/GoogleCharts) [MarkdownPapers](http://markdown.tautua.org) [Jetty](http://eclipse.org/jetty) [SLF4J](http://www.slf4j.org) [Log4j](http://logging.apache.org/log4j) [google-code-prettify](http://code.google.com/p/google-code-prettify) [JCommander](http://jcommander.org)
\ No newline at end of file
+Built with [JGit](http://eclipse.org/jgit), [Wicket](http://wicket.apache.org), [WicketStuff GoogleCharts](https://github.com/wicketstuff/core/wiki/GoogleCharts), [markitup](http://markitup.jaysalvat.com), [MarkdownPapers](http://markdown.tautua.org), [Jetty](http://eclipse.org/jetty), [SLF4J](http://www.slf4j.org), [Log4j](http://logging.apache.org/log4j), [google-code-prettify](http://code.google.com/p/google-code-prettify), [JCommander](http://jcommander.org), Most icons courtesy of [FatCow Hosting](http://www.fatcow.com/free-icons)
\ No newline at end of file