</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
<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
<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
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
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
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
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
};\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
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