summaryrefslogtreecommitdiffstats
path: root/src/main
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
parenta0d5c865f8e7161f73d5e4420e662e81f1640acd (diff)
downloadgitblit-a961100556e5a8aa301261f08319c54bc49ace59.tar.gz
gitblit-a961100556e5a8aa301261f08319c54bc49ace59.zip
Improve milestone listing and include closed milestones
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/com/gitblit/wicket/WicketUtils.java5
-rw-r--r--src/main/java/com/gitblit/wicket/pages/TicketsPage.html4
-rw-r--r--src/main/java/com/gitblit/wicket/pages/TicketsPage.java31
3 files changed, 33 insertions, 7 deletions
diff --git a/src/main/java/com/gitblit/wicket/WicketUtils.java b/src/main/java/com/gitblit/wicket/WicketUtils.java
index 8598447e..2a34ca80 100644
--- a/src/main/java/com/gitblit/wicket/WicketUtils.java
+++ b/src/main/java/com/gitblit/wicket/WicketUtils.java
@@ -587,10 +587,13 @@ public class WicketUtils {
if (TimeUtils.isToday(date, timeZone)) {
title = timeUtils.today();
} else if (TimeUtils.isYesterday(date, timeZone)) {
- title = timeUtils.yesterday();
+ title = timeUtils.yesterday();
} else if (date.getTime() <= System.currentTimeMillis()) {
// past
title = timeUtils.timeAgo(date);
+ } else {
+ // future
+ title = timeUtils.inFuture(date);
}
if ((System.currentTimeMillis() - date.getTime()) < 10 * 24 * 60 * 60 * 1000L) {
String tmp = dateString;
diff --git a/src/main/java/com/gitblit/wicket/pages/TicketsPage.html b/src/main/java/com/gitblit/wicket/pages/TicketsPage.html
index 07e6563f..7d13852b 100644
--- a/src/main/java/com/gitblit/wicket/pages/TicketsPage.html
+++ b/src/main/java/com/gitblit/wicket/pages/TicketsPage.html
@@ -139,9 +139,9 @@
</div>
<div class="tab-pane" id="milestones">
<div class="row">
- <div class="span9" wicket:id="milestoneList">
+ <div class="span9" wicket:id="milestoneList" style="padding-bottom: 10px;">
<h3><span wicket:id="milestoneName"></span> <small><span wicket:id="milestoneState"></span></small></h3>
- <span wicket:id="milestoneDue"></span>
+ <i style="color:#888;"class="fa fa-calendar"></i> <span wicket:id="milestoneDue"></span>
</div>
</div>
</div>
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);