The Unified and Autonomous Development Platform
Add blob blame page
steved326697c220e
diff --git a/commons.git/src/main/java/com/pmease/commons/git/BriefCommit.java b/commons.git/src/main/java/com/pmease/commons/git/BriefCommit.javaindex 7bc0edaa4e..e28c6e8221 100644--- a/commons.git/src/main/java/com/pmease/commons/git/BriefCommit.java+++ b/commons.git/src/main/java/com/pmease/commons/git/BriefCommit.java@@ -38,6 +38,20 @@ public class BriefCommit implements Serializable {return subject;}+ @Override+ public int hashCode() {+ return Objects.hashCode(hash);+ }++ @Override+ public boolean equals(Object other) {+ if (this == other) return true;+ if (!(other instanceof BriefCommit)) return false;++ BriefCommit rhs = (BriefCommit) other;+ return Objects.equal(hash, rhs.hash);+ }+@Overridepublic String toString() {return Objects.toStringHelper(this)diff --git a/commons.git/src/main/java/com/pmease/commons/git/UserInfo.java b/commons.git/src/main/java/com/pmease/commons/git/UserInfo.javaindex 245c1d2743..aad8c5e84b 100644--- a/commons.git/src/main/java/com/pmease/commons/git/UserInfo.java+++ b/commons.git/src/main/java/com/pmease/commons/git/UserInfo.java@@ -4,6 +4,8 @@ import java.io.Serializable;import java.util.Date;import com.google.common.base.Objects;+import com.google.common.base.Preconditions;+import com.google.common.base.Strings;@SuppressWarnings("serial")public class UserInfo implements Serializable {@@ -14,6 +16,43 @@ public class UserInfo implements Serializable {private final Date date;+ public static class Builder {+ private String name;+ private String email;+ private Date date;++ public Builder name(String name) {+ this.name = name;+ return this;+ }++ public Builder email(String email) {+ this.email = email;+ return this;+ }++ public Builder date(Date date) {+ this.date = date;+ return this;+ }++ public boolean isValid() {+ return !Strings.isNullOrEmpty(name)+ && !Strings.isNullOrEmpty(email)+ && date != null;+ }++ public UserInfo build() {+ return new UserInfo(Preconditions.checkNotNull(name, "name"),+ Preconditions.checkNotNull(email, "email"),+ Preconditions.checkNotNull(date, "date"));+ }+ }++ public static Builder builder() {+ return new Builder();+ }+public UserInfo(String name, String email, Date date) {this.name = name;this.email = email;diff --git a/gitop.web/src/main/java/com/pmease/gitop/web/GitopWebApp.java b/gitop.web/src/main/java/com/pmease/gitop/web/GitopWebApp.javaindex 0bf3582ee8..4b71adb4e7 100644--- a/gitop.web/src/main/java/com/pmease/gitop/web/GitopWebApp.java+++ b/gitop.web/src/main/java/com/pmease/gitop/web/GitopWebApp.java@@ -84,6 +84,7 @@ import com.pmease.gitop.web.page.project.settings.ProjectOptionsPage;import com.pmease.gitop.web.page.project.settings.ProjectPermissionsPage;import com.pmease.gitop.web.page.project.settings.PullRequestSettingsPage;import com.pmease.gitop.web.page.project.source.ProjectHomePage;+import com.pmease.gitop.web.page.project.source.blame.BlobBlamePage;import com.pmease.gitop.web.page.project.source.blob.SourceBlobPage;import com.pmease.gitop.web.page.project.source.blob.renderer.RawBlobResourceReference;import com.pmease.gitop.web.page.project.source.branches.BranchesPage;@@ -270,16 +271,21 @@ public class GitopWebApp extends AbstractWicketConfig {mount(new PageParameterAwareMountedMapper("${user}/${project}/tree/${objectId}", SourceTreePage.class));mount(new PageParameterAwareMountedMapper("${user}/${project}/blob/${objectId}", SourceBlobPage.class));+ mount(new PageParameterAwareMountedMapper("${user}/${project}/blame/#{objectId}", BlobBlamePage.class));mount(new PageParameterAwareMountedMapper("${user}/${project}/commit/${objectId}", SourceCommitPage.class));mount(new PageParameterAwareMountedMapper("${user}/${project}/commits/#{objectId}", CommitsPage.class));+mount(new PageParameterAwareMountedMapper("${user}/${project}/branches", BranchesPage.class));mount(new PageParameterAwareMountedMapper("${user}/${project}/tags", TagsPage.class));- mount(new PageParameterAwareMountedMapper("${user}/${project}/contributors", ContributorsPage.class));+mount(new PageParameterAwareMountedMapper("${user}/${project}/wiki", ProjectWikiPage.class));+mount(new PageParameterAwareMountedMapper("${user}/${project}/pull-requests/open", OpenRequestsPage.class));mount(new PageParameterAwareMountedMapper("${user}/${project}/pull-requests/closed", ClosedRequestsPage.class));mount(new PageParameterAwareMountedMapper("${user}/${project}/pull-requests/new", NewRequestPage.class));mount(new PageParameterAwareMountedMapper("${user}/${project}/pull-requests", RequestDetailPage.class));++ mount(new PageParameterAwareMountedMapper("${user}/${project}/contributors", ContributorsPage.class));mount(new PageParameterAwareMountedMapper("${user}/${project}/graphs", ProjectGraphsPage.class));mount(new PageParameterAwareMountedMapper("${user}/${project}/forks", ProjectForksPage.class));diff --git a/gitop.web/src/main/java/com/pmease/gitop/web/assets/css/page.css b/gitop.web/src/main/java/com/pmease/gitop/web/assets/css/page.cssindex 3b2b7e323f..d1d7eaab80 100644--- a/gitop.web/src/main/java/com/pmease/gitop/web/assets/css/page.css+++ b/gitop.web/src/main/java/com/pmease/gitop/web/assets/css/page.css@@ -630,6 +630,17 @@ a.diffstat:hover { text-decoration: none; }.comment-list-header .checkbox { margin: 0; }.comment-list .form-comment { background: #f7f7f7; border: 1px solid #ddd; border-radius: 4px; padding-top: 8px; margin: 0; }+/**+ * BLAME PAGE+ */+.blame-head .breadcrumb { padding-left: 0; }+.table-blob td.blame-msg { width: 1%; padding: 0;}+.blame-row { white-space: nowrap; padding: 0 12px; border-right: 4px solid #ddd; }+.blame-row:hover { background: #f2f2f2; border-right-color: #08C; }+.blame-msg .blame-row:first-child { padding-top: 9px; }+.blame-msg .blame-row:last-child { padding-bottom: 9px; }+.blame-row .section-first > i { color: #888; }+/*** BRANCHES PAGE*/diff --git a/gitop.web/src/main/java/com/pmease/gitop/web/component/commit/AuthorInfoPanel.java b/gitop.web/src/main/java/com/pmease/gitop/web/component/commit/AuthorInfoPanel.javaindex 54d6c10d20..eb6b6828c4 100644--- a/gitop.web/src/main/java/com/pmease/gitop/web/component/commit/AuthorInfoPanel.java+++ b/gitop.web/src/main/java/com/pmease/gitop/web/component/commit/AuthorInfoPanel.java@@ -17,12 +17,10 @@ import com.pmease.gitop.web.page.project.api.GitPerson;@SuppressWarnings("serial")public class AuthorInfoPanel extends Panel {- private final IModel<GitPersonLink.Mode> authorModeModel;+ private final IModel<GitPersonLink.Mode> mode = Model.of(Mode.NAME);public AuthorInfoPanel(String id, IModel<Commit> model) {super(id, model);-- authorModeModel = Model.of(Mode.NAME_ONLY);}@Override@@ -36,7 +34,7 @@ public class AuthorInfoPanel extends Panel {return GitPerson.of(getCommit().getAuthor());}- }, authorModeModel.getObject()));+ }, mode.getObject()));add(new AgeLabel("authordate", new AbstractReadOnlyModel<Date>() {@Override@@ -47,7 +45,7 @@ public class AuthorInfoPanel extends Panel {}public void setAuthorMode(Mode mode) {- authorModeModel.setObject(Preconditions.checkNotNull(mode));+ this.mode.setObject(Preconditions.checkNotNull(mode));}private Commit getCommit() {@@ -56,8 +54,8 @@ public class AuthorInfoPanel extends Panel {@Overridepublic void onDetach() {- if (authorModeModel != null) {- authorModeModel.detach();+ if (mode != null) {+ mode.detach();}super.onDetach();diff --git a/gitop.web/src/main/java/com/pmease/gitop/web/component/commit/CommitsTablePanel.java b/gitop.web/src/main/java/com/pmease/gitop/web/component/commit/CommitsTablePanel.javaindex b6d6d32a59..7f61d5b18c 100644--- a/gitop.web/src/main/java/com/pmease/gitop/web/component/commit/CommitsTablePanel.java+++ b/gitop.web/src/main/java/com/pmease/gitop/web/component/commit/CommitsTablePanel.java@@ -111,7 +111,7 @@ public class CommitsTablePanel extends Panel {protected void populateItem(ListItem<Commit> item) {Commit commit = item.getModelObject();GitPerson person = GitPerson.of(commit.getAuthor());- item.add(new GitPersonLink("name", Model.of(person), GitPersonLink.Mode.FULL).enableTooltip());+ item.add(new GitPersonLink("name", Model.of(person), GitPersonLink.Mode.AVATAR_AND_NAME).enableTooltip());item.add(new CommitMessagePanel("message", item.getModel(), projectModel));AbstractLink link = new BookmarkablePageLink<Void>("commitlink",diff --git a/gitop.web/src/main/java/com/pmease/gitop/web/component/commit/CommitterInfoPanel.java b/gitop.web/src/main/java/com/pmease/gitop/web/component/commit/CommitterInfoPanel.javaindex 019e0e9560..0262ea411b 100644--- a/gitop.web/src/main/java/com/pmease/gitop/web/component/commit/CommitterInfoPanel.java+++ b/gitop.web/src/main/java/com/pmease/gitop/web/component/commit/CommitterInfoPanel.java@@ -5,6 +5,7 @@ import java.util.Date;import org.apache.wicket.markup.html.panel.Panel;import org.apache.wicket.model.AbstractReadOnlyModel;import org.apache.wicket.model.IModel;+import org.apache.wicket.model.Model;import com.pmease.commons.git.Commit;import com.pmease.gitop.web.component.label.AgeLabel;@@ -15,6 +16,8 @@ import com.pmease.gitop.web.page.project.api.GitPerson;@SuppressWarnings("serial")public class CommitterInfoPanel extends Panel {+ private final IModel<GitPersonLink.Mode> mode = Model.of(Mode.NAME);+public CommitterInfoPanel(String id, IModel<Commit> model) {super(id, model);}@@ -31,7 +34,7 @@ public class CommitterInfoPanel extends Panel {return GitPerson.of(getCommit().getCommitter());}- }, Mode.NAME_ONLY));+ }, mode.getObject()));add(new AgeLabel("committerdate", new AbstractReadOnlyModel<Date>() {@@ -45,4 +48,18 @@ public class CommitterInfoPanel extends Panel {private Commit getCommit() {return (Commit) getDefaultModelObject();}++ public CommitterInfoPanel committerLinkMode(GitPersonLink.Mode mode) {+ this.mode.setObject(mode);+ return this;+ }++ @Override+ public void onDetach() {+ if (mode != null) {+ mode.detach();+ }++ super.onDetach();+ }}diff --git a/gitop.web/src/main/java/com/pmease/gitop/web/component/link/GitPersonLink.java b/gitop.web/src/main/java/com/pmease/gitop/web/component/link/GitPersonLink.javaindex 6598b9c5b2..e7282947d1 100644--- a/gitop.web/src/main/java/com/pmease/gitop/web/component/link/GitPersonLink.java+++ b/gitop.web/src/main/java/com/pmease/gitop/web/component/link/GitPersonLink.java@@ -30,9 +30,9 @@ public class GitPersonLink extends Panel {private static final long serialVersionUID = 1L;public static enum Mode {- FULL,- AVATAR_ONLY,- NAME_ONLY+ AVATAR,+ NAME,+ AVATAR_AND_NAME}private final Mode mode;@@ -57,7 +57,7 @@ public class GitPersonLink extends Panel {link = newLink("link", user);add(link);- if (mode == Mode.FULL || mode == Mode.AVATAR_ONLY) {+ if (mode == Mode.AVATAR_AND_NAME || mode == Mode.AVATAR) {if (user.isPresent()) {image = new AvatarImage("avatar", new UserModel(user.get()));link.add(image);@@ -69,7 +69,7 @@ public class GitPersonLink extends Panel {}}- if (mode == Mode.FULL || mode == Mode.NAME_ONLY) {+ if (mode == Mode.AVATAR_AND_NAME || mode == Mode.NAME) {if (user.isPresent()) {link.add(new Label("name", user.get().getName()));} else {@@ -77,11 +77,11 @@ public class GitPersonLink extends Panel {}}- if (mode == Mode.AVATAR_ONLY) {+ if (mode == Mode.AVATAR) {link.add(new WebMarkupContainer("name").setVisibilityAllowed(false));}- if (mode == Mode.NAME_ONLY) {+ if (mode == Mode.NAME) {link.add(new WebMarkupContainer("avatar").setVisibilityAllowed(false));}diff --git a/gitop.web/src/main/java/com/pmease/gitop/web/component/link/UserAvatarLink.java b/gitop.web/src/main/java/com/pmease/gitop/web/component/link/UserAvatarLink.javaindex 35d38aa191..6289bac362 100644--- a/gitop.web/src/main/java/com/pmease/gitop/web/component/link/UserAvatarLink.java+++ b/gitop.web/src/main/java/com/pmease/gitop/web/component/link/UserAvatarLink.java@@ -18,9 +18,9 @@ import com.pmease.gitop.web.page.account.home.AccountHomePage;public class UserAvatarLink extends Panel {public static enum Mode {- AVATAR_ONLY,- NAME_ONLY,- BOTH+ NAME,+ AVATAR,+ NAME_AND_AVATAR}private final Mode mode;@@ -31,7 +31,7 @@ public class UserAvatarLink extends Panel {}public UserAvatarLink(String id, IModel<User> model) {- this(id, model, Mode.BOTH);+ this(id, model, Mode.NAME_AND_AVATAR);}@SuppressWarnings("unchecked")@@ -47,7 +47,7 @@ public class UserAvatarLink extends Panel {@Overrideprotected void onConfigure() {super.onConfigure();- setVisibilityAllowed(mode != Mode.NAME_ONLY);+ setVisibilityAllowed(mode != Mode.NAME);}});@@ -61,7 +61,7 @@ public class UserAvatarLink extends Panel {@Overrideprotected void onConfigure() {super.onConfigure();- this.setVisibilityAllowed(mode != Mode.AVATAR_ONLY);+ this.setVisibilityAllowed(mode != Mode.AVATAR);}});}diff --git a/gitop.web/src/main/java/com/pmease/gitop/web/git/command/BlameCommand.java b/gitop.web/src/main/java/com/pmease/gitop/web/git/command/BlameCommand.javanew file mode 100644index 0000000000..ff982abefb--- /dev/null+++ b/gitop.web/src/main/java/com/pmease/gitop/web/git/command/BlameCommand.java@@ -0,0 +1,200 @@+package com.pmease.gitop.web.git.command;++import java.io.File;+import java.io.IOException;+import java.util.Collections;+import java.util.Date;+import java.util.List;+import java.util.regex.Matcher;+import java.util.regex.Pattern;++import org.apache.commons.lang3.StringUtils;+import org.parboiled.common.Preconditions;++import com.google.common.base.Charsets;+import com.google.common.base.Objects;+import com.google.common.base.Strings;+import com.google.common.collect.Lists;+import com.google.common.io.LineProcessor;+import com.google.common.io.Resources;+import com.pmease.commons.git.UserInfo;+import com.pmease.commons.git.command.GitCommand;+import com.pmease.commons.util.execution.Commandline;+import com.pmease.commons.util.execution.LineConsumer;+import com.pmease.gitop.web.git.GitUtils;++public class BlameCommand extends GitCommand<List<BlameEntry>> {++ public BlameCommand(File repoDir) {+ super(repoDir);+ }++ private String objectId;+ private String fileName;++ public BlameCommand objectId(String objectId) {+ this.objectId = objectId;+ return this;+ }++ public BlameCommand fileName(String fileName) {+ this.fileName = fileName;+ return this;+ }++ @Override+ public List<BlameEntry> call() {+ Commandline cmd = cmd();+ cmd.addArgs("blame", "--incremental");+ cmd.addArgs(Preconditions.checkArgNotNull(objectId, "objectId"));+ cmd.addArgs("--encoding=UTF-8");+ cmd.addArgs("--", Preconditions.checkArgNotNull(fileName, "file name"));++ BlameOutputHandler out = new BlameOutputHandler();+ cmd.execute(out, new LineConsumer.ErrorLogger());++ return out.getResult();+ }++ static Pattern pEntryStart = Pattern.compile("([a-z0-9]{40}) (\\d+) (\\d+) (\\d+)");++ static class BlameOutputHandler extends LineConsumer implements LineProcessor<List<BlameEntry>> {+ List<BlameEntry> entries = Lists.newArrayList();+ List<String> lines = Lists.newArrayList();++ BlameEntry previous;++ @Override+ public void consume(String line) {+ if (Strings.isNullOrEmpty(line)) {+ onBlockFinished();+ return;+ }++ Matcher m = pEntryStart.matcher(line);+ if (m.matches()) {+ onBlockFinished();+ }++ lines.add(line);+ }++ private void onBlockFinished() {+ if (lines.isEmpty())+ return;++ UserInfo.Builder author = UserInfo.builder();+ UserInfo.Builder committer = UserInfo.builder();+ String summary = null;+ String hash = null;+ int sourceLine = 0, resultLine = 0, numLines = 0;++ for (String each : lines) {+ Matcher m = pEntryStart.matcher(each);+ if (m.matches()) {+ hash = m.group(1);+ sourceLine = Integer.valueOf(m.group(2));+ resultLine = Integer.valueOf(m.group(3));+ numLines = Integer.valueOf(m.group(4));+ } else if (each.startsWith("author ")) {+ author.name(each.substring("author ".length()));++ } else if (each.startsWith("author-mail ")) {+ author.email(GitUtils.parseEmail(each.substring("author-mail ".length())));++ } else if (each.startsWith("author-time ")) {+ long time = Long.valueOf(each.substring("author-time ".length()));+ author.date(new Date(time * 1000L));++ } else if (each.startsWith("author-tz ")) {+ // TODO: Add timezone info++ } else if (each.startsWith("committer ")) {+ committer.name(each.substring("committer ".length()));++ } else if (each.startsWith("committer-mail ")) {+ committer.email(each.substring("committer-mail ".length()));++ } else if (each.startsWith("committer-time ")) {+ long time = Long.valueOf(each.substring("committer-time ".length()));+ committer.date(new Date(time * 1000L));++ } else if (each.startsWith("committer-tz ")) {+ // TODO: add timezone info++ } else if (each.startsWith("summary ")) {+ summary = each.substring("summary ".length());++ }+ }++ BlameEntry.Builder builder = BlameEntry.builder();+ builder.sha(hash)+ .sourceLine(sourceLine)+ .resultLine(resultLine)+ .numLines(numLines);++ if (Strings.isNullOrEmpty(summary)) {+ // no commit summary, use previous+ Preconditions.checkState(previous != null+ && Objects.equal(previous.getCommit().getHash(), hash));++ builder.sha(hash)+ .author(previous.getCommit().getAuthor())+ .committer(previous.getCommit().getCommitter())+ .summary(previous.getCommit().getSubject());+ } else {+ builder.committer(committer.build())+ .author(author.build())+ .summary(summary);+ }++ BlameEntry entry = builder.build();+ entries.add(entry);+ previous = entry;+ lines = Lists.newArrayList();+ }++ @Override+ public boolean processLine(String line) throws IOException {+ consume(line);+ return true;+ }++ @Override+ public List<BlameEntry> getResult() {+ if (!lines.isEmpty()) {+ onBlockFinished();+ }++ Collections.sort(entries);+ return entries;+ }+ }++ public static void main(String[] args) throws IOException {+ BlameOutputHandler output = new BlameOutputHandler();+ Resources.readLines(Resources.getResource(BlameCommand.class, "blame.txt"), Charsets.UTF_8, output);++ List<BlameEntry> entries = output.getResult();+ Collections.sort(entries);++ for (BlameEntry each : entries) {+ int startLine = each.getResultLine();+ int numLines = each.getNumLines();+ for (int i = 0; i < numLines; i++) {+ if (i == 0) {+ System.out.print(GitUtils.abbreviateSHA(each.getCommit().getHash()));+ } else {+ System.out.print(StringUtils.repeat(" ", 10));+ }++ System.out.print("\t" + (startLine + i));+ if (i == 0) {+ System.out.print("\t\t" + each.getCommit().getSubject());+ }+ System.out.print("\n");+ }+ }+ }+}diff --git a/gitop.web/src/main/java/com/pmease/gitop/web/git/command/BlameEntry.java b/gitop.web/src/main/java/com/pmease/gitop/web/git/command/BlameEntry.javanew file mode 100644index 0000000000..447aa93038--- /dev/null+++ b/gitop.web/src/main/java/com/pmease/gitop/web/git/command/BlameEntry.java@@ -0,0 +1,108 @@+package com.pmease.gitop.web.git.command;++import java.io.Serializable;++import com.google.common.base.Objects;+import com.pmease.commons.git.BriefCommit;+import com.pmease.commons.git.UserInfo;++public class BlameEntry implements Serializable, Comparable<BlameEntry> {+ private static final long serialVersionUID = 1L;++ private final BriefCommit commit;+ private final int sourceLine;+ private final int resultLine;+ private final int numLines;++ public static class Builder {+ private String sha;+ private int sourceLine;+ private int resultLine;+ private int numLines;+ private UserInfo author;+ private UserInfo committer;+ private String summary;++ public Builder sha(String sha) {+ this.sha = sha;+ return this;+ }++ public Builder sourceLine(int sourceLine) {+ this.sourceLine = sourceLine;+ return this;+ }++ public Builder resultLine(int resultLine) {+ this.resultLine = resultLine;+ return this;+ }++ public Builder numLines(int numLines) {+ this.numLines = numLines;+ return this;+ }++ public Builder author(UserInfo author) {+ this.author = author;+ return this;+ }++ public Builder committer(UserInfo committer) {+ this.committer = committer;+ return this;+ }++ public Builder summary(String summary) {+ this.summary = summary;+ return this;+ }++ public BlameEntry build() {+ BriefCommit commit = new BriefCommit(sha, committer, author, summary);+ return new BlameEntry(commit, sourceLine, resultLine, numLines);+ }+ }++ public static Builder builder() {+ return new Builder();+ }++ BlameEntry(BriefCommit commit, int sourceLine, int resultLine, int numLines) {+ this.commit = commit;+ this.sourceLine = sourceLine;+ this.resultLine = resultLine;+ this.numLines = numLines;+ }++ public BriefCommit getCommit() {+ return commit;+ }++ public int getSourceLine() {+ return sourceLine;+ }++ public int getResultLine() {+ return resultLine;+ }++ public int getNumLines() {+ return numLines;+ }++ @Override+ public int compareTo(BlameEntry o) {+ return resultLine - o.resultLine;+ }++ @Override+ public String toString() {+ return commit.getHash() + " " + sourceLine + " " + resultLine + " " + numLines;+ }++ @Override+ public int hashCode() {+ return Objects.hashCode(commit, sourceLine, resultLine, numLines);+ }+}diff --git a/gitop.web/src/main/java/com/pmease/gitop/web/git/command/blame.txt b/gitop.web/src/main/java/com/pmease/gitop/web/git/command/blame.txtnew file mode 100644index 0000000000..243ba330f3--- /dev/null+++ b/gitop.web/src/main/java/com/pmease/gitop/web/git/command/blame.txt@@ -0,0 +1,374 @@+a20e3a795b1a1975f09f7f729ba2b6fc74f4a54a 92 92 1+author Michael Witten+author-mail <[email protected]>+author-time 1333480802+author-tz +0000+committer Jiri Kosina+committer-mail <[email protected]>+committer-time 1334651011+committer-tz +0200+summary README: Grammar: `me has' -> `I have'+previous 5b4285fbd4692928ed41992b9aba55c7d1efd723 README+filename README+5b4285fbd4692928ed41992b9aba55c7d1efd723 71 71 1+author Michael Witten+author-mail <[email protected]>+author-time 1333319250+author-tz +0000+committer Jiri Kosina+committer-mail <[email protected]>+committer-time 1334651011+committer-tz +0200+summary README: Use `X' and `x' consistently+previous 6b2aac42b20f495d9ea220036f57596d525d4233 README+filename README+5b4285fbd4692928ed41992b9aba55c7d1efd723 81 81 1+filename README+5b4285fbd4692928ed41992b9aba55c7d1efd723 88 88 4+filename README+5b4285fbd4692928ed41992b9aba55c7d1efd723 145 145 1+filename README+5b4285fbd4692928ed41992b9aba55c7d1efd723 149 149 1+filename README+0466dcbeda72e6a2753cd7e81f0a190054bd2233 1 1 1+author Jesper Juhl+author-mail <[email protected]>+author-time 1309517216+author-tz +0200+committer Linus Torvalds+committer-mail <[email protected]>+committer-time 1309551934+committer-tz -0700+summary Update version number references in README+previous 724d4c03066cec0e23b44344ad384fb4ebb7419d README+filename README+0466dcbeda72e6a2753cd7e81f0a190054bd2233 3 3 1+filename README+0466dcbeda72e6a2753cd7e81f0a190054bd2233 65 65 1+filename README+0466dcbeda72e6a2753cd7e81f0a190054bd2233 68 68 1+filename README+0466dcbeda72e6a2753cd7e81f0a190054bd2233 78 78 1+filename README+0466dcbeda72e6a2753cd7e81f0a190054bd2233 83 83 1+filename README+0466dcbeda72e6a2753cd7e81f0a190054bd2233 86 86 1+filename README+0466dcbeda72e6a2753cd7e81f0a190054bd2233 94 94 1+filename README+0466dcbeda72e6a2753cd7e81f0a190054bd2233 96 96 1+filename README+0466dcbeda72e6a2753cd7e81f0a190054bd2233 110 110 8+filename README+0466dcbeda72e6a2753cd7e81f0a190054bd2233 129 129 1+filename README+cddb5de0531738b1adcebca8186e7078fd8c33fd 27 27 1+author Tracey Dent+author-mail <[email protected]>+author-time 1290599796+author-tz -0500+committer Chris Metcalf+committer-mail <[email protected]>+committer-time 1298478682+committer-tz -0500+summary Readme: Add architecture+previous f5412be599602124d2bdd49947b231dd77c0bf99 README+filename README+b3235fe420edf7faf5e8e67b978b12d5524fb161 169 169 1+author Andrea Gelmini+author-mail <[email protected]>+author-time 1285967735+author-tz -0700+committer Michal Marek+committer-mail <[email protected]>+committer-time 1286962584+committer-tz +0200+summary README: cite nconfig+previous b1f7d6e1909c72338aa93a113d5844767434dacb README+filename README+b2d8993026a26f4ece8c8b3f2e138d2ba8f18eaa 179 180 9+author Patrick Ringl+author-mail <[email protected]>+author-time 1244807916+author-tz +0200+committer Sam Ravnborg+committer-mail <[email protected]>+committer-time 1245010827+committer-tz +0200+summary README: fix misleading pointer to the defconf directory+previous 7923f90fffa8746f6457d4eea2109fd3d6414189 README+filename README+590a5857291e88c00a1be53fb373e8bf82f86284 177 178 1+author Markus Heidelberg+author-mail <[email protected]>+author-time 1242603406+author-tz +0200+committer Sam Ravnborg+committer-mail <[email protected]>+committer-time 1244579866+committer-tz +0200+summary kconfig: add a note about the deps to the 'silentoldconfig' help+previous 6f26e5e412ddc23e1d698390243e39802410ab15 README+filename README+ad444684b78f12fb3f45a733722e2cbfe102d25c 191 201 1+author Li Zefan+author-mail <[email protected]>+author-time 1235173123+author-tz -0800+committer Linus Torvalds+committer-mail <[email protected]>+committer-time 1235181469+committer-tz -0800+summary README: fix a wrong filename+previous 3ef0e5ba467366125f04b423f4638baca54a4fc1 README+filename README+2af238e455ef5fd31c2f7a06c2db3f13d843b9bf 55 55 3+author Randy Dunlap+author-mail <[email protected]>+author-time 1204323713+author-tz -0800+committer Sam Ravnborg+committer-mail <[email protected]>+committer-time 1230925405+committer-tz +0100+summary kbuild: make *config usage docs+previous 80a7d1d991e35b0370c0396f36f6a076869a6bac README+filename README+2af238e455ef5fd31c2f7a06c2db3f13d843b9bf 59 59 1+filename README+2af238e455ef5fd31c2f7a06c2db3f13d843b9bf 190 200 1+filename README+2af238e455ef5fd31c2f7a06c2db3f13d843b9bf 192 202 1+filename README+2af238e455ef5fd31c2f7a06c2db3f13d843b9bf 229 239 13+filename README+99ddcc7edbb6b1d35a542f6bf0383f1f5a1aa0b0 281 299 2+author Linus Torvalds+author-mail <[email protected]>+author-time 1169590955+author-tz -0800+committer Linus Torvalds+committer-mail <[email protected]>+committer-time 1169590955+committer-tz -0800+summary Change Linus' email address too+previous 65ebe63420eae40fba73d3b4f79f99adc8e148b3 README+filename README+620034c84d1d939717bdfbe02c51a3fee43541c3 25 25 1+author Jesper Juhl+author-mail <[email protected]>+author-time 1165448758+author-tz +0100+committer Linus Torvalds+committer-mail <[email protected]>+committer-time 1165452081+committer-tz -0800+summary [PATCH] A few small additions and corrections to README+previous 6fc52f81a871e4c29ade34dd736a383906caf47e README+filename README+620034c84d1d939717bdfbe02c51a3fee43541c3 34 34 2+filename README+620034c84d1d939717bdfbe02c51a3fee43541c3 118 118 1+filename README+620034c84d1d939717bdfbe02c51a3fee43541c3 167 167 1+filename README+620034c84d1d939717bdfbe02c51a3fee43541c3 310 328 3+filename README+620034c84d1d939717bdfbe02c51a3fee43541c3 344 362 1+filename README+9dfb563b07b1aafcd7d40528ebfa7f9ce28f0556 168 173 2+author Randy Dunlap+author-mail <[email protected]>+author-time 1145424113+author-tz -0700+committer Linus Torvalds+committer-mail <[email protected]>+committer-time 1145463232+committer-tz -0700+summary [PATCH] config: update usage/help info+previous 7420884c038f326bdac3a8ded856033523e7684e README+filename README+9dfb563b07b1aafcd7d40528ebfa7f9ce28f0556 173 179 1+filename README+9dfb563b07b1aafcd7d40528ebfa7f9ce28f0556 175 189 11+filename README+2b422383c3d8dcd203dd9aea70155be6258dbf6c 77 79 1+author Håkon Løvdal+author-mail <[email protected]>+author-time 1142883124+author-tz +0100+committer Adrian Bunk+committer-mail <[email protected]>+committer-time 1142883124+committer-tz +0100+summary README: bzip2 is not new+previous 44fc355db7c224c95752155c54cbe28380f14c19 README+filename README+4f4e2dc3ce46d279a311e5250ac3cbd394279c31 9 9 3+author Xose Vazquez Perez+author-mail <[email protected]>+author-time 1137264988+author-tz +0100+committer Linus Torvalds+committer-mail <[email protected]>+committer-time 1137482761+committer-tz -0800+summary [PATCH] README updated+previous a462e9ff524f33da3e504fc71b8dd2b7584e4f28 README+filename README+4f4e2dc3ce46d279a311e5250ac3cbd394279c31 13 13 4+filename README+4f4e2dc3ce46d279a311e5250ac3cbd394279c31 23 23 2+filename README+4f4e2dc3ce46d279a311e5250ac3cbd394279c31 26 26 1+filename README+4f4e2dc3ce46d279a311e5250ac3cbd394279c31 28 28 6+filename README+a1365647022eb05a5993f270a78e9bef3bf554eb 186 224 2+author Andrew Morton+author-mail <[email protected]>+author-time 1136711049+author-tz -0800+committer Linus Torvalds+committer-mail <[email protected]>+committer-time 1136780042+committer-tz -0800+summary [PATCH] remove gcc-2 checks+previous fd285bb54d8a3e99810090ae88cfe8ed77d1da25 README+filename README+6ad44229ec85b3938a313a325f0449e23eac8aac 85 95 1+author Jesper Juhl+author-mail <[email protected]>+author-time 1131926864+author-tz -0800+committer Linus Torvalds+committer-mail <[email protected]>+committer-time 1131934457+committer-tz -0800+summary [PATCH] README: add info about -stable to README and point at applying-patches.txt+previous 3f39894d1b5c253b10fcb8fbbbcf65a330f6cdc7 README+filename README+6ad44229ec85b3938a313a325f0449e23eac8aac 87 97 2+filename README+b39f72fef241ce0ce971ed21922b4d64aefaf916 57 67 1+author Horms+author-mail <[email protected]>+author-time 1130713399+author-tz -0800+committer Linus Torvalds+committer-mail <[email protected]>+committer-time 1130722647+committer-tz -0800+summary [PATCH] README doesn't mention bzip2 source tarball+previous 82da2c372712c772134d01317aa2517c923a74f8 README+filename README+b39f72fef241ce0ce971ed21922b4d64aefaf916 59 69 2+filename README+e3fc4cc17ac4dbadab0ba0d5c8233d3b18170d4a 154 177 1+author Randy Dunlap+author-mail <[email protected]>+author-time 1127450647+author-tz -0700+committer Linus Torvalds+committer-mail <[email protected]>+committer-time 1127452655+committer-tz -0700+summary [PATCH] corrections to top-level README+previous 0365ba7fb1fa94a41289d6a3d36b4d95960e56cc README+filename README+e3fc4cc17ac4dbadab0ba0d5c8233d3b18170d4a 202 259 3+filename README+f875a1a6650edce859bd21051a22e1c27ac7ea63 152 175 2+author Paolo 'Blaisorblade' Giarrusso+author-mail <[email protected]>+author-time 1127321737+author-tz -0700+committer Linus Torvalds+committer-mail <[email protected]>+committer-time 1127322715+committer-tz -0700+summary [PATCH] README update from the stone age+previous f10df6860498c7f52db4f00ff00a1ba334bcfea0 README+filename README+896e5518da74f9d20db8163526014fba16b1f2b4 90 109 1+author Kurt Wall+author-mail <[email protected]>+author-time 1122489920+author-tz -0700+committer Linus Torvalds+committer-mail <[email protected]>+committer-time 1122506769+committer-tz -0700+summary [PATCH] Add text for dealing with "dot releases" to README+previous e5c2d749172657ed51e20e4b5ab540447666cc50 README+filename README+896e5518da74f9d20db8163526014fba16b1f2b4 99 119 1+filename README+1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 2 2 1+author Linus Torvalds+author-mail <[email protected]>+author-time 1113690036+author-tz -0700+committer Linus Torvalds+committer-mail <[email protected]>+committer-time 1113690036+committer-tz -0700+summary Linux-2.6.12-rc2+boundary+filename README+1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 4 4 5+filename README+1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 12 12 1+filename README+1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 17 17 6+filename README+1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 26 36 19+filename README+1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 48 58 1+filename README+1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 50 60 5+filename README+1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 56 66 1+filename README+1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 58 72 6+filename README+1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 66 80 1+filename README+1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 68 82 1+filename README+1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 70 84 2+filename README+1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 73 87 1+filename README+1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 79 93 1+filename README+1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 80 99 10+filename README+1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 90 120 9+filename README+1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 100 130 15+filename README+1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 116 146 3+filename README+1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 120 150 17+filename README+1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 137 168 1+filename README+1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 138 170 3+filename README+1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 143 203 19+filename README+1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 165 222 2+filename README+1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 172 226 13+filename README+1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 185 252 7+filename README+1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 192 262 37+filename README+1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 231 301 27+filename README+1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 260 331 31+filename README+1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 292 363 14+filename READMEdiff --git a/gitop.web/src/main/java/com/pmease/gitop/web/page/project/pullrequest/RequestDetailPanel.java b/gitop.web/src/main/java/com/pmease/gitop/web/page/project/pullrequest/RequestDetailPanel.javaindex 09ffaba1cc..96c38f1336 100644--- a/gitop.web/src/main/java/com/pmease/gitop/web/page/project/pullrequest/RequestDetailPanel.java+++ b/gitop.web/src/main/java/com/pmease/gitop/web/page/project/pullrequest/RequestDetailPanel.java@@ -183,7 +183,7 @@ public class RequestDetailPanel extends Panel {return new GitPerson(user.getName(), user.getEmail());}- }, Mode.FULL));+ }, Mode.AVATAR_AND_NAME));Link<Void> targetLink = new Link<Void>("targetLink") {diff --git a/gitop.web/src/main/java/com/pmease/gitop/web/page/project/pullrequest/RequestSummaryPanel.java b/gitop.web/src/main/java/com/pmease/gitop/web/page/project/pullrequest/RequestSummaryPanel.javaindex b6c223a511..dba3fe3f50 100644--- a/gitop.web/src/main/java/com/pmease/gitop/web/page/project/pullrequest/RequestSummaryPanel.java+++ b/gitop.web/src/main/java/com/pmease/gitop/web/page/project/pullrequest/RequestSummaryPanel.java@@ -81,7 +81,7 @@ public class RequestSummaryPanel extends Panel {return new GitPerson(user.getName(), user.getEmail());}- }, Mode.FULL));+ }, Mode.AVATAR_AND_NAME));Link<Void> branchLink = new Link<Void>("branchLink") {diff --git a/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/blame/BlobBlamePage.html b/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/blame/BlobBlamePage.htmlnew file mode 100644index 0000000000..241af36c9b--- /dev/null+++ b/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/blame/BlobBlamePage.html@@ -0,0 +1,58 @@+<html xmlns:wicket>+<wicket:extend>+ <div class="padder">+ <div class="blame-head">+ <ol class="breadcrumb breadcrumb-paths">+ <wicket:container wicket:id="paths"></wicket:container>+ </ol>+ </div>++ <div wicket:id="content"></div>+ </div>++ <wicket:fragment wicket:id="blamefrag">+ <div class="blob">+ <div class="blob-head clearfix">+ <div class="left blob-meta">+ <span><i class="icon" wicket:id="typeicon"></i> <span wicket:id="mode"></span></span>+ <wicket:enclosure child="loc">+ <span><wicket:container wicket:id="loc"></wicket:container> lines (<wicket:container wicket:id="sloc"></wicket:container> sloc)</span>+ </wicket:enclosure>+ <span wicket:id="size"></span>+ </div>+ <div class="right blob-actions btn-toolbar">+ <div class="btn-group">+ <a class="btn btn-sm btn-default">Raw</a>+ <a wicket:id="normallink" class="btn btn-sm btn-default">Normal View</a>+ <a wicket:id="historylink" class="btn btn-sm btn-default">History</a>+ </div>+ </div>+ </div>+ <div class="blob-body" wicket:id="body"></div>+ </div>+ </wicket:fragment>++ <wicket:fragment wicket:id="infofrag">+ <div class="alert alert-warning">+ This file doesn't support blame view+ </div>+ </wicket:fragment>++ <wicket:fragment wicket:id="blameColumnFrag">+ <td class="blame-msg">+ <div class="blob-blames">+ <div wicket:id="rows" class="blame-row">+ <div class="section-first">+ <a wicket:id="shalink" class="sha"><span wicket:id="sha"></span></a>+ + <i wicket:id="date"></i>+ + <wicket:container wicket:id="author"></wicket:container>+ </div>+ <div wicket:id="empties"> </div>+ </div>+ </div>+ </td>+ </wicket:fragment>+</wicket:extend>+</html>\ No newline at end of filediff --git a/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/blame/BlobBlamePage.java b/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/blame/BlobBlamePage.javanew file mode 100644index 0000000000..3371008a5b--- /dev/null+++ b/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/blame/BlobBlamePage.java@@ -0,0 +1,242 @@+package com.pmease.gitop.web.page.project.source.blame;++import java.util.List;++import org.apache.commons.lang3.StringUtils;+import org.apache.wicket.AttributeModifier;+import org.apache.wicket.Component;+import org.apache.wicket.markup.html.WebMarkupContainer;+import org.apache.wicket.markup.html.basic.Label;+import org.apache.wicket.markup.html.link.BookmarkablePageLink;+import org.apache.wicket.markup.html.list.Loop;+import org.apache.wicket.markup.html.list.LoopItem;+import org.apache.wicket.markup.html.panel.Fragment;+import org.apache.wicket.markup.repeater.RepeatingView;+import org.apache.wicket.model.AbstractReadOnlyModel;+import org.apache.wicket.model.IModel;+import org.apache.wicket.model.LoadableDetachableModel;+import org.apache.wicket.model.Model;+import org.apache.wicket.request.mapper.parameter.PageParameters;+import org.eclipse.jgit.lib.FileMode;++import com.google.common.base.Splitter;+import com.google.common.collect.Lists;+import com.pmease.gitop.core.Gitop;+import com.pmease.gitop.core.manager.ProjectManager;+import com.pmease.gitop.model.Project;+import com.pmease.gitop.web.common.datatype.DataTypes;+import com.pmease.gitop.web.common.quantity.Data;+import com.pmease.gitop.web.common.wicket.bootstrap.Icon;+import com.pmease.gitop.web.component.link.GitPersonLink;+import com.pmease.gitop.web.component.link.GitPersonLink.Mode;+import com.pmease.gitop.web.git.GitUtils;+import com.pmease.gitop.web.git.command.BlameCommand;+import com.pmease.gitop.web.git.command.BlameEntry;+import com.pmease.gitop.web.page.project.api.GitPerson;+import com.pmease.gitop.web.page.project.source.AbstractFilePage;+import com.pmease.gitop.web.page.project.source.blob.SourceBlobPage;+import com.pmease.gitop.web.page.project.source.blob.renderer.TextBlobPanel;+import com.pmease.gitop.web.page.project.source.commit.SourceCommitPage;+import com.pmease.gitop.web.page.project.source.commits.CommitsPage;+import com.pmease.gitop.web.page.project.source.component.PathsBreadcrumb;+import com.pmease.gitop.web.service.FileBlob;+import com.pmease.gitop.web.util.UrlUtils;++@SuppressWarnings("serial")+public class BlobBlamePage extends AbstractFilePage {++ private final IModel<FileBlob> blobModel;+ private final IModel<List<BlameEntry>> blamesModel;++ public BlobBlamePage(PageParameters params) {+ super(params);++ this.blobModel = new LoadableDetachableModel<FileBlob>() {++ @Override+ protected FileBlob load() {+ return FileBlob.of(getProject(), getRevision(), getFilePath());+ }++ };++ this.blamesModel = new LoadableDetachableModel<List<BlameEntry>>() {++ @Override+ protected List<BlameEntry> load() {+ BlameCommand cmd = new BlameCommand(getProject().code().repoDir());+ cmd.fileName(getFilePath()).objectId(getRevision());++ return cmd.call();+ }++ };+ }++ protected String getFilePath() {+ return UrlUtils.concatSegments(getPaths());+ }++ @Override+ protected String getPageTitle() {+ return getFilePath() + " at " + getRevision() + " " + getProject().getPathName();+ }++ @Override+ protected void onPageInitialize() {+ super.onPageInitialize();++ add(new PathsBreadcrumb("paths", projectModel, revisionModel, pathsModel));++ FileBlob blob = getBlob();+ if (blob.isText()) {+ add(createBlameView("content"));+ } else {+ add(createInfoView("content"));+ }+ }++ private Component createBlameView(String id) {+ Fragment frag = new Fragment(id, "blamefrag", this);++ frag.add(new Label("mode", new AbstractReadOnlyModel<String>() {++ @Override+ public String getObject() {+ FileMode mode = getBlob().getMode();+ if (mode == FileMode.SYMLINK) {+ return "symbolic link";+ } else if (mode == FileMode.EXECUTABLE_FILE) {+ return "executable file";+ } else {+ return "file";+ }+ }++ }));++ frag.add(new Icon("typeicon", new AbstractReadOnlyModel<String>() {++ @Override+ public String getObject() {+ return "icon-file-text";+ }+ }));++ frag.add(new Label("size", new AbstractReadOnlyModel<String>() {++ @Override+ public String getObject() {+ return Data.formatBytes(getBlob().getSize(), Data.KB);+ }++ }));++ frag.add(new Label("loc", new AbstractReadOnlyModel<Integer>() {++ @Override+ public Integer getObject() {+ return getBlob().getLines().size();+ }++ }).setVisibilityAllowed(getBlob().isText()));++ frag.add(new Label("sloc", new AbstractReadOnlyModel<Integer>() {++ @Override+ public Integer getObject() {+ List<String> lines = getBlob().getLines();+ int sloc = 0;+ for (String each : lines) {+ if (!StringUtils.isBlank(each)) {+ sloc++;+ }+ }++ return sloc;+ }++ }));++ FileBlob blob = getBlob();+ Project project = Gitop.getInstance(ProjectManager.class).get(blob.getProjectId());+ List<String> paths = Lists.newArrayList(Splitter.on("/").split(blob.getFilePath()));+ frag.add(new BookmarkablePageLink<Void>("historylink", CommitsPage.class,+ CommitsPage.newParams(+ project,+ blob.getRevision(),+ paths,+ 0)));++ frag.add(new BookmarkablePageLink<Void>("normallink",+ SourceBlobPage.class,+ SourceBlobPage.newParams(project, blob.getRevision(), paths)));++ frag.add(new TextBlobPanel("body", blobModel) {++ @Override+ protected Component createPrependColumn(String id) {+ Fragment frag = new Fragment(id, "blameColumnFrag", BlobBlamePage.this);++ List<BlameEntry> entries = blamesModel.getObject();++ RepeatingView view = new RepeatingView("rows");+ frag.add(view);+ for (BlameEntry each : entries) {+ WebMarkupContainer container = new WebMarkupContainer(view.newChildId());+ view.add(container);+ container.add(AttributeModifier.replace("title", each.getCommit().getSubject()));+ BookmarkablePageLink<Void> link = new BookmarkablePageLink<Void>(+ "shalink",+ SourceCommitPage.class,+ SourceCommitPage.newParams(getProject(), getRevision()));++ link.add(new Label("sha", GitUtils.abbreviateSHA(each.getCommit().getHash(), 8)));+ container.add(link);+ container.add(new GitPersonLink("author",+ Model.of(GitPerson.of(each.getCommit().getAuthor())),+ Mode.NAME));++ container.add(new Label("date",+ DataTypes.DATE.asString(each.getCommit().getAuthor().getDate(), "yyyy-MM-dd")));++ Loop loop = new Loop("empties", each.getNumLines() - 1) {++ @Override+ protected void populateItem(LoopItem item) {++ }+ };+ container.add(loop);+ }++ frag.setRenderBodyOnly(true);+ return frag;+ }+ });++ return frag;+ }++ private Component createInfoView(String id) {+ Fragment frag = new Fragment(id, "infofrag", this);+ return frag;+ }++ FileBlob getBlob() {+ return blobModel.getObject();+ }++ @Override+ public void onDetach() {+ if (blobModel != null) {+ blobModel.detach();+ }++ if (blamesModel != null) {+ blamesModel.detach();+ }++ super.onDetach();+ }+}diff --git a/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/blob/BlobBlamePage.java b/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/blob/BlobBlamePage.javadeleted file mode 100644index 7e2d9d5ad8..0000000000--- a/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/blob/BlobBlamePage.java+++ /dev/null@@ -1,12 +0,0 @@-package com.pmease.gitop.web.page.project.source.blob;--import org.apache.wicket.request.mapper.parameter.PageParameters;--@SuppressWarnings("serial")-public class BlobBlamePage extends SourceBlobPage {-- public BlobBlamePage(PageParameters params) {- super(params);- }--}diff --git a/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/blob/ContributorsPanel.java b/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/blob/ContributorsPanel.javaindex a371d3184a..72c888b192 100644--- a/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/blob/ContributorsPanel.java+++ b/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/blob/ContributorsPanel.java@@ -65,7 +65,7 @@ public class ContributorsPanel extends Panel {@Overrideprotected void populateItem(ListItem<GitPerson> item) {GitPerson person = item.getModelObject();- item.add(new GitPersonLink("link", Model.of(person), Mode.AVATAR_ONLY).enableTooltip());+ item.add(new GitPersonLink("link", Model.of(person), Mode.AVATAR).enableTooltip());}};@@ -91,7 +91,7 @@ public class ContributorsPanel extends Panel {@Overrideprotected void populateItem(ListItem<GitPerson> item) {- item.add(new GitPersonLink("committer", item.getModel(), Mode.FULL));+ item.add(new GitPersonLink("committer", item.getModel(), Mode.AVATAR_AND_NAME));}});diff --git a/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/blob/SourceBlobPage.java b/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/blob/SourceBlobPage.javaindex 6e14f9a70e..9fb9d61058 100644--- a/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/blob/SourceBlobPage.java+++ b/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/blob/SourceBlobPage.java@@ -114,7 +114,7 @@ public class SourceBlobPage extends AbstractFilePage {public GitPerson getObject() {return GitPerson.of(getLastCommit().getAuthor());}- }, Mode.FULL));+ }, Mode.AVATAR_AND_NAME));add(new AgeLabel("author-date", new AbstractReadOnlyModel<Date>() {diff --git a/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/blob/SourceBlobPanel.html b/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/blob/SourceBlobPanel.htmlindex fb232ac6f1..0e66c8bb13 100644--- a/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/blob/SourceBlobPanel.html+++ b/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/blob/SourceBlobPanel.html@@ -11,10 +11,9 @@</div><div class="right blob-actions btn-toolbar"><div class="btn-group">- <a class="btn btn-sm btn-default">Edit</a><a class="btn btn-sm btn-default">Raw</a>- <a class="btn btn-sm btn-default">Blame</a>- <a class="btn btn-sm btn-default">History</a>+ <a wicket:id="blamelink" class="btn btn-sm btn-default">Blame</a>+ <a wicket:id="historylink" class="btn btn-sm btn-default">History</a></div><div class="btn-group">diff --git a/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/blob/SourceBlobPanel.java b/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/blob/SourceBlobPanel.javaindex 563231e080..fce4af83fc 100644--- a/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/blob/SourceBlobPanel.java+++ b/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/blob/SourceBlobPanel.java@@ -4,16 +4,23 @@ import java.util.List;import org.apache.commons.lang3.StringUtils;import org.apache.wicket.markup.html.basic.Label;+import org.apache.wicket.markup.html.link.BookmarkablePageLink;import org.apache.wicket.markup.html.panel.Panel;import org.apache.wicket.model.AbstractReadOnlyModel;import org.apache.wicket.model.IModel;import org.eclipse.jgit.lib.FileMode;+import com.google.common.base.Splitter;+import com.google.common.collect.Lists;import com.pmease.gitop.core.Gitop;+import com.pmease.gitop.core.manager.ProjectManager;+import com.pmease.gitop.model.Project;import com.pmease.gitop.web.common.quantity.Data;import com.pmease.gitop.web.common.wicket.bootstrap.Icon;+import com.pmease.gitop.web.page.project.source.blame.BlobBlamePage;import com.pmease.gitop.web.page.project.source.blob.renderer.BlobRenderer;import com.pmease.gitop.web.page.project.source.blob.renderer.BlobRendererFactory;+import com.pmease.gitop.web.page.project.source.commits.CommitsPage;import com.pmease.gitop.web.service.FileBlob;@SuppressWarnings("serial")@@ -87,6 +94,21 @@ public class SourceBlobPanel extends Panel {}));+ FileBlob blob = getBlob();++ Project project = Gitop.getInstance(ProjectManager.class).get(blob.getProjectId());+ List<String> paths = Lists.newArrayList(Splitter.on("/").split(blob.getFilePath()));+ add(new BookmarkablePageLink<Void>("historylink", CommitsPage.class,+ CommitsPage.newParams(+ project,+ blob.getRevision(),+ paths,+ 0)));++ add(new BookmarkablePageLink<Void>("blamelink",+ BlobBlamePage.class,+ BlobBlamePage.newParams(project, blob.getRevision(), paths)).setVisibilityAllowed(blob.isText()));+BlobRenderer renderer = getRenderer();add(renderer.render("body", (IModel<FileBlob>) getDefaultModel()));}diff --git a/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/blob/renderer/TextBlobPanel.html b/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/blob/renderer/TextBlobPanel.htmlindex 0659f6b427..0a9adec991 100644--- a/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/blob/renderer/TextBlobPanel.html+++ b/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/blob/renderer/TextBlobPanel.html@@ -2,6 +2,8 @@<wicket:panel><table class="table-blob"><tr>+ <wicket:container wicket:id="prepend">+ </wicket:container><td class="blob-lineno"><wicket:container wicket:id="lineno"></wicket:container></td>diff --git a/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/blob/renderer/TextBlobPanel.java b/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/blob/renderer/TextBlobPanel.javaindex 7242653e55..5a5b5309b1 100644--- a/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/blob/renderer/TextBlobPanel.java+++ b/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/blob/renderer/TextBlobPanel.java@@ -2,7 +2,9 @@ package com.pmease.gitop.web.page.project.source.blob.renderer;import java.util.List;+import org.apache.wicket.Component;import org.apache.wicket.behavior.AttributeAppender;+import org.apache.wicket.markup.html.WebMarkupContainer;import org.apache.wicket.markup.html.basic.Label;import org.apache.wicket.markup.html.panel.Panel;import org.apache.wicket.model.AbstractReadOnlyModel;@@ -79,11 +81,16 @@ public class TextBlobPanel extends Panel {code.add(AttributeAppender.append("class", cssModel));code.add(new AceHighlighter());add(code);++ add(createPrependColumn("prepend"));}- private FileBlob getBlob() {- return (FileBlob) getDefaultModelObject();+ protected Component createPrependColumn(String id) {+ return new WebMarkupContainer(id).setVisibilityAllowed(false);}+ protected FileBlob getBlob() {+ return (FileBlob) getDefaultModelObject();+ }}diff --git a/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/branches/BranchesPage.java b/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/branches/BranchesPage.javaindex f6d183d3d3..b3dea694e1 100644--- a/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/branches/BranchesPage.java+++ b/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/branches/BranchesPage.java@@ -193,7 +193,7 @@ public class BranchesPage extends ProjectCategoryPage {add(new AgeLabel("updatedTime", Model.of(commit.getAuthor().getDate())));add(new GitPersonLink("author",Model.<GitPerson>of(GitPerson.of(commit.getAuthor())),- Mode.NAME_ONLY));+ Mode.NAME));}}diff --git a/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/commit/SourceCommitPage.java b/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/commit/SourceCommitPage.javaindex 69b7119e1d..bf12dac4e8 100644--- a/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/commit/SourceCommitPage.java+++ b/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/commit/SourceCommitPage.java@@ -114,7 +114,7 @@ public class SourceCommitPage extends ProjectCategoryPage implements CommitCommeSourceTreePage.class,SourceTreePage.newParams(getProject(), getRevision())));- add(new GitPersonLink("authoravatar", authorModel, Mode.AVATAR_ONLY).enableTooltip("left"));+ add(new GitPersonLink("authoravatar", authorModel, Mode.AVATAR).enableTooltip("left"));add(new CommitMetaPanel("meta", commitModel));add(new Label("commitsha", new PropertyModel<String>(commitModel, "hash")));diff --git a/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/commit/diff/CommentListPanel.java b/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/commit/diff/CommentListPanel.javaindex 55c3f201e6..a45e411169 100644--- a/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/commit/diff/CommentListPanel.java+++ b/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/commit/diff/CommentListPanel.java@@ -135,7 +135,7 @@ public class CommentListPanel extends Panel {CommitComment c = item.getModelObject();item.add(new UserAvatarLink("author",new UserModel(c.getAuthor()),- UserAvatarLink.Mode.AVATAR_ONLY));+ UserAvatarLink.Mode.AVATAR));item.add(new CommitCommentPanel("message", projectModel, new CommitCommentModel(c)) {@Overrideprotected Component createCommentHead(String id) {@@ -145,7 +145,7 @@ public class CommentListPanel extends Panel {Fragment frag = new Fragment(id, "commenthead", CommentListPanel.this);frag.add(new UserAvatarLink("author",new UserModel(comment.getAuthor()),- UserAvatarLink.Mode.NAME_ONLY));+ UserAvatarLink.Mode.NAME));AbstractLink link = new BookmarkablePageLink<Void>("commitlink",SourceCommitPage.class,SourceCommitPage.newParams(getProject(), getCommit()));@@ -178,7 +178,7 @@ public class CommentListPanel extends Panel {add(formHolder);if (GitopSession.getCurrentUser().isPresent()) {- formHolder.add(new UserAvatarLink("author", new UserModel(GitopSession.getCurrentUser().get()), UserAvatarLink.Mode.AVATAR_ONLY));+ formHolder.add(new UserAvatarLink("author", new UserModel(GitopSession.getCurrentUser().get()), UserAvatarLink.Mode.AVATAR));formHolder.add(new CommitCommentEditor("form") {@Overridediff --git a/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/commit/diff/renderer/image/SwipePanel.java b/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/commit/diff/renderer/image/SwipePanel.javaindex 82ff06689b..5e2ae7e21d 100644--- a/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/commit/diff/renderer/image/SwipePanel.java+++ b/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/commit/diff/renderer/image/SwipePanel.java@@ -64,8 +64,8 @@ public class SwipePanel extends AbstractImageDiffPanel {private String getInitScript() {String str =- "gitop.utils.onImageLoad('#" + oldImage.getMarkupId(true) + "', function() {"- + "gitop.utils.onImageLoad('#" + newImage.getMarkupId(true) + "', function() {"+ "gitop.utils.onImageLoad('#" + newImage.getMarkupId(true) + "', function() {"+ + "gitop.utils.onImageLoad('#" + oldImage.getMarkupId(true) + "', function() {"+ JQuery.$(this, ".swipe-view").chain("twentytwenty").get()+ "});});";diff --git a/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/commits/CommitsPage.html b/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/commits/CommitsPage.htmlindex c81cab5c3b..3c29311230 100644--- a/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/commits/CommitsPage.html+++ b/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/commits/CommitsPage.html@@ -5,6 +5,7 @@<wicket:container wicket:id="revselector"></wicket:container><ol class="breadcrumb inline breadcrumb-paths"><li><a wicket:id="home"><b wicket:id="name"></b></a></li>+ <li wicket:id="paths"><a wicket:id="link"><b wicket:id="name"></b></a></li><li><b class="text-muted">Commits</b></li></ol></div>diff --git a/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/commits/CommitsPage.java b/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/commits/CommitsPage.javaindex 3939824270..20364ea70e 100644--- a/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/commits/CommitsPage.java+++ b/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/commits/CommitsPage.java@@ -2,15 +2,20 @@ package com.pmease.gitop.web.page.project.source.commits;import java.util.List;+import org.apache.wicket.Component;import org.apache.wicket.markup.html.basic.Label;import org.apache.wicket.markup.html.link.BookmarkablePageLink;+import org.apache.wicket.markup.html.list.ListItem;+import org.apache.wicket.markup.html.list.ListView;import org.apache.wicket.model.AbstractReadOnlyModel;import org.apache.wicket.model.IModel;import org.apache.wicket.model.LoadableDetachableModel;import org.apache.wicket.request.mapper.parameter.PageParameters;import org.parboiled.common.Preconditions;+import com.google.common.base.Joiner;import com.google.common.base.Strings;+import com.google.common.collect.Lists;import com.pmease.commons.git.Commit;import com.pmease.commons.git.Git;import com.pmease.commons.git.command.LogCommand;@@ -19,20 +24,23 @@ import com.pmease.gitop.web.page.PageSpec;import com.pmease.gitop.web.page.project.ProjectCategoryPage;import com.pmease.gitop.web.page.project.api.IRevisionAware;import com.pmease.gitop.web.page.project.source.component.RevisionSelector;-import com.pmease.gitop.web.page.project.source.tree.SourceTreePage;@SuppressWarnings("serial")public class CommitsPage extends ProjectCategoryPage implements IRevisionAware {public static final int COMMITS_PER_PAGE = 30;- public static PageParameters newParams(Project project, String revision, int page) {+ public static PageParameters newParams(Project project, String revision, List<String> paths, int page) {Preconditions.checkNotNull(project);PageParameters params = PageSpec.forProject(project);if (!Strings.isNullOrEmpty(revision)) {params.set("objectId", revision);}+ for (int i = 0; i < paths.size(); i++) {+ params.set(i, paths.get(i));+ }+if (page > 0) {params.set("page", page);}@@ -43,50 +51,90 @@ public class CommitsPage extends ProjectCategoryPage implements IRevisionAware {private int page;private final IModel<List<Commit>> commitsModel;+ private final IModel<List<String>> pathsModel;public CommitsPage(PageParameters params) {super(params);page = params.get("page").toInt(1);+ pathsModel = new LoadableDetachableModel<List<String>>() {++ @Override+ public List<String> load() {+ PageParameters params = CommitsPage.this.getPageParameters();+ int count = params.getIndexedCount();+ List<String> paths = Lists.newArrayList();+ for (int i = 0; i < count; i++) {+ String p = params.get(i).toString();+ if (!Strings.isNullOrEmpty(p)) {+ paths.add(p);+ }+ }++ return paths;+ }+ };+commitsModel = new LoadableDetachableModel<List<Commit>>() {@Overrideprotected List<Commit> load() {Git git = getProject().code();- List<Commit> commits = new LogCommand(git.repoDir())+ List<String> paths = getPaths();++ // load additional one commit to see whether there is still more page+ LogCommand command = new LogCommand(git.repoDir()).toRev(getRevision()).skip((page - 1) * COMMITS_PER_PAGE)- .maxCount(COMMITS_PER_PAGE + 1) // load additional one commit to see whether there is still more page- .call();+ .maxCount(COMMITS_PER_PAGE + 1);+ if (!paths.isEmpty()) {+ String p = Joiner.on("/").join(paths);+ command.path(p);+ }++ List<Commit> commits = command.call();return commits;}};}+ protected List<String> getPaths() {+ return pathsModel.getObject();+ }+@Overrideprotected void onPageInitialize() {super.onPageInitialize();add(new RevisionSelector("revselector", projectModel, revisionModel, null));- BookmarkablePageLink<Void> homeLink = new BookmarkablePageLink<Void>("home",- SourceTreePage.class,- PageSpec.forProject(getProject()).add(PageSpec.OBJECT_ID, getRevision()));- add(homeLink);- homeLink.add(new Label("name", new AbstractReadOnlyModel<String>() {+// BookmarkablePageLink<Void> homeLink = new BookmarkablePageLink<Void>("home",+// SourceTreePage.class,+// PageSpec.forProject(getProject()).add(PageSpec.OBJECT_ID, getRevision()));+// add(homeLink);+// homeLink.add(new Label("name", new AbstractReadOnlyModel<String>() {+//+// @Override+// public String getObject() {+// return getProject().getName();+// }+// }));++ add(newNavLink("home", -1));+ add(new ListView<String>("paths", pathsModel) {@Override- public String getObject() {- return getProject().getName();+ protected void populateItem(ListItem<String> item) {+ item.add(newNavLink("link", item.getIndex()));}- }));+ });add(new CommitsPanel("commits", commitsModel, projectModel));add(new BookmarkablePageLink<Void>("newer", CommitsPage.class,- newParams(getProject(), getRevision(), page - 1)).setEnabled(page > 1));+ newParams(getProject(), getRevision(), getPaths(), page - 1)).setEnabled(page > 1));add(new BookmarkablePageLink<Void>("older", CommitsPage.class,- newParams(getProject(), getRevision(), page + 1)) {+ newParams(getProject(), getRevision(), getPaths(), page + 1)) {@Overrideprotected void onConfigure() {super.onConfigure();@@ -96,6 +144,33 @@ public class CommitsPage extends ProjectCategoryPage implements IRevisionAware {});}+ private Component newNavLink(String id, final int pathNum) {+ List<String> all = getPaths();+ List<String> paths = Lists.newArrayList();+ if (pathNum >= 0) {+ paths = all.subList(0, pathNum + 1);+ }++ BookmarkablePageLink<Void> link = new BookmarkablePageLink<Void>(id,+ CommitsPage.class,+ CommitsPage.newParams(getProject(), getRevision(), paths, 0));+ link.setEnabled(pathNum < 0 || pathNum < all.size() - 1);+ link.add(new Label("name", new AbstractReadOnlyModel<String>() {++ @Override+ public String getObject() {+ if (pathNum < 0) {+ return getProject().getName();+ } else {+ List<String> all = getPaths();+ return all.get(pathNum);+ }+ }++ }));++ return link;+ }@Overrideprotected String getPageTitle() {return "Commits - " + getProject();@@ -106,6 +181,10 @@ public class CommitsPage extends ProjectCategoryPage implements IRevisionAware {if (commitsModel != null) {commitsModel.detach();}++ if (pathsModel != null) {+ pathsModel.detach();+ }super.onDetach();}diff --git a/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/commits/CommitsPanel.java b/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/commits/CommitsPanel.javaindex cc2069d2f6..c1e5a356ce 100644--- a/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/commits/CommitsPanel.java+++ b/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/commits/CommitsPanel.java@@ -135,7 +135,7 @@ public class CommitsPanel extends Panel {item.add(new GitPersonLink("avatar",Model.of(GitPerson.of(commit.getAuthor())),- Mode.AVATAR_ONLY)+ Mode.AVATAR).enableTooltip("right"));item.add(new CommitMessagePanel("message", item.getModel(), projectModel));diff --git a/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/component/PathsBreadcrumb.html b/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/component/PathsBreadcrumb.htmlnew file mode 100644index 0000000000..345db9a87e--- /dev/null+++ b/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/component/PathsBreadcrumb.html@@ -0,0 +1,8 @@+<html xmlns:wicket>+<wicket:panel>+ <li>+ <a wicket:id="home"><b wicket:id="name"></b></a>+ </li>+ <li wicket:id="paths"><a wicket:id="link"><span wicket:id="name"></span></a></li>+</wicket:panel>+</html>\ No newline at end of filediff --git a/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/component/PathsBreadcrumb.java b/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/component/PathsBreadcrumb.javanew file mode 100644index 0000000000..b2eba76d1f--- /dev/null+++ b/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/component/PathsBreadcrumb.java@@ -0,0 +1,67 @@+package com.pmease.gitop.web.page.project.source.component;++import java.util.List;++import org.apache.wicket.behavior.AttributeAppender;+import org.apache.wicket.markup.html.basic.Label;+import org.apache.wicket.markup.html.link.BookmarkablePageLink;+import org.apache.wicket.markup.html.list.ListItem;+import org.apache.wicket.markup.html.list.ListView;+import org.apache.wicket.model.AbstractReadOnlyModel;+import org.apache.wicket.model.IModel;++import com.pmease.gitop.model.Project;+import com.pmease.gitop.web.page.PageSpec;+import com.pmease.gitop.web.page.project.source.tree.SourceTreePage;++@SuppressWarnings("serial")+public class PathsBreadcrumb extends AbstractSourcePagePanel {++ public PathsBreadcrumb(String id, IModel<Project> projectModel,+ IModel<String> revisionModel,+ IModel<List<String>> pathsModel) {+ super(id, projectModel, revisionModel, pathsModel);+ }++ @Override+ protected void onInitialize() {+ super.onInitialize();++ BookmarkablePageLink<Void> homeLink = new BookmarkablePageLink<Void>("home",+ SourceTreePage.class,+ PageSpec.forProject(getProject()).add(PageSpec.OBJECT_ID, getRevision()));+ add(homeLink);+ homeLink.add(new Label("name", new AbstractReadOnlyModel<String>() {++ @Override+ public String getObject() {+ return getProject().getName();+ }+ }));++ ListView<String> pathsView = new ListView<String>("paths", pathsModel) {++ @Override+ protected void populateItem(ListItem<String> item) {+ String path = item.getModelObject();++ BookmarkablePageLink<Void> link = new BookmarkablePageLink<Void>(+ "link",+ SourceTreePage.class,+ SourceTreePage.newParams(getProject(),+ getRevision(),+ getPaths().subList(0, item.getIndex() + 1)));++ item.add(link);+ link.add(new Label("name", path));+ if (item.getIndex() == getList().size() - 1) {+ item.add(AttributeAppender.append("class", "active"));+ link.setEnabled(false);+ }++ }+ };++ add(pathsView);+ }+}diff --git a/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/component/SourceBreadcrumbPanel.html b/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/component/SourceBreadcrumbPanel.htmlindex 700fccc777..5c462d23c9 100644--- a/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/component/SourceBreadcrumbPanel.html+++ b/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/component/SourceBreadcrumbPanel.html@@ -4,10 +4,7 @@<a class="btn btn-success has-tip" data-toggle="tooltip" title="compare and review"><i class="icon icon-git-branch-compare"></i></a><wicket:container wicket:id="revselector"></wicket:container><ol class="breadcrumb inline breadcrumb-paths">- <li>- <a wicket:id="home"><b wicket:id="name"></b></a>- </li>- <li wicket:id="paths"><a wicket:id="link"><span wicket:id="name"></span></a></li>+ <wicket:container wicket:id="paths"></wicket:container><li><a class="has-tip" data-toggle="tooltip" title="Fork this repository and add a new file"><i class="icon icon-file-add"></i></a></li>diff --git a/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/component/SourceBreadcrumbPanel.java b/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/component/SourceBreadcrumbPanel.javaindex aaae869152..f3136640e4 100644--- a/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/component/SourceBreadcrumbPanel.java+++ b/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/component/SourceBreadcrumbPanel.java@@ -2,17 +2,9 @@ package com.pmease.gitop.web.page.project.source.component;import java.util.List;-import org.apache.wicket.behavior.AttributeAppender;-import org.apache.wicket.markup.html.basic.Label;-import org.apache.wicket.markup.html.link.BookmarkablePageLink;-import org.apache.wicket.markup.html.list.ListItem;-import org.apache.wicket.markup.html.list.ListView;-import org.apache.wicket.model.AbstractReadOnlyModel;import org.apache.wicket.model.IModel;import com.pmease.gitop.model.Project;-import com.pmease.gitop.web.page.PageSpec;-import com.pmease.gitop.web.page.project.source.tree.SourceTreePage;@SuppressWarnings("serial")public class SourceBreadcrumbPanel extends AbstractSourcePagePanel {@@ -28,44 +20,7 @@ public class SourceBreadcrumbPanel extends AbstractSourcePagePanel {protected void onInitialize() {super.onInitialize();-- BookmarkablePageLink<Void> homeLink = new BookmarkablePageLink<Void>("home",- SourceTreePage.class,- PageSpec.forProject(getProject()).add(PageSpec.OBJECT_ID, getRevision()));- add(homeLink);- homeLink.add(new Label("name", new AbstractReadOnlyModel<String>() {-- @Override- public String getObject() {- return getProject().getName();- }- }));-add(new RevisionSelector("revselector", projectModel, revisionModel, pathsModel));-- ListView<String> pathsView = new ListView<String>("paths", pathsModel) {-- @Override- protected void populateItem(ListItem<String> item) {- String path = item.getModelObject();-- BookmarkablePageLink<Void> link = new BookmarkablePageLink<Void>(- "link",- SourceTreePage.class,- SourceTreePage.newParams(getProject(),- getRevision(),- getPaths().subList(0, item.getIndex() + 1)));-- item.add(link);- link.add(new Label("name", path));- if (item.getIndex() == getList().size() - 1) {- item.add(AttributeAppender.append("class", "active"));- link.setEnabled(false);- }-- }- };-- add(pathsView);+ add(new PathsBreadcrumb("paths", projectModel, revisionModel, pathsModel));}}diff --git a/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/tags/TagsPage.java b/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/tags/TagsPage.javaindex 2e2c4d8b95..d32c919263 100644--- a/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/tags/TagsPage.java+++ b/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/tags/TagsPage.java@@ -101,7 +101,7 @@ public class TagsPage extends ProjectCategoryPage {} else {item.add(new GitPersonLink("creator",Model.of(GitPerson.of(tag.getTagger())),- Mode.AVATAR_ONLY).enableTooltip("right"));+ Mode.AVATAR).enableTooltip("right"));item.add(new AgeLabel("date", Model.of(tag.getTagger().getDate())));}diff --git a/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/tree/SourceTreePanel.java b/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/tree/SourceTreePanel.javaindex 26d391bfcb..6de9e2d6f2 100644--- a/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/tree/SourceTreePanel.java+++ b/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/tree/SourceTreePanel.java@@ -28,6 +28,7 @@ import com.pmease.gitop.model.Project;import com.pmease.gitop.web.common.wicket.bootstrap.Icon;import com.pmease.gitop.web.component.commit.CommitMessagePanel;import com.pmease.gitop.web.component.commit.CommitMetaPanel;+import com.pmease.gitop.web.component.link.GitPersonLink.Mode;import com.pmease.gitop.web.git.GitUtils;import com.pmease.gitop.web.page.PageSpec;import com.pmease.gitop.web.page.project.source.blob.SourceBlobPage;@@ -72,12 +73,12 @@ public class SourceTreePanel extends AbstractSourcePagePanel {super.onInitialize();add(new CommitMessagePanel("message", lastCommitModel, projectModel));- add(new CommitMetaPanel("meta", lastCommitModel));+ add(new CommitMetaPanel("meta", lastCommitModel).setAuthorMode(Mode.AVATAR_AND_NAME));BookmarkablePageLink<Void> historyLink = new BookmarkablePageLink<Void>("history",CommitsPage.class,- CommitsPage.newParams(getProject(), getRevision(), 0));+ CommitsPage.newParams(getProject(), getRevision(), getPaths(), 0));add(historyLink);BookmarkablePageLink<Void> commitLink = new BookmarkablePageLink<Void>(