]> source.dussan.org Git - gitblit.git/commitdiff
Eliminated most session usage.
authorJames Moger <james.moger@gitblit.com>
Tue, 12 Apr 2011 01:49:36 +0000 (21:49 -0400)
committerJames Moger <james.moger@gitblit.com>
Tue, 12 Apr 2011 01:49:36 +0000 (21:49 -0400)
15 files changed:
gitblit.properties
src/com/gitblit/wicket/BasePage.java
src/com/gitblit/wicket/GitBlitWebSession.java
src/com/gitblit/wicket/WicketUtils.java
src/com/gitblit/wicket/pages/CommitPage.java
src/com/gitblit/wicket/pages/SummaryPage.java
src/com/gitblit/wicket/pages/TagPage.java
src/com/gitblit/wicket/pages/TicGitTicketPage.java
src/com/gitblit/wicket/panels/BasePanel.java [new file with mode: 0644]
src/com/gitblit/wicket/panels/BranchesPanel.java
src/com/gitblit/wicket/panels/LogPanel.java
src/com/gitblit/wicket/panels/PageLinksPanel.java
src/com/gitblit/wicket/panels/RefsPanel.java
src/com/gitblit/wicket/panels/TagsPanel.java
src/com/gitblit/wicket/resources/gitblit.css

index 839b914b3fe573aebc428d5875713d2c4e164dbd..b06adc268a62187780e3457f297751d4a7276317 100644 (file)
@@ -56,14 +56,19 @@ siteName =
 allowAdministration = true\r
 repositoriesMessage = Welcome to Git:Blit!<br>A quick and easy way to host your own Git repositories.<br>Built with <a href="http://eclipse.org/jgit">JGit</a>, <a href="http://wicket.apache.org">Wicket</a>, <a href="http://code.google.com/p/google-code-prettify/">google-code-prettify</a>, <a href="http://eclipse.org/jetty">Jetty</a>, <a href="http://www.slf4j.org">SLF4J</a>, <a href="http://logging.apache.org/log4j">Log4j</a>, and <a href="http://jcommander.org">JCommander</a>.\r
 \r
+# Use the client timezone when formatting dates.\r
+# This uses AJAX to determine the browser's timezone and enables Wicket \r
+# session management for the connection.\r
+useClientTimezone = false\r
+\r
 # Date and Time formats\r
 timestampFormat = h:mm a\r
 \r
 datestampShortFormat = yyyy-MM-dd\r
 datestampLongFormat = EEEE, MMMM d, yyyy\r
 \r
-datetimestampShortFormat = yyyy-MM-dd h:mm a\r
-datetimestampLongFormat = EEEE, MMMM d, yyyy h:mm a\r
+datetimestampShortFormat = yyyy-MM-dd h:mm a z\r
+datetimestampLongFormat = EEEE, MMMM d, yyyy h:mm a z\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
@@ -97,6 +102,13 @@ regex.global.changeid = \\b(Change-Id:\\s*)([A-Za-z0-9]*)\\b!!!<a href="http://s
 # 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 ticgit viewer for all repositories (checks for ticgit branch)\r
+ticgit.global = false\r
+\r
+# Enable ticgit viewer for specified repository (checks for ticgit branch)\r
+ticgit.myrepository = true\r
+ticgit.ticgit = true\r
+\r
 #\r
 # Jetty Settings\r
 #\r
index d795c615ceb5e9f2ce8813c694fb278a45d6c364..7a512d69c02fa75d5cabaea143e3a427a55ae4cb 100644 (file)
@@ -1,5 +1,7 @@
 package com.gitblit.wicket;\r
 \r
+import java.util.TimeZone;\r
+\r
 import javax.servlet.http.HttpServletRequest;\r
 \r
 import org.apache.wicket.PageParameters;\r
@@ -48,6 +50,10 @@ public abstract class BasePage extends WebPage {
                }\r
        }\r
        \r
+       protected TimeZone getTimeZone() {\r
+               return StoredSettings.getBoolean("useClientTimezone", false) ? GitBlitWebSession.get().getTimezone() : TimeZone.getDefault();\r
+       }\r
+       \r
        protected String getServerName() {\r
                ServletWebRequest servletWebRequest = (ServletWebRequest) getRequest();\r
                HttpServletRequest req = servletWebRequest.getHttpServletRequest();\r
index 0a15466e50322115de288469c78e98332e904030..038118e5c25ac0468f39c1fdebb54b45c998404a 100644 (file)
@@ -1,8 +1,5 @@
 package com.gitblit.wicket;\r
 \r
-import java.text.DateFormat;\r
-import java.text.SimpleDateFormat;\r
-import java.util.Date;\r
 import java.util.TimeZone;\r
 \r
 import org.apache.wicket.Request;\r
@@ -10,9 +7,6 @@ import org.apache.wicket.Session;
 import org.apache.wicket.protocol.http.WebSession;\r
 import org.apache.wicket.protocol.http.request.WebClientInfo;\r
 \r
-import com.gitblit.StoredSettings;\r
-\r
-\r
 public final class GitBlitWebSession extends WebSession {\r
 \r
        private static final long serialVersionUID = 1L;\r
@@ -38,36 +32,6 @@ public final class GitBlitWebSession extends WebSession {
                return timezone;\r
        }\r
 \r
-       public String formatTime(Date date) {\r
-               DateFormat df = new SimpleDateFormat(StoredSettings.getString("timestampFormat", "h:mm a"));\r
-               df.setTimeZone(getTimezone());\r
-               return df.format(date);\r
-       }\r
-\r
-       public String formatDate(Date date) {\r
-               DateFormat df = new SimpleDateFormat(StoredSettings.getString("datestampShortFormat", "MM/dd/yy"));\r
-               df.setTimeZone(getTimezone());\r
-               return df.format(date);\r
-       }\r
-\r
-       public String formatDateLong(Date date) {\r
-               DateFormat df = new SimpleDateFormat(StoredSettings.getString("datestampLongFormat", "EEEE, MMMM d, yyyy"));\r
-               df.setTimeZone(getTimezone());\r
-               return df.format(date);\r
-       }\r
-\r
-       public String formatDateTime(Date date) {\r
-               DateFormat df = new SimpleDateFormat(StoredSettings.getString("datetimestampShortFormat", "MM/dd/yy h:mm a"));\r
-               df.setTimeZone(getTimezone());\r
-               return df.format(date);\r
-       }\r
-\r
-       public String formatDateTimeLong(Date date) {\r
-               DateFormat df = new SimpleDateFormat(StoredSettings.getString("datetimestampLongFormat", "EEEE, MMMM d, yyyy h:mm a z"));\r
-               df.setTimeZone(getTimezone());\r
-               return df.format(date);\r
-       }\r
-\r
        public static GitBlitWebSession get() {\r
                return (GitBlitWebSession) Session.get();\r
        }\r
index 126c37de7af4ca93c1b2177749d36ad26a91c1b6..3a5ab9213f02063b93017f22bf4d691a2fc580b9 100644 (file)
@@ -136,4 +136,16 @@ public class WicketUtils {
                WicketUtils.setHtmlTitle(label, title);\r
                return label;\r
        }\r
+       \r
+       public static Label createTimestampLabel(String wicketId, Date date, TimeZone timeZone) {\r
+               DateFormat df = new SimpleDateFormat(StoredSettings.getString("datetimestampLongFormat", "EEEE, MMMM d, yyyy h:mm a z"));\r
+               if (timeZone != null) {\r
+                       df.setTimeZone(timeZone);\r
+               }\r
+               String dateString = df.format(date);\r
+               String title = Utils.timeAgo(date);\r
+               Label label = new Label(wicketId, dateString);\r
+               WicketUtils.setHtmlTitle(label, title);\r
+               return label;\r
+       }\r
 }\r
index 7de03457ef1631aa27b1cbb193b0bbbbaf197ea4..a53e322e163d31b1c92006629e1e6e16356ceaaf 100644 (file)
@@ -14,7 +14,6 @@ import org.eclipse.jgit.lib.Repository;
 import org.eclipse.jgit.revwalk.RevCommit;\r
 \r
 import com.gitblit.utils.JGitUtils;\r
-import com.gitblit.wicket.GitBlitWebSession;\r
 import com.gitblit.wicket.LinkPanel;\r
 import com.gitblit.wicket.RepositoryPage;\r
 import com.gitblit.wicket.WicketUtils;\r
@@ -51,12 +50,10 @@ public class CommitPage extends RepositoryPage {
                addRefs(r, c);\r
 \r
                add(new Label("commitAuthor", JGitUtils.getDisplayName(c.getAuthorIdent())));\r
-               String authorDate = GitBlitWebSession.get().formatDateTimeLong(c.getAuthorIdent().getWhen());\r
-               add(new Label("commitAuthorDate", authorDate));\r
+               add(WicketUtils.createTimestampLabel("commitAuthorDate", c.getAuthorIdent().getWhen(), getTimeZone()));\r
 \r
                add(new Label("commitCommitter", JGitUtils.getDisplayName(c.getCommitterIdent())));\r
-               String comitterDate = GitBlitWebSession.get().formatDateTimeLong(c.getCommitterIdent().getWhen());\r
-               add(new Label("commitCommitterDate", comitterDate));\r
+               add(WicketUtils.createTimestampLabel("commitCommitterDate", c.getCommitterIdent().getWhen(), getTimeZone()));\r
 \r
                add(new Label("commitId", c.getName()));\r
 \r
index 273de57fb4ca50cc537b4f61299251fa18e869a4..1dafb52b0bbb1f68803a72d5b6b95a60fc498ca9 100644 (file)
@@ -18,8 +18,8 @@ import com.codecommit.wicket.IChartData;
 import com.gitblit.StoredSettings;\r
 import com.gitblit.utils.JGitUtils;\r
 import com.gitblit.wicket.GitBlitWebApp;\r
-import com.gitblit.wicket.GitBlitWebSession;\r
 import com.gitblit.wicket.RepositoryPage;\r
+import com.gitblit.wicket.WicketUtils;\r
 import com.gitblit.wicket.models.Metric;\r
 import com.gitblit.wicket.panels.BranchesPanel;\r
 import com.gitblit.wicket.panels.LogPanel;\r
@@ -51,16 +51,12 @@ public class SummaryPage extends RepositoryPage {
                        numberOfCommits += m.count;\r
                }\r
 \r
-               String owner = JGitUtils.getRepositoryOwner(r);\r
-               GitBlitWebSession session = GitBlitWebSession.get();\r
-               String lastchange = session.formatDateTimeLong(JGitUtils.getLastChange(r));\r
-               String cloneurl = GitBlitWebApp.get().getCloneUrl(repositoryName);\r
-\r
                // repository description\r
                add(new Label("repositoryDescription", description));\r
-               add(new Label("repositoryOwner", owner));\r
-               add(new Label("repositoryLastChange", lastchange));\r
-               add(new Label("repositoryCloneUrl", cloneurl));\r
+               add(new Label("repositoryOwner", JGitUtils.getRepositoryOwner(r)));\r
+               \r
+               add(WicketUtils.createTimestampLabel("repositoryLastChange", JGitUtils.getLastChange(r), getTimeZone()));\r
+               add(new Label("repositoryCloneUrl", GitBlitWebApp.get().getCloneUrl(repositoryName)));\r
 \r
                add(new LogPanel("commitsPanel", repositoryName, null, r, numberCommits, 0));\r
                add(new TagsPanel("tagsPanel", repositoryName, r, numberRefs));\r
index 0f0d1595dcd4752aabc0d9452723a25a67880286..95be46ca3e13dceb4b68ccb36316a5d5749e49f5 100644 (file)
@@ -6,9 +6,9 @@ import org.eclipse.jgit.lib.Repository;
 import org.eclipse.jgit.revwalk.RevCommit;\r
 \r
 import com.gitblit.utils.JGitUtils;\r
-import com.gitblit.wicket.GitBlitWebSession;\r
 import com.gitblit.wicket.LinkPanel;\r
 import com.gitblit.wicket.RepositoryPage;\r
+import com.gitblit.wicket.WicketUtils;\r
 \r
 \r
 public class TagPage extends RepositoryPage {\r
@@ -23,8 +23,7 @@ public class TagPage extends RepositoryPage {
 \r
                add(new LinkPanel("tagId", "list", c.getName(), CommitPage.class, newCommitParameter(c.getName())));\r
                add(new Label("tagAuthor", JGitUtils.getDisplayName(c.getAuthorIdent())));\r
-               String authorDate = GitBlitWebSession.get().formatDateTimeLong(c.getAuthorIdent().getWhen());\r
-               add(new Label("tagDate", authorDate));\r
+               add(WicketUtils.createTimestampLabel("tagDate", c.getAuthorIdent().getWhen(), getTimeZone()));\r
 \r
                addFullText("fullMessage", c.getFullMessage(), true);\r
        }\r
index 5cdc4a7b6ff559b2d5b3d07ca2e95c8bdb72cff1..a27c8ddfb5004736c9fc5f4834b467e0b58e5ddf 100644 (file)
@@ -27,8 +27,7 @@ public class TicGitTicketPage extends RepositoryPage {
                add(new Label("ticketTitle", t.title));\r
                add(new Label("ticketId", t.id));\r
                add(new Label("ticketHandler", t.handler));\r
-               String openDate = GitBlitWebSession.get().formatDateTimeLong(t.date);\r
-               add(new Label("ticketOpenDate", openDate));\r
+               add(WicketUtils.createTimestampLabel("ticketOpendate", t.date, getTimeZone()));\r
                Label stateLabel = new Label("ticketState", t.state);\r
                WicketUtils.setTicketCssClass(stateLabel, t.state);\r
                add(stateLabel);\r
diff --git a/src/com/gitblit/wicket/panels/BasePanel.java b/src/com/gitblit/wicket/panels/BasePanel.java
new file mode 100644 (file)
index 0000000..f81dfa9
--- /dev/null
@@ -0,0 +1,21 @@
+package com.gitblit.wicket.panels;\r
+\r
+import java.util.TimeZone;\r
+\r
+import org.apache.wicket.markup.html.panel.Panel;\r
+\r
+import com.gitblit.StoredSettings;\r
+import com.gitblit.wicket.GitBlitWebSession;\r
+\r
+public abstract class BasePanel extends Panel {\r
+\r
+       private static final long serialVersionUID = 1L;\r
+\r
+       public BasePanel(String wicketId) {\r
+               super(wicketId);\r
+       }\r
+\r
+       protected TimeZone getTimeZone() {\r
+               return StoredSettings.getBoolean("useClientTimezone", false) ? GitBlitWebSession.get().getTimezone() : TimeZone.getDefault();\r
+       }\r
+}\r
index d060b147c4309a1138afc0332135144c84f1a6d4..1c68b6f9d8e874494c757aeede52c6d8667a3d5b 100644 (file)
@@ -6,7 +6,6 @@ import java.util.List;
 \r
 import org.apache.wicket.markup.html.basic.Label;\r
 import org.apache.wicket.markup.html.link.BookmarkablePageLink;\r
-import org.apache.wicket.markup.html.panel.Panel;\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
@@ -15,7 +14,6 @@ import org.eclipse.jgit.lib.Constants;
 import org.eclipse.jgit.lib.Repository;\r
 \r
 import com.gitblit.utils.JGitUtils;\r
-import com.gitblit.wicket.GitBlitWebSession;\r
 import com.gitblit.wicket.LinkPanel;\r
 import com.gitblit.wicket.WicketUtils;\r
 import com.gitblit.wicket.models.RefModel;\r
@@ -24,7 +22,7 @@ import com.gitblit.wicket.pages.LogPage;
 import com.gitblit.wicket.pages.SummaryPage;\r
 import com.gitblit.wicket.pages.TreePage;\r
 \r
-public class BranchesPanel extends Panel {\r
+public class BranchesPanel extends BasePanel {\r
 \r
        private static final long serialVersionUID = 1L;\r
 \r
@@ -59,7 +57,7 @@ public class BranchesPanel extends Panel {
                        public void populateItem(final Item<RefModel> item) {\r
                                final RefModel entry = item.getModelObject();\r
 \r
-                               item.add(WicketUtils.createDateLabel("branchDate", entry.getDate(), GitBlitWebSession.get().getTimezone()));\r
+                               item.add(WicketUtils.createDateLabel("branchDate", entry.getDate(), getTimeZone()));\r
 \r
                                item.add(new LinkPanel("branchName", "list name", WicketUtils.trimString(entry.getDisplayName(), 28), LogPage.class, WicketUtils.newObjectParameter(repositoryName, entry.getName())));\r
                                \r
index e496ed06048171654d263324056520189bd0a4b7..ccc46fd3d756723fb692fdabf2c3522d720c2063 100644 (file)
@@ -6,7 +6,6 @@ import java.util.Map;
 \r
 import org.apache.wicket.markup.html.basic.Label;\r
 import org.apache.wicket.markup.html.link.BookmarkablePageLink;\r
-import org.apache.wicket.markup.html.panel.Panel;\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
@@ -17,7 +16,6 @@ import org.eclipse.jgit.revwalk.RevCommit;
 \r
 import com.gitblit.StoredSettings;\r
 import com.gitblit.utils.JGitUtils;\r
-import com.gitblit.wicket.GitBlitWebSession;\r
 import com.gitblit.wicket.LinkPanel;\r
 import com.gitblit.wicket.WicketUtils;\r
 import com.gitblit.wicket.pages.CommitPage;\r
@@ -26,7 +24,7 @@ import com.gitblit.wicket.pages.LogPage;
 import com.gitblit.wicket.pages.SummaryPage;\r
 import com.gitblit.wicket.pages.TreePage;\r
 \r
-public class LogPanel extends Panel {\r
+public class LogPanel extends BasePanel {\r
 \r
        private static final long serialVersionUID = 1L;\r
 \r
@@ -37,7 +35,7 @@ public class LogPanel extends Panel {
                if (itemsPerPage <= 1) {\r
                        itemsPerPage = 50;\r
                }\r
-               \r
+\r
                final Map<ObjectId, List<String>> allRefs = JGitUtils.getAllRefs(r);\r
                List<RevCommit> commits;\r
                if (pageResults) {\r
@@ -68,7 +66,7 @@ public class LogPanel extends Panel {
                                final RevCommit entry = item.getModelObject();\r
                                final Date date = JGitUtils.getCommitDate(entry);\r
 \r
-                               item.add(WicketUtils.createDateLabel("commitDate", date, GitBlitWebSession.get().getTimezone()));\r
+                               item.add(WicketUtils.createDateLabel("commitDate", date, getTimeZone()));\r
 \r
                                String author = entry.getAuthorIdent().getName();\r
                                item.add(WicketUtils.createAuthorLabel("commitAuthor", author));\r
index 9c6298c0d3f0fca6940d9094ac9bd1227672c338..e2f9401d1b06d613f6f51405e80d38f1a67eaa03 100644 (file)
@@ -1,5 +1,6 @@
 package com.gitblit.wicket.panels;\r
 \r
+import java.text.MessageFormat;\r
 import java.util.ArrayList;\r
 import java.util.HashMap;\r
 import java.util.List;\r
@@ -14,6 +15,7 @@ import org.apache.wicket.markup.repeater.data.DataView;
 import org.apache.wicket.markup.repeater.data.ListDataProvider;\r
 import org.eclipse.jgit.lib.Repository;\r
 \r
+import com.gitblit.StoredSettings;\r
 import com.gitblit.utils.JGitUtils;\r
 import com.gitblit.wicket.LinkPanel;\r
 import com.gitblit.wicket.WicketUtils;\r
@@ -52,9 +54,13 @@ public class PageLinksPanel extends Panel {
                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 ticgit setting\r
+               boolean checkTicgit = StoredSettings.getBoolean("ticgit.global", false);\r
+               checkTicgit |= StoredSettings.getBoolean(MessageFormat.format("ticgit.{0}", repositoryName), false);\r
+               \r
                // Add dynamic repository extras\r
                List<String> extras = new ArrayList<String>();\r
-               if (JGitUtils.getTicGitBranch(r) != null) {\r
+               if (checkTicgit && JGitUtils.getTicGitBranch(r) != null) {\r
                        extras.add("ticgit");\r
                }\r
 \r
index bfdf50c4bddd21c1e848f62cbcb07266c80a0bfd..9f92891208475ccc0f88db1cad1d818ce9862f26 100644 (file)
@@ -6,7 +6,6 @@ import java.util.List;
 import java.util.Map;\r
 \r
 import org.apache.wicket.Component;\r
-import org.apache.wicket.markup.html.basic.Label;\r
 import org.apache.wicket.markup.html.panel.Panel;\r
 import org.apache.wicket.markup.repeater.Item;\r
 import org.apache.wicket.markup.repeater.data.DataView;\r
@@ -17,6 +16,7 @@ import org.eclipse.jgit.revwalk.RevCommit;
 \r
 import com.gitblit.wicket.LinkPanel;\r
 import com.gitblit.wicket.WicketUtils;\r
+import com.gitblit.wicket.pages.CommitPage;\r
 import com.gitblit.wicket.pages.LogPage;\r
 import com.gitblit.wicket.pages.TagPage;\r
 \r
@@ -32,7 +32,7 @@ public class RefsPanel extends Panel {
                        refNames = new ArrayList<String>();\r
                }\r
                Collections.sort(refNames);\r
-               refNames.remove(Constants.HEAD);\r
+//             refNames.remove(Constants.HEAD);\r
                \r
                ListDataProvider<String> refsDp = new ListDataProvider<String>(refNames);\r
                DataView<String> refsView = new DataView<String>("ref", refsDp) {\r
@@ -43,22 +43,19 @@ public class RefsPanel extends Panel {
                                if (entry.startsWith(Constants.R_HEADS)) {\r
                                        // local head\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
+                                       WicketUtils.setCssClass(c, "headRef");\r
                                } else if (entry.startsWith(Constants.R_REMOTES)) {\r
                                        // remote head\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
+                                       WicketUtils.setCssClass(c, "remoteRef");\r
                                } else if (entry.startsWith(Constants.R_TAGS)) {\r
                                        // tag\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
+                                       WicketUtils.setCssClass(c, "tagRef");\r
                                } else {\r
                                        // other\r
-                                       c = new Label("refName", entry);\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
                                item.add(c);\r
index 454f9b2a59f2f4f0aaf4c054f41957ee5dbcd3ee..3d8364cd905e6b56a6401cdc4e62613492ac8ca6 100644 (file)
@@ -4,7 +4,6 @@ import java.util.List;
 \r
 import org.apache.wicket.markup.html.basic.Label;\r
 import org.apache.wicket.markup.html.link.BookmarkablePageLink;\r
-import org.apache.wicket.markup.html.panel.Panel;\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
@@ -12,7 +11,6 @@ import org.apache.wicket.model.StringResourceModel;
 import org.eclipse.jgit.lib.Repository;\r
 \r
 import com.gitblit.utils.JGitUtils;\r
-import com.gitblit.wicket.GitBlitWebSession;\r
 import com.gitblit.wicket.LinkPanel;\r
 import com.gitblit.wicket.WicketUtils;\r
 import com.gitblit.wicket.models.RefModel;\r
@@ -22,7 +20,7 @@ import com.gitblit.wicket.pages.SummaryPage;
 import com.gitblit.wicket.pages.TagPage;\r
 import com.gitblit.wicket.pages.TagsPage;\r
 \r
-public class TagsPanel extends Panel {\r
+public class TagsPanel extends BasePanel {\r
 \r
        private static final long serialVersionUID = 1L;\r
 \r
@@ -49,7 +47,7 @@ public class TagsPanel extends Panel {
                        public void populateItem(final Item<RefModel> item) {\r
                                RefModel entry = item.getModelObject();\r
 \r
-                               item.add(WicketUtils.createDateLabel("tagDate", entry.getDate(), GitBlitWebSession.get().getTimezone()));\r
+                               item.add(WicketUtils.createDateLabel("tagDate", entry.getDate(), getTimeZone()));\r
 \r
                                item.add(new LinkPanel("tagName", "list name", entry.getDisplayName(), CommitPage.class, WicketUtils.newObjectParameter(repositoryName, entry.getCommitId().getName())));\r
                                String message;\r
index 4587f7804baf9771c4f3ad0473ebad58292b9c9e..c089560742d655938dd18b65f024c3345d4527a0 100644 (file)
@@ -409,38 +409,45 @@ td.rightAlign {
        text-align: right;\r
 }\r
 \r
-span .tag, span .head, span .ref {\r
+span .tagRef, span .headRef, span .remoteRef, span .otherRef { \r
        padding: 0px 4px;\r
+       margin-right:2px;\r
        font-family: sans-serif;\r
+       font-size: 9px;\r
        font-weight: normal;\r
        border: 1px solid;\r
        color: black;\r
 }\r
 \r
-span .tag a, span .head a, span .ref a {\r
+span .tagRef a span, span .headRef a span, span .remoteRef a span, span .otherRef a span {\r
+       font-size: 9px;\r
+}\r
+\r
+span .tagRef a, span .headRef a, span .remoteRef a, span .otherRef a {\r
        text-decoration: none;\r
        color: inherit;\r
 }\r
 \r
-span .tag a:hover, span .head a:hover, span .ref a:hover {\r
+span .tagRef a:hover, span .headRef a:hover, span .remoteRef a:hover, span .otherRef a:hover {\r
        color: inherit;\r
 }\r
 \r
-span .tag a span, span .head a span, span .ref a span {\r
-       font-size: 9px;\r
+span .otherRef {\r
+       background-color: #ffaaff;\r
+       border-color: #ffccff #ff00ee #ff00ee #ffccff;\r
 }\r
 \r
-span .ref {\r
+span .remoteRef {\r
        background-color: #aaaaff;\r
        border-color: #ccccff #0033cc #0033cc #ccccff;\r
 }\r
 \r
-span .tag {\r
+span .tagRef {\r
        background-color: #ffffaa;\r
        border-color: #ffffcc #ffee00 #ffee00 #ffffcc;\r
 }\r
 \r
-span .head {\r
+span .headRef {\r
        background-color: #aaffaa;\r
        border-color: #ccffcc #00cc33 #00cc33 #ccffcc;\r
 }
\ No newline at end of file