The Unified and Autonomous Development Platform
Refine branches and branch compare and new request page.
robin shine9a70cdb38b44
diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/GitPlexMappings.java b/gitplex.web/src/main/java/com/pmease/gitplex/web/GitPlexMappings.javaindex 77a61b2577..f2f509269e 100644--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/GitPlexMappings.java+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/GitPlexMappings.java@@ -39,10 +39,10 @@ import com.pmease.gitplex.web.page.repository.admin.integrationpolicy.Integratioimport com.pmease.gitplex.web.page.repository.code.blame.BlobBlamePage;import com.pmease.gitplex.web.page.repository.code.blob.RepoBlobPage;import com.pmease.gitplex.web.page.repository.code.blob.renderer.RawBlobResourceReference;-import com.pmease.gitplex.web.page.repository.code.branches.BranchesPage;+import com.pmease.gitplex.web.page.repository.code.branches.BranchComparePage;+import com.pmease.gitplex.web.page.repository.code.branches.RepoBranchesPage;import com.pmease.gitplex.web.page.repository.code.commit.RepoCommitPage;import com.pmease.gitplex.web.page.repository.code.commits.RepoCommitsPage;-import com.pmease.gitplex.web.page.repository.code.compare.BranchComparePage;import com.pmease.gitplex.web.page.repository.code.contributors.ContributorsPage;import com.pmease.gitplex.web.page.repository.code.tags.GitArchiveResourceReference;import com.pmease.gitplex.web.page.repository.code.tags.TagsPage;@@ -152,7 +152,7 @@ public class GitPlexMappings extends CompoundRequestMapper {"${user}/${repo}/compare", BranchComparePage.class));add(new PageParameterAwareMountedMapper("${user}/${repo}/branches",- BranchesPage.class));+ RepoBranchesPage.class));add(new PageParameterAwareMountedMapper("${user}/${repo}/tags",TagsPage.class));diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/assets/css/page.css b/gitplex.web/src/main/java/com/pmease/gitplex/web/assets/css/page.cssindex ad352daf46..93abe594b1 100644--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/assets/css/page.css+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/assets/css/page.css@@ -648,18 +648,21 @@ table.table-blob { width: 100%; }.branches>.body>.options>div.base {width: 240px;}.branches>.body>.options>div.search input {width: 240px;}.branches>.body>.options .pagination {margin: 0;}-table.branches td {white-space: nowrap;}-table.branches td.watch {width: 60px;}-table.branches td.actions {width: 1px;}-table.branches td.behind-ahead {width: 25%;}-table.branches td.behind {padding-right: 0;}-table.branches td.ahead {padding-left: 0;}-table.branches td.behind>div {border-right: 1px solid #333;}-table.branches td.behind-ahead div.text {margin: 0 4px;}-table.branches .bar {height: 12px;}-table.branches .ahead .bar {background: #666;}-table.branches .behind .bar {background: #ccc;}-table.branches td.summary>div, table.branches td.summary>div .name a {font-size: 13px; color: #666;}+.branches>.body>table.branches td {white-space: nowrap;}+.branches>.body>table.branches td.summary, .branches>.body>table.branches td.actions {width: 1%;}+.branches>.body>table.branches td.actions .fa.fa-times {color: red; margin-left: 8px;}+.branches>.body>table.branches td.actions span.fa.fa-times {color: #888;}+.branches>.body>table.branches td.behind {padding-right: 0;}+.branches>.body>table.branches td.ahead {padding-left: 0;}+.branches>.body>table.branches td.behind>div {border-right: 1px solid #333;}+.branches>.body>table.branches td.behind-ahead div.text {margin: 0 4px;}+.branches>.body>table.branches .bar {height: 12px;}+.branches>.body>table.branches .ahead .bar {background: #666;}+.branches>.body>table.branches .ahead .bar.request {background: #F1D763;}+.branches>.body>table.branches .behind .bar {background: #ccc;}+.branches>.body>table.branches .behind .bar.request {background: #F1D763;}+.branches>.body>.help-block .bar.request {background: #F1D763; font-size: 10px;}+.branches>.body>table.branches td.summary>div, table.branches td.summary>div .name a {font-size: 13px; color: #666;}#searching-branches {position: absolute; left: 50%; top: 250px; z-index: 100; display: none;}@@ -835,21 +838,18 @@ ul.status-help .description {color: #444; margin: 4px 0 8px 0; border-bottom: 1pul.status-help li:last-child .description {border-bottom: none;}/* NEW PULL REQUEST AND BRANCH COMPARE PAGE */-.new-request {padding: 20px;}-.new-request>.branches, .compare>.body>.branches {margin-bottom: 20px;}-.new-request>.branches td, .compare>.body>.branches td {background: #F2F2F2; border-radius: 4px; vertical-align: top;}-.new-request>.branches .actions, .compare>.body>.branches .actions {width: 1%; background: none; padding: 0 12px 0 8px;}-.new-request>.branches .direction, .compare>.body>.branches .direction {font-size: 48px; color: #999;}-.new-request>.branches .status {background: none;}--.new-request>div, .compare>.body>div {margin-bottom: 20px;}-.new-request .status .summary {font-size: 16px; padding: 0; margin-bottom: 8px;}-.new-request .can-send {border-radius: 4px; background: #F2F2F2; padding: 4px;}-.new-request .can-send form .title, .new-request .can-send form .comment {margin-bottom: 12px;}-.new-request .can-send textarea {min-height: 64px;}-.new-request .can-send .foot>div {margin-right: 12px;}-.new-request .can-send .foot label {font-weight: normal;}-.new-request .can-send .foot .help-block {margin: 0;}+.branch-compare>.body>div {margin-bottom: 20px;}+.branch-compare>.body>.branches {margin-bottom: 20px;}+.branch-compare>.body>.branches td {vertical-align: top;}+.branch-compare>.body>.branches td>div.title {font-size: 18px; margin-bottom: 8px;}+.branch-compare>.body>.branches td>div.branch {background: #F2F2F2; border-radius: 4px; vertical-align: top;}+.branch-compare>.body>.branches .actions {width: 1%; background: none; padding: 77px 10px 0 10px;}++.branch-compare>.body>.status .summary {font-size: 16px; padding: 0; margin-bottom: 8px;}+.new-request>.body>.status>.can-send form .title {margin-bottom: 20px;}+.new-request>.body>.status>.can-send form .description {margin-bottom: 8px;}+.new-request>.body>.status>.can-send form .description>h4 {margin-right: 24px;}+/* PULL REQUEST DETAIL PANEL */.request-detail {padding: 20px;}diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/repository/RepositoryPage.java b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/repository/RepositoryPage.javaindex 961d0eddbc..2c78317a7c 100644--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/repository/RepositoryPage.java+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/repository/RepositoryPage.java@@ -45,7 +45,8 @@ import com.pmease.gitplex.web.page.repository.admin.PermissionSettingPage;import com.pmease.gitplex.web.page.repository.admin.gatekeeper.GateKeeperPage;import com.pmease.gitplex.web.page.repository.admin.integrationpolicy.IntegrationPolicyPage;import com.pmease.gitplex.web.page.repository.code.blob.RepoBlobPage;-import com.pmease.gitplex.web.page.repository.code.branches.BranchesPage;+import com.pmease.gitplex.web.page.repository.code.branches.BranchComparePage;+import com.pmease.gitplex.web.page.repository.code.branches.RepoBranchesPage;import com.pmease.gitplex.web.page.repository.code.commit.RepoCommitPage;import com.pmease.gitplex.web.page.repository.code.commits.RepoCommitsPage;import com.pmease.gitplex.web.page.repository.code.contributors.ContributorsPage;@@ -203,7 +204,7 @@ public abstract class RepositoryPage extends AccountBasePage {List<Tab> codeTabs = new ArrayList<>();codeTabs.add(new RepositoryTab(Model.of("Files"), "fa fa-file-code", RepoTreePage.class, RepoBlobPage.class));codeTabs.add(new RepositoryTab(Model.of("Commits"), "fa fa-commit", RepoCommitsPage.class, RepoCommitPage.class));- codeTabs.add(new RepositoryTab(Model.of("Branches"), "fa fa-branch", BranchesPage.class));+ codeTabs.add(new RepositoryTab(Model.of("Branches"), "fa fa-branch", RepoBranchesPage.class, BranchComparePage.class));codeTabs.add(new RepositoryTab(Model.of("Tags"), "fa fa-tags", TagsPage.class));codeTabs.add(new RepositoryTab(Model.of("Contributors"), "fa fa-group-o", ContributorsPage.class));diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/repository/code/branches/BranchComparePage.html b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/repository/code/branches/BranchComparePage.htmlnew file mode 100644index 0000000000..bb11a0c4ff--- /dev/null+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/repository/code/branches/BranchComparePage.html@@ -0,0 +1,46 @@+<wicket:extend>+ <section class="branch-compare">+ <div class="head">Compare Branches</div>+ <div class="body">+ <table class="branches">+ <tr>+ <td class="target">+ <div class="title">Base</div>+ <div wicket:id="target" class="branch"></div>+ </td>+ <td class="actions">+ <a wicket:id="swap" class="swap btn btn-sm btn-default"><i class="fa fa-key-tab"></i> swap</a>+ </td>+ <td class="source">+ <div class="title">Compare</div>+ <div wicket:id="source" class="branch"></div>+ </td>+ </tr>+ </table>+ <div wicket:id="sameBranch" class="alert alert-warning status">+ <div class="summary">+ <span class="fa fa-lg fa-warning"></span>+ <span>Please select different branches to compare.</span>+ </div>+ </div>+ <div wicket:id="openedRequest" class="alert alert-info status">+ <div class="summary">+ <a wicket:id="view">Pull request #<span wicket:id="no"></span></a> is already open for this comparison:+ </div>+ <div wicket:id="title" class="detail"></div>+ </div>+ <div wicket:id="upToDate" class="alert alert-success status">+ <div class="summary">+ <span class="fa fa-lg fa-check-circle"></span>+ <span wicket:id="targetBranch"></span> is up to date with all commits from <span wicket:id="sourceBranch"></span>.+ </div>+ </div>+ <div>+ <a wicket:id="createRequest" class="btn btn-primary">Create Pull Request</a>+ </div>+ <div wicket:id="tabs"></div>+ <div wicket:id="tabPanel"></div>+ </div>+ </section>+ <div wicket:id="backToTop"></div>+</wicket:extend>\ No newline at end of filediff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/repository/code/compare/BranchComparePage.java b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/repository/code/branches/BranchComparePage.javasimilarity index 93%rename from gitplex.web/src/main/java/com/pmease/gitplex/web/page/repository/code/compare/BranchComparePage.javarename to gitplex.web/src/main/java/com/pmease/gitplex/web/page/repository/code/branches/BranchComparePage.javaindex 16b329e37a..90048c81ec 100644--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/repository/code/compare/BranchComparePage.java+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/repository/code/branches/BranchComparePage.java@@ -1,4 +1,4 @@-package com.pmease.gitplex.web.page.repository.code.compare;+package com.pmease.gitplex.web.page.repository.code.branches;import java.util.ArrayList;import java.util.List;@@ -133,7 +133,7 @@ public class BranchComparePage extends RepositoryPage {@Overrideprotected String load() {Branch target = targetModel.getObject();- Branch source = targetModel.getObject();+ Branch source = sourceModel.getObject();if (!target.getRepository().equals(source.getRepository())) {Git sandbox = new Git(FileUtils.createTempDir());try {@@ -246,16 +246,19 @@ public class BranchComparePage extends RepositoryPage {protected void onInitialize() {super.onInitialize();- new Label("requestInfo", new AbstractReadOnlyModel<String>() {+ add(new Link<Void>("view") {@Override- public String getObject() {- PullRequest request = requestModel.getObject();- return "#" + request.getId() + ": " + request.getTitle();+ protected void onInitialize() {+ super.onInitialize();+ add(new Label("no", new AbstractReadOnlyModel<String>() {++ @Override+ public String getObject() {+ return requestModel.getObject().getId().toString();+ }+ }));}-- });- add(new Link<Void>("viewRequest") {@Overridepublic void onClick() {@@ -265,6 +268,13 @@ public class BranchComparePage extends RepositoryPage {});+ add(new Label("title", new AbstractReadOnlyModel<String>() {++ @Override+ public String getObject() {+ return requestModel.getObject().getTitle();+ }+ }));}});@@ -274,7 +284,8 @@ public class BranchComparePage extends RepositoryPage {protected void onConfigure() {super.onConfigure();- setVisible(mergeBaseModel.getObject().equals(sourceModel.getObject().getHeadCommitHash()));+ setVisible(!targetModel.getObject().equals(sourceModel.getObject())+ && mergeBaseModel.getObject().equals(sourceModel.getObject().getHeadCommitHash()));}@Override@@ -283,16 +294,6 @@ public class BranchComparePage extends RepositoryPage {add(new BranchLink("sourceBranch", sourceModel));add(new BranchLink("targetBranch", targetModel));- add(new Link<Void>("swapBranches") {-- @Override- public void onClick() {- setResponsePage(- NewRequestPage.class,- paramsOf(getRepository(), targetModel.getObject(), sourceModel.getObject()));- }-- });}});diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/repository/code/branches/BranchesPage.html b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/repository/code/branches/RepoBranchesPage.htmlsimilarity index 67%rename from gitplex.web/src/main/java/com/pmease/gitplex/web/page/repository/code/branches/BranchesPage.htmlrename to gitplex.web/src/main/java/com/pmease/gitplex/web/page/repository/code/branches/RepoBranchesPage.htmlindex 2c96235c82..f9ab5edc50 100644--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/repository/code/branches/BranchesPage.html+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/repository/code/branches/RepoBranchesPage.html@@ -26,10 +26,7 @@<td class="behind behind-ahead"><div align="right"><div class="text">- <a wicket:id="behindLink">- <span class="fa fa-download" wicket:id="pullRequest"></span>- <span wicket:id="count"></span> behind- </a>+ <a wicket:id="behindLink"><span wicket:id="count"></span> behind</a></div><div class="bar" wicket:id="behindBar"></div></div>@@ -37,25 +34,23 @@<td class="ahead behind-ahead"><div><div class="text">- <a wicket:id="aheadLink">- <span wicket:id="count"></span> ahead- <span class="fa fa-upload" wicket:id="pullRequest"></span>- </a>+ <a wicket:id="aheadLink"><span wicket:id="count"></span> ahead</a></div><div class="bar" wicket:id="aheadBar"></div></div></td>- <td wicket:id="watch" class="watch">- <div class="btn-group">- <button wicket:id="unwatchRequests" class="btn btn-default" title="You are watching pull requests of this branch, click to unwatch"><i class="fa fa-eye-open"></i></button>- <button wicket:id="watchRequests" class="btn btn-default" title="You are not watching pull requests of this branch, click to watch"><i class="fa fa-eye-slash"></i></button>- </div>- </td>- <td class="actions">+ <td wicket:id="actions" class="actions">+ <button wicket:id="unwatchRequests" class="btn btn-default" title="You are watching pull requests of this branch, click to unwatch"><i class="fa fa-eye-slash"></i> Unwatch</button>+ <button wicket:id="watchRequests" class="btn btn-default" title="You are not watching pull requests of this branch, click to watch"><i class="fa fa-eye-open"></i> Watch</button><a wicket:id="delete" class="fa fa-times fa-lg" title="Delete this branch"></a></td></tr></table>+ <div class="help-block">+ <i class="fa fa-info-circle"></i> Yellow bars+ <span class="bar request"> </span>+ represent ahead/behind commits with a pull request opening.+ </div><div id="searching-branches" class="ajax-indicator"><img src="/assets/img/ajax-indicator.gif"></img></div></div></section>diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/repository/code/branches/BranchesPage.java b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/repository/code/branches/RepoBranchesPage.javasimilarity index 93%rename from gitplex.web/src/main/java/com/pmease/gitplex/web/page/repository/code/branches/BranchesPage.javarename to gitplex.web/src/main/java/com/pmease/gitplex/web/page/repository/code/branches/RepoBranchesPage.javaindex 8770030c65..680da2f3a7 100644--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/repository/code/branches/BranchesPage.java+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/repository/code/branches/RepoBranchesPage.java@@ -67,7 +67,6 @@ import com.pmease.gitplex.web.git.command.AheadBehindCommand;import com.pmease.gitplex.web.git.command.BranchForEachRefCommand;import com.pmease.gitplex.web.page.repository.NoCommitsPage;import com.pmease.gitplex.web.page.repository.RepositoryPage;-import com.pmease.gitplex.web.page.repository.code.compare.BranchComparePage;import com.pmease.gitplex.web.page.repository.code.tree.RepoTreePage;import com.pmease.gitplex.web.page.repository.pullrequest.RequestActivitiesPage;@@ -75,7 +74,7 @@ import de.agilecoders.wicket.core.markup.html.bootstrap.components.TooltipConfigimport de.agilecoders.wicket.core.markup.html.bootstrap.components.TooltipConfig.Placement;@SuppressWarnings("serial")-public class BranchesPage extends RepositoryPage {+public class RepoBranchesPage extends RepositoryPage {private Long baseBranchId;@@ -182,7 +181,7 @@ public class BranchesPage extends RepositoryPage {};- public BranchesPage(PageParameters params) {+ public RepoBranchesPage(PageParameters params) {super(params);if (!getRepository().git().hasCommits())@@ -218,7 +217,7 @@ public class BranchesPage extends RepositoryPage {@Overrideprotected void onUpdate(AjaxRequestTarget target) {- setResponsePage(BranchesPage.this);+ setResponsePage(RepoBranchesPage.this);}}));@@ -230,7 +229,7 @@ public class BranchesPage extends RepositoryPage {branchesContainer.setOutputMarkupId(true);add(branchesContainer);- PageableListView<Branch> branchesView;+ final PageableListView<Branch> branchesView;branchesContainer.add(branchesView = new PageableListView<Branch>("branches", new AbstractReadOnlyModel<List<Branch>>() {@Override@@ -306,15 +305,6 @@ public class BranchesPage extends RepositoryPage {protected void onInitialize() {super.onInitialize();add(new Label("count", ab.getBehind()));- add(new WebMarkupContainer("pullRequest") {-- @Override- protected void onConfigure() {- super.onConfigure();- setVisible(behindOpenRequestsModel.getObject().get(item.getModelObject().getName()) != null);- }-- });}@Override@@ -344,6 +334,13 @@ public class BranchesPage extends RepositoryPage {});item.add(new Label("behindBar") {+ @Override+ protected void onInitialize() {+ super.onInitialize();+ if (behindOpenRequestsModel.getObject().get(item.getModelObject().getName()) != null)+ add(AttributeAppender.append("class", " request"));+ }+@Overrideprotected void onComponentTag(ComponentTag tag) {super.onComponentTag(tag);@@ -365,15 +362,6 @@ public class BranchesPage extends RepositoryPage {protected void onInitialize() {super.onInitialize();add(new Label("count", ab.getAhead()));- add(new WebMarkupContainer("pullRequest") {-- @Override- protected void onConfigure() {- super.onConfigure();- setVisible(aheadOpenRequestsModel.getObject().get(item.getModelObject().getName()) != null);- }-- });}@Override@@ -403,6 +391,13 @@ public class BranchesPage extends RepositoryPage {});item.add(new Label("aheadBar") {+ @Override+ protected void onInitialize() {+ super.onInitialize();+ if (aheadOpenRequestsModel.getObject().get(item.getModelObject().getName()) != null)+ add(AttributeAppender.append("class", " request"));+ }+@Overrideprotected void onComponentTag(ComponentTag tag) {super.onComponentTag(tag);@@ -412,10 +407,10 @@ public class BranchesPage extends RepositoryPage {});- final WebMarkupContainer watchContainer = new WebMarkupContainer("watch");- item.add(watchContainer.setOutputMarkupId(true));+ final WebMarkupContainer actionsContainer = new WebMarkupContainer("actions");+ item.add(actionsContainer.setOutputMarkupId(true));- watchContainer.add(new AjaxLink<Void>("unwatchRequests") {+ actionsContainer.add(new AjaxLink<Void>("unwatchRequests") {@Overridepublic void onClick(AjaxRequestTarget target) {@@ -425,7 +420,7 @@ public class BranchesPage extends RepositoryPage {GitPlex.getInstance(Dao.class).remove(watch);requestWatchesModel.getObject().remove(branchName);}- target.add(watchContainer);+ target.add(actionsContainer);}@Override@@ -436,7 +431,7 @@ public class BranchesPage extends RepositoryPage {}});- watchContainer.add(new AjaxLink<Void>("watchRequests") {+ actionsContainer.add(new AjaxLink<Void>("watchRequests") {@Overridepublic void onClick(AjaxRequestTarget target) {@@ -444,7 +439,7 @@ public class BranchesPage extends RepositoryPage {watch.setBranch(item.getModelObject());watch.setUser(getCurrentUser());GitPlex.getInstance(Dao.class).persist(watch);- target.add(watchContainer);+ target.add(actionsContainer);}@Override@@ -457,7 +452,7 @@ public class BranchesPage extends RepositoryPage {});Link<Void> deleteLink;- item.add(deleteLink = new Link<Void>("delete") {+ actionsContainer.add(deleteLink = new Link<Void>("delete") {@Overridepublic void onClick() {@@ -495,7 +490,7 @@ public class BranchesPage extends RepositoryPage {PullRequest aheadOpen = aheadOpenRequestsModel.getObject().get(branch.getName());PullRequest behindOpen = behindOpenRequestsModel.getObject().get(branch.getName());if (aheadOpen != null || behindOpen != null) {- String hint = "This branch can not be deleted as there are <br>pull request openning against it.";+ String hint = "This branch can not be deleted as there are <br>pull request opening against it.";deleteLink.add(new TooltipBehavior(Model.of(hint), new TooltipConfig().withPlacement(Placement.left)));deleteLink.add(AttributeAppender.append("data-html", "true"));}@@ -503,7 +498,15 @@ public class BranchesPage extends RepositoryPage {});- add(pagingNavigator = new PagingNavigator("branchesPageNav", branchesView));+ add(pagingNavigator = new PagingNavigator("branchesPageNav", branchesView) {++ @Override+ protected void onConfigure() {+ super.onConfigure();+ setVisible(branchesView.getPageCount() > 1);+ }++ });pagingNavigator.setOutputMarkupPlaceholderTag(true);}diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/repository/code/compare/BranchComparePage.html b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/repository/code/compare/BranchComparePage.htmldeleted file mode 100644index 67911ece1d..0000000000--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/repository/code/compare/BranchComparePage.html+++ /dev/null@@ -1,48 +0,0 @@-<wicket:extend>- <section class="compare">- <div class="head">Compare Branches</div>- <div class="body">- <table class="branches">- <tr>- <td class="target">- <div wicket:id="target"></div>- </td>- <td class="actions">- <a wicket:id="swap" class="swap btn btn-xs btn-default">swap</a>- <div class="direction"><span class="fa fa-arrow-left fa-lg"></span></div>- <a wicket:id="createRequest" class="btn btn-primary btn-sm">Create Pull Request</a>- </td>- <td class="source">- <div wicket:id="source"></div>- </td>- </tr>- </table>- <div wicket:id="sameBranch" class="alert alert-warning">- <div class="summary">- <span class="fa fa-lg fa-warning"></span>- <span>Please select different branches to integrate.</span>- </div>- </div>- <div wicket:id="openedRequest" class="alert alert-info">- <div class="summary">- <span class="fa fa-lg fa-info-circle"></span>- <span>- An integration request is already open for this comparison.- <a wicket:id="viewRequest">View Request <span class="fa fa-arrow-right"></span></a>- </span>- </div>- <div wicket:id="requestInfo" class="detail" ></div>- </div>- <div wicket:id="upToDate" class="alert alert-success">- <div class="summary">- <span class="fa fa-lg fa-check-circle"></span>- <span wicket:id="targetBranch"></span> is up to date with all commits from <span wicket:id="sourceBranch"></span>.- Try <a wicket:id="swapBranches">swap source and target</a> for the comparison.- </div>- </div>- <div wicket:id="tabs"></div>- <div wicket:id="tabPanel"></div>- </div>- </section>- <div wicket:id="backToTop"></div>-</wicket:extend>\ No newline at end of filediff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/repository/pullrequest/NewRequestPage.html b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/repository/pullrequest/NewRequestPage.htmlindex 6af73ae8cb..48e55b93d0 100644--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/repository/pullrequest/NewRequestPage.html+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/repository/pullrequest/NewRequestPage.html@@ -1,34 +1,34 @@<wicket:extend>- <div class="new-request">- <table class="branches">- <tr>- <td class="target">- <div wicket:id="target"></div>- </td>- <td class="actions">- <a wicket:id="swap" class="swap btn btn-xs btn-default">swap</a>- <div class="direction"><span class="fa fa-arrow-left fa-lg"></span></div>- </td>- <td class="source">- <div wicket:id="source"></div>- </td>- </tr>- </table>- <div wicket:id="status" class="status"></div>- <div wicket:id="tabs"></div>- <div wicket:id="tabPanel"></div>- <div wicket:id="backToTop"></div>- </div>+ <section class="new-request branch-compare">+ <div class="head">Create Pull Request</div>+ <div class="body">+ <table class="branches">+ <tr>+ <td class="target">+ <div class="title">To</div>+ <div wicket:id="target" class="branch"></div>+ </td>+ <td class="actions">+ <a wicket:id="swap" class="swap btn btn-sm btn-default"><i class="fa fa-key-tab"></i> swap</a>+ </td>+ <td class="source">+ <div class="title">From</div>+ <div wicket:id="source" class="branch"></div>+ </td>+ </tr>+ </table>+ <div wicket:id="status" class="status"></div>+ <div wicket:id="tabs"></div>+ <div wicket:id="tabPanel"></div>+ <div wicket:id="backToTop"></div>+ </div>+ </section><wicket:fragment wicket:id="openedFrag"><div class="alert alert-info"><div class="summary">- <span class="fa fa-lg fa-info-circle"></span>- <span>- Below integration request is already open for selected branches.- <a wicket:id="viewRequest">View Request <span class="fa fa-arrow-right"></span></a>- </span>+ <a wicket:id="view">Pull request #<span wicket:id="no"></span></a> is already open for this comparison:</div>- <div wicket:id="requestInfo" class="detail" ></div>+ <div wicket:id="title" class="detail"></div></div></wicket:fragment><wicket:fragment wicket:id="sameBranchFrag">@@ -63,14 +63,16 @@<div class="can-send"><form wicket:id="form"><div class="title">- <input wicket:id="title" type="text" class="form-control" placeholder="Title has to be specified">- </div>- <div class="comment">- <textarea wicket:id="comment" class="form-control" rows="8" placeholder="Leave a comment"></textarea>+ <h4>Title</h4>+ <div>+ <input wicket:id="title" type="text" class="form-control" placeholder="Title has to be specified">+ </div></div>- <div class="foot">- <input wicket:id="send" type="submit" class="btn btn-primary btn-lg" value="Send Integration Request"></input>+ <div class="description">+ <h4 class="pull-left">Description</h4>+ <div wicket:id="comment"></div></div>+ <input wicket:id="send" type="submit" class="btn btn-primary" value="Send Pull Request"></input></form></div></wicket:fragment>diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/repository/pullrequest/NewRequestPage.java b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/repository/pullrequest/NewRequestPage.javaindex 5e20c4d8b5..db2bde4b37 100644--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/repository/pullrequest/NewRequestPage.java+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/repository/pullrequest/NewRequestPage.java@@ -13,7 +13,6 @@ import org.apache.wicket.ajax.AjaxRequestTarget;import org.apache.wicket.markup.html.basic.Label;import org.apache.wicket.markup.html.form.Button;import org.apache.wicket.markup.html.form.Form;-import org.apache.wicket.markup.html.form.TextArea;import org.apache.wicket.markup.html.form.TextField;import org.apache.wicket.markup.html.link.Link;import org.apache.wicket.markup.html.list.ListItem;@@ -34,6 +33,7 @@ import com.pmease.commons.loader.AppLoader;import com.pmease.commons.util.FileUtils;import com.pmease.commons.wicket.behavior.DisableIfBlankBehavior;import com.pmease.commons.wicket.component.backtotop.BackToTop;+import com.pmease.commons.wicket.component.markdown.MarkdownInput;import com.pmease.commons.wicket.component.tabbable.AjaxActionTab;import com.pmease.commons.wicket.component.tabbable.Tab;import com.pmease.commons.wicket.component.tabbable.Tabbable;@@ -243,7 +243,7 @@ public class NewRequestPage extends RepositoryPage {List<Tab> tabs = new ArrayList<>();- tabs.add(new AjaxActionTab(Model.of("Commits")) {+ tabs.add(new AjaxActionTab(Model.of("Pending Commits")) {@Overrideprotected void onSelect(AjaxRequestTarget target, Component tabLink) {@@ -307,8 +307,19 @@ public class NewRequestPage extends RepositoryPage {private Fragment newOpenedFrag() {Fragment fragment = new Fragment("status", "openedFrag", this);- fragment.add(new Label("requestInfo", "#" + pullRequest.getId() + ": " + pullRequest.getTitle()));- fragment.add(new Link<Void>("viewRequest") {+ fragment.add(new Link<Void>("view") {++ @Override+ protected void onInitialize() {+ super.onInitialize();+ add(new Label("no", new AbstractReadOnlyModel<String>() {++ @Override+ public String getObject() {+ return pullRequest.getId().toString();+ }+ }));+ }@Overridepublic void onClick() {@@ -318,6 +329,14 @@ public class NewRequestPage extends RepositoryPage {});+ fragment.add(new Label("title", new AbstractReadOnlyModel<String>() {++ @Override+ public String getObject() {+ return pullRequest.getTitle();+ }+ }));+return fragment;}@@ -422,7 +441,7 @@ public class NewRequestPage extends RepositoryPage {}).setRequired(true).add(new DisableIfBlankBehavior(form.get("send"))));- form.add(new TextArea<String>("comment", new IModel<String>() {+ form.add(new MarkdownInput("comment", new IModel<String>() {@Overridepublic void detach() {