Skip to content

The Unified and Autonomous Development Platform

midwork

robin shineee2830fa2619
diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/repository/pullrequest/requestdetail/RequestDetailPage.java b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/repository/pullrequest/requestdetail/RequestDetailPage.java
index fc4565f3c0..138d926f2c 100644
--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/repository/pullrequest/requestdetail/RequestDetailPage.java
+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/repository/pullrequest/requestdetail/RequestDetailPage.java
@@ -77,6 +77,7 @@ import com.pmease.gitplex.web.model.EntityModel;
import com.pmease.gitplex.web.page.repository.NoCommitsPage;
import com.pmease.gitplex.web.page.repository.RepositoryPage;
import com.pmease.gitplex.web.page.repository.pullrequest.PullRequestPage;
+import com.pmease.gitplex.web.page.repository.pullrequest.requestdetail.attachments.RequestAttachmentsPage;
import com.pmease.gitplex.web.page.repository.pullrequest.requestdetail.compare.RequestComparePage;
import com.pmease.gitplex.web.page.repository.pullrequest.requestdetail.overview.RequestOverviewPage;
import com.pmease.gitplex.web.page.repository.pullrequest.requestdetail.updates.RequestUpdatesPage;
@@ -306,6 +307,7 @@ public abstract class RequestDetailPage extends PullRequestPage {
}
});
+ tabs.add(new RequestTab("Attachments", RequestAttachmentsPage.class));
add(new Tabbable("requestTabs", tabs).setOutputMarkupId(true));
diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/repository/pullrequest/requestdetail/attachments/RequestAttachmentsPage.html b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/repository/pullrequest/requestdetail/attachments/RequestAttachmentsPage.html
new file mode 100644
index 0000000000..dc7f8267cf
--- /dev/null
+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/repository/pullrequest/requestdetail/attachments/RequestAttachmentsPage.html
@@ -0,0 +1,18 @@
+<wicket:extend>
+ <div class="attachments">
+ <form wicket:id="form">
+ <div class="fileinput fileinput-new input-group" data-provides="fileinput">
+ <div class="form-control" data-trigger="fileinput"><i class="glyphicon glyphicon-file fileinput-exists"></i> <span class="fileinput-filename"></span></div>
+ <span class="input-group-addon btn btn-default btn-file"><span class="fileinput-new">Select file to upload</span><span class="fileinput-exists">Change</span><input wicket:id="fileUpload" type="file" name="..."></span>
+ <a href="#" class="input-group-addon btn btn-default fileinput-exists" data-dismiss="fileinput">Remove</a>
+ </div>
+ </form>
+ <table class="table table-condensed table-striped">
+ <tr wicket:id="attachment">
+ <td class="link"><a wicket:id="link"><span wicket:id="name"></span></a></td>
+ <td class="size"><span wicket:id="size"></span></td>
+ <td class="operations"><a wicket:id="delete"><i class="fa fa-trash"></i></a></td>
+ </tr>
+ </table>
+ </div>
+</wicket:extend>
\ No newline at end of file
diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/repository/pullrequest/requestdetail/attachments/RequestAttachmentsPage.java b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/repository/pullrequest/requestdetail/attachments/RequestAttachmentsPage.java
new file mode 100644
index 0000000000..1307f657bc
--- /dev/null
+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/repository/pullrequest/requestdetail/attachments/RequestAttachmentsPage.java
@@ -0,0 +1,44 @@
+package com.pmease.gitplex.web.page.repository.pullrequest.requestdetail.attachments;
+
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.markup.head.CssHeaderItem;
+import org.apache.wicket.markup.head.IHeaderResponse;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.request.mapper.parameter.PageParameters;
+import org.apache.wicket.request.resource.CssResourceReference;
+
+import com.pmease.gitplex.core.model.Repository;
+import com.pmease.gitplex.web.page.repository.pullrequest.requestdetail.RequestDetailPage;
+import com.pmease.gitplex.web.page.repository.pullrequest.requestlist.RequestListPage;
+
+import de.agilecoders.wicket.extensions.javascript.jasny.FileUploadField;
+
+@SuppressWarnings("serial")
+public class RequestAttachmentsPage extends RequestDetailPage {
+
+ public RequestAttachmentsPage(PageParameters params) {
+ super(params);
+ }
+
+ @Override
+ protected void onInitialize() {
+ super.onInitialize();
+
+ Form<?> form = new Form<Void>("form");
+ form.add(new FileUploadField("fileUpload", ));
+ add(form);
+ }
+
+ @Override
+ public void renderHead(IHeaderResponse response) {
+ super.renderHead(response);
+ response.render(CssHeaderItem.forReference(
+ new CssResourceReference(RequestAttachmentsPage.class, "request-attachments.css")));
+ }
+
+ @Override
+ protected void onSelect(AjaxRequestTarget target, Repository repository) {
+ setResponsePage(RequestListPage.class, paramsOf(repository));
+ }
+
+}
diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/repository/pullrequest/requestdetail/attachments/request-attachments.css b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/repository/pullrequest/requestdetail/attachments/request-attachments.css
new file mode 100644
index 0000000000..e69de29bb2