diff options
author | James Moger <james.moger@gitblit.com> | 2014-03-07 14:59:02 -0500 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2014-03-07 14:59:02 -0500 |
commit | 4affd0a3a4fe086b31a87d56616f74093d2ac715 (patch) | |
tree | a3183d1798bd7447e6188fe845915ef7b9443564 /src | |
parent | 31e1bfd91836f35a6482431956a03b831e9ae956 (diff) | |
download | gitblit-4affd0a3a4fe086b31a87d56616f74093d2ac715.tar.gz gitblit-4affd0a3a4fe086b31a87d56616f74093d2ac715.zip |
Display an explanation in ticket page if the user can't propose commits
Diffstat (limited to 'src')
3 files changed, 39 insertions, 3 deletions
diff --git a/src/main/java/com/gitblit/wicket/GitBlitWebApp.properties b/src/main/java/com/gitblit/wicket/GitBlitWebApp.properties index 1a907bab..e52623e6 100644 --- a/src/main/java/com/gitblit/wicket/GitBlitWebApp.properties +++ b/src/main/java/com/gitblit/wicket/GitBlitWebApp.properties @@ -662,4 +662,10 @@ gb.mergeTo = merge to gb.labels = labels gb.reviewers = reviewers gb.voters = voters -gb.mentions = mentions
\ No newline at end of file +gb.mentions = mentions +gb.canNotProposePatchset = can not propose a patchset +gb.repositoryIsMirror = This repository is a read-only mirror. +gb.repositoryIsFrozen = This repository is frozen. +gb.repositoryDoesNotAcceptPatchsets = This repository does not accept patchsets. +gb.serverDoesNotAcceptPatchsets = This server does not accept patchsets. +gb.ticketIsClosed = This ticket is closed.
\ No newline at end of file diff --git a/src/main/java/com/gitblit/wicket/pages/TicketPage.html b/src/main/java/com/gitblit/wicket/pages/TicketPage.html index 6fcf96c8..a2f105d3 100644 --- a/src/main/java/com/gitblit/wicket/pages/TicketPage.html +++ b/src/main/java/com/gitblit/wicket/pages/TicketPage.html @@ -298,6 +298,22 @@ pt push</pre> </wicket:fragment>
+<!-- CAN NOT PROPOSE FRAGMENT -->
+<wicket:fragment wicket:id="canNotProposeFragment">
+ <div class="featureWelcome">
+ <div class="row">
+ <div class="icon span2 hidden-phone"><i class="fa fa-ban"></i></div>
+ <div class="span9">
+ <h1><wicket:message key="gb.canNotProposePatchset"></wicket:message></h1>
+ <div class="markdown">
+ <p><span wicket:id="reason"></span></p>
+ </div>
+ </div>
+ </div>
+ </div>
+</wicket:fragment>
+
+
<!-- PATCHSET FRAGMENT -->
<wicket:fragment wicket:id="patchsetFragment">
<div class="row" style="padding: 0px 0px 20px;">
diff --git a/src/main/java/com/gitblit/wicket/pages/TicketPage.java b/src/main/java/com/gitblit/wicket/pages/TicketPage.java index 4be9e69f..7b492dc2 100644 --- a/src/main/java/com/gitblit/wicket/pages/TicketPage.java +++ b/src/main/java/com/gitblit/wicket/pages/TicketPage.java @@ -744,8 +744,22 @@ public class TicketPage extends TicketBasePage { changeIdFrag.add(new Label("gitWorkflowSteps", getProposeWorkflow("propose_git.md", repoUrl, ticket.number)).setEscapeModelStrings(false));
add(changeIdFrag);
} else {
- // ticket is resolved OR repository is rejecting new patchsets
- add(new Label("patchset").setVisible(false));
+ // explain why you can't propose a patchset
+ Fragment fragment = new Fragment("patchset", "canNotProposeFragment", this);
+ String reason = "";
+ if (ticket.isClosed()) {
+ reason = getString("gb.ticketIsClosed");
+ } else if (repository.isMirror) {
+ reason = getString("gb.repositoryIsMirror");
+ } else if (repository.isFrozen) {
+ reason = getString("gb.repositoryIsFrozen");
+ } else if (!repository.acceptNewPatchsets) {
+ reason = getString("gb.repositoryDoesNotAcceptPatchsets");
+ } else {
+ reason = getString("gb.serverDoesNotAcceptPatchsets");
+ }
+ fragment.add(new Label("reason", reason));
+ add(fragment);
}
} else {
// show current patchset
|