]> source.dussan.org Git - gitblit.git/commitdiff
Fix for #1042 - Filestore items now shown as icons 1044/head
authorPaul Martin <paul@paulsputer.com>
Wed, 6 Apr 2016 07:27:20 +0000 (08:27 +0100)
committerPaul Martin <paul@paulsputer.com>
Wed, 6 Apr 2016 18:31:41 +0000 (19:31 +0100)
src/main/java/com/gitblit/wicket/WicketUtils.java
src/main/java/com/gitblit/wicket/pages/CommitDiffPage.html
src/main/java/com/gitblit/wicket/pages/CommitDiffPage.java
src/main/java/com/gitblit/wicket/pages/CommitPage.html
src/main/java/com/gitblit/wicket/pages/CommitPage.java
src/main/java/com/gitblit/wicket/pages/TreePage.html
src/main/java/com/gitblit/wicket/pages/TreePage.java
src/main/resources/gitblit.css

index 0d48e2beb412f2d4f1061f3347a819cfc6c25f79..d9ff34a28212733935278c975651dbc43188be08 100644 (file)
@@ -73,8 +73,8 @@ public class WicketUtils {
                container.add(new SimpleAttributeModifier("style", background));\r
        }\r
 \r
-       public static void setHtmlTooltip(Component container, String value) {\r
-               container.add(new SimpleAttributeModifier("title", value));\r
+       public static Component setHtmlTooltip(Component container, String value) {\r
+               return container.add(new SimpleAttributeModifier("title", value));\r
        }\r
 \r
        public static void setInputPlaceholder(Component container, String value) {\r
index 254d7d0c4d4d9a6c00951864478a540ebf0b4ebd..20bf19f24ed31208e283e47f79701100bf9b24d7 100644 (file)
@@ -45,7 +45,7 @@
                        <td class="changeType"><span wicket:id="changeType">[change type]</span></td>           \r
                        <td class="path"><span wicket:id="pathName">[commit path]</span></td>                   \r
                        <td class="hidden-phone rightAlign">\r
-                               <span wicket:id="filestore" style="margin-right:20px;" class="aui-lozenge aui-lozenge-moved"></span>\r
+                               <span wicket:id="filestore" style="margin-right:20px;" class="fa fa-fw fa-external-link-square filestore-item"></span>\r
                                <span class="hidden-tablet" style="padding-right:20px;" wicket:id="diffStat"></span>\r
                                <span class="link">\r
                                        <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>\r
index eaff2067dc9cc855dc4b9fce2c97c0f69d0e41f8..f127517d0caf9baadf76bb4533351f4f77591887 100644 (file)
@@ -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)));
index 23e94380ce9ea930b6dcaa4de5d9638f49c091a7..2cfbbea416096b86cb567f67e4a14fe84cee883d 100644 (file)
@@ -79,7 +79,7 @@
                        <td class="changeType"><span wicket:id="changeType">[change type]</span></td>\r
                        <td class="path"><span wicket:id="pathName">[commit path]</span></td>   \r
                        <td class="hidden-phone rightAlign">\r
-                               <span wicket:id="filestore" style="margin-right:20px;" class="aui-lozenge aui-lozenge-moved"></span>\r
+                               <span wicket:id="filestore" style="margin-right:20px;" class="fa fa-fw fa-external-link-square filestore-item"></span>\r
                                <span class="hidden-tablet" style="padding-right:20px;" wicket:id="diffStat"></span>\r
                                <span class="link">\r
                                        <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>\r
index 417afe30fed3c604d0b66a894e39e5ed1a385364..3998204d1c0a0207a50b4ec952d47b9dfd2ea56b 100644 (file)
 package com.gitblit.wicket.pages;\r
 \r
 import java.io.OutputStream;\r
-import java.sql.Blob;\r
 import java.util.ArrayList;\r
 import java.util.Arrays;\r
 import java.util.List;\r
-import java.util.concurrent.Callable;\r
 \r
 import org.apache.wicket.PageParameters;\r
-import org.apache.wicket.behavior.SimpleAttributeModifier;\r
 import org.apache.wicket.markup.html.basic.Label;\r
 import org.apache.wicket.markup.html.link.BookmarkablePageLink;\r
-import org.apache.wicket.markup.html.link.DownloadLink;\r
 import org.apache.wicket.markup.html.link.ExternalLink;\r
 import org.apache.wicket.markup.html.link.Link;\r
-import org.apache.wicket.markup.html.link.ResourceLink;\r
 import org.apache.wicket.markup.repeater.Item;\r
 import org.apache.wicket.markup.repeater.data.DataView;\r
 import org.apache.wicket.markup.repeater.data.ListDataProvider;\r
-import org.apache.wicket.model.AbstractReadOnlyModel;\r
-import org.apache.wicket.model.IModel;\r
 import org.apache.wicket.model.StringResourceModel;\r
-import org.apache.wicket.request.target.basic.RedirectRequestTarget;\r
 import org.apache.wicket.request.target.resource.ResourceStreamRequestTarget;\r
-import org.apache.wicket.util.resource.AbstractResourceStream;\r
 import org.apache.wicket.util.resource.AbstractResourceStreamWriter;\r
 import org.apache.wicket.util.resource.IResourceStream;\r
-import org.bouncycastle.jcajce.provider.symmetric.Threefish;\r
 import org.eclipse.jgit.diff.DiffEntry.ChangeType;\r
 import org.eclipse.jgit.lib.Repository;\r
 import org.eclipse.jgit.revwalk.RevCommit;\r
 \r
 import com.gitblit.Constants;\r
-import com.gitblit.GitBlit;\r
-import com.gitblit.manager.FilestoreManager;\r
-import com.gitblit.manager.GitblitManager;\r
-import com.gitblit.models.FilestoreModel;\r
 import com.gitblit.models.GitNote;\r
-import com.gitblit.models.RepositoryModel;\r
 import com.gitblit.models.PathModel.PathChangeModel;\r
 import com.gitblit.models.SubmoduleModel;\r
 import com.gitblit.models.UserModel;\r
@@ -185,13 +170,14 @@ public class CommitPage extends RepositoryPage {
                        @Override\r
                        public void populateItem(final Item<PathChangeModel> item) {\r
                                final PathChangeModel entry = item.getModelObject();\r
-                               final String filestoreItemUrl = entry.isFilestoreItem() ? JGitUtils.getLfsRepositoryUrl(getContextUrl(), repositoryName, entry.getFilestoreOid()) : null;\r
                                \r
                                Label changeType = new Label("changeType", "");\r
                                WicketUtils.setChangeTypeCssClass(changeType, entry.changeType);\r
                                setChangeTypeTooltip(changeType, entry.changeType);\r
                                item.add(changeType);\r
                                item.add(new DiffStatPanel("diffStat", entry.insertions, entry.deletions, true));\r
+                               item.add(WicketUtils.setHtmlTooltip(new Label("filestore", ""), getString("gb.filestore"))\r
+                                                                       .setVisible(entry.isFilestoreItem()));\r
 \r
                                boolean hasSubmodule = false;\r
                                String submodulePath = null;\r
@@ -256,8 +242,6 @@ public class CommitPage extends RepositoryPage {
                                if (entry.isSubmodule()) {\r
                                        item.add(new ExternalLink("raw", "").setEnabled(false));\r
 \r
-                                       item.add(new Label("filestore", getString("gb.filestore")).setVisible(false));\r
-                                       \r
                                        // submodule\r
                                        item.add(new BookmarkablePageLink<Void>("diff", BlobDiffPage.class, WicketUtils\r
                                                        .newPathParameter(repositoryName, entry.commitId, entry.path))\r
@@ -276,10 +260,6 @@ public class CommitPage extends RepositoryPage {
                                                                        && !entry.changeType.equals(ChangeType.DELETE)));\r
                                        \r
                                        if (entry.isFilestoreItem()) {\r
-                                               item.add(new Label("filestore", getString("gb.filestore")).setVisible(true));\r
-                                               \r
-                                               \r
-                                               \r
                                                item.add(new Link<Object>("view", null) {\r
                                                         \r
                                                        private static final long serialVersionUID = 1L;\r
@@ -329,8 +309,6 @@ public class CommitPage extends RepositoryPage {
                                                    }});\r
                                                                                                \r
                                        } else {\r
-                                               item.add(new Label("filestore", getString("gb.filestore")).setVisible(false));\r
-                                               \r
                                                item.add(new BookmarkablePageLink<Void>("view", BlobPage.class, WicketUtils\r
                                                                .newPathParameter(repositoryName, entry.commitId, entry.path))\r
                                                                .setEnabled(!entry.changeType.equals(ChangeType.DELETE)));\r
index c07f9c508f42af1776fcc7f3060e26318705edf1..322c90112e4e09a43b4ed237e5564dc69fd65b06 100644 (file)
@@ -23,7 +23,7 @@
                <tr wicket:id="changedPath">\r
                        <td class="hidden-phone icon"><img wicket:id="pathIcon" /></td>\r
                        <td><span wicket:id="pathName"></span></td>\r
-                       <td class="hidden-phone filestore"><span wicket:id="filestore" class="aui-lozenge aui-lozenge-moved"></span></td>\r
+                       <td class="hidden-phone filestore"><span wicket:id="filestore" class="fa fa-fw fa-external-link-square filestore-item"></span></td>\r
                        <td class="hidden-phone size"><span wicket:id="pathSize">[path size]</span></td>\r
                        <td class="hidden-phone mode"><span wicket:id="pathPermissions">[path permissions]</span></td>\r
                        <td class="treeLinks"><span wicket:id="pathLinks">[path links]</span></td>\r
index 3961e044f1bb657b222d2e397e2274a9120376fa..eecad26e024a53e5c2ce1571a08a7d7aa2df01b4 100644 (file)
@@ -98,15 +98,15 @@ public class TreePage extends RepositoryPage {
                                final PathModel entry = item.getModelObject();\r
                                \r
                                item.add(new Label("pathPermissions", JGitUtils.getPermissionsFromMode(entry.mode)));\r
-                               \r
+                               item.add(WicketUtils.setHtmlTooltip(new Label("filestore", ""), getString("gb.filestore"))\r
+                                                                       .setVisible(entry.isFilestoreItem()));\r
+\r
                                if (entry.isParentPath) {\r
                                        // parent .. path\r
                                        item.add(WicketUtils.newBlankImage("pathIcon"));\r
                                        item.add(new Label("pathSize", ""));\r
                                        item.add(new LinkPanel("pathName", null, entry.name, TreePage.class,\r
-                                                       WicketUtils\r
-                                                                       .newPathParameter(repositoryName, id, entry.path)));\r
-                                       item.add(new Label("filestore", getString("gb.filestore")).setVisible(false));\r
+                                                       WicketUtils.newPathParameter(repositoryName, id, entry.path)));\r
                                        item.add(new Label("pathLinks", ""));\r
                                } else {\r
                                        if (entry.isTree()) {\r
@@ -117,8 +117,6 @@ public class TreePage extends RepositoryPage {
                                                                WicketUtils.newPathParameter(repositoryName, id,\r
                                                                                entry.path)));\r
 \r
-                                               item.add(new Label("filestore", getString("gb.filestore")).setVisible(false));\r
-\r
                                                // links\r
                                                Fragment links = new Fragment("pathLinks", "treeLinks", this);\r
                                                links.add(new BookmarkablePageLink<Void>("tree", TreePage.class,\r
@@ -146,8 +144,6 @@ public class TreePage extends RepositoryPage {
                                                                getShortObjectId(submoduleId), TreePage.class,\r
                                                                WicketUtils.newPathParameter(submodulePath, submoduleId, "")).setEnabled(hasSubmodule));\r
 \r
-                                               item.add(new Label("filestore", getString("gb.filestore")).setVisible(false));\r
-                                               \r
                                                Fragment links = new Fragment("pathLinks", "submoduleLinks", this);\r
                                                links.add(new BookmarkablePageLink<Void>("view", SummaryPage.class,\r
                                                                WicketUtils.newRepositoryParameter(submodulePath)).setEnabled(hasSubmodule));\r
@@ -175,8 +171,6 @@ public class TreePage extends RepositoryPage {
                                                Fragment links = new Fragment("pathLinks", "blobLinks", this);\r
                                                \r
                                                if (entry.isFilestoreItem()) {\r
-                                                       item.add(new Label("filestore", getString("gb.filestore")).setVisible(true));\r
-                                                       \r
                                                        item.add(new LinkPanel("pathName", "list", displayPath, new Link<Object>("link", null) {\r
                                                                 \r
                                                                private static final long serialVersionUID = 1L;\r
@@ -250,8 +244,6 @@ public class TreePage extends RepositoryPage {
                                                            }});\r
                                                        \r
                                                } else {\r
-                                                       item.add(new Label("filestore", getString("gb.filestore")).setVisible(false));\r
-                                                       \r
                                                        item.add(new LinkPanel("pathName", "list", displayPath, BlobPage.class,\r
                                                                        WicketUtils.newPathParameter(repositoryName, id,\r
                                                                                        path)));\r
index 5b82e87487db510e7e8a0bc26fa3fbef2b5462fb..0199190970dfae4f20b04de71f249554081e8b1b 100644 (file)
@@ -2356,3 +2356,7 @@ div.markdown table.text th, div.markdown table.text td {
 .file-negative {\r
        color:#D51900;\r
 }\r
+\r
+.filestore-item {\r
+       color:#815b3a;\r
+}
\ No newline at end of file