Browse Source

Fixed missing clone url on the empty repository page

tags/v1.3.1
James Moger 10 years ago
parent
commit
0096569bfd
2 changed files with 20 additions and 8 deletions
  1. 8
    3
      releases.moxie
  2. 12
    5
      src/main/java/com/gitblit/wicket/pages/EmptyRepositoryPage.java

+ 8
- 3
releases.moxie View File

fixes: fixes:
- Gitblit-as-viewer with no repository urls failed to display summary page (issue 269) - Gitblit-as-viewer with no repository urls failed to display summary page (issue 269)
- Fixed missing model class dependencies in Gitblit Manager build - Fixed missing model class dependencies in Gitblit Manager build
- Fix for IE10 compatability mode
- Fix for IE10 compatibility mode
- Reset dashboard and activity commit cache on branch REWIND or DELETE - Reset dashboard and activity commit cache on branch REWIND or DELETE
- Fixed bug with adding new local users with external authentication - Fixed bug with adding new local users with external authentication
- Fixed missing clone url on the empty repository page
changes: changes:
- updated Chinese translation - updated Chinese translation
- updated Dutch translation - updated Dutch translation
- updated Spanish translation
- updated Korean translation
additions: additions:
- Added optional browser-side page caching using Last-Modified and Cache-Control for the dashboard, activity, project, and several repository pages - Added optional browser-side page caching using Last-Modified and Cache-Control for the dashboard, activity, project, and several repository pages
dependencyChanges: ~ dependencyChanges: ~
- James Moger - James Moger
- Stardrad Yin - Stardrad Yin
- Chad Horohoe - Chad Horohoe
- Eduardo Guervós Narvaez
- Dongsu, KIM
} }


# #
contributors: contributors:
- James Moger - James Moger
- github/mystygage - github/mystygage
- github/ds5apn
- github/kwoot
- Dongsu, KIM
- Jeroen Baten
- github/inaiat - github/inaiat
} }



+ 12
- 5
src/main/java/com/gitblit/wicket/pages/EmptyRepositoryPage.java View File

package com.gitblit.wicket.pages; package com.gitblit.wicket.pages;
import java.text.MessageFormat; import java.text.MessageFormat;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import org.apache.wicket.PageParameters; import org.apache.wicket.PageParameters;
import org.apache.wicket.markup.html.basic.Label; import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.protocol.http.WebRequest;
import com.gitblit.GitBlit; import com.gitblit.GitBlit;
import com.gitblit.models.RepositoryModel; import com.gitblit.models.RepositoryModel;
import com.gitblit.models.RepositoryUrl;
import com.gitblit.models.UserModel; import com.gitblit.models.UserModel;
import com.gitblit.wicket.GitBlitWebSession; import com.gitblit.wicket.GitBlitWebSession;
import com.gitblit.wicket.GitblitRedirectException; import com.gitblit.wicket.GitblitRedirectException;
user = UserModel.ANONYMOUS; user = UserModel.ANONYMOUS;
} }
RepositoryUrlPanel urlPanel = new RepositoryUrlPanel("pushurl", false, user, repository);
String primaryUrl = urlPanel.getPrimaryUrl();
HttpServletRequest req = ((WebRequest) getRequest()).getHttpServletRequest();
List<RepositoryUrl> repositoryUrls = GitBlit.self().getRepositoryUrls(req, user, repository);
RepositoryUrl primaryUrl = repositoryUrls.size() == 0 ? null : repositoryUrls.get(0);
String url = primaryUrl != null ? primaryUrl.url : "";
add(new Label("repository", repositoryName)); add(new Label("repository", repositoryName));
add(urlPanel);
add(new Label("cloneSyntax", MessageFormat.format("git clone {0}", primaryUrl)));
add(new Label("remoteSyntax", MessageFormat.format("git remote add gitblit {0}\ngit push gitblit master", primaryUrl)));
add(new RepositoryUrlPanel("pushurl", false, user, repository));
add(new Label("cloneSyntax", MessageFormat.format("git clone {0}", url)));
add(new Label("remoteSyntax", MessageFormat.format("git remote add gitblit {0}\ngit push gitblit master", url)));
} }
@Override @Override

Loading…
Cancel
Save