summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2013-06-18 21:55:25 -0400
committerJames Moger <james.moger@gitblit.com>2013-06-18 21:55:25 -0400
commit0457984cef51c24f08d32fd802eb7d3c8a204920 (patch)
tree0c518c0d6ea4da17a53aabc259028d0d802825fc /src
parent9b609e48c1392ac12632cb3d9835e6667c8228fd (diff)
downloadgitblit-0457984cef51c24f08d32fd802eb7d3c8a204920.tar.gz
gitblit-0457984cef51c24f08d32fd802eb7d3c8a204920.zip
Indicate default days back filter selection
Diffstat (limited to 'src')
-rw-r--r--src/main/java/com/gitblit/wicket/pages/RootPage.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/main/java/com/gitblit/wicket/pages/RootPage.java b/src/main/java/com/gitblit/wicket/pages/RootPage.java
index e8d10074..d21be366 100644
--- a/src/main/java/com/gitblit/wicket/pages/RootPage.java
+++ b/src/main/java/com/gitblit/wicket/pages/RootPage.java
@@ -300,6 +300,17 @@ public abstract class RootPage extends BasePage {
if (daysBack < 1) {
daysBack = 7;
}
+ PageParameters clonedParams;;
+ if (params == null) {
+ clonedParams = new PageParameters();
+ } else {
+ clonedParams = new PageParameters(params);
+ }
+
+ if (!clonedParams.containsKey("db")) {
+ clonedParams.put("db", daysBack);
+ }
+
List<DropDownMenuItem> items = new ArrayList<DropDownMenuItem>();
Set<Integer> choicesSet = new TreeSet<Integer>(GitBlit.getIntegers(Keys.web.activityDurationChoices));
if (choicesSet.isEmpty()) {
@@ -310,7 +321,7 @@ public abstract class RootPage extends BasePage {
String lastDaysPattern = getString("gb.lastNDays");
for (Integer db : choices) {
String txt = MessageFormat.format(lastDaysPattern, db);
- items.add(new DropDownMenuItem(txt, "db", db.toString(), params));
+ items.add(new DropDownMenuItem(txt, "db", db.toString(), clonedParams));
}
items.add(new DropDownMenuItem());
return items;