Commit 2050499c authored by Gradl, Tobias's avatar Gradl, Tobias
Browse files

1296: Show hierarchy on recursive hierarchical elements

Task-Url: https://pm.winseda.de/issues/1296
parent 1009130f
<%@page import="de.unibamberg.minf.processing.model.helper.ResourceHelper"%>
<%@page import="de.unibamberg.minf.processing.model.base.Resource"%>
<%@page import="java.util.List"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<c:set var="hierarchyElementTitle" scope="request" value="" />
<c:choose>
<c:when test="${idTitleMap!=null && fn:length(idTitleMap)>0}">
<c:forEach items="${idTitleMap}" var="e">
<c:if test="${e.key==hierarchyElement.id}">
<c:forEach items="${e.value}" var="title">
<c:set var="hierarchyElementTitle" scope="request" value="${hierarchyElementTitle} ${fn:replace(title.value, newLineChar, ' ')}" />
</c:forEach>
</c:if>
</c:forEach>
</c:when>
</c:choose>
<c:if test="${fn:length(hierarchyElementTitle)==0}">
<c:set var="hierarchyElementTitle" scope="request" value="~no title" />
</c:if>
<li class="item-detail-hierarchy-element">
<c:choose>
<c:when test="${hierarchyElement.id==item.id}">
<span class="item-detail-hierarchy-element-selected">${hierarchyElementTitle}</span>
</c:when>
<c:otherwise>
<a href="/item/${type}/${hierarchyElement.id}/">${hierarchyElementTitle}</a>
</c:otherwise>
</c:choose>
<c:if test="${hierarchyElement.relatedElementsMap!=null && fn:length(hierarchyElement.relatedElementsMap)>0}">
<ul class="item-detail-hierarchy">
<c:forEach items="${hierarchyElement.relatedElementsMap}" var="e">
<c:if test="${e.key=='PARENT_OF'}">
<c:set var="placeholderElements" value="false" />
<c:forEach items="${e.value}" var="childElement">
<c:choose>
<c:when test="${!childElement.placeholder}">
<c:set var="hierarchyElement" value="${childElement}" scope="request"/>
<jsp:include page="hierarchyElement.jsp" />
</c:when>
<c:otherwise>
<c:set var="placeholderElements" value="true" />
</c:otherwise>
</c:choose>
</c:forEach>
<c:if test="${placeholderElements}">
<li class="item-detail-hierarchy-placeholder">Unterelemente gesamt: ${fn:length(e.value)}</li>
</c:if>
</c:if>
</c:forEach>
</ul>
</c:if>
</li>
\ No newline at end of file
......@@ -100,6 +100,18 @@
<div class="row">
<div class="col-12 col-md-7 col-lg-8 col-xl-9">
<c:if test="${rootParents!=null && fn:length(rootParents)>0}">
<h2>~Hierarchy</h2>
<c:forEach items="${rootParents}" var="hierarchyElement">
<ul class="item-detail-hierarchy">
<%@ include file="hierarchyElement.jsp" %>
</c:forEach>
<c:forEach items="${rootParents}" var="hierarchyElement">
</ul>
</c:forEach>
</c:if>
<h2><s:message code="~eu.dariah.de.minfba.search.view.item.additional_data" /></h2>
<div class="row">
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment