summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Martin <paul@paulsputer.com>2016-04-06 08:27:20 +0100
committerPaul Martin <paul@paulsputer.com>2016-04-06 19:31:41 +0100
commit5bb79fbb553a11e6582392f658233cf58a4ceb11 (patch)
tree72bbd5077466925cf03e70f9a53c39a6f299c8e4 /src
parent018ad3913231e1aa53a60a00db40d5fea7ceb279 (diff)
downloadgitblit-5bb79fbb553a11e6582392f658233cf58a4ceb11.tar.gz
gitblit-5bb79fbb553a11e6582392f658233cf58a4ceb11.zip
Fix for #1042 - Filestore items now shown as icons
Diffstat (limited to 'src')
-rw-r--r--src/main/java/com/gitblit/wicket/WicketUtils.java4
-rw-r--r--src/main/java/com/gitblit/wicket/pages/CommitDiffPage.html2
-rw-r--r--src/main/java/com/gitblit/wicket/pages/CommitDiffPage.java9
-rw-r--r--src/main/java/com/gitblit/wicket/pages/CommitPage.html2
-rw-r--r--src/main/java/com/gitblit/wicket/pages/CommitPage.java26
-rw-r--r--src/main/java/com/gitblit/wicket/pages/TreePage.html2
-rw-r--r--src/main/java/com/gitblit/wicket/pages/TreePage.java16
-rw-r--r--src/main/resources/gitblit.css4
8 files changed, 17 insertions, 48 deletions
diff --git a/src/main/java/com/gitblit/wicket/WicketUtils.java b/src/main/java/com/gitblit/wicket/WicketUtils.java
index 0d48e2be..d9ff34a2 100644
--- a/src/main/java/com/gitblit/wicket/WicketUtils.java
+++ b/src/main/java/com/gitblit/wicket/WicketUtils.java
@@ -73,8 +73,8 @@ public class WicketUtils {
container.add(new SimpleAttributeModifier("style", background));
}
- public static void setHtmlTooltip(Component container, String value) {
- container.add(new SimpleAttributeModifier("title", value));
+ public static Component setHtmlTooltip(Component container, String value) {
+ return container.add(new SimpleAttributeModifier("title", value));
}
public static void setInputPlaceholder(Component container, String value) {
diff --git a/src/main/java/com/gitblit/wicket/pages/CommitDiffPage.html b/src/main/java/com/gitblit/wicket/pages/CommitDiffPage.html
index 254d7d0c..20bf19f2 100644
--- a/src/main/java/com/gitblit/wicket/pages/CommitDiffPage.html
+++ b/src/main/java/com/gitblit/wicket/pages/CommitDiffPage.html
@@ -45,7 +45,7 @@
<td class="changeType"><span wicket:id="changeType">[change type]</span></td>
<td class="path"><span wicket:id="pathName">[commit path]</span></td>
<td class="hidden-phone rightAlign">
- <span wicket:id="filestore" style="margin-right:20px;" class="aui-lozenge aui-lozenge-moved"></span>
+ <span wicket:id="filestore" style="margin-right:20px;" class="fa fa-fw fa-external-link-square filestore-item"></span>
<span class="hidden-tablet" style="padding-right:20px;" wicket:id="diffStat"></span>
<span class="link">
<span class="hidden-tablet"><a wicket:id="patch"><wicket:message key="gb.patch"></wicket:message></a> | </span><a wicket:id="view"><wicket:message key="gb.view"></wicket:message></a><span class="hidden-tablet"> | <a wicket:id="raw"><wicket:message key="gb.raw"></wicket:message></a></span> | <a wicket:id="blame"><wicket:message key="gb.blame"></wicket:message></a> | <a wicket:id="history"><wicket:message key="gb.history"></wicket:message></a>
diff --git a/src/main/java/com/gitblit/wicket/pages/CommitDiffPage.java b/src/main/java/com/gitblit/wicket/pages/CommitDiffPage.java
index eaff2067..f127517d 100644
--- a/src/main/java/com/gitblit/wicket/pages/CommitDiffPage.java
+++ b/src/main/java/com/gitblit/wicket/pages/CommitDiffPage.java
@@ -148,6 +148,8 @@ public class CommitDiffPage extends RepositoryPage {
setChangeTypeTooltip(changeType, entry.changeType);
item.add(changeType);
item.add(new DiffStatPanel("diffStat", entry.insertions, entry.deletions, true));
+ item.add(WicketUtils.setHtmlTooltip(new Label("filestore", ""), getString("gb.filestore"))
+ .setVisible(entry.isFilestoreItem()));
boolean hasSubmodule = false;
String submodulePath = null;
@@ -200,8 +202,6 @@ public class CommitDiffPage extends RepositoryPage {
// quick links
if (entry.isSubmodule()) {
- item.add(new Label("filestore", getString("gb.filestore")).setVisible(false));
-
item.add(new ExternalLink("raw", "").setEnabled(false));
// submodule
item.add(new ExternalLink("patch", "").setEnabled(false));
@@ -219,8 +219,6 @@ public class CommitDiffPage extends RepositoryPage {
&& !entry.changeType.equals(ChangeType.DELETE)));
if (entry.isFilestoreItem()) {
- item.add(new Label("filestore", getString("gb.filestore")).setVisible(true));
-
item.add(new Link<Object>("view", null) {
private static final long serialVersionUID = 1L;
@@ -269,9 +267,6 @@ public class CommitDiffPage extends RepositoryPage {
getRequestCycle().setRequestTarget(new ResourceStreamRequestTarget(resourceStream, entry.path));
}});
} else {
-
- item.add(new Label("filestore", getString("gb.filestore")).setVisible(false));
-
item.add(new BookmarkablePageLink<Void>("view", BlobPage.class, WicketUtils
.newPathParameter(repositoryName, entry.commitId, entry.path))
.setEnabled(!entry.changeType.equals(ChangeType.DELETE)));
diff --git a/src/main/java/com/gitblit/wicket/pages/CommitPage.html b/src/main/java/com/gitblit/wicket/pages/CommitPage.html
index 23e94380..2cfbbea4 100644
--- a/src/main/java/com/gitblit/wicket/pages/CommitPage.html
+++ b/src/main/java/com/gitblit/wicket/pages/CommitPage.html
@@ -79,7 +79,7 @@
<td class="changeType"><span wicket:id="changeType">[change type]</span></td>
<td class="path"><span wicket:id="pathName">[commit path]</span></td>
<td class="hidden-phone rightAlign">
- <span wicket:id="filestore" style="margin-right:20px;" class="aui-lozenge aui-lozenge-moved"></span>
+ <span wicket:id="filestore" style="margin-right:20px;" class="fa fa-fw fa-external-link-square filestore-item"></span>
<span class="hidden-tablet" style="padding-right:20px;" wicket:id="diffStat"></span>
<span class="link">
<a wicket:id="diff"><wicket:message key="gb.diff"></wicket:message></a> | <span class="hidden-tablet"><a wicket:id="view"><wicket:message key="gb.view"></wicket:message></a> | <a wicket:id="raw"><wicket:message key="gb.raw"></wicket:message></a> | </span><a wicket:id="blame"><wicket:message key="gb.blame"></wicket:message></a> | <a wicket:id="history"><wicket:message key="gb.history"></wicket:message></a>
diff --git a/src/main/java/com/gitblit/wicket/pages/CommitPage.java b/src/main/java/com/gitblit/wicket/pages/CommitPage.java
index 417afe30..3998204d 100644
--- a/src/main/java/com/gitblit/wicket/pages/CommitPage.java
+++ b/src/main/java/com/gitblit/wicket/pages/CommitPage.java
@@ -16,43 +16,28 @@
package com.gitblit.wicket.pages;
import java.io.OutputStream;
-import java.sql.Blob;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
-import java.util.concurrent.Callable;
import org.apache.wicket.PageParameters;
-import org.apache.wicket.behavior.SimpleAttributeModifier;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.link.BookmarkablePageLink;
-import org.apache.wicket.markup.html.link.DownloadLink;
import org.apache.wicket.markup.html.link.ExternalLink;
import org.apache.wicket.markup.html.link.Link;
-import org.apache.wicket.markup.html.link.ResourceLink;
import org.apache.wicket.markup.repeater.Item;
import org.apache.wicket.markup.repeater.data.DataView;
import org.apache.wicket.markup.repeater.data.ListDataProvider;
-import org.apache.wicket.model.AbstractReadOnlyModel;
-import org.apache.wicket.model.IModel;
import org.apache.wicket.model.StringResourceModel;
-import org.apache.wicket.request.target.basic.RedirectRequestTarget;
import org.apache.wicket.request.target.resource.ResourceStreamRequestTarget;
-import org.apache.wicket.util.resource.AbstractResourceStream;
import org.apache.wicket.util.resource.AbstractResourceStreamWriter;
import org.apache.wicket.util.resource.IResourceStream;
-import org.bouncycastle.jcajce.provider.symmetric.Threefish;
import org.eclipse.jgit.diff.DiffEntry.ChangeType;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.revwalk.RevCommit;
import com.gitblit.Constants;
-import com.gitblit.GitBlit;
-import com.gitblit.manager.FilestoreManager;
-import com.gitblit.manager.GitblitManager;
-import com.gitblit.models.FilestoreModel;
import com.gitblit.models.GitNote;
-import com.gitblit.models.RepositoryModel;
import com.gitblit.models.PathModel.PathChangeModel;
import com.gitblit.models.SubmoduleModel;
import com.gitblit.models.UserModel;
@@ -185,13 +170,14 @@ public class CommitPage extends RepositoryPage {
@Override
public void populateItem(final Item<PathChangeModel> item) {
final PathChangeModel entry = item.getModelObject();
- final String filestoreItemUrl = entry.isFilestoreItem() ? JGitUtils.getLfsRepositoryUrl(getContextUrl(), repositoryName, entry.getFilestoreOid()) : null;
Label changeType = new Label("changeType", "");
WicketUtils.setChangeTypeCssClass(changeType, entry.changeType);
setChangeTypeTooltip(changeType, entry.changeType);
item.add(changeType);
item.add(new DiffStatPanel("diffStat", entry.insertions, entry.deletions, true));
+ item.add(WicketUtils.setHtmlTooltip(new Label("filestore", ""), getString("gb.filestore"))
+ .setVisible(entry.isFilestoreItem()));
boolean hasSubmodule = false;
String submodulePath = null;
@@ -256,8 +242,6 @@ public class CommitPage extends RepositoryPage {
if (entry.isSubmodule()) {
item.add(new ExternalLink("raw", "").setEnabled(false));
- item.add(new Label("filestore", getString("gb.filestore")).setVisible(false));
-
// submodule
item.add(new BookmarkablePageLink<Void>("diff", BlobDiffPage.class, WicketUtils
.newPathParameter(repositoryName, entry.commitId, entry.path))
@@ -276,10 +260,6 @@ public class CommitPage extends RepositoryPage {
&& !entry.changeType.equals(ChangeType.DELETE)));
if (entry.isFilestoreItem()) {
- item.add(new Label("filestore", getString("gb.filestore")).setVisible(true));
-
-
-
item.add(new Link<Object>("view", null) {
private static final long serialVersionUID = 1L;
@@ -329,8 +309,6 @@ public class CommitPage extends RepositoryPage {
}});
} else {
- item.add(new Label("filestore", getString("gb.filestore")).setVisible(false));
-
item.add(new BookmarkablePageLink<Void>("view", BlobPage.class, WicketUtils
.newPathParameter(repositoryName, entry.commitId, entry.path))
.setEnabled(!entry.changeType.equals(ChangeType.DELETE)));
diff --git a/src/main/java/com/gitblit/wicket/pages/TreePage.html b/src/main/java/com/gitblit/wicket/pages/TreePage.html
index c07f9c50..322c9011 100644
--- a/src/main/java/com/gitblit/wicket/pages/TreePage.html
+++ b/src/main/java/com/gitblit/wicket/pages/TreePage.html
@@ -23,7 +23,7 @@
<tr wicket:id="changedPath">
<td class="hidden-phone icon"><img wicket:id="pathIcon" /></td>
<td><span wicket:id="pathName"></span></td>
- <td class="hidden-phone filestore"><span wicket:id="filestore" class="aui-lozenge aui-lozenge-moved"></span></td>
+ <td class="hidden-phone filestore"><span wicket:id="filestore" class="fa fa-fw fa-external-link-square filestore-item"></span></td>
<td class="hidden-phone size"><span wicket:id="pathSize">[path size]</span></td>
<td class="hidden-phone mode"><span wicket:id="pathPermissions">[path permissions]</span></td>
<td class="treeLinks"><span wicket:id="pathLinks">[path links]</span></td>
diff --git a/src/main/java/com/gitblit/wicket/pages/TreePage.java b/src/main/java/com/gitblit/wicket/pages/TreePage.java
index 3961e044..eecad26e 100644
--- a/src/main/java/com/gitblit/wicket/pages/TreePage.java
+++ b/src/main/java/com/gitblit/wicket/pages/TreePage.java
@@ -98,15 +98,15 @@ public class TreePage extends RepositoryPage {
final PathModel entry = item.getModelObject();
item.add(new Label("pathPermissions", JGitUtils.getPermissionsFromMode(entry.mode)));
-
+ item.add(WicketUtils.setHtmlTooltip(new Label("filestore", ""), getString("gb.filestore"))
+ .setVisible(entry.isFilestoreItem()));
+
if (entry.isParentPath) {
// parent .. path
item.add(WicketUtils.newBlankImage("pathIcon"));
item.add(new Label("pathSize", ""));
item.add(new LinkPanel("pathName", null, entry.name, TreePage.class,
- WicketUtils
- .newPathParameter(repositoryName, id, entry.path)));
- item.add(new Label("filestore", getString("gb.filestore")).setVisible(false));
+ WicketUtils.newPathParameter(repositoryName, id, entry.path)));
item.add(new Label("pathLinks", ""));
} else {
if (entry.isTree()) {
@@ -117,8 +117,6 @@ public class TreePage extends RepositoryPage {
WicketUtils.newPathParameter(repositoryName, id,
entry.path)));
- item.add(new Label("filestore", getString("gb.filestore")).setVisible(false));
-
// links
Fragment links = new Fragment("pathLinks", "treeLinks", this);
links.add(new BookmarkablePageLink<Void>("tree", TreePage.class,
@@ -146,8 +144,6 @@ public class TreePage extends RepositoryPage {
getShortObjectId(submoduleId), TreePage.class,
WicketUtils.newPathParameter(submodulePath, submoduleId, "")).setEnabled(hasSubmodule));
- item.add(new Label("filestore", getString("gb.filestore")).setVisible(false));
-
Fragment links = new Fragment("pathLinks", "submoduleLinks", this);
links.add(new BookmarkablePageLink<Void>("view", SummaryPage.class,
WicketUtils.newRepositoryParameter(submodulePath)).setEnabled(hasSubmodule));
@@ -175,8 +171,6 @@ public class TreePage extends RepositoryPage {
Fragment links = new Fragment("pathLinks", "blobLinks", this);
if (entry.isFilestoreItem()) {
- item.add(new Label("filestore", getString("gb.filestore")).setVisible(true));
-
item.add(new LinkPanel("pathName", "list", displayPath, new Link<Object>("link", null) {
private static final long serialVersionUID = 1L;
@@ -250,8 +244,6 @@ public class TreePage extends RepositoryPage {
}});
} else {
- item.add(new Label("filestore", getString("gb.filestore")).setVisible(false));
-
item.add(new LinkPanel("pathName", "list", displayPath, BlobPage.class,
WicketUtils.newPathParameter(repositoryName, id,
path)));
diff --git a/src/main/resources/gitblit.css b/src/main/resources/gitblit.css
index 5b82e874..01991909 100644
--- a/src/main/resources/gitblit.css
+++ b/src/main/resources/gitblit.css
@@ -2356,3 +2356,7 @@ div.markdown table.text th, div.markdown table.text td {
.file-negative {
color:#D51900;
}
+
+.filestore-item {
+ color:#815b3a;
+} \ No newline at end of file