import com.gitblit.models.FederationSet;\r
import com.gitblit.models.RepositoryModel;\r
import com.gitblit.models.UserModel;\r
+import com.gitblit.utils.ByteFormat;\r
import com.gitblit.utils.FederationUtils;\r
import com.gitblit.utils.JGitUtils;\r
import com.gitblit.utils.JsonUtils;\r
model.origin = config.getString("remote", "origin", "url");\r
}\r
r.close();\r
+ if (getBoolean(Keys.web.showRepositorySizes, true)) {\r
+ ByteFormat byteFormat = new ByteFormat();\r
+ model.size = byteFormat.format(calculateSize(model)); \r
+ }\r
return model;\r
}\r
\r
import com.gitblit.SyndicationServlet;\r
import com.gitblit.models.RepositoryModel;\r
import com.gitblit.models.UserModel;\r
-import com.gitblit.utils.ByteFormat;\r
import com.gitblit.utils.StringUtils;\r
import com.gitblit.utils.TimeUtils;\r
import com.gitblit.wicket.GitBlitWebSession;\r
if (models == null) {\r
linksActive = true;\r
models = GitBlit.self().getRepositoryModels(user);\r
- final ByteFormat byteFormat = new ByteFormat();\r
- if (showSize) {\r
- for (RepositoryModel model : models) {\r
- model.size = byteFormat.format(GitBlit.self().calculateSize(model));\r
- }\r
- }\r
} else {\r
// disable links if the repositories are already provided\r
// the repositories are most likely from a proposal\r
} else {\r
dp = new SortableRepositoriesProvider(models);\r
}\r
- \r
+\r
final String baseUrl = WicketUtils.getGitblitURL(getRequest());\r
\r
DataView<RepositoryModel> dataView = new DataView<RepositoryModel>("row", dp) {\r
\r
if (entry.hasCommits) {\r
// Existing repository\r
- if (showSize) {\r
- row.add(new Label("repositorySize", entry.size));\r
- } else {\r
- row.add(new Label("repositorySize").setVisible(false));\r
- }\r
+ row.add(new Label("repositorySize", entry.size).setVisible(showSize));\r
} else {\r
// New repository\r
row.add(new Label("repositorySize", "<span class='empty'>(empty)</span>")\r