]> source.dussan.org Git - gitblit.git/commitdiff
Remove the edit link and the rss feed link from the repositories panel 73/73/1
authorJames Moger <james.moger@gitblit.com>
Thu, 15 May 2014 12:11:39 +0000 (08:11 -0400)
committerJames Moger <james.moger@gitblit.com>
Thu, 15 May 2014 12:11:39 +0000 (08:11 -0400)
src/main/java/com/gitblit/wicket/panels/RepositoriesPanel.html
src/main/java/com/gitblit/wicket/panels/RepositoriesPanel.java

index c3ec2e27f66d0f08cb09a05504820efdc02eed0d..9ac525ad77821987a358f2a8e8ab2d88d57014f6 100644 (file)
                </div>  \r
        </wicket:fragment>\r
 \r
-       <wicket:fragment wicket:id="repositoryOwnerLinks">\r
-               <span class="link"><a wicket:id="editRepository"><wicket:message key="gb.edit">[edit]</wicket:message></a></span>\r
-       </wicket:fragment>\r
-\r
        <wicket:fragment wicket:id="flatRepositoryHeader">\r
                <tr>\r
                        <th class="left" wicket:id="orderByRepository">\r
@@ -56,8 +52,7 @@
                        <th class="hidden-tablet hidden-phone" wicket:id="orderByOwner"><wicket:message key="gb.owner">Owner</wicket:message></th>\r
                        <th class="hidden-phone"></th>\r
                        <th wicket:id="orderByDate"><wicket:message key="gb.lastChange">Last Change</wicket:message></th>\r
-                       <th class="hidden-phone"></th>\r
-                       <th class="right"></th>\r
+                       <th class="right hidden-phone"></th>\r
                </tr>\r
        </wicket:fragment>\r
        \r
@@ -71,8 +66,7 @@
                        <th class="hidden-tablet hidden-phone"><span><wicket:message key="gb.owner">Owner</wicket:message></span></th>\r
                        <th class="hidden-phone"></th>\r
                        <th><wicket:message key="gb.lastChange">Last Change</wicket:message></th>\r
-                       <th class="hidden-phone"></th>\r
-                       <th class="right"></th>\r
+                       <th class="right hidden-phone"></th>\r
                </tr>\r
        </wicket:fragment>\r
        \r
         <td class="hidden-tablet hidden-phone author"><span wicket:id="repositoryOwner">[repository owner]</span></td>\r
         <td class="hidden-phone" style="text-align: right;padding-right:10px;"><img class="inlineIcon" wicket:id="sparkleshareIcon" /><img class="inlineIcon" wicket:id="mirrorIcon" /><img class="inlineIcon" wicket:id="forkIcon" /><img class="inlineIcon" wicket:id="frozenIcon" /><img class="inlineIcon" wicket:id="federatedIcon" /><img class="inlineIcon" wicket:id="accessRestrictionIcon" /></td>\r
         <td><span wicket:id="repositoryLastChange">[last change]</span></td>\r
-        <td class="hidden-phone" style="text-align: right;padding-right:15px;"><span style="font-size:0.8em;" wicket:id="repositorySize">[repository size]</span></td>\r
-        <td class="rightAlign">\r
-               <span class="hidden-phone">\r
-                       <span wicket:id="repositoryLinks"></span>\r
-                               <a style="text-decoration: none;" wicket:id="syndication" wicket:message="title:gb.feed">\r
-                                       <img style="border:0px;vertical-align:middle;" src="feed_16x16.png"></img>\r
-                               </a>\r
-                       </span>\r
-               </td>                           \r
+        <td class="rightAlign hidden-phone" style="text-align: right;padding-right:15px;"><span style="font-size:0.8em;" wicket:id="repositorySize">[repository size]</span></td>\r
        </wicket:fragment>\r
        \r
 </wicket:panel>\r
index 54e2aab9104f82d9f87387978383925ef87c8838..d8e23bea2f317bef7ae355bc74590ce70e57b657 100644 (file)
@@ -31,7 +31,6 @@ import org.apache.wicket.extensions.markup.html.repeater.util.SortParam;
 import org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider;\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.ExternalLink;\r
 import org.apache.wicket.markup.html.link.Link;\r
 import org.apache.wicket.markup.html.panel.Fragment;\r
 import org.apache.wicket.markup.repeater.Item;\r
@@ -46,7 +45,6 @@ import com.gitblit.Keys;
 import com.gitblit.models.ProjectModel;\r
 import com.gitblit.models.RepositoryModel;\r
 import com.gitblit.models.UserModel;\r
-import com.gitblit.servlet.SyndicationServlet;\r
 import com.gitblit.utils.ArrayUtils;\r
 import com.gitblit.utils.ModelUtils;\r
 import com.gitblit.utils.StringUtils;\r
@@ -140,12 +138,11 @@ public class RepositoriesPanel extends BasePanel {
                                Collections.sort(subModels);\r
                                groupedModels.addAll(subModels);\r
                        }\r
-                       dp = new RepositoriesProvider(groupedModels);\r
+                       dp = new ListDataProvider<RepositoryModel>(groupedModels);\r
                } else {\r
                        dp = new SortableRepositoriesProvider(models);\r
                }\r
 \r
-               final String baseUrl = WicketUtils.getGitblitURL(getRequest());\r
                final boolean showSwatch = app().settings().getBoolean(Keys.web.repositoryListSwatches, true);\r
 \r
                DataView<RepositoryModel> dataView = new DataView<RepositoryModel>("row", dp) {\r
@@ -319,18 +316,6 @@ public class RepositoriesPanel extends BasePanel {
                                        WicketUtils.setHtmlTooltip(lastChangeLabel, getString("gb.author") + ": " + entry.lastChangeAuthor);\r
                                }\r
 \r
-                               if (user != null && user.canAdmin(entry)) {\r
-                                       Fragment repositoryLinks = new Fragment("repositoryLinks",\r
-                                                       "repositoryOwnerLinks", this);\r
-                                       repositoryLinks.add(new BookmarkablePageLink<Void>("editRepository",\r
-                                                       EditRepositoryPage.class, WicketUtils\r
-                                                                       .newRepositoryParameter(entry.name)));\r
-                                       row.add(repositoryLinks);\r
-                               } else {\r
-                                       row.add(new Label("repositoryLinks"));\r
-                               }\r
-                               row.add(new ExternalLink("syndication", SyndicationServlet.asLink(baseUrl,\r
-                                               entry.name, null, 0)).setVisible(linksActive));\r
                                WicketUtils.setAlternatingBackground(item, counter);\r
                                counter++;\r
                        }\r
@@ -387,59 +372,6 @@ public class RepositoriesPanel extends BasePanel {
                };\r
        }\r
 \r
-       private static class RepositoriesProvider extends ListDataProvider<RepositoryModel> {\r
-\r
-               private static final long serialVersionUID = 1L;\r
-\r
-               public RepositoriesProvider(List<RepositoryModel> list) {\r
-                       super(list);\r
-               }\r
-\r
-               @Override\r
-               public List<RepositoryModel> getData() {\r
-                       return super.getData();\r
-               }\r
-\r
-               public void remove(RepositoryModel model) {\r
-                       int index = getData().indexOf(model);\r
-                       RepositoryModel groupModel = null;\r
-                       if (index == (getData().size() - 1)) {\r
-                               // last element\r
-                               if (index > 0) {\r
-                                       // previous element is group header, then this is last\r
-                                       // repository in group. remove group too.\r
-                                       if (getData().get(index - 1) instanceof GroupRepositoryModel) {\r
-                                               groupModel = getData().get(index - 1);\r
-                                       }\r
-                               }\r
-                       } else if (index < (getData().size() - 1)) {\r
-                               // not last element. check next element for group match.\r
-                               if (getData().get(index - 1) instanceof GroupRepositoryModel\r
-                                               && getData().get(index + 1) instanceof GroupRepositoryModel) {\r
-                                       // repository is sandwiched by group headers so this\r
-                                       // repository is the only element in the group. remove\r
-                                       // group.\r
-                                       groupModel = getData().get(index - 1);\r
-                               }\r
-                       }\r
-\r
-                       if (groupModel == null) {\r
-                               // Find the group and decrement the count\r
-                               for (int i = index; i >= 0; i--) {\r
-                                       if (getData().get(i) instanceof GroupRepositoryModel) {\r
-                                               ((GroupRepositoryModel) getData().get(i)).count--;\r
-                                               break;\r
-                                       }\r
-                               }\r
-                       } else {\r
-                               // Remove the group header\r
-                               getData().remove(groupModel);\r
-                       }\r
-\r
-                       getData().remove(model);\r
-               }\r
-       }\r
-\r
        private static class SortableRepositoriesProvider extends SortableDataProvider<RepositoryModel> {\r
 \r
                private static final long serialVersionUID = 1L;\r
@@ -451,10 +383,6 @@ public class RepositoriesPanel extends BasePanel {
                        setSort(SortBy.date.name(), false);\r
                }\r
 \r
-               public void remove(RepositoryModel model) {\r
-                       list.remove(model);\r
-               }\r
-\r
                @Override\r
                public int size() {\r
                        if (list == null) {\r