diff options
author | James Moger <james.moger@gitblit.com> | 2014-04-25 23:52:30 -0400 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2014-05-01 14:27:28 -0400 |
commit | ce048e750f7ae986dddfc8ab9b57750114d2b7b9 (patch) | |
tree | 05c085d9fdfaf00109a31fd98ef12f41012b2357 /src/main/java/com/gitblit/wicket/pages/TicketsPage.java | |
parent | 16ef06d210bec7dd5b44d82f70d9f7bb9e4dbf6f (diff) | |
download | gitblit-ce048e750f7ae986dddfc8ab9b57750114d2b7b9.tar.gz gitblit-ce048e750f7ae986dddfc8ab9b57750114d2b7b9.zip |
Create and update milestone pages with rename support
Diffstat (limited to 'src/main/java/com/gitblit/wicket/pages/TicketsPage.java')
-rw-r--r-- | src/main/java/com/gitblit/wicket/pages/TicketsPage.java | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/main/java/com/gitblit/wicket/pages/TicketsPage.java b/src/main/java/com/gitblit/wicket/pages/TicketsPage.java index ca509e28..984b3754 100644 --- a/src/main/java/com/gitblit/wicket/pages/TicketsPage.java +++ b/src/main/java/com/gitblit/wicket/pages/TicketsPage.java @@ -42,6 +42,7 @@ import com.gitblit.Constants; import com.gitblit.Constants.AccessPermission;
import com.gitblit.Keys;
import com.gitblit.models.RegistrantAccessPermission;
+import com.gitblit.models.RepositoryModel;
import com.gitblit.models.TicketModel;
import com.gitblit.models.TicketModel.Status;
import com.gitblit.models.UserModel;
@@ -646,7 +647,19 @@ public class TicketsPage extends TicketBasePage { };
add(ticketsView);
- List<TicketMilestone> allMilestones = app().tickets().getMilestones(getRepositoryModel());
+ // new milestone link
+ RepositoryModel repositoryModel = getRepositoryModel();
+ final boolean acceptingUpdates = app().tickets().isAcceptingTicketUpdates(repositoryModel)
+ && user != null && user.canAdmin(getRepositoryModel());
+ if (acceptingUpdates) {
+ add(new LinkPanel("newMilestone", null, getString("gb.newMilestone"),
+ NewMilestonePage.class, WicketUtils.newRepositoryParameter(repositoryName)));
+ } else {
+ add(new Label("newMilestone").setVisible(false));
+ }
+
+ // milestones list
+ List<TicketMilestone> allMilestones = app().tickets().getMilestones(repositoryModel);
ListDataProvider<TicketMilestone> allMilestonesDp = new ListDataProvider<TicketMilestone>(allMilestones);
DataView<TicketMilestone> milestonesList = new DataView<TicketMilestone>("milestoneList", allMilestonesDp) {
private static final long serialVersionUID = 1L;
@@ -675,6 +688,12 @@ public class TicketsPage extends TicketBasePage { } else {
item.add(WicketUtils.createDatestampLabel("milestoneDue", tm.due, getTimeZone(), getTimeUtils()));
}
+ if (acceptingUpdates) {
+ item.add(new LinkPanel("editMilestone", null, getString("gb.edit"), EditMilestonePage.class,
+ WicketUtils.newObjectParameter(repositoryName, tm.name)));
+ } else {
+ item.add(new Label("editMilestone").setVisible(false));
+ }
}
};
add(milestonesList);
|