summaryrefslogtreecommitdiffstats
path: root/src/main/java/com/gitblit/wicket/pages/TicketsPage.java
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2014-04-15 23:58:57 -0400
committerJames Moger <james.moger@gitblit.com>2014-04-15 23:58:57 -0400
commita961100556e5a8aa301261f08319c54bc49ace59 (patch)
tree19bd5695df2689e4b25770fe65f13a0223a46884 /src/main/java/com/gitblit/wicket/pages/TicketsPage.java
parenta0d5c865f8e7161f73d5e4420e662e81f1640acd (diff)
downloadgitblit-a961100556e5a8aa301261f08319c54bc49ace59.tar.gz
gitblit-a961100556e5a8aa301261f08319c54bc49ace59.zip
Improve milestone listing and include closed milestones
Diffstat (limited to 'src/main/java/com/gitblit/wicket/pages/TicketsPage.java')
-rw-r--r--src/main/java/com/gitblit/wicket/pages/TicketsPage.java31
1 files changed, 27 insertions, 4 deletions
diff --git a/src/main/java/com/gitblit/wicket/pages/TicketsPage.java b/src/main/java/com/gitblit/wicket/pages/TicketsPage.java
index 3e8e4edd..ca509e28 100644
--- a/src/main/java/com/gitblit/wicket/pages/TicketsPage.java
+++ b/src/main/java/com/gitblit/wicket/pages/TicketsPage.java
@@ -164,6 +164,9 @@ public class TicketsPage extends TicketBasePage {
if (currentMilestone == null) {
// milestone not found, create a temporary one
currentMilestone = new TicketMilestone(milestoneParam);
+ String q = QueryBuilder.q(Lucene.rid.matches(getRepositoryModel().getRID())).and(Lucene.milestone.matches(milestoneParam)).build();
+ currentMilestone.tickets = app().tickets().queryFor(q, 1, 0, Lucene.number.name(), true);
+ milestones.add(currentMilestone);
}
}
@@ -643,15 +646,35 @@ public class TicketsPage extends TicketBasePage {
};
add(ticketsView);
- DataView<TicketMilestone> milestonesList = new DataView<TicketMilestone>("milestoneList", milestonesDp) {
+ List<TicketMilestone> allMilestones = app().tickets().getMilestones(getRepositoryModel());
+ ListDataProvider<TicketMilestone> allMilestonesDp = new ListDataProvider<TicketMilestone>(allMilestones);
+ DataView<TicketMilestone> milestonesList = new DataView<TicketMilestone>("milestoneList", allMilestonesDp) {
private static final long serialVersionUID = 1L;
@Override
public void populateItem(final Item<TicketMilestone> item) {
final TicketMilestone tm = item.getModelObject();
- item.add(new Label("milestoneName", tm.name));
- item.add(new Label("milestoneState", tm.status.name()));
- item.add(new Label("milestoneDue", tm.due == null ? getString("gb.notSpecified") : tm.due.toString()));
+ PageParameters params = queryParameters(null, tm.name, null, null, null, desc, 1);
+ item.add(new LinkPanel("milestoneName", null, tm.name, TicketsPage.class, params).setRenderBodyOnly(true));
+
+ String css;
+ switch (tm.status) {
+ case Open:
+ css = "aui-lozenge aui-lozenge-subtle";
+ break;
+ default:
+ css = "aui-lozenge";
+ break;
+ }
+ Label stateLabel = new Label("milestoneState", tm.status.name());
+ WicketUtils.setCssClass(stateLabel, css);
+ item.add(stateLabel);
+
+ if (tm.due == null) {
+ item.add(new Label("milestoneDue", getString("gb.notSpecified")));
+ } else {
+ item.add(WicketUtils.createDatestampLabel("milestoneDue", tm.due, getTimeZone(), getTimeUtils()));
+ }
}
};
add(milestonesList);