summaryrefslogtreecommitdiffstats
path: root/src/com/gitblit/wicket/pages/CommitDiffPage.java
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2011-04-18 22:29:20 -0400
committerJames Moger <james.moger@gitblit.com>2011-04-18 22:29:20 -0400
commit9bc17d16ea48a7978b198126d346828b1d24fe4e (patch)
tree192fb8ddb61bc2aadf311fb2d3803a119f3da3ff /src/com/gitblit/wicket/pages/CommitDiffPage.java
parent7203a415392b5372c0866991f1c2810eb5e3527a (diff)
downloadgitblit-9bc17d16ea48a7978b198126d346828b1d24fe4e.tar.gz
gitblit-9bc17d16ea48a7978b198126d346828b1d24fe4e.zip
Color-coded change type indicator with tooltip for changed paths.
Also fixed /dev/null reference due to deletion change.
Diffstat (limited to 'src/com/gitblit/wicket/pages/CommitDiffPage.java')
-rw-r--r--src/com/gitblit/wicket/pages/CommitDiffPage.java17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/com/gitblit/wicket/pages/CommitDiffPage.java b/src/com/gitblit/wicket/pages/CommitDiffPage.java
index 87e81102..d52b7a36 100644
--- a/src/com/gitblit/wicket/pages/CommitDiffPage.java
+++ b/src/com/gitblit/wicket/pages/CommitDiffPage.java
@@ -16,7 +16,7 @@ import com.gitblit.utils.JGitUtils;
import com.gitblit.wicket.LinkPanel;
import com.gitblit.wicket.RepositoryPage;
import com.gitblit.wicket.WicketUtils;
-import com.gitblit.wicket.models.PathModel;
+import com.gitblit.wicket.models.PathModel.PathChangeModel;
public class CommitDiffPage extends RepositoryPage {
@@ -46,14 +46,19 @@ public class CommitDiffPage extends RepositoryPage {
add(new LinkPanel("shortlog", "title", commit.getShortMessage(), CommitPage.class, newCommitParameter()));
// changed paths list
- List<PathModel> paths = JGitUtils.getFilesInCommit(r, commit);
- ListDataProvider<PathModel> pathsDp = new ListDataProvider<PathModel>(paths);
- DataView<PathModel> pathsView = new DataView<PathModel>("changedPath", pathsDp) {
+ List<PathChangeModel> paths = JGitUtils.getFilesInCommit(r, commit);
+ ListDataProvider<PathChangeModel> pathsDp = new ListDataProvider<PathChangeModel>(paths);
+ DataView<PathChangeModel> pathsView = new DataView<PathChangeModel>("changedPath", pathsDp) {
private static final long serialVersionUID = 1L;
int counter = 0;
- public void populateItem(final Item<PathModel> item) {
- final PathModel entry = item.getModelObject();
+ public void populateItem(final Item<PathChangeModel> item) {
+ final PathChangeModel entry = item.getModelObject();
+ Label changeType = new Label("changeType", "");
+ WicketUtils.setChangeTypeCssClass(changeType, entry.changeType);
+ setChangeTypeTooltip(changeType, entry.changeType);
+ item.add(changeType);
+
if (entry.isTree()) {
item.add(new LinkPanel("pathName", null, entry.path, TreePage.class, newPathParameter(entry.path)));
} else {