\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
-logPageCommitsCount = 50\r
+logPageCommitCount = 50\r
\r
# Registered extensions for google-code-prettify\r
prettyPrintExtensions = c cpp cs css htm html java js php pl prefs properties py rb sh sql xml vb\r
error("Repository not specified!");\r
redirectToInterceptPage(new RepositoriesPage());\r
}\r
- repositoryName = params.getString("r", "");\r
- objectId = params.getString("h", "HEAD");\r
+ repositoryName = WicketUtils.getRepositoryName(params);\r
+ objectId = WicketUtils.getObject(params);\r
\r
Repository r = getRepository();\r
\r
}\r
\r
protected void addRefs(Repository r, RevCommit c) {\r
- add(new RefsPanel("refsPanel", r, c));\r
+ add(new RefsPanel("refsPanel", repositoryName, c, JGitUtils.getAllRefs(r)));\r
}\r
\r
protected void addFullText(String wicketId, String text, boolean substituteRegex) {\r
return new PageParameters("r=" + repositoryName + ",h=" + objectId + ",page=" + pageNumber);\r
}\r
\r
+ public static String getRepositoryName(PageParameters params) {\r
+ return params.getString("r", "");\r
+ }\r
+\r
+ public static String getObject(PageParameters params) {\r
+ return params.getString("h", "");\r
+ }\r
+\r
+ public static String getPath(PageParameters params) {\r
+ return params.getString("f", null);\r
+ }\r
+\r
+ public static int getPage(PageParameters params) {\r
+ return params.getInt("page", 1); // index from 1\r
+ }\r
+\r
public static Label createDateLabel(String wicketId, Date date, TimeZone timeZone) {\r
DateFormat df = new SimpleDateFormat(StoredSettings.getString("datestampShortFormat", "MM/dd/yy"));\r
if (timeZone != null) {\r
public BlobPage(PageParameters params) {\r
super(params);\r
\r
- final String blobPath = params.getString("f", null);\r
+ final String blobPath = WicketUtils.getPath(params);\r
\r
Repository r = getRepository();\r
RevCommit commit = JGitUtils.getCommit(r, objectId);\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.PathBreadcrumbsPanel;\r
\r
public class DiffPage extends RepositoryPage {\r
public DiffPage(PageParameters params) {\r
super(params);\r
\r
- final String blobPath = params.getString("f", null);\r
+ final String blobPath = WicketUtils.getPath(params);\r
\r
Repository r = getRepository();\r
RevCommit commit = JGitUtils.getCommit(r, objectId);\r
public LogPage(PageParameters params) {\r
super(params);\r
\r
- int pageNumber = params.getInt("page", 1); // index from 1\r
+ int pageNumber = WicketUtils.getPage(params);\r
int prevPage = Math.max(0, pageNumber - 1);\r
int nextPage = pageNumber + 1;\r
\r
public TicGitTicketPage(PageParameters params) {\r
super(params);\r
\r
- final String ticketFolder = params.getString("f", "");\r
+ final String ticketFolder = WicketUtils.getPath(params);\r
\r
Repository r = getRepository();\r
TicGitTicket t = JGitUtils.getTicGitTicket(r, ticketFolder);\r
public TreePage(PageParameters params) {\r
super(params);\r
\r
- final String basePath = params.getString("f", null);\r
+ final String basePath = WicketUtils.getPath(params);\r
\r
Repository r = getRepository();\r
RevCommit commit = JGitUtils.getCommit(r, objectId);\r
public LogPanel(String wicketId, final String repositoryName, String objectId, Repository r, int limit, int pageOffset) {\r
super(wicketId);\r
boolean pageResults = limit <= 0;\r
- int itemsPerPage = StoredSettings.getInteger("logPageCommitsCount", 50);\r
+ int itemsPerPage = StoredSettings.getInteger("logPageCommitCount", 50);\r
if (itemsPerPage <= 1) {\r
itemsPerPage = 50;\r
}\r
}\r
item.add(shortlog);\r
\r
- item.add(new RefsPanel("commitRefs", entry, allRefs));\r
+ item.add(new RefsPanel("commitRefs", repositoryName, entry, allRefs));\r
\r
item.add(new BookmarkablePageLink<Void>("view", CommitPage.class, WicketUtils.newObjectParameter(repositoryName, entry.getName())));\r
item.add(new BookmarkablePageLink<Void>("diff", DiffPage.class, WicketUtils.newObjectParameter(repositoryName, entry.getName())));\r
lang="en"> \r
\r
<wicket:panel>\r
- <span class="refs" wicket:id="ref">\r
+ <span wicket:id="ref">\r
<span wicket:id="refName">ref</span>\r
</span> \r
</wicket:panel>\r
import org.apache.wicket.markup.repeater.data.ListDataProvider;\r
import org.eclipse.jgit.lib.Constants;\r
import org.eclipse.jgit.lib.ObjectId;\r
-import org.eclipse.jgit.lib.Repository;\r
import org.eclipse.jgit.revwalk.RevCommit;\r
\r
-import com.gitblit.utils.JGitUtils;\r
+import com.gitblit.wicket.LinkPanel;\r
import com.gitblit.wicket.WicketUtils;\r
+import com.gitblit.wicket.pages.LogPage;\r
+import com.gitblit.wicket.pages.TagPage;\r
\r
\r
public class RefsPanel extends Panel {\r
\r
private static final long serialVersionUID = 1L;\r
\r
- public RefsPanel(String id, Repository r, RevCommit c) {\r
- this(id, c, JGitUtils.getAllRefs(r));\r
- }\r
- \r
- public RefsPanel(String id, RevCommit c, Map<ObjectId, List<String>> refs) {\r
+ public RefsPanel(String id, final String repositoryName, RevCommit c, Map<ObjectId, List<String>> refs) {\r
super(id);\r
List<String> refNames = refs.get(c.getId());\r
if (refNames == null) {\r
refNames = new ArrayList<String>();\r
}\r
Collections.sort(refNames);\r
+ refNames.remove(Constants.HEAD);\r
+ \r
ListDataProvider<String> refsDp = new ListDataProvider<String>(refNames);\r
DataView<String> refsView = new DataView<String>("ref", refsDp) {\r
private static final long serialVersionUID = 1L;\r
Component c = null;\r
if (entry.startsWith(Constants.R_HEADS)) {\r
// local head\r
- c = new Label("refName", entry.substring(Constants.R_HEADS.length()));\r
+ c = new LinkPanel("refName", null, entry.substring(Constants.R_HEADS.length()), LogPage.class, WicketUtils.newObjectParameter(repositoryName, entry));\r
+// c = new Label("refName", entry.substring(Constants.R_HEADS.length()));\r
WicketUtils.setCssClass(c, "head");\r
} else if (entry.startsWith(Constants.R_REMOTES)) {\r
// remote head\r
- c = new Label("refName", entry.substring(Constants.R_REMOTES.length()));\r
+ c = new LinkPanel("refName", null, entry.substring(Constants.R_REMOTES.length()), LogPage.class, WicketUtils.newObjectParameter(repositoryName, entry));\r
+// c = new Label("refName", entry.substring(Constants.R_REMOTES.length()));\r
WicketUtils.setCssClass(c, "ref");\r
} else if (entry.startsWith(Constants.R_TAGS)) {\r
// tag\r
- c = new Label("refName", entry.substring(Constants.R_TAGS.length()));\r
+// c = new BookmarkablePageLink<Void>("refName", TagPage.class, WicketUtils.newObjectParameter(repositoryName, entry));\r
+ c = new LinkPanel("refName", null, entry.substring(Constants.R_TAGS.length()), TagPage.class, WicketUtils.newObjectParameter(repositoryName, entry));\r
+ //c = new Label("refName", entry.substring(Constants.R_TAGS.length()));\r
WicketUtils.setCssClass(c, "tag");\r
} else {\r
// other\r
- c = new Label("refName", entry); \r
+ c = new Label("refName", entry);\r
}\r
WicketUtils.setHtmlTitle(c, entry);\r
item.add(c);\r
text-align: right;\r
}\r
\r
-span.refs span {\r
+span .tag, span .head, span .ref {\r
padding: 0px 4px;\r
font-family: sans-serif;\r
- font-size: 70%;\r
font-weight: normal;\r
border: 1px solid;\r
- background-color: #ffaaff;\r
- border-color: #ffccff #ff00ee #ff00ee #ffccff;\r
color: black;\r
}\r
\r
-span.refs span a {\r
+span .tag a, span .head a, span .ref a {\r
text-decoration: none;\r
color: inherit;\r
}\r
\r
-span.refs span a:hover {\r
- text-decoration: underline;\r
+span .tag a:hover, span .head a:hover, span .ref a:hover {\r
+ color: inherit;\r
}\r
\r
-span.refs span.indirect {\r
- font-style: italic;\r
+span .tag a span, span .head a span, span .ref a span {\r
+ font-size: 9px;\r
}\r
\r
-span.refs span.ref {\r
+span .ref {\r
background-color: #aaaaff;\r
border-color: #ccccff #0033cc #0033cc #ccccff;\r
}\r
\r
-span.refs span.tag {\r
+span .tag {\r
background-color: #ffffaa;\r
border-color: #ffffcc #ffee00 #ffee00 #ffffcc;\r
}\r
\r
-span.refs span.head {\r
+span .head {\r
background-color: #aaffaa;\r
border-color: #ccffcc #00cc33 #00cc33 #ccffcc;\r
}
\ No newline at end of file