From cebf455f3fd54b72e530942f308097ec54b408cd Mon Sep 17 00:00:00 2001 From: James Moger Date: Thu, 7 Apr 2011 09:46:30 -0400 Subject: [PATCH] Let Wicket manage resources and use markup inheritance. This seems to improve page loading times. --- .classpath | 1 - build.xml | 1 - src/com/gitblit/wicket/BasePage.html | 34 ++ src/com/gitblit/wicket/BasePage.java | 31 ++ src/com/gitblit/wicket/RepositoryPage.java | 11 +- src/com/gitblit/wicket/pages/BlobPage.html | 40 +- src/com/gitblit/wicket/pages/BlobPage.java | 10 +- .../gitblit/wicket/pages/BranchesPage.html | 20 +- .../gitblit/wicket/pages/BranchesPage.java | 8 +- src/com/gitblit/wicket/pages/CommitPage.html | 34 +- src/com/gitblit/wicket/pages/CommitPage.java | 10 +- src/com/gitblit/wicket/pages/DiffPage.html | 20 +- src/com/gitblit/wicket/pages/DiffPage.java | 8 +- .../wicket/pages/RepositoriesPage.html | 19 +- .../wicket/pages/RepositoriesPage.java | 9 +- .../gitblit/wicket/pages/ShortLogPage.html | 22 +- .../gitblit/wicket/pages/ShortLogPage.java | 8 +- src/com/gitblit/wicket/pages/SummaryPage.html | 54 ++- src/com/gitblit/wicket/pages/SummaryPage.java | 7 +- src/com/gitblit/wicket/pages/TagPage.html | 18 +- src/com/gitblit/wicket/pages/TagPage.java | 9 +- src/com/gitblit/wicket/pages/TagsPage.html | 18 +- src/com/gitblit/wicket/pages/TagsPage.java | 8 +- src/com/gitblit/wicket/pages/TicGitPage.html | 24 +- src/com/gitblit/wicket/pages/TicGitPage.java | 8 +- .../wicket/pages/TicGitTicketPage.html | 28 +- .../wicket/pages/TicGitTicketPage.java | 8 +- src/com/gitblit/wicket/pages/TreePage.html | 22 +- src/com/gitblit/wicket/pages/TreePage.java | 10 +- .../wicket/pages/prettify/lang-apollo.js | 2 + .../gitblit/wicket/pages/prettify/lang-css.js | 2 + .../gitblit/wicket/pages/prettify/lang-hs.js | 2 + .../wicket/pages/prettify/lang-lisp.js | 2 + .../gitblit/wicket/pages/prettify/lang-lua.js | 2 + .../gitblit/wicket/pages/prettify/lang-ml.js | 2 + .../wicket/pages/prettify/lang-proto.js | 1 + .../wicket/pages/prettify/lang-scala.js | 2 + .../gitblit/wicket/pages/prettify/lang-sql.js | 2 + .../gitblit/wicket/pages/prettify/lang-vb.js | 2 + .../wicket/pages/prettify/lang-vhdl.js | 3 + .../wicket/pages/prettify/lang-wiki.js | 2 + .../wicket/pages/prettify/lang-yaml.js | 2 + .../wicket/pages/prettify/prettify.css | 1 + .../gitblit/wicket/pages/prettify/prettify.js | 33 ++ src/com/gitblit/wicket/panels/PageFooter.html | 11 - src/com/gitblit/wicket/panels/PageFooter.java | 26 -- src/com/gitblit/wicket/panels/PageHeader.html | 14 - src/com/gitblit/wicket/panels/PageHeader.java | 41 -- .../gitblit/wicket/resources/arrow_down.png | Bin 0 -> 189 bytes .../gitblit/wicket/resources/arrow_off.png | Bin 0 -> 178 bytes src/com/gitblit/wicket/resources/arrow_up.png | Bin 0 -> 189 bytes src/com/gitblit/wicket/resources/blank.png | Bin 0 -> 704 bytes src/com/gitblit/wicket/resources/gitblit.css | 442 ++++++++++++++++++ .../wicket/resources/gitblt-favicon.png | Bin 0 -> 380 bytes .../gitblit/wicket/resources/gitblt-logo.png | Bin 0 -> 3050 bytes src/com/gitblit/wicket/resources/gitblt.png | Bin 0 -> 5427 bytes src/com/gitblit/wicket/resources/gitblt2.png | Bin 0 -> 6543 bytes src/com/gitblit/wicket/resources/gitblt3.png | Bin 0 -> 4464 bytes .../gitblit/wicket/resources/gitblt_25.png | Bin 0 -> 3040 bytes 59 files changed, 790 insertions(+), 304 deletions(-) create mode 100644 src/com/gitblit/wicket/BasePage.html create mode 100644 src/com/gitblit/wicket/pages/prettify/lang-apollo.js create mode 100644 src/com/gitblit/wicket/pages/prettify/lang-css.js create mode 100644 src/com/gitblit/wicket/pages/prettify/lang-hs.js create mode 100644 src/com/gitblit/wicket/pages/prettify/lang-lisp.js create mode 100644 src/com/gitblit/wicket/pages/prettify/lang-lua.js create mode 100644 src/com/gitblit/wicket/pages/prettify/lang-ml.js create mode 100644 src/com/gitblit/wicket/pages/prettify/lang-proto.js create mode 100644 src/com/gitblit/wicket/pages/prettify/lang-scala.js create mode 100644 src/com/gitblit/wicket/pages/prettify/lang-sql.js create mode 100644 src/com/gitblit/wicket/pages/prettify/lang-vb.js create mode 100644 src/com/gitblit/wicket/pages/prettify/lang-vhdl.js create mode 100644 src/com/gitblit/wicket/pages/prettify/lang-wiki.js create mode 100644 src/com/gitblit/wicket/pages/prettify/lang-yaml.js create mode 100644 src/com/gitblit/wicket/pages/prettify/prettify.css create mode 100644 src/com/gitblit/wicket/pages/prettify/prettify.js delete mode 100644 src/com/gitblit/wicket/panels/PageFooter.html delete mode 100644 src/com/gitblit/wicket/panels/PageFooter.java delete mode 100644 src/com/gitblit/wicket/panels/PageHeader.html delete mode 100644 src/com/gitblit/wicket/panels/PageHeader.java create mode 100644 src/com/gitblit/wicket/resources/arrow_down.png create mode 100644 src/com/gitblit/wicket/resources/arrow_off.png create mode 100644 src/com/gitblit/wicket/resources/arrow_up.png create mode 100644 src/com/gitblit/wicket/resources/blank.png create mode 100644 src/com/gitblit/wicket/resources/gitblit.css create mode 100644 src/com/gitblit/wicket/resources/gitblt-favicon.png create mode 100644 src/com/gitblit/wicket/resources/gitblt-logo.png create mode 100644 src/com/gitblit/wicket/resources/gitblt.png create mode 100644 src/com/gitblit/wicket/resources/gitblt2.png create mode 100644 src/com/gitblit/wicket/resources/gitblt3.png create mode 100644 src/com/gitblit/wicket/resources/gitblt_25.png diff --git a/.classpath b/.classpath index 2fc1d0f4..4f9e926b 100644 --- a/.classpath +++ b/.classpath @@ -1,7 +1,6 @@ - diff --git a/build.xml b/build.xml index 258f4f45..54cbaa27 100644 --- a/build.xml +++ b/build.xml @@ -34,7 +34,6 @@ - diff --git a/src/com/gitblit/wicket/BasePage.html b/src/com/gitblit/wicket/BasePage.html new file mode 100644 index 00000000..ccd8c12a --- /dev/null +++ b/src/com/gitblit/wicket/BasePage.html @@ -0,0 +1,34 @@ + + + + + [page title] + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/com/gitblit/wicket/BasePage.java b/src/com/gitblit/wicket/BasePage.java index 5c29eac2..a1cd413d 100644 --- a/src/com/gitblit/wicket/BasePage.java +++ b/src/com/gitblit/wicket/BasePage.java @@ -2,14 +2,20 @@ package com.gitblit.wicket; import java.util.Date; +import javax.servlet.http.HttpServletRequest; + import org.apache.wicket.Component; import org.apache.wicket.PageParameters; import org.apache.wicket.markup.html.WebPage; import org.apache.wicket.markup.html.basic.Label; +import org.apache.wicket.protocol.http.servlet.ServletWebRequest; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import com.gitblit.Constants; +import com.gitblit.StoredSettings; import com.gitblit.utils.Utils; +import com.gitblit.wicket.pages.SummaryPage; public abstract class BasePage extends WebPage { @@ -23,6 +29,31 @@ public abstract class BasePage extends WebPage { public BasePage(PageParameters params) { super(params); } + + protected void setupPage(String repositoryName, String pageName) { + if (repositoryName != null && repositoryName.trim().length() > 0) { + add(new Label("title", getServerName() + " - " + repositoryName)); + } else { + add(new Label("title", getServerName())); + } + // header + add(new Label("siteName", StoredSettings.getString("siteName", Constants.NAME))); + add(new LinkPanel("repositoryName", null, repositoryName, SummaryPage.class, new PageParameters("p=" + repositoryName))); + add(new Label("pageName", pageName)); + + // footer + add(new Label("footerText", "")); + add(new Label("gbVersion", "v" + Constants.VERSION)); + if (StoredSettings.getBoolean("aggressiveHeapManagement", false)) { + System.gc(); + } + } + + protected String getServerName() { + ServletWebRequest servletWebRequest = (ServletWebRequest) getRequest(); + HttpServletRequest req = servletWebRequest.getHttpServletRequest(); + return req.getServerName(); + } protected Label createAuthorLabel(String wicketId, String author) { Label label = new Label(wicketId, author); diff --git a/src/com/gitblit/wicket/RepositoryPage.java b/src/com/gitblit/wicket/RepositoryPage.java index 2f2b9676..d3e0589f 100644 --- a/src/com/gitblit/wicket/RepositoryPage.java +++ b/src/com/gitblit/wicket/RepositoryPage.java @@ -15,8 +15,6 @@ import org.eclipse.jgit.revwalk.RevCommit; import com.gitblit.StoredSettings; import com.gitblit.utils.JGitUtils; import com.gitblit.wicket.pages.RepositoriesPage; -import com.gitblit.wicket.panels.PageFooter; -import com.gitblit.wicket.panels.PageHeader; import com.gitblit.wicket.panels.PageLinksPanel; import com.gitblit.wicket.panels.RefsPanel; @@ -28,7 +26,7 @@ public abstract class RepositoryPage extends BasePage { private transient Repository r = null; - public RepositoryPage(PageParameters params, String pageName) { + public RepositoryPage(PageParameters params) { super(params); if (!params.containsKey("p")) { error("Repository not specified!"); @@ -39,8 +37,7 @@ public abstract class RepositoryPage extends BasePage { Repository r = getRepository(); - add(new PageHeader("pageHeader", repositoryName, "/ " + pageName)); - add(new PageLinksPanel("pageLinks", r, repositoryName, pageName)); + add(new PageLinksPanel("pageLinks", r, repositoryName, getPageName())); setStatelessHint(true); } @@ -95,10 +92,12 @@ public abstract class RepositoryPage extends BasePage { } add(new Label(wicketId, html).setEscapeModelStrings(false)); } + + protected abstract String getPageName(); protected void addFooter() { r.close(); - add(new PageFooter("pageFooter", description)); + setupPage(repositoryName, "/ " + getPageName()); } protected PageParameters newRepositoryParameter() { diff --git a/src/com/gitblit/wicket/pages/BlobPage.html b/src/com/gitblit/wicket/pages/BlobPage.html index 6d04e180..3eff62da 100644 --- a/src/com/gitblit/wicket/pages/BlobPage.html +++ b/src/com/gitblit/wicket/pages/BlobPage.html @@ -1,31 +1,35 @@ - + + + + - + + + + + - -
- -
+ +
[page links]
- - + + - -
+ +
[shortlog header]
- -
+ +
[breadcrumbs]
- -

+		
+		
[blob content]
- -
+
\ No newline at end of file diff --git a/src/com/gitblit/wicket/pages/BlobPage.java b/src/com/gitblit/wicket/pages/BlobPage.java index 324a74e2..b9cdc037 100644 --- a/src/com/gitblit/wicket/pages/BlobPage.java +++ b/src/com/gitblit/wicket/pages/BlobPage.java @@ -20,7 +20,7 @@ import com.gitblit.wicket.panels.PathBreadcrumbsPanel; public class BlobPage extends RepositoryPage { public BlobPage(PageParameters params) { - super(params, "view"); + super(params); final String blobPath = params.getString("f", null); @@ -85,10 +85,12 @@ public class BlobPage extends RepositoryPage { add(blobLabel); } - // close repository - r.close(); - // footer addFooter(); } + + @Override + protected String getPageName() { + return "view"; + } } diff --git a/src/com/gitblit/wicket/pages/BranchesPage.html b/src/com/gitblit/wicket/pages/BranchesPage.html index d4e59199..0d0657ef 100644 --- a/src/com/gitblit/wicket/pages/BranchesPage.html +++ b/src/com/gitblit/wicket/pages/BranchesPage.html @@ -1,26 +1,24 @@ - -
+ -
+
[page links]
-
+
[header]
- - - - + + + +
[branch date]
[branch name]
[branch type]
[branch links]
- - -
+ +
\ No newline at end of file diff --git a/src/com/gitblit/wicket/pages/BranchesPage.java b/src/com/gitblit/wicket/pages/BranchesPage.java index 1fc5f88b..82577992 100644 --- a/src/com/gitblit/wicket/pages/BranchesPage.java +++ b/src/com/gitblit/wicket/pages/BranchesPage.java @@ -23,13 +23,12 @@ import com.gitblit.wicket.panels.BranchLinksPanel; public class BranchesPage extends RepositoryPage { public BranchesPage(PageParameters params) { - super(params, "branches"); + super(params); Repository r = getRepository(); List branches = new ArrayList(); branches.addAll(JGitUtils.getLocalBranches(r, -1)); branches.addAll(JGitUtils.getRemoteBranches(r, -1)); - r.close(); // shortlog add(new LinkPanel("summary", "title", repositoryName, SummaryPage.class, newRepositoryParameter())); @@ -68,4 +67,9 @@ public class BranchesPage extends RepositoryPage { // footer addFooter(); } + + @Override + protected String getPageName() { + return "branches"; + } } diff --git a/src/com/gitblit/wicket/pages/CommitPage.html b/src/com/gitblit/wicket/pages/CommitPage.html index c2edbea3..da455d6d 100644 --- a/src/com/gitblit/wicket/pages/CommitPage.html +++ b/src/com/gitblit/wicket/pages/CommitPage.html @@ -1,45 +1,43 @@ - -
+ -
+
[page links]
-
+
[shortlog header]
- - - - - - - + + + + + + + +
[commit parents]
refs
authorMessage goes here
Message goes here
committerMessage goes here
Message goes here
commitMessage goes here
treeMessage goes here
refs
[references]
author[author
[author date]
committer[committer]
[commit date]
commit[commit id]
tree[commit tree]
parent -
Message goes here
-
+
[commit message]
- - + +
[commit path][path links]
- -
+
\ No newline at end of file diff --git a/src/com/gitblit/wicket/pages/CommitPage.java b/src/com/gitblit/wicket/pages/CommitPage.java index 0754532b..662ba4ce 100644 --- a/src/com/gitblit/wicket/pages/CommitPage.java +++ b/src/com/gitblit/wicket/pages/CommitPage.java @@ -23,7 +23,7 @@ import com.gitblit.wicket.panels.PathLinksPanel; public class CommitPage extends RepositoryPage { public CommitPage(PageParameters params) { - super(params, "commit"); + super(params); final String commitId = params.getString("h", ""); @@ -97,10 +97,12 @@ public class CommitPage extends RepositoryPage { }; add(pathsView); - // close repository - r.close(); - // footer addFooter(); } + + @Override + protected String getPageName() { + return "commit"; + } } diff --git a/src/com/gitblit/wicket/pages/DiffPage.html b/src/com/gitblit/wicket/pages/DiffPage.html index b001dead..afec6d63 100644 --- a/src/com/gitblit/wicket/pages/DiffPage.html +++ b/src/com/gitblit/wicket/pages/DiffPage.html @@ -1,31 +1,25 @@ - - - - - -
+ -
+
[page links]
-
+
[shortlog header]
-
+
[breadcrumbs]
-

+	
[diff text]
- -
+
\ No newline at end of file diff --git a/src/com/gitblit/wicket/pages/DiffPage.java b/src/com/gitblit/wicket/pages/DiffPage.java index 05500f83..7f72f0f5 100644 --- a/src/com/gitblit/wicket/pages/DiffPage.java +++ b/src/com/gitblit/wicket/pages/DiffPage.java @@ -13,7 +13,7 @@ import com.gitblit.wicket.panels.PathBreadcrumbsPanel; public class DiffPage extends RepositoryPage { public DiffPage(PageParameters params) { - super(params, "diff"); + super(params); final String blobPath = params.getString("f", null); @@ -27,7 +27,6 @@ public class DiffPage extends RepositoryPage { // commit diff diff = JGitUtils.getCommitDiff(r, commit, true); } - r.close(); // diff page links add(new Label("historyLink", "history")); @@ -43,4 +42,9 @@ public class DiffPage extends RepositoryPage { // footer addFooter(); } + + @Override + protected String getPageName() { + return "diff"; + } } diff --git a/src/com/gitblit/wicket/pages/RepositoriesPage.html b/src/com/gitblit/wicket/pages/RepositoriesPage.html index 43168bba..252af4f0 100644 --- a/src/com/gitblit/wicket/pages/RepositoriesPage.html +++ b/src/com/gitblit/wicket/pages/RepositoriesPage.html @@ -1,11 +1,10 @@ -
+ +
[admin links]
-
- -
+
[repositories message]
@@ -16,15 +15,13 @@ - - - - + + + +
[repository name]
[repository description]
[repository owner][last change]
- - -
+
\ No newline at end of file diff --git a/src/com/gitblit/wicket/pages/RepositoriesPage.java b/src/com/gitblit/wicket/pages/RepositoriesPage.java index 4755e415..d1b9694e 100644 --- a/src/com/gitblit/wicket/pages/RepositoriesPage.java +++ b/src/com/gitblit/wicket/pages/RepositoriesPage.java @@ -23,15 +23,14 @@ import com.gitblit.wicket.LinkPanel; import com.gitblit.wicket.WicketUtils; import com.gitblit.wicket.models.RepositoryModel; import com.gitblit.wicket.panels.AdminLinksPanel; -import com.gitblit.wicket.panels.PageFooter; -import com.gitblit.wicket.panels.PageHeader; public class RepositoriesPage extends BasePage { public RepositoriesPage() { - add(new PageHeader("pageHeader")); - + super(); + setupPage("", ""); + add(new AdminLinksPanel("adminPanel").setVisible(StoredSettings.getBoolean("allowAdministration", false))); add(new Label("repositoriesMessage", StoredSettings.getString("repositoriesMessage", "")).setEscapeModelStrings(false)); @@ -65,8 +64,6 @@ public class RepositoriesPage extends BasePage { add(newSort("orderByDescription", SortBy.description, dp, dataView)); add(newSort("orderByOwner", SortBy.owner, dp, dataView)); add(newSort("orderByDate", SortBy.date, dp, dataView)); - - add(new PageFooter("pageFooter", "")); } protected enum SortBy { diff --git a/src/com/gitblit/wicket/pages/ShortLogPage.html b/src/com/gitblit/wicket/pages/ShortLogPage.html index f1daa272..5a688fd9 100644 --- a/src/com/gitblit/wicket/pages/ShortLogPage.html +++ b/src/com/gitblit/wicket/pages/ShortLogPage.html @@ -1,28 +1,26 @@ - -
+ -
+
[page links]
-
+
[shortlog header]
- - - - - + + + + +
[commit date][commit author]
[commit short message]
[commit refs]
[commit links]
-
+
[pager]
- -
+
\ No newline at end of file diff --git a/src/com/gitblit/wicket/pages/ShortLogPage.java b/src/com/gitblit/wicket/pages/ShortLogPage.java index 220874e8..cc12aac9 100644 --- a/src/com/gitblit/wicket/pages/ShortLogPage.java +++ b/src/com/gitblit/wicket/pages/ShortLogPage.java @@ -25,12 +25,11 @@ import com.gitblit.wicket.panels.ShortLogLinksPanel; public class ShortLogPage extends RepositoryPage { public ShortLogPage(PageParameters params) { - super(params, "shortlog"); + super(params); Repository r = getRepository(); final Map> allRefs = JGitUtils.getAllRefs(r); List commits = JGitUtils.getRevLog(r, 100); - r.close(); // shortlog add(new LinkPanel("summary", "title", repositoryName, SummaryPage.class, newRepositoryParameter())); @@ -73,4 +72,9 @@ public class ShortLogPage extends RepositoryPage { // footer addFooter(); } + + @Override + protected String getPageName() { + return "shortlog"; + } } diff --git a/src/com/gitblit/wicket/pages/SummaryPage.html b/src/com/gitblit/wicket/pages/SummaryPage.html index 6a103e4b..ccfb6ae4 100644 --- a/src/com/gitblit/wicket/pages/SummaryPage.html +++ b/src/com/gitblit/wicket/pages/SummaryPage.html @@ -1,11 +1,10 @@ - -
- + + -
+
[page links]
@@ -16,65 +15,64 @@
- - - - + + + +
descriptionMessage goes here
ownerMessage goes here
last changeMessage goes here
URLMessage goes here
description[repository description]
owner[repository owner]
last change[repository last change]
URL[repository clone url]
-
+
[shortlog header]
- - - - - + + + + +
[commit date][commit author]
[commit short message]
[commit refs]
[commit links]
-
+
[more shortlogs]
-
+
[branches header]
- - - + + +
[branch date]
[branch name]
[branch links]
-
+
[all branches]
-
+
[tags header]
- - - - + + + +
[tag date]
[tag name]
[tag description]
[tag links]
-
+
[all tags]
- -
+
\ No newline at end of file diff --git a/src/com/gitblit/wicket/pages/SummaryPage.java b/src/com/gitblit/wicket/pages/SummaryPage.java index b7be71a5..c086480e 100644 --- a/src/com/gitblit/wicket/pages/SummaryPage.java +++ b/src/com/gitblit/wicket/pages/SummaryPage.java @@ -42,7 +42,7 @@ import com.gitblit.wicket.panels.TagLinksPanel; public class SummaryPage extends RepositoryPage { public SummaryPage(PageParameters params) { - super(params, "summary"); + super(params); int numCommitsDef = 20; int numRefsDef = 5; @@ -195,6 +195,11 @@ public class SummaryPage extends RepositoryPage { // footer addFooter(); } + + @Override + protected String getPageName() { + return "summary"; + } private void insertActivityGraph(Repository r) { if (StoredSettings.getBoolean("generateActivityGraph", true)) { diff --git a/src/com/gitblit/wicket/pages/TagPage.html b/src/com/gitblit/wicket/pages/TagPage.html index f86becf9..41a604d4 100644 --- a/src/com/gitblit/wicket/pages/TagPage.html +++ b/src/com/gitblit/wicket/pages/TagPage.html @@ -1,26 +1,24 @@ - -
+ -
+
[page links]
-
+
[shortlog header]
- - - + + +
objectMessage goes here
authorMessage goes here
Message goes here
object[tag id]
author[tag author]
[tag date]
-
+
[tag full message]
- -
+
\ No newline at end of file diff --git a/src/com/gitblit/wicket/pages/TagPage.java b/src/com/gitblit/wicket/pages/TagPage.java index f098c1e3..ccceea8e 100644 --- a/src/com/gitblit/wicket/pages/TagPage.java +++ b/src/com/gitblit/wicket/pages/TagPage.java @@ -14,7 +14,7 @@ import com.gitblit.wicket.RepositoryPage; public class TagPage extends RepositoryPage { public TagPage(PageParameters params) { - super(params, "tag"); + super(params); Repository r = getRepository(); RevCommit c = JGitUtils.getCommit(r, commitId); @@ -28,9 +28,12 @@ public class TagPage extends RepositoryPage { addFullText("fullMessage", c.getFullMessage(), true); - r.close(); - // footer addFooter(); } + + @Override + protected String getPageName() { + return "tag"; + } } diff --git a/src/com/gitblit/wicket/pages/TagsPage.html b/src/com/gitblit/wicket/pages/TagsPage.html index e5899c52..4cface1a 100644 --- a/src/com/gitblit/wicket/pages/TagsPage.html +++ b/src/com/gitblit/wicket/pages/TagsPage.html @@ -1,26 +1,24 @@ - -
+ -
+
[page links]
-
+
[header]
- - - - + + + +
[tag date]
[tag name]
[tag description]
[tag links]
- -
+
\ No newline at end of file diff --git a/src/com/gitblit/wicket/pages/TagsPage.java b/src/com/gitblit/wicket/pages/TagsPage.java index 1f73ed03..0fa1cdf8 100644 --- a/src/com/gitblit/wicket/pages/TagsPage.java +++ b/src/com/gitblit/wicket/pages/TagsPage.java @@ -20,10 +20,9 @@ import com.gitblit.wicket.panels.TagLinksPanel; public class TagsPage extends RepositoryPage { public TagsPage(PageParameters params) { - super(params, "tags"); + super(params); Repository r = getRepository(); List tags = JGitUtils.getTags(r, -1); - r.close(); // shortlog add(new LinkPanel("summary", "title", repositoryName, SummaryPage.class, newRepositoryParameter())); @@ -58,4 +57,9 @@ public class TagsPage extends RepositoryPage { // footer addFooter(); } + + @Override + protected String getPageName() { + return "tags"; + } } diff --git a/src/com/gitblit/wicket/pages/TicGitPage.html b/src/com/gitblit/wicket/pages/TicGitPage.html index 451058d0..78edc63f 100644 --- a/src/com/gitblit/wicket/pages/TicGitPage.html +++ b/src/com/gitblit/wicket/pages/TicGitPage.html @@ -1,26 +1,26 @@ - -
+ -
+
[page links]
- -
+ +
[header]
+ + - - - - + + + +
[ticket state]
[ticket date]
[ticket handler]
[ticket title]
- - -
+ +
\ No newline at end of file diff --git a/src/com/gitblit/wicket/pages/TicGitPage.java b/src/com/gitblit/wicket/pages/TicGitPage.java index 889093d1..16b07b99 100644 --- a/src/com/gitblit/wicket/pages/TicGitPage.java +++ b/src/com/gitblit/wicket/pages/TicGitPage.java @@ -18,11 +18,10 @@ import com.gitblit.wicket.WicketUtils; public class TicGitPage extends RepositoryPage { public TicGitPage(PageParameters params) { - super(params, "ticgit"); + super(params); Repository r = getRepository(); List tickets = JGitUtils.getTicGitTickets(r); - r.close(); // shortlog add(new LinkPanel("summary", "title", repositoryName, SummaryPage.class, newRepositoryParameter())); @@ -62,4 +61,9 @@ public class TicGitPage extends RepositoryPage { // footer addFooter(); } + + @Override + protected String getPageName() { + return "ticgit"; + } } diff --git a/src/com/gitblit/wicket/pages/TicGitTicketPage.html b/src/com/gitblit/wicket/pages/TicGitTicketPage.html index b66bf505..b36c3ae6 100644 --- a/src/com/gitblit/wicket/pages/TicGitTicketPage.html +++ b/src/com/gitblit/wicket/pages/TicGitTicketPage.html @@ -1,22 +1,21 @@ - -
+ -
+
[page links]
-
+
[ticket title]
- - - - - + + + + +
ticket idMessage goes here
assignedMessage goes here
open dateMessage goes here
stateMessage goes here
tagsMessage goes here
ticket id[ticket id]
assigned[ticket title]
open date[ticket open date]
state[ticket state]
tags[ticket tags]
@@ -26,14 +25,13 @@ - - - + + +
[comment date]
[comment author]
[comment text]
- - -
+ +
\ No newline at end of file diff --git a/src/com/gitblit/wicket/pages/TicGitTicketPage.java b/src/com/gitblit/wicket/pages/TicGitTicketPage.java index c73a3ce5..76d9c1ac 100644 --- a/src/com/gitblit/wicket/pages/TicGitTicketPage.java +++ b/src/com/gitblit/wicket/pages/TicGitTicketPage.java @@ -19,13 +19,12 @@ import com.gitblit.wicket.WicketUtils; public class TicGitTicketPage extends RepositoryPage { public TicGitTicketPage(PageParameters params) { - super(params, "ticket"); + super(params); final String ticketFolder = params.getString("f", ""); Repository r = getRepository(); TicGitTicket t = JGitUtils.getTicGitTicket(r, ticketFolder); - r.close(); add(new Label("ticketTitle", t.title)); add(new Label("ticketId", t.id)); @@ -68,6 +67,11 @@ public class TicGitTicketPage extends RepositoryPage { // footer addFooter(); } + + @Override + protected String getPageName() { + return "ticket"; + } private String prepareComment(String comment) { String html = WicketUtils.breakLines(comment).trim(); diff --git a/src/com/gitblit/wicket/pages/TreePage.html b/src/com/gitblit/wicket/pages/TreePage.html index 174e4278..e2b87ef3 100644 --- a/src/com/gitblit/wicket/pages/TreePage.html +++ b/src/com/gitblit/wicket/pages/TreePage.html @@ -1,34 +1,32 @@ - -
+ -
+
[page links]
-
+
[shortlog header]
-
+
[breadcrumbs]
- - - + + +
[path size][path permissions][path links]
- - -
+ +
\ No newline at end of file diff --git a/src/com/gitblit/wicket/pages/TreePage.java b/src/com/gitblit/wicket/pages/TreePage.java index 2ac04b7f..082a72c8 100644 --- a/src/com/gitblit/wicket/pages/TreePage.java +++ b/src/com/gitblit/wicket/pages/TreePage.java @@ -24,7 +24,7 @@ import com.gitblit.wicket.panels.TreeLinksPanel; public class TreePage extends RepositoryPage { public TreePage(PageParameters params) { - super(params, "tree"); + super(params); final String basePath = params.getString("f", null); @@ -80,10 +80,12 @@ public class TreePage extends RepositoryPage { }; add(pathsView); - // close repository - r.close(); - // footer addFooter(); } + + @Override + protected String getPageName() { + return "tree"; + } } diff --git a/src/com/gitblit/wicket/pages/prettify/lang-apollo.js b/src/com/gitblit/wicket/pages/prettify/lang-apollo.js new file mode 100644 index 00000000..bfc0014c --- /dev/null +++ b/src/com/gitblit/wicket/pages/prettify/lang-apollo.js @@ -0,0 +1,2 @@ +PR.registerLangHandler(PR.createSimpleLexer([["com",/^#[^\r\n]*/,null,"#"],["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"']],[["kwd",/^(?:ADS|AD|AUG|BZF|BZMF|CAE|CAF|CA|CCS|COM|CS|DAS|DCA|DCOM|DCS|DDOUBL|DIM|DOUBLE|DTCB|DTCF|DV|DXCH|EDRUPT|EXTEND|INCR|INDEX|NDX|INHINT|LXCH|MASK|MSK|MP|MSU|NOOP|OVSK|QXCH|RAND|READ|RELINT|RESUME|RETURN|ROR|RXOR|SQUARE|SU|TCR|TCAA|OVSK|TCF|TC|TS|WAND|WOR|WRITE|XCH|XLQ|XXALQ|ZL|ZQ|ADD|ADZ|SUB|SUZ|MPY|MPR|MPZ|DVP|COM|ABS|CLA|CLZ|LDQ|STO|STQ|ALS|LLS|LRS|TRA|TSQ|TMI|TOV|AXT|TIX|DLY|INP|OUT)\s/, +null],["typ",/^(?:-?GENADR|=MINUS|2BCADR|VN|BOF|MM|-?2CADR|-?[1-6]DNADR|ADRES|BBCON|[SE]?BANK\=?|BLOCK|BNKSUM|E?CADR|COUNT\*?|2?DEC\*?|-?DNCHAN|-?DNPTR|EQUALS|ERASE|MEMORY|2?OCT|REMADR|SETLOC|SUBRO|ORG|BSS|BES|SYN|EQU|DEFINE|END)\s/,null],["lit",/^\'(?:-*(?:\w|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?)?/],["pln",/^-*(?:[!-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?/i],["pun",/^[^\w\t\n\r \xA0()\"\\\';]+/]]),["apollo","agc","aea"]) \ No newline at end of file diff --git a/src/com/gitblit/wicket/pages/prettify/lang-css.js b/src/com/gitblit/wicket/pages/prettify/lang-css.js new file mode 100644 index 00000000..61157f38 --- /dev/null +++ b/src/com/gitblit/wicket/pages/prettify/lang-css.js @@ -0,0 +1,2 @@ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[ \t\r\n\f]+/,null," \t\r\n\u000c"]],[["str",/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],["str",/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],["kwd",/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],["com",/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//], +["com",/^(?: