From ed3a0e89af762626423fd519056ec8e675a39238 Mon Sep 17 00:00:00 2001 From: James Moger Date: Thu, 29 Mar 2012 08:28:26 -0400 Subject: [PATCH] Fixed activity page row layout regression (issue 79) --- docs/04_releases.mkd | 2 + resources/gitblit.css | 5 ++ .../gitblit/wicket/panels/ActivityPanel.html | 45 ++++++++--------- .../gitblit/wicket/panels/ActivityPanel.java | 48 +++++++++---------- 4 files changed, 50 insertions(+), 50 deletions(-) diff --git a/docs/04_releases.mkd b/docs/04_releases.mkd index 322aed46..057661a0 100644 --- a/docs/04_releases.mkd +++ b/docs/04_releases.mkd @@ -7,6 +7,8 @@ #### fixes - Fixed absolute path/canonical path discrepancy between Gitblit and JGit regarding use of symlinks (issue 78) +- Fixed row layout on activity page (issue 79) +- Fixed Centos service script (Github/mohamedmansour) **0.9.1** *released 2012-03-27* diff --git a/resources/gitblit.css b/resources/gitblit.css index f53d3e73..7aa208e8 100644 --- a/resources/gitblit.css +++ b/resources/gitblit.css @@ -776,6 +776,11 @@ table.activity { margin-top: 10px; } +table.activity td { + padding-top:7px; + padding-bottom:7px; +} + tr th a { background-position: right; padding-right: 15px; background-repeat:no-repeat; } tr th.wicket_orderDown a {background-image: url(arrow_down.png); } tr th.wicket_orderUp a { background-image: url(arrow_up.png); } diff --git a/src/com/gitblit/wicket/panels/ActivityPanel.html b/src/com/gitblit/wicket/panels/ActivityPanel.html index 1b3dd059..41541df2 100644 --- a/src/com/gitblit/wicket/panels/ActivityPanel.html +++ b/src/com/gitblit/wicket/panels/ActivityPanel.html @@ -9,32 +9,29 @@
[title]
- - +
+ + + + + + + +
[time of day] + [repository link] + + + [shortlog commit link]
+ [author link] [commit id] on +
+
[commit refs]
+
+ + | | + +
- - - [time of day] - - [repository link] - - - - - [shortlog commit link]
- [author link] [commit id] on - - -
[commit refs]
- - - - | | - - -
- \ No newline at end of file diff --git a/src/com/gitblit/wicket/panels/ActivityPanel.java b/src/com/gitblit/wicket/panels/ActivityPanel.java index 250b58df..f75cf7d5 100644 --- a/src/com/gitblit/wicket/panels/ActivityPanel.java +++ b/src/com/gitblit/wicket/panels/ActivityPanel.java @@ -19,7 +19,6 @@ import java.util.Collections; import java.util.List; import org.apache.wicket.markup.html.link.BookmarkablePageLink; -import org.apache.wicket.markup.html.panel.Fragment; import org.apache.wicket.markup.repeater.Item; import org.apache.wicket.markup.repeater.data.DataView; import org.apache.wicket.markup.repeater.data.ListDataProvider; @@ -31,8 +30,8 @@ import com.gitblit.utils.StringUtils; import com.gitblit.wicket.WicketUtils; import com.gitblit.wicket.pages.CommitDiffPage; import com.gitblit.wicket.pages.CommitPage; -import com.gitblit.wicket.pages.LogPage; import com.gitblit.wicket.pages.GitSearchPage; +import com.gitblit.wicket.pages.LogPage; import com.gitblit.wicket.pages.SummaryPage; import com.gitblit.wicket.pages.TreePage; @@ -55,32 +54,31 @@ public class ActivityPanel extends BasePanel { new ListDataProvider(recentActivity)) { private static final long serialVersionUID = 1L; - public void populateItem(final Item item) { - final Activity entry = item.getModelObject(); - item.add(WicketUtils.createDatestampLabel("title", entry.startDate, getTimeZone())); + public void populateItem(final Item activityItem) { + final Activity entry = activityItem.getModelObject(); + activityItem.add(WicketUtils.createDatestampLabel("title", entry.startDate, getTimeZone())); // display the commits in chronological order - DataView commits = new DataView("commits", + DataView commits = new DataView("commit", new ListDataProvider(entry.getCommits())) { private static final long serialVersionUID = 1L; - public void populateItem(final Item item) { - final RepositoryCommit commit = item.getModelObject(); - Fragment fragment = new Fragment("commit", "commitFragment", this); + public void populateItem(final Item commitItem) { + final RepositoryCommit commit = commitItem.getModelObject(); // commit time of day - fragment.add(WicketUtils.createTimeLabel("time", commit.getCommitterIdent() + commitItem.add(WicketUtils.createTimeLabel("time", commit.getCommitterIdent() .getWhen(), getTimeZone())); // avatar - fragment.add(new GravatarImage("avatar", commit.getAuthorIdent(), 36)); + commitItem.add(new GravatarImage("avatar", commit.getAuthorIdent(), 36)); // merge icon if (commit.getParentCount() > 1) { - fragment.add(WicketUtils.newImage("commitIcon", + commitItem.add(WicketUtils.newImage("commitIcon", "commit_merge_16x16.png")); } else { - fragment.add(WicketUtils.newBlankImage("commitIcon")); + commitItem.add(WicketUtils.newBlankImage("commitIcon")); } // author search link @@ -89,7 +87,7 @@ public class ActivityPanel extends BasePanel { GitSearchPage.class, WicketUtils.newSearchParameter(commit.repository, commit.getName(), author, Constants.SearchType.AUTHOR), true); setPersonSearchTooltip(authorLink, author, Constants.SearchType.AUTHOR); - fragment.add(authorLink); + commitItem.add(authorLink); // repository String repoName = StringUtils.stripDotGit(commit.repository); @@ -97,19 +95,19 @@ public class ActivityPanel extends BasePanel { repoName, SummaryPage.class, WicketUtils.newRepositoryParameter(commit.repository), true); WicketUtils.setCssBackground(repositoryLink, repoName); - fragment.add(repositoryLink); + commitItem.add(repositoryLink); // repository branch LinkPanel branchLink = new LinkPanel("branch", "list", commit.branch, LogPage.class, WicketUtils.newObjectParameter(commit.repository, commit.branch), true); WicketUtils.setCssStyle(branchLink, "color: #008000;"); - fragment.add(branchLink); + commitItem.add(branchLink); LinkPanel commitid = new LinkPanel("commitid", "list subject", commit.getShortName(), CommitPage.class, WicketUtils.newObjectParameter(commit.repository, commit.getName()), true); - fragment.add(commitid); + commitItem.add(commitid); // message/commit link String shortMessage = commit.getShortMessage(); @@ -125,25 +123,23 @@ public class ActivityPanel extends BasePanel { if (!shortMessage.equals(trimmedMessage)) { WicketUtils.setHtmlTooltip(shortlog, shortMessage); } - fragment.add(shortlog); + commitItem.add(shortlog); // refs - fragment.add(new RefsPanel("commitRefs", commit.repository, commit + commitItem.add(new RefsPanel("commitRefs", commit.repository, commit .getRefs())); // view, diff, tree links - fragment.add(new BookmarkablePageLink("view", CommitPage.class, + commitItem.add(new BookmarkablePageLink("view", CommitPage.class, WicketUtils.newObjectParameter(commit.repository, commit.getName()))); - fragment.add(new BookmarkablePageLink("diff", CommitDiffPage.class, + commitItem.add(new BookmarkablePageLink("diff", CommitDiffPage.class, WicketUtils.newObjectParameter(commit.repository, commit.getName())) .setEnabled(commit.getParentCount() > 0)); - fragment.add(new BookmarkablePageLink("tree", TreePage.class, - WicketUtils.newObjectParameter(commit.repository, commit.getName()))); - - item.add(fragment); + commitItem.add(new BookmarkablePageLink("tree", TreePage.class, + WicketUtils.newObjectParameter(commit.repository, commit.getName()))); } }; - item.add(commits); + activityItem.add(commits); } }; add(activityView); -- 2.39.5