| | |
| | |
|
| | | # The number of commits to show on each page of a Log
|
| | | # Value must exceed 0 else default of 50 is used
|
| | | logPageCommitsCount = 50
|
| | | logPageCommitCount = 50
|
| | |
|
| | | # Registered extensions for google-code-prettify
|
| | | prettyPrintExtensions = c cpp cs css htm html java js php pl prefs properties py rb sh sql xml vb
|
| | |
| | | error("Repository not specified!");
|
| | | redirectToInterceptPage(new RepositoriesPage());
|
| | | }
|
| | | repositoryName = params.getString("r", "");
|
| | | objectId = params.getString("h", "HEAD");
|
| | | repositoryName = WicketUtils.getRepositoryName(params);
|
| | | objectId = WicketUtils.getObject(params);
|
| | |
|
| | | Repository r = getRepository();
|
| | |
|
| | |
| | | }
|
| | |
|
| | | protected void addRefs(Repository r, RevCommit c) {
|
| | | add(new RefsPanel("refsPanel", r, c));
|
| | | add(new RefsPanel("refsPanel", repositoryName, c, JGitUtils.getAllRefs(r)));
|
| | | }
|
| | |
|
| | | protected void addFullText(String wicketId, String text, boolean substituteRegex) {
|
| | |
| | | return new PageParameters("r=" + repositoryName + ",h=" + objectId + ",page=" + pageNumber);
|
| | | }
|
| | |
|
| | | public static String getRepositoryName(PageParameters params) {
|
| | | return params.getString("r", "");
|
| | | }
|
| | |
|
| | | public static String getObject(PageParameters params) {
|
| | | return params.getString("h", "");
|
| | | }
|
| | |
|
| | | public static String getPath(PageParameters params) {
|
| | | return params.getString("f", null);
|
| | | }
|
| | |
|
| | | public static int getPage(PageParameters params) {
|
| | | return params.getInt("page", 1); // index from 1
|
| | | }
|
| | |
|
| | | public static Label createDateLabel(String wicketId, Date date, TimeZone timeZone) {
|
| | | DateFormat df = new SimpleDateFormat(StoredSettings.getString("datestampShortFormat", "MM/dd/yy"));
|
| | | if (timeZone != null) {
|
| | |
| | | public BlobPage(PageParameters params) {
|
| | | super(params);
|
| | |
|
| | | final String blobPath = params.getString("f", null);
|
| | | final String blobPath = WicketUtils.getPath(params);
|
| | |
|
| | | Repository r = getRepository();
|
| | | RevCommit commit = JGitUtils.getCommit(r, objectId);
|
| | |
| | | import com.gitblit.utils.JGitUtils;
|
| | | import com.gitblit.wicket.LinkPanel;
|
| | | import com.gitblit.wicket.RepositoryPage;
|
| | | import com.gitblit.wicket.WicketUtils;
|
| | | import com.gitblit.wicket.panels.PathBreadcrumbsPanel;
|
| | |
|
| | | public class DiffPage extends RepositoryPage {
|
| | |
| | | public DiffPage(PageParameters params) {
|
| | | super(params);
|
| | |
|
| | | final String blobPath = params.getString("f", null);
|
| | | final String blobPath = WicketUtils.getPath(params);
|
| | |
|
| | | Repository r = getRepository();
|
| | | RevCommit commit = JGitUtils.getCommit(r, objectId);
|
| | |
| | | public LogPage(PageParameters params) {
|
| | | super(params);
|
| | |
|
| | | int pageNumber = params.getInt("page", 1); // index from 1
|
| | | int pageNumber = WicketUtils.getPage(params);
|
| | | int prevPage = Math.max(0, pageNumber - 1);
|
| | | int nextPage = pageNumber + 1;
|
| | |
|
| | |
| | | public TicGitTicketPage(PageParameters params) {
|
| | | super(params);
|
| | |
|
| | | final String ticketFolder = params.getString("f", "");
|
| | | final String ticketFolder = WicketUtils.getPath(params);
|
| | |
|
| | | Repository r = getRepository();
|
| | | TicGitTicket t = JGitUtils.getTicGitTicket(r, ticketFolder);
|
| | |
| | | public TreePage(PageParameters params) {
|
| | | super(params);
|
| | |
|
| | | final String basePath = params.getString("f", null);
|
| | | final String basePath = WicketUtils.getPath(params);
|
| | |
|
| | | Repository r = getRepository();
|
| | | RevCommit commit = JGitUtils.getCommit(r, objectId);
|
| | |
| | | public LogPanel(String wicketId, final String repositoryName, String objectId, Repository r, int limit, int pageOffset) {
|
| | | super(wicketId);
|
| | | boolean pageResults = limit <= 0;
|
| | | int itemsPerPage = StoredSettings.getInteger("logPageCommitsCount", 50);
|
| | | int itemsPerPage = StoredSettings.getInteger("logPageCommitCount", 50);
|
| | | if (itemsPerPage <= 1) {
|
| | | itemsPerPage = 50;
|
| | | }
|
| | |
| | | }
|
| | | item.add(shortlog);
|
| | |
|
| | | item.add(new RefsPanel("commitRefs", entry, allRefs));
|
| | | item.add(new RefsPanel("commitRefs", repositoryName, entry, allRefs));
|
| | |
|
| | | item.add(new BookmarkablePageLink<Void>("view", CommitPage.class, WicketUtils.newObjectParameter(repositoryName, entry.getName())));
|
| | | item.add(new BookmarkablePageLink<Void>("diff", DiffPage.class, WicketUtils.newObjectParameter(repositoryName, entry.getName())));
|
| | |
| | | lang="en">
|
| | |
|
| | | <wicket:panel>
|
| | | <span class="refs" wicket:id="ref">
|
| | | <span wicket:id="ref">
|
| | | <span wicket:id="refName">ref</span>
|
| | | </span>
|
| | | </wicket:panel>
|
| | |
| | | import org.apache.wicket.markup.repeater.data.ListDataProvider;
|
| | | import org.eclipse.jgit.lib.Constants;
|
| | | import org.eclipse.jgit.lib.ObjectId;
|
| | | import org.eclipse.jgit.lib.Repository;
|
| | | import org.eclipse.jgit.revwalk.RevCommit;
|
| | |
|
| | | import com.gitblit.utils.JGitUtils;
|
| | | import com.gitblit.wicket.LinkPanel;
|
| | | import com.gitblit.wicket.WicketUtils;
|
| | | import com.gitblit.wicket.pages.LogPage;
|
| | | import com.gitblit.wicket.pages.TagPage;
|
| | |
|
| | |
|
| | | public class RefsPanel extends Panel {
|
| | |
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | public RefsPanel(String id, Repository r, RevCommit c) {
|
| | | this(id, c, JGitUtils.getAllRefs(r));
|
| | | }
|
| | | |
| | | public RefsPanel(String id, RevCommit c, Map<ObjectId, List<String>> refs) {
|
| | | public RefsPanel(String id, final String repositoryName, RevCommit c, Map<ObjectId, List<String>> refs) {
|
| | | super(id);
|
| | | List<String> refNames = refs.get(c.getId());
|
| | | if (refNames == null) {
|
| | | refNames = new ArrayList<String>();
|
| | | }
|
| | | Collections.sort(refNames);
|
| | | refNames.remove(Constants.HEAD);
|
| | | |
| | | ListDataProvider<String> refsDp = new ListDataProvider<String>(refNames);
|
| | | DataView<String> refsView = new DataView<String>("ref", refsDp) {
|
| | | private static final long serialVersionUID = 1L;
|
| | |
| | | Component c = null;
|
| | | if (entry.startsWith(Constants.R_HEADS)) {
|
| | | // local head
|
| | | c = new Label("refName", entry.substring(Constants.R_HEADS.length()));
|
| | | c = new LinkPanel("refName", null, entry.substring(Constants.R_HEADS.length()), LogPage.class, WicketUtils.newObjectParameter(repositoryName, entry));
|
| | | // c = new Label("refName", entry.substring(Constants.R_HEADS.length()));
|
| | | WicketUtils.setCssClass(c, "head");
|
| | | } else if (entry.startsWith(Constants.R_REMOTES)) {
|
| | | // remote head
|
| | | c = new Label("refName", entry.substring(Constants.R_REMOTES.length()));
|
| | | c = new LinkPanel("refName", null, entry.substring(Constants.R_REMOTES.length()), LogPage.class, WicketUtils.newObjectParameter(repositoryName, entry));
|
| | | // c = new Label("refName", entry.substring(Constants.R_REMOTES.length()));
|
| | | WicketUtils.setCssClass(c, "ref");
|
| | | } else if (entry.startsWith(Constants.R_TAGS)) {
|
| | | // tag
|
| | | c = new Label("refName", entry.substring(Constants.R_TAGS.length()));
|
| | | // c = new BookmarkablePageLink<Void>("refName", TagPage.class, WicketUtils.newObjectParameter(repositoryName, entry));
|
| | | c = new LinkPanel("refName", null, entry.substring(Constants.R_TAGS.length()), TagPage.class, WicketUtils.newObjectParameter(repositoryName, entry));
|
| | | //c = new Label("refName", entry.substring(Constants.R_TAGS.length()));
|
| | | WicketUtils.setCssClass(c, "tag");
|
| | | } else {
|
| | | // other
|
| | |
| | | text-align: right;
|
| | | }
|
| | |
|
| | | span.refs span {
|
| | | span .tag, span .head, span .ref {
|
| | | padding: 0px 4px;
|
| | | font-family: sans-serif;
|
| | | font-size: 70%;
|
| | | font-weight: normal;
|
| | | border: 1px solid;
|
| | | background-color: #ffaaff;
|
| | | border-color: #ffccff #ff00ee #ff00ee #ffccff;
|
| | | color: black;
|
| | | }
|
| | |
|
| | | span.refs span a {
|
| | | span .tag a, span .head a, span .ref a {
|
| | | text-decoration: none;
|
| | | color: inherit;
|
| | | }
|
| | |
|
| | | span.refs span a:hover {
|
| | | text-decoration: underline;
|
| | | span .tag a:hover, span .head a:hover, span .ref a:hover {
|
| | | color: inherit;
|
| | | }
|
| | |
|
| | | span.refs span.indirect {
|
| | | font-style: italic;
|
| | | span .tag a span, span .head a span, span .ref a span {
|
| | | font-size: 9px;
|
| | | }
|
| | |
|
| | | span.refs span.ref {
|
| | | span .ref {
|
| | | background-color: #aaaaff;
|
| | | border-color: #ccccff #0033cc #0033cc #ccccff;
|
| | | }
|
| | |
|
| | | span.refs span.tag {
|
| | | span .tag {
|
| | | background-color: #ffffaa;
|
| | | border-color: #ffffcc #ffee00 #ffee00 #ffffcc;
|
| | | }
|
| | |
|
| | | span.refs span.head {
|
| | | span .head {
|
| | | background-color: #aaffaa;
|
| | | border-color: #ccffcc #00cc33 #00cc33 #ccffcc;
|
| | | } |