From 9ab5cc754c62ac9f7aa58b1f64fda7532cdad05b Mon Sep 17 00:00:00 2001 From: James Moger Date: Wed, 13 Apr 2011 15:53:19 -0400 Subject: [PATCH] Html and Css simplifications. --- src/com/gitblit/wicket/BasePage.java | 2 +- .../gitblit/wicket/pages/CommitDiffPage.html | 4 +-- src/com/gitblit/wicket/pages/CommitPage.html | 20 ++++++++++----- src/com/gitblit/wicket/pages/CommitPage.java | 2 ++ src/com/gitblit/wicket/pages/TagPage.html | 2 +- src/com/gitblit/wicket/pages/TagPage.java | 21 +++++++++++----- .../wicket/pages/TicGitTicketPage.html | 2 +- src/com/gitblit/wicket/pages/TreePage.html | 10 ++++---- src/com/gitblit/wicket/pages/TreePage.java | 1 + .../gitblit/wicket/panels/BranchesPanel.html | 4 +-- src/com/gitblit/wicket/panels/LogPanel.html | 7 +++--- src/com/gitblit/wicket/panels/TagsPanel.html | 4 +-- src/com/gitblit/wicket/resources/gitblit.css | 25 +++++++------------ 13 files changed, 59 insertions(+), 45 deletions(-) diff --git a/src/com/gitblit/wicket/BasePage.java b/src/com/gitblit/wicket/BasePage.java index 7a512d69..3121804a 100644 --- a/src/com/gitblit/wicket/BasePage.java +++ b/src/com/gitblit/wicket/BasePage.java @@ -39,7 +39,7 @@ public abstract class BasePage extends WebPage { siteName = Constants.NAME; } add(new Label("siteName", siteName)); - add(new LinkPanel("repositoryName", null, repositoryName, SummaryPage.class, new PageParameters("p=" + repositoryName))); + add(new LinkPanel("repositoryName", null, repositoryName, SummaryPage.class, WicketUtils.newRepositoryParameter(repositoryName))); add(new Label("pageName", pageName)); // footer diff --git a/src/com/gitblit/wicket/pages/CommitDiffPage.html b/src/com/gitblit/wicket/pages/CommitDiffPage.html index 2759de8f..af731a0d 100644 --- a/src/com/gitblit/wicket/pages/CommitDiffPage.html +++ b/src/com/gitblit/wicket/pages/CommitDiffPage.html @@ -23,9 +23,9 @@ [commit path] - + diff --git a/src/com/gitblit/wicket/pages/CommitPage.html b/src/com/gitblit/wicket/pages/CommitPage.html index a65c5884..a639f4a3 100644 --- a/src/com/gitblit/wicket/pages/CommitPage.html +++ b/src/com/gitblit/wicket/pages/CommitPage.html @@ -25,10 +25,18 @@ [author date] committer[committer] [commit date] - commit[commit id] - tree[commit tree] - parent -
[commit parents]
+ commit[commit id] + tree[commit tree] + parent + + + [commit parents] + + | + + + + @@ -39,9 +47,9 @@ [commit path] - + diff --git a/src/com/gitblit/wicket/pages/CommitPage.java b/src/com/gitblit/wicket/pages/CommitPage.java index d906f075..7e3403de 100644 --- a/src/com/gitblit/wicket/pages/CommitPage.java +++ b/src/com/gitblit/wicket/pages/CommitPage.java @@ -67,6 +67,8 @@ public class CommitPage extends RepositoryPage { public void populateItem(final Item item) { String entry = item.getModelObject(); item.add(new LinkPanel("commitParent", "list", entry, CommitPage.class, newCommitParameter(entry))); + item.add(new BookmarkablePageLink("view", CommitPage.class, newCommitParameter(entry))); + item.add(new BookmarkablePageLink("diff", CommitDiffPage.class, newCommitParameter(entry))); } }; add(parentsView); diff --git a/src/com/gitblit/wicket/pages/TagPage.html b/src/com/gitblit/wicket/pages/TagPage.html index 4eb3b4b4..42a75854 100644 --- a/src/com/gitblit/wicket/pages/TagPage.html +++ b/src/com/gitblit/wicket/pages/TagPage.html @@ -15,7 +15,7 @@ - +
object[tag id]
object[tag id]
author[tag author]
[tag date]
diff --git a/src/com/gitblit/wicket/pages/TagPage.java b/src/com/gitblit/wicket/pages/TagPage.java index 622c2b15..e6f2fd6b 100644 --- a/src/com/gitblit/wicket/pages/TagPage.java +++ b/src/com/gitblit/wicket/pages/TagPage.java @@ -23,16 +23,25 @@ public class TagPage extends RepositoryPage { List tags = JGitUtils.getTags(r, -1); RevCommit c = JGitUtils.getCommit(r, objectId); - String name = c.getName(); + RefModel tagRef = null; + // determine tag for (RefModel tag:tags) { - if (tag.getName().equals(objectId)) { - name = tag.getDisplayName(); + if (tag.getName().equals(objectId) || tag.getObjectId().getName().equals(objectId)) { + tagRef = tag; + break; } } - add(new LinkPanel("commit", "title", name, CommitPage.class, newCommitParameter())); - - add(new LinkPanel("tagId", "list", c.getName(), CommitPage.class, newCommitParameter(c.getName()))); + if (tagRef == null) { + // point to commit + add(new LinkPanel("commit", "title", c.getShortMessage(), CommitPage.class, newCommitParameter())); + add(new LinkPanel("tagId", "list", c.getName(), CommitPage.class, newCommitParameter(c.getName()))); + } else { + // TODO commit or tree or blob? + add(new LinkPanel("commit", "title", tagRef.getDisplayName(), CommitPage.class, newCommitParameter())); + add(new LinkPanel("tagId", "list", c.getName(), CommitPage.class, newCommitParameter(c.getName()))); + } + add(new Label("tagAuthor", JGitUtils.getDisplayName(c.getAuthorIdent()))); add(WicketUtils.createTimestampLabel("tagDate", c.getAuthorIdent().getWhen(), getTimeZone())); diff --git a/src/com/gitblit/wicket/pages/TicGitTicketPage.html b/src/com/gitblit/wicket/pages/TicGitTicketPage.html index 47fa87be..17462662 100644 --- a/src/com/gitblit/wicket/pages/TicGitTicketPage.html +++ b/src/com/gitblit/wicket/pages/TicGitTicketPage.html @@ -15,7 +15,7 @@ - + diff --git a/src/com/gitblit/wicket/pages/TreePage.html b/src/com/gitblit/wicket/pages/TreePage.html index 85fbdfc8..add03ebd 100644 --- a/src/com/gitblit/wicket/pages/TreePage.html +++ b/src/com/gitblit/wicket/pages/TreePage.html @@ -33,16 +33,16 @@ - + - + + | | | + diff --git a/src/com/gitblit/wicket/pages/TreePage.java b/src/com/gitblit/wicket/pages/TreePage.java index 2bea987d..d83939ea 100644 --- a/src/com/gitblit/wicket/pages/TreePage.java +++ b/src/com/gitblit/wicket/pages/TreePage.java @@ -82,6 +82,7 @@ public class TreePage extends RepositoryPage { Fragment links = new Fragment("pathLinks", "blobLinks", this); links.add(new BookmarkablePageLink("view", BlobPage.class, WicketUtils.newPathParameter(repositoryName, entry.commitId, entry.path))); links.add(new BookmarkablePageLink("raw", RawPage.class, WicketUtils.newPathParameter(repositoryName, entry.commitId, entry.path))); + links.add(new BookmarkablePageLink("blame", BlobPage.class).setEnabled(false)); links.add(new BookmarkablePageLink("history", BlobPage.class).setEnabled(false)); item.add(links); } diff --git a/src/com/gitblit/wicket/panels/BranchesPanel.html b/src/com/gitblit/wicket/panels/BranchesPanel.html index 78774f2d..76c3e09f 100644 --- a/src/com/gitblit/wicket/panels/BranchesPanel.html +++ b/src/com/gitblit/wicket/panels/BranchesPanel.html @@ -17,9 +17,9 @@ diff --git a/src/com/gitblit/wicket/panels/LogPanel.html b/src/com/gitblit/wicket/panels/LogPanel.html index e12d1b8f..0a746ba9 100644 --- a/src/com/gitblit/wicket/panels/LogPanel.html +++ b/src/com/gitblit/wicket/panels/LogPanel.html @@ -17,9 +17,10 @@ - diff --git a/src/com/gitblit/wicket/panels/TagsPanel.html b/src/com/gitblit/wicket/panels/TagsPanel.html index 8b906550..0255a724 100644 --- a/src/com/gitblit/wicket/panels/TagsPanel.html +++ b/src/com/gitblit/wicket/panels/TagsPanel.html @@ -16,9 +16,9 @@ diff --git a/src/com/gitblit/wicket/resources/gitblit.css b/src/com/gitblit/wicket/resources/gitblit.css index da0c317e..bb993508 100644 --- a/src/com/gitblit/wicket/resources/gitblit.css +++ b/src/com/gitblit/wicket/resources/gitblit.css @@ -87,26 +87,15 @@ div.pager { padding: 0px 0px 15px 5px; } -div.link { - padding: 2px 5px; +span.link, span.link a { font-family: sans-serif; font-size: 11px; } -div.link span { - font-family: inherit; - font-size: inherit; -} - -div.link a { - font-family: inherit; - font-size: inherit; -} - -div.link em, div.link span em { +span.link em, div.link span em { font-style: normal; - font-family: inherit; - font-size: inherit; + font-family: sans-serif; + font-size: 11px; } div.page_header { @@ -311,6 +300,10 @@ table.pretty, table.repositories { border-right: 1px solid #bbb; } +table.pretty td { + padding: 2px 4px; +} + table.repositories { width:100%; } @@ -388,7 +381,7 @@ td.date { font-style: italic; } -td.sha1, td.sha1 span { +span.sha1, span.sha1 a, span.sha1 a span { font-family: monospace; font-size: 13px; } -- 2.39.5
ticket id[ticket id]
ticket id[ticket id]
assigned[ticket title]
open date[ticket open date]
state[ticket state]
[branch name] [branch type] - +
[commit author]
[commit short message]
[commit refs]
+ + + | | +
[tag name] [tag description] - +