return true;\r
}\r
\r
- protected void addActivity(UserModel user, Collection<RepositoryModel> repositories, boolean isStarred, int daysBack) {\r
+ protected void addActivity(UserModel user, Collection<RepositoryModel> repositories, String feedTitle, int daysBack) {\r
Calendar c = Calendar.getInstance();\r
c.add(Calendar.DATE, -1*daysBack);\r
Date minimumDate = c.getTime();\r
\r
Fragment activityFragment = new Fragment("activity", "activityFragment", this);\r
add(activityFragment);\r
- activityFragment.add(new Label("feedTitle", getString( isStarred ? "gb.starredAndOwned" : "gb.recentActivity")));\r
+ activityFragment.add(new Label("feedTitle", feedTitle));\r
if (digests.size() == 0) {\r
// quiet or no starred repositories\r
if (repositories.size() == 0) {\r
Collections.sort(starred, lastUpdateSort);\r
Collections.sort(active, lastUpdateSort);\r
\r
+ String activityTitle;\r
Set<RepositoryModel> feed = new HashSet<RepositoryModel>();\r
feed.addAll(starred);\r
feed.addAll(owned);\r
if (feed.isEmpty()) {\r
+ // no starred or owned, go with recent activity\r
+ activityTitle = getString("gb.recentActivity");\r
feed.addAll(active);\r
+ } else if (starred.isEmpty()){\r
+ // no starred, owned repos feed\r
+ activityTitle = getString("gb.owned");\r
+ } else if (owned.isEmpty()){\r
+ // no owned, starred repos feed\r
+ activityTitle = getString("gb.starred");\r
+ } else {\r
+ // starred and owned repositories\r
+ activityTitle = getString("gb.starredAndOwned");\r
}\r
\r
- addActivity(user, feed, starred.size() > 0 || owned.size() > 0, daysBack);\r
+ addActivity(user, feed, activityTitle, daysBack);\r
\r
Fragment repositoryTabs;\r
if (UserModel.ANONYMOUS.equals(user)) {\r
if (ArrayUtils.isEmpty(owned)) {\r
repositoryTabs.add(new Label("owned").setVisible(false));\r
} else {\r
- FilterableRepositoryList repoList = new FilterableRepositoryList("owned", starred);\r
+ FilterableRepositoryList repoList = new FilterableRepositoryList("owned", owned);\r
repoList.setTitle(getString("gb.myRepositories"), "icon-user");\r
repoList.setAllowCreate(user.canCreate() || user.canAdmin());\r
repositoryTabs.add(repoList);\r