Commit 58eca335 authored by Gradl, Tobias's avatar Gradl, Tobias
Browse files

1251: Migrate sidebar navigation

Task-Url: https://pm.winseda.de/issues/1251
parent d66c501a
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="s" uri="http://www.springframework.org/tags" %>
<div class="list-group options active">
<h4 class="sidebar-title"><s:message code="~eu.dariah.de.minfba.search.options.simple" /></h4>
<label class="checkbox list-group-item"><input type="checkbox" id="explain" name="explain" value="true" /><s:message code="~eu.dariah.de.minfba.search.options.show_explanation" /></label>
<label class="checkbox list-group-item"><input type="checkbox" id="includeOriginal" name="includeOriginal" value="true" /><s:message code="~eu.dariah.de.minfba.search.options.include_original" /></label>
<div class="list-group-item-spacer"></div>
<label class="list-group-item"><span style="font-weight: bold;" id="size_shown">${query.size}</span> <s:message code="~eu.dariah.de.minfba.search.options.results_per_page" />
<input style="display: none;" type="text" id="size" name="size" data-slider-theme="volume" data-slider-range="10,150" data-slider-step="10" data-slider="true" value="${query.size}" data-slider-highlight="true" />
</label>
</div>
<nav class="sidebar-block">
<h2><s:message code="~eu.dariah.de.minfba.search.options.simple" /></h2>
<div class="checkbox"><label><input type="checkbox" id="explain" name="explain" value="true" /><s:message code="~eu.dariah.de.minfba.search.options.show_explanation" /></label></div>
<div class="checkbox"><label><input type="checkbox" id="includeOriginal" name="includeOriginal" value="true" /><s:message code="~eu.dariah.de.minfba.search.options.include_original" /></label></div>
<label><span id="size_shown">${query.size}</span>&nbsp;<s:message code="~eu.dariah.de.minfba.search.options.results_per_page" /></label>
<input type="text" id="size" name="size" data-slider-range="10,150" data-slider-step="10" data-slider="true" value="${query.size}" data-slider-highlight="true" />
</nav>
<nav class="sidebar-block">
<h2><s:message code="~eu.dariah.de.minfba.search.options.selected_collections" /></h2>
<div class="list-group options active">
<h4 class="sidebar-title"><s:message code="~eu.dariah.de.minfba.search.options.selected_collections" /></h4>
<ul id="search-available-collections" class="hide">
<c:forEach items="${datasources}" var="ds">
<li class="search-available-collection" id="search-available-collection-${ds.id}">${ds.name} <span style="font-weight: bold;" class="search-available-collection-doccount"></span></li>
</c:forEach>
</ul>
<div id="search-more-available-collections" class="hide">
<div id="search-more-available-collections" class="hide text-center">
<span id="search-more-available-collections-count"></span> <s:message code="~eu.dariah.de.minfba.search.options.n_more" />
</div>
<div class="list-group-item" style="text-align: right;">
<button class="btn btn-sm btn-default" onclick="sourceSelection.getSelectionDialog();"><s:message code="~eu.dariah.de.minfba.search.options.actions.select_collections" /></button>
<button class="btn btn-sm btn-default" onclick="sourceSelection.selectAll();"><s:message code="~eu.dariah.de.minfba.search.options.actions.select_all_collections" /></button>
<div class="text-right">
<button class="btn btn-link" onclick="sourceSelection.getSelectionDialog();"><s:message code="~eu.dariah.de.minfba.search.options.actions.select_collections" /></button>
<button class="btn btn-link" onclick="sourceSelection.selectAll();"><s:message code="~eu.dariah.de.minfba.search.options.actions.select_all_collections" /></button>
<input type="hidden" id="selected-datasources" name="selected-datasources" value="[]" />
</div>
</div>
\ No newline at end of file
</nav>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="s" uri="http://www.springframework.org/tags" %>
<div id="search-loading-indicator" class="pull-right fade">
<img src='<s:url value="/resources/img/ajax-loader.gif"></s:url>'>
<div id="search-loading-indicator" class="float-right fade">
<i class="fas fa-spinner fa-2x fa-spin"></i>
</div>
<div id="search-results-container" class="hide">
<ul class="nav nav-tabs">
<li class="active"><a href="#search-results-resources-tab" data-toggle="tab"><s:message code="~eu.dariah.de.minfba.search.view.result.resources" /></a></li>
<li><a href="#search-results-collections-tab" data-toggle="tab"><s:message code="~eu.dariah.de.minfba.search.view.result.collections" /></a></li>
<li><a href="#search-results-subjects-tab" data-toggle="tab"><s:message code="~eu.dariah.de.minfba.search.view.result.subjects" /></a></li>
<li><a href="#search-results-terms-tab" data-toggle="tab"><s:message code="~eu.dariah.de.minfba.search.view.result.terms" /></a></li>
<li class="hide"><a href="#search-results-explanations-tab" data-toggle="tab"><s:message code="~eu.dariah.de.minfba.search.view.result.explanations" /></a></li>
<div id="search-results-container" class="hide">
<ul class="nav nav-tabs" role="tablist">
<li class="nav-item">
<a class="nav-link active" id="search-results-resources-tab" href="#search-results-resources-panel" data-toggle="tab" role="tab" aria-controls="search-results-resources-panel" aria-selected="true">
<s:message code="~eu.dariah.de.minfba.search.view.result.resources" />
</a>
</li>
<li class="nav-item">
<a class="nav-link" id="search-results-collection-tab" href="#search-results-collection-panel" data-toggle="tab" role="tab" aria-controls="search-results-collection-panel" aria-selected="false">
<s:message code="~eu.dariah.de.minfba.search.view.result.collections" />
</a>
</li>
<li class="nav-item">
<a class="nav-link" id="search-results-subjects-tab" href="#search-results-subjects-panel" data-toggle="tab" role="tab" aria-controls="search-results-subjects-panel" aria-selected="false">
<s:message code="~eu.dariah.de.minfba.search.view.result.subjects" />
</a>
</li>
<li class="nav-item">
<a class="nav-link" id="search-results-terms-tab" href="#search-results-terms-panel" data-toggle="tab" role="tab" aria-controls="search-results-terms-panel" aria-selected="false">
<s:message code="~eu.dariah.de.minfba.search.view.result.terms" />
</a>
</li>
<li class="nav-item hide">
<a class="nav-link" id="search-results-explanations-tab" href="#search-results-explanations-panel" data-toggle="tab" role="tab" aria-controls="search-results-explanations-panel" aria-selected="false">
<s:message code="~eu.dariah.de.minfba.search.view.result.explanations" />
</a>
</li>
</ul>
<input type="hidden" id="lightThemeColor" value="${lightThemeColor}" />
<input type="hidden" id="darkThemeColor" value="${darkThemeColor}" />
<input type="hidden" id="themeFontColor" value="${themeFontColor}" />
<!-- Tab panes -->
<div id="search-results" class="tab-content">
<div class="tab-pane active" id="search-results-resources-tab">
<p style="font-style: italic; margin-top: 20px;" id="search-results-resources-heading"></p>
<div class="tab-pane fade show active" id="search-results-resources-panel" role="tabpanel" aria-labelledby="search-results-resources-tab">
<p id="search-results-resources-heading"></p>
<div id="search-results-resources"></div>
</div>
<div class="tab-pane" id="search-results-collections-tab">
<div class="tab-pane fade" id="search-results-collection-panel" role="tabpanel" aria-labelledby="search-results-collection-tab">
<h4><s:message code="~eu.dariah.de.minfba.search.search.collections.info" /></h4>
<p style="font-style: italic; margin-top: 20px;" id="search-results-collections-heading"></p>
<p id="search-results-collections-heading"></p>
<div id="search-results-collections"></div>
</div>
<div class="tab-pane" id="search-results-subjects-tab">
<div class="tab-pane fade" id="search-results-subjects-panel" role="tabpanel" aria-labelledby="search-results-subjects-tab">
<h4><s:message code="~eu.dariah.de.minfba.search.search.subjects.info" /></h4>
<div id="search-results-subjects"></div>
</div>
<div class="tab-pane" id="search-results-terms-tab">
<div class="tab-pane fade" id="search-results-terms-panel" role="tabpanel" aria-labelledby="search-results-terms-tab">
<h4><s:message code="~eu.dariah.de.minfba.search.search.terms.info" /></h4>
<div id="search-results-terms"></div>
</div>
<div class="tab-pane" id="search-results-explanations-tab" class="hide">
<div class="tab-pane fade hide" id="search-results-explanations-panel" role="tabpanel" aria-labelledby="search-results-explanations-tab">
<h3><s:message code="~eu.dariah.de.minfba.search.view.result.queries" /></h3>
<div id="executed-queries"></div>
</div>
......
......@@ -6,30 +6,27 @@
<input type="hidden" id="customSearchPrefix" value="${customSearch!=null ? customSearch.prefix : null}" />
<ul class="breadcrumb">
<li class="active"><s:message code="~eu.dariah.de.minfba.search.view.titles.generic_search" /></li>
<li class="active"><s:message code="~eu.dariah.de.minfba.search.view.titles.simple_search" /></li>
</ul>
<div id="main-content">
<div class="container<c:if test="${fluidLayout==true}">-fluid</c:if>">
<div class="row">
<div class="col-lg-12">
<h2 class="pull-left">
<s:message code="~eu.dariah.de.minfba.search.view.titles.simple_search" />
</h2>
<div class="col-12">
<h1><s:message code="~eu.dariah.de.minfba.search.view.titles.simple_search" /></h1>
</div>
<div class="col-lg-12">
<div class="input-group">
<input type="text" id="expression" name="expression" class="form-control" value="${query.queryString}" />
<span class="input-group-btn">
<button id="btn-exec-search" class="btn btn-primary" value="true" name="exec-search" type="submit"><span class="glyphicon glyphicon-search"></span></button>
</span>
</div>
<div class="col-12">
<div class="input-group">
<input type="text" autofocus="autofocus" id="expression" name="expression" class="form-control" placeholder="${query.queryString}" />
<div class="input-group-append">
<button id="btn-exec-search" class="btn btn-primary" value="true" name="exec-search" type="submit"><i class="fas fa-search"></i></button>
</div>
</div>
<p class="text-right mt-1">
<a href='<s:url value="/search/extended/"></s:url>' target="_self"><s:message code="~eu.dariah.de.minfba.search.view.titles.extended_search" /></a>
</p>
</div>
<div class="col-lg-12">
<div class="col-12">
<%@ include file="incl/applied_filters_container.jsp" %>
</div>
<div class="col-lg-12">
<div class="col-12">
<%@ include file="incl/tabs_results.jsp" %>
</div>
</div>
......
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="s" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="tpl" tagdir="/WEB-INF/tags" %>
<div class="list-group nav active">
<h4 class="sidebar-title"><s:message code="~eu.dariah.de.colreg.titles.collection_registry" /></h4>
<a class="list-group-item${_navigationAttribute=='dashboard' ? ' active' : ''}" href="<s:url value='/' />"><s:message code="~eu.dariah.de.colreg.view.common.labels.dashboard" /></a>
<hr />
<c:choose>
<c:when test="${_auth!=null && _auth.auth==true}">
<h5 class="list-group-header"><s:message code="~eu.dariah.de.colreg.titles.collections" /></h5>
<a class="list-group-item${_navigationAttribute=='drafts' ? ' active' : ''}" href="<s:url value='/drafts/' />"><s:message code="~eu.dariah.de.colreg.view.common.labels.drafts" arguments="${_draftCount}" /></a>
<a class="list-group-item${_navigationAttribute=='collections' ? ' active' : ''}" href="<s:url value='/collections/' />"><s:message code="~eu.dariah.de.colreg.titles.public_collections" /></a>
<hr />
</c:when>
<c:otherwise>
<a class="list-group-item${_navigationAttribute=='collections' ? ' active' : ''}" href="<s:url value='/collections/' />"><s:message code="~eu.dariah.de.colreg.titles.collections" /></a>
</c:otherwise>
</c:choose>
<a class="list-group-item${_navigationAttribute=='agents' ? ' active' : ''}" href="<s:url value='/agents/' />"><s:message code="~eu.dariah.de.colreg.titles.agents" /></a>
<c:if test="${_vocabularies!=null && fn:length(_vocabularies)>0}">
<hr />
<h5 class="list-group-header"><s:message code="~eu.dariah.de.colreg.titles.vocabularies" /></h5>
<c:forEach items="${_vocabularies}" var="vocabulary">
<a class="list-group-item${_navigationAttribute==vocabulary.identifier ? ' active' : ''}" href="<s:url value='/vocabularies/${vocabulary.id}/' />">${vocabulary.localizedLabel}</a>
</c:forEach>
</c:if>
</div>
\ No newline at end of file
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="s" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="tpl" tagdir="/WEB-INF/tags" %>
<c:forEach items="${_nav.rootItems}" var="_navItem">
<c:set var="hide" value="false" />
<c:forEach items="${_navItem.attributes}" var="attr">
<c:if test="${customSearch!=null && customSearch.staticCustomSearch==false && attr.key=='hideInCustomSearch' && attr.value==true}">
<c:set var="hide" value="true" />
</c:if>
</c:forEach>
<c:if test="${hide==false && (_navItem.hideInSidebar==false && (_navItem.authRequired==false ||
( (_navItem.authRequired==true && _auth!=null && _auth.auth==true) &&
( _navItem.authMinLevel==0 || (_navItem.authMinLevel<=_auth.level)) )))}">
<div class="list-group nav active">
<h4 class="sidebar-title">
<c:choose>
<c:when test="${_navItem.linkUrl!=null && fn:length(_navItem.linkUrl)>0}">
<a href="<s:url value='${_navItem.linkUrl}'/>">
<c:if test="${_navItem.glyphicon!=null && fn:length(_navItem.glyphicon)>0}">
<span class="${_navItem.glyphicon}"></span>&nbsp;
</c:if>
<s:message code="${_navItem.displayCode}" />
</a>
</c:when>
<c:otherwise>
<c:if test="${_navItem.glyphicon!=null && fn:length(_navItem.glyphicon)>0}">
<span class="${_navItem.glyphicon}"></span>&nbsp;
</c:if>
<s:message code="${_navItem.displayCode}" />
</c:otherwise>
</c:choose>
</h4>
<tpl:sideNav navItem="${_navItem}"></tpl:sideNav>
</div>
</c:if>
</c:forEach>
\ No newline at end of file
......@@ -8,10 +8,8 @@
<html lang="${pageContext.response.locale}">
<%@ include file="incl/head.jsp" %>
<body class="drawer drawer--right drawer--sidebar">
<tiles:importAttribute name="sideNav" />
<tiles:importAttribute name="collapsePanel" ignore="true" />
<tiles:importAttribute name="sideOpts" ignore="true" />
<tiles:importAttribute name="navbarInverse" />
<tiles:importAttribute name="fluidLayout" />
<tiles:importAttribute name="smallLogo" />
......@@ -35,9 +33,6 @@
<div class="grid-hidden grid-lg-visible col-lg-4 col-xl-4" >
<div class="sidebar-container">
<div id="editor-sidebar" class="sidebar">
<c:if test="${sideNav==true}">
<%@ include file="incl/sideNav.jsp" %>
</c:if>
<c:if test="${sideOpts!=null}">
<tiles:insertAttribute name="sideOpts"/>
</c:if>
......
......@@ -9,7 +9,6 @@
<%@ include file="incl/head.jsp" %>
<body class="site">
<wrapper class="d-flex flex-column">
<tiles:importAttribute name="navbarInverse" />
<tiles:importAttribute name="fluidLayout" />
<tiles:importAttribute name="smallLogo" />
......
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