Strip trailing .git from displayed repository links, saves room, looks cleaner
| | |
| | | public List<String> postReceiveScripts;
|
| | | public List<String> mailingLists;
|
| | |
|
| | | private String displayName;
|
| | | |
| | | public RepositoryModel() {
|
| | | this("", "", "", new Date(0));
|
| | | }
|
| | |
| | |
|
| | | @Override
|
| | | public String toString() {
|
| | | return name;
|
| | | if (displayName == null) {
|
| | | displayName = StringUtils.stripDotGit(name);
|
| | | }
|
| | | return displayName;
|
| | | }
|
| | |
|
| | | @Override
|
| | |
| | | String bs = Integer.toHexString((int) (b * 256));
|
| | | return "#" + rs + gs + bs;
|
| | | }
|
| | | |
| | | public static String stripDotGit(String value) {
|
| | | if (value.toLowerCase().endsWith(".git")) {
|
| | | return value.substring(0, value.length() - 4);
|
| | | }
|
| | | return value;
|
| | | }
|
| | | } |
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | protected void setupPage(String repositoryName, String pageName) {
|
| | | add(new LinkPanel("repositoryName", null, repositoryName, SummaryPage.class,
|
| | | protected void setupPage(String repositoryName, String pageName) { |
| | | add(new LinkPanel("repositoryName", null, StringUtils.stripDotGit(repositoryName), SummaryPage.class,
|
| | | WicketUtils.newRepositoryParameter(repositoryName)));
|
| | | add(new Label("pageName", pageName));
|
| | |
|
| | |
| | | fragment.add(authorLink);
|
| | |
|
| | | // repository
|
| | | String repoName = StringUtils.stripDotGit(commit.repository);
|
| | | LinkPanel repositoryLink = new LinkPanel("repository", null,
|
| | | commit.repository, SummaryPage.class,
|
| | | repoName, SummaryPage.class,
|
| | | WicketUtils.newRepositoryParameter(commit.repository), true);
|
| | | WicketUtils.setCssBackground(repositoryLink, commit.repository);
|
| | | fragment.add(repositoryLink);
|
| | |
| | | item.add(row);
|
| | |
|
| | | // try to strip group name for less cluttered list
|
| | | String repoName = entry.name;
|
| | | String repoName = entry.toString();
|
| | | if (!StringUtils.isEmpty(currGroupName) && (repoName.indexOf('/') > -1)) {
|
| | | repoName = repoName.substring(currGroupName.length() + 1);
|
| | | }
|