}\r
}\r
\r
- protected Fragment createNgList(String wicketId, String fragmentId, String ngController, List<RepositoryModel> repositories) {\r
- String format = GitBlit.getString(Keys.web.datestampShortFormat, "MM/dd/yy");\r
- final DateFormat df = new SimpleDateFormat(format);\r
- df.setTimeZone(getTimeZone());\r
-\r
- Fragment fragment = new Fragment(wicketId, fragmentId, this);\r
- \r
- List<RepoListItem> list = new ArrayList<RepoListItem>();\r
- for (RepositoryModel repo : repositories) {\r
- String name = StringUtils.stripDotGit(repo.name); \r
- String path = "";\r
- if (name.indexOf('/') > -1) {\r
- path = name.substring(0, name.lastIndexOf('/') + 1);\r
- name = name.substring(name.lastIndexOf('/') + 1);\r
- }\r
- \r
- RepoListItem item = new RepoListItem();\r
- item.n = name;\r
- item.p = path;\r
- item.r = repo.name;\r
- item.i = repo.description;\r
- item.s = GitBlit.self().getStarCount(repo);\r
- item.t = getTimeUtils().timeAgo(repo.lastChange);\r
- item.d = df.format(repo.lastChange);\r
- item.c = StringUtils.getColor(StringUtils.stripDotGit(repo.name));\r
- item.wc = repo.isBare ? 0 : 1;\r
- list.add(item);\r
- }\r
- \r
- // inject an AngularJS controller with static data\r
- NgController ctrl = new NgController(ngController);\r
- ctrl.addVariable(wicketId, list);\r
- add(new HeaderContributor(ctrl));\r
- \r
- return fragment;\r
- }\r
-\r
@Override\r
protected void addDropDownMenus(List<PageRegistration> pages) {\r
PageParameters params = getPageParameters();\r
add(new HeaderContributor(charts)); \r
frag.add(new Fragment("charts", "chartsFragment", this));\r
}\r
- \r
- protected class RepoListItem implements Serializable {\r
-\r
- private static final long serialVersionUID = 1L;\r
- \r
- String r; // repository\r
- String n; // name\r
- String p; // project/path\r
- String t; // time ago\r
- String d; // last updated\r
- String i; // information/description\r
- long s; // stars\r
- String c; // html color\r
- int wc; // working copy, 1 = true\r
- }\r
}\r