|
| 1 | +<%-- |
| 2 | +CDDL HEADER START |
| 3 | +
|
| 4 | +The contents of this file are subject to the terms of the |
| 5 | +Common Development and Distribution License (the "License"). |
| 6 | +You may not use this file except in compliance with the License. |
| 7 | +
|
| 8 | +See LICENSE.txt included in this distribution for the specific |
| 9 | +language governing permissions and limitations under the License. |
| 10 | +
|
| 11 | +When distributing Covered Code, include this CDDL HEADER in each |
| 12 | +file and include the License file at LICENSE.txt. |
| 13 | +If applicable, add the following below this CDDL HEADER, with the |
| 14 | +fields enclosed by brackets "[]" replaced with your own identifying |
| 15 | +information: Portions Copyright [yyyy] [name of copyright owner] |
| 16 | +
|
| 17 | +CDDL HEADER END |
| 18 | +
|
| 19 | +Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. |
| 20 | +Portions Copyright (c) 2019, Krystof Tulinger <[email protected]>. |
| 21 | +--%> |
| 22 | +<%@ tag import="java.nio.file.Paths" %> |
| 23 | +<%@ tag import="org.apache.commons.lang3.ObjectUtils" %> |
| 24 | +<%@ tag import="org.opengrok.indexer.web.Prefix" %> |
| 25 | +<%@ tag import="org.opengrok.indexer.web.Util" %> |
| 26 | +<%@ tag import="org.opengrok.indexer.web.messages.MessagesUtils" %> |
| 27 | + |
| 28 | +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> |
| 29 | +<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> |
| 30 | + |
| 31 | +<%@ attribute name="pageConfig" required="true" type="org.opengrok.indexer.web.PageConfig" %> |
| 32 | +<%@ attribute name="project" required="true" type="org.opengrok.indexer.configuration.Project" %> |
| 33 | +<%@ attribute name="repositoryInfo" required="true" type="org.opengrok.indexer.history.RepositoryInfo" %> |
| 34 | +<%@ attribute name="isFirst" required="true" type="java.lang.Boolean" %> |
| 35 | + |
| 36 | +<c:set var="isSubrepository" value="${!repositoryInfo.getDirectoryNameRelative().equals(project.getPath())}"/> |
| 37 | +<c:set var="name" value="${project.name}"/> |
| 38 | +<c:set var="defaultLength" value="${Integer.valueOf(10)}"/> |
| 39 | +<c:set var="summary" value="${ObjectUtils.defaultIfNull(repositoryInfo.currentVersion, \"N/A\")}"/> |
| 40 | +<c:set var="maxLength" value="${Math.max(defaultLength, pageConfig.currentIndexedCollapseThreshold)}"/> |
| 41 | +
|
| 42 | +<c:if test="${isSubrepository}"> |
| 43 | + <c:set var="name" |
| 44 | + value="${Paths.get(pageConfig.sourceRootPath).relativize(Paths.get(repositoryInfo.directoryName))}"/> |
| 45 | +</c:if> |
| 46 | +
|
| 47 | +<c:if test="${isSubrepository && isFirst}"> |
| 48 | + <tr> |
| 49 | + <td class="name repository" colspan="3"> |
| 50 | + <a href="${request.getContextPath()}${Prefix.XREF_P.toString()}/${project.name}" |
| 51 | + title="Xref for project ${Util.htmlize(project.name)}"> |
| 52 | + ${Util.htmlize(project.name)} |
| 53 | + </a> |
| 54 | + </td> |
| 55 | + </tr> |
| 56 | +</c:if> |
| 57 | +
|
| 58 | +<tr> |
| 59 | + <td class="name ${isSubrepository ? "subrepository" : "repository"}"> |
| 60 | + <a href="${request.getContextPath()}${Prefix.XREF_P.toString()}/${project.name}" |
| 61 | + title="Xref for project ${Util.htmlize(name)}"> |
| 62 | + ${Util.htmlize(name)} |
| 63 | + </a> |
| 64 | +
|
| 65 | + <c:set var="messages" value="${MessagesUtils.messagesToJson(project)}"/> |
| 66 | + <c:if test="${not empty messages}"> |
| 67 | + <span class="important-note important-note-rounded" |
| 68 | + data-messages='${messages}'>!</span> |
| 69 | + </c:if> |
| 70 | + </td> |
| 71 | + <td>${Util.htmlize(ObjectUtils.defaultIfNull(repositoryInfo.type, "N/A"))}: |
| 72 | + ${Util.linkify(ObjectUtils.defaultIfNull(Util.redactUrl(repositoryInfo.parent), "N/A"))} |
| 73 | + (${Util.htmlize(ObjectUtils.defaultIfNull(repositoryInfo.branch, "N/A"))}) |
| 74 | + </td> |
| 75 | + <td> |
| 76 | + <c:choose> |
| 77 | + <c:when test="${summary.length() > maxLength}"> |
| 78 | + <span class="rev-message-summary">${Util.htmlize(summary.substring(0, maxLength))}</span> |
| 79 | + <span class="rev-message-full rev-message-hidden">${Util.htmlize(summary)}</span> |
| 80 | + <span data-toggle-state="less"><a class="rev-toggle-a rev-message-toggle" |
| 81 | + href="#">show more ... </a></span> |
| 82 | + </c:when> |
| 83 | + <c:otherwise> |
| 84 | + <span class="rev-message-full">${Util.htmlize(summary)}</span> |
| 85 | + </c:otherwise> |
| 86 | + </c:choose> |
| 87 | + </td> |
| 88 | +</tr> |
0 commit comments