| | |
| | |
|
| | | import java.util.List;
|
| | |
|
| | | import org.apache.wicket.Component;
|
| | | import org.apache.wicket.markup.html.basic.Label;
|
| | | import org.apache.wicket.markup.html.panel.Panel;
|
| | | import org.apache.wicket.markup.repeater.Item;
|
| | |
| | |
|
| | | public CompressedDownloadsPanel(String id, final String baseUrl, final String repositoryName, final String objectId, final String path) {
|
| | | super(id);
|
| | | |
| | |
|
| | | List<String> types = GitBlit.getStrings(Keys.web.compressedDownloads);
|
| | | if (types.isEmpty()) {
|
| | | types.add(Format.zip.name());
|
| | | types.add(Format.gz.name());
|
| | | }
|
| | | |
| | |
|
| | | ListDataProvider<String> refsDp = new ListDataProvider<String>(types);
|
| | | DataView<String> refsView = new DataView<String>("compressedLinks", refsDp) {
|
| | | private static final long serialVersionUID = 1L;
|
| | |
| | | super.onBeforeRender();
|
| | | counter = 0;
|
| | | }
|
| | | |
| | |
|
| | | @Override
|
| | | public void populateItem(final Item<String> item) {
|
| | | String compressionType = item.getModelObject();
|
| | | Format format = Format.fromName(compressionType);
|
| | | |
| | |
|
| | | String href = DownloadZipServlet.asLink(baseUrl, repositoryName,
|
| | | objectId, path, format);
|
| | | LinkPanel c = new LinkPanel("compressedLink", null, format.name(), href);
|
| | |
| | | }
|
| | | };
|
| | | add(refsView);
|
| | | |
| | |
|
| | | setVisible(GitBlit.getBoolean(Keys.web.allowZipDownloads, true));
|
| | | }
|
| | | } |