summaryrefslogtreecommitdiffstats
path: root/src/main/java/com/gitblit/wicket/pages/MyDashboardPage.java
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2013-09-30 09:30:04 -0400
committerJames Moger <james.moger@gitblit.com>2013-09-30 10:11:28 -0400
commit699e71e76b15081baf746c6ce9c9144f7e5f1ff9 (patch)
tree4a9ea25c258caeae3dea4bc1de809f47bc615d81 /src/main/java/com/gitblit/wicket/pages/MyDashboardPage.java
parent235ad956fa84cad4fac1b2e69a0c9e4f50376ea3 (diff)
downloadgitblit-699e71e76b15081baf746c6ce9c9144f7e5f1ff9.tar.gz
gitblit-699e71e76b15081baf746c6ce9c9144f7e5f1ff9.zip
Trim trailing whitespace and organize imports
Change-Id: I9f91138b20219be6e3c4b28251487df262bff6cc
Diffstat (limited to 'src/main/java/com/gitblit/wicket/pages/MyDashboardPage.java')
-rw-r--r--src/main/java/com/gitblit/wicket/pages/MyDashboardPage.java34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/main/java/com/gitblit/wicket/pages/MyDashboardPage.java b/src/main/java/com/gitblit/wicket/pages/MyDashboardPage.java
index 0768b2ac..8e05b4f0 100644
--- a/src/main/java/com/gitblit/wicket/pages/MyDashboardPage.java
+++ b/src/main/java/com/gitblit/wicket/pages/MyDashboardPage.java
@@ -44,9 +44,9 @@ import com.gitblit.utils.ArrayUtils;
import com.gitblit.utils.MarkdownUtils;
import com.gitblit.utils.StringUtils;
import com.gitblit.wicket.CacheControl;
+import com.gitblit.wicket.CacheControl.LastModified;
import com.gitblit.wicket.GitBlitWebSession;
import com.gitblit.wicket.WicketUtils;
-import com.gitblit.wicket.CacheControl.LastModified;
import com.gitblit.wicket.panels.FilterableProjectList;
import com.gitblit.wicket.panels.FilterableRepositoryList;
@@ -106,8 +106,8 @@ public class MyDashboardPage extends DashboardPage {
Calendar c = Calendar.getInstance();
c.add(Calendar.DATE, -1*daysBack);
Date minimumDate = c.getTime();
-
- // build repo lists
+
+ // build repo lists
List<RepositoryModel> starred = new ArrayList<RepositoryModel>();
List<RepositoryModel> owned = new ArrayList<RepositoryModel>();
List<RepositoryModel> active = new ArrayList<RepositoryModel>();
@@ -116,27 +116,27 @@ public class MyDashboardPage extends DashboardPage {
if (model.isUsersPersonalRepository(user.username) || model.isOwner(user.username)) {
owned.add(model);
}
-
+
if (user.getPreferences().isStarredRepository(model.name)) {
starred.add(model);
}
-
+
if (model.isShowActivity() && model.lastChange.after(minimumDate)) {
active.add(model);
}
}
-
+
Comparator<RepositoryModel> lastUpdateSort = new Comparator<RepositoryModel>() {
@Override
public int compare(RepositoryModel o1, RepositoryModel o2) {
return o2.lastChange.compareTo(o1.lastChange);
}
};
-
+
Collections.sort(owned, lastUpdateSort);
Collections.sort(starred, lastUpdateSort);
Collections.sort(active, lastUpdateSort);
-
+
String activityTitle;
Set<RepositoryModel> feed = new HashSet<RepositoryModel>();
feed.addAll(starred);
@@ -155,22 +155,22 @@ public class MyDashboardPage extends DashboardPage {
// starred and owned repositories
activityTitle = getString("gb.starredAndOwned");
}
-
+
addActivity(user, feed, activityTitle, daysBack);
-
+
Fragment repositoryTabs;
if (UserModel.ANONYMOUS.equals(user)) {
repositoryTabs = new Fragment("repositoryTabs", "anonymousTabsFragment", this);
} else {
repositoryTabs = new Fragment("repositoryTabs", "authenticatedTabsFragment", this);
}
-
+
add(repositoryTabs);
-
+
// projects list
List<ProjectModel> projects = GitBlit.self().getProjectModels(getRepositoryModels(), false);
repositoryTabs.add(new FilterableProjectList("projects", projects));
-
+
// active repository list
if (active.isEmpty()) {
repositoryTabs.add(new Label("active").setVisible(false));
@@ -179,7 +179,7 @@ public class MyDashboardPage extends DashboardPage {
repoList.setTitle(getString("gb.activeRepositories"), "icon-time");
repositoryTabs.add(repoList);
}
-
+
// starred repository list
if (ArrayUtils.isEmpty(starred)) {
repositoryTabs.add(new Label("starred").setVisible(false));
@@ -188,7 +188,7 @@ public class MyDashboardPage extends DashboardPage {
repoList.setTitle(getString("gb.starredRepositories"), "icon-star");
repositoryTabs.add(repoList);
}
-
+
// owned repository list
if (ArrayUtils.isEmpty(owned)) {
repositoryTabs.add(new Label("owned").setVisible(false));
@@ -199,7 +199,7 @@ public class MyDashboardPage extends DashboardPage {
repositoryTabs.add(repoList);
}
}
-
+
private String readMarkdown(String messageSource, String resource) {
String message = "";
if (messageSource.equalsIgnoreCase("gitblit")) {
@@ -268,7 +268,7 @@ public class MyDashboardPage extends DashboardPage {
} catch (Exception e) {
}
}
- }
+ }
}
return MessageFormat.format(getString("gb.failedToReadMessage"), file);
}