search_results.html

 1   <div class="container">
 2   	<div class="row g-4">
 3   		<div class="col-md-3">
 4   			<div class="card">
 5   				<div class="card-body">
 6   		  			<form method="get" action="jsp/site/Portal.jsp" class="form">
 7   					<input type="hidden" name="page" value="search" >
 8   					<div class="form-label">#i18n{portal.search.search_results.pageTitle}</div>
 9   					<label for="">#i18n{portal.search_results.buttonSearch}</label>
 10   					<div class="input-group mb-3">
 11   						<input type="text" class="form-control" name="query" value="${query?if_exists}" placeholder="Ex: Lutece">
 12   						<button class="btn btn-outline-secondary" type="submit" title="#i18n{portal.search.search_results.buttonSearch}">
 13   							<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0" /><path d="M21 21l-6 -6" /></svg>
 14   						</button>
 15   						</span>
 16   					</div>
 17   					<#-- Number of documents per page selector -->
 18   					<div class="form-label">#i18n{portal.search.search_results.labelNbDocsPerPage}</div>
 19   					<@NbItemsPerPageSelectorRadioList nb_items_per_page />
 20   					<#if type_filter != "none">
 21   					<#-- type_filter -->
 22   					<label for="type_filter">i18n{portal.search.search_results.typeFilter}</label>
 23   					<#if type_filter == "option">
 24   						<select name="type_filter" class="form-control form-select">
 25   							<#list list_type_and_link as map><option value="${map.type}"><#if map_index != 0>${map.type}<#else>#i18n{portal.search.search_results.typeFilterNone}</#if></option></#list>
 26   						</select>
 27   					<#else>
 28   						<#list list_type_and_link as map>
 29   						<#if type_filter != "checkbox" || map_index != 0>
 30   							<input type=${type_filter} name="type_filter"  class="form-control" value="${map.type}" />
 31   							<#if map.link?exists && map.link != ""><a href="${map.link!}"  ><#if map_index != 0>${map.type}<#else>#i18n{portal.search.search_results.typeFilterNone}</#if></a><#else><#if map_index != 0>${map.type}<#else>#i18n{portal.search.search_results.typeFilterNone}</#if></#if>
 32   						</#if>
 33   						</#list>
 34   					</#if>
 35   					</#if>
 36   					<#-- default_operator and/or -->
 37   					<label for="default_operator">#i18n{portal.search.search_results.operator}</label>
 38   					<select name="default_operator"  id="default_operator" class="form-control form-select">
 39   						<#list ["OR","AND"] as operator><option value="${operator}" <#if operator = default_operator> selected="selected"</#if>>${operator}</option></#list>
 40   					</select>
 41   					<#if date_filter == "1">
 42   						<#-- date_filter 0/1 -->
 43   						<p>#i18n{portal.search.search_results.dateFilter} :</p>
 44   						<@fieldInputCalendarSite i18nLabelKey="portal.search.search_results.dateFilterAfter" inputName="date_after" />
 45   						<@fieldInputCalendarSite i18nLabelKey="portal.search.search_results.dateFilterBefore" inputName="date_before" />
 46   					</#if>
 47   					<#if taglist?has_content><#if tag_filter == "1" && taglist?trim != ""><#list taglist?split(" ") as tag><#if tag?exists && tag?trim !=""><button type="submit" name="tag_filter" value="${tag}">${tag}</button></#if></#list></#if></#if>
 48   					</form>
 49   				</div>
 50   			</div>
 51   		</div>
 52   		<div class="col-md-9">
 53   			<#if error?has_content><div class="alert alert-danger">${error}</div></#if>
 54   			<#if query?has_content && paginator.itemsCount gt 0>
 55   			<h2 class="h3 mt-3">#i18n{portal.search.search_results.title}</h2>
 56   			<h3 class="h4 d-flex">
 57   				<span>
 58   					<strong class="text-danger">${paginator.itemsCount}</strong> #i18n{portal.search.search_results.labelResultsFoundForSearch} <strong class="text-danger">${query?if_exists}</strong> 
 59   				</span>
 60   				<span class="ms-auto">#i18n{portal.search.search_results.labelResultsRange} : <strong>${paginator.rangeMin} - ${paginator.rangeMax}</strong></span>
 61   			</h3>					
 62   			<@pagination paginator=paginator/>
 63   			<div class="row row-cards">
 64   				<div class="space-y">
 65   					<!-- Result Card -->	
 66   					${sponsoredlinks_set!}
 67   					<#list results_list as result>
 68   					<div class="card mb-1">
 69   						<div class="row g-0">
 70   							<div class="col-auto">
 71   								<div class="card-body">
 72   								<div class="avatar avatar-md" style="background-image: url(./images/local/skin/logo-nav.png)"></div>
 73   								</div>
 74   							</div>
 75   							<div class="col">
 76   								<div class="card-body ps-0">
 77   									<div class="row">
 78   										<div class="col-auto">
 79   											<h3 class="mb-0"><a href="${result.url?xhtml}">${result.title}</a></h3>
 80   										</div>
 81   										<div class="col d-flex align-items-center">
 82   											<#if result.summary?has_content>
 83   											${result.summary}
 84   											</#if>
 85   										</div>
 86   									</div>
 87   									<div class="row">
 88   										<div class="col-md">
 89   											<div class="mt-3 list-inline list-inline-dots mb-0 text-secondary d-sm-block d-none">
 90   												<div class="list-inline-item">
 91   													<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-calendar-stats" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M11.795 21h-6.795a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v4" /><path d="M18 14v4h4" /><path d="M18 18m-4 0a4 4 0 1 0 8 0a4 4 0 1 0 -8 0" /><path d="M15 3v4" /><path d="M7 3v4" /><path d="M3 11h16" /></svg>
 92   													<#if result.date?has_content>${result.date?date?string.short}</#if> ${result.date?time?string.short}
 93   												</div>
 94   												<div class="list-inline-item">
 95   													<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-file-info" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M14 3v4a1 1 0 0 0 1 1h4" /><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z" /><path d="M11 14h1v4h1" /><path d="M12 11h.01" /></svg>
 96   													${result.type}
 97   												</div>
 98   											</div>
 99   											<div class="mt-3 list mb-0 text-secondary d-block d-sm-none">
 100   												<div class="list-item">
 101   													<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-calendar-stats" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M11.795 21h-6.795a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v4" /><path d="M18 14v4h4" /><path d="M18 18m-4 0a4 4 0 1 0 8 0a4 4 0 1 0 -8 0" /><path d="M15 3v4" /><path d="M7 3v4" /><path d="M3 11h16" /></svg>
 102   													<#if result.date?has_content>${result.date?date?string.short}</#if> ${result.date?time?string.short}
 103   												</div>
 104   												<div class="list-item">
 105   													<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-file-info" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M14 3v4a1 1 0 0 0 1 1h4" /><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z" /><path d="M11 14h1v4h1" /><path d="M12 11h.01" /></svg>
 106   													${result.type}
 107   												</div>
 108   											</div>
 109   										</div>
 110   									</div>
 111   								</div>
 112   							</div>
 113   						</div>
 114   					</div>
 115   				</#list>
 116   				</div>
 117   			</div>
 118   			<#else>
 119   			<div class="container-xl d-flex justify-content-center">
 120   				<div class="empty d-flex flex-column align-items-center">
 121   					<div class="empty-img">
 122   						<svg xmlns="http://www.w3.org/2000/svg"  width="128" height="128" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0" /><path d="M9 10l.01 0" /><path d="M15 10l.01 0" /><path d="M9 15l6 0" /></svg>
 123   					</div>
 124   					<p class="empty-title">No results found</p>
 125   					<p class="empty-subtitle text-secondary">Try adjusting your search or filter to find what you're looking for.</p>
 126   					<div class="empty-action">
 127   					<a href="./." class="btn btn-primary">
 128   						<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-search" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0" /><path d="M21 21l-6 -6" /></svg>
 129   						Relancer une recherche
 130   					</a>
 131   					</div>
 132   				</div>
 133   			</div>
 134   			</#if>	
 135   		</div>
 136   	</div>
 137   </div>
 138   <#-- Search macros -->
 139   <#-- Number of items per page selector - Combo Box implementation -->
 140   <#macro NbItemsPerPageSelectorCombo nb_items_per_page>
 141   <label for="items_per_page">#i18n{portal.search.search_results.labelNbDocsPerPage}</label>
 142   <select name="items_per_page" id="items_per_page"  class="form-control form-select">
 143   <#list [ "10" , "20" , "50" , "100" ] as nb><#if nb_items_per_page = nb ><option selected="selected" value="${nb}">${nb}</option><#else><option value="${nb}">${nb}</option></#if></#list>
 144   </select>
 145   </#macro>
 146   <#-- Number of items per page selector - Radio List implementation -->
 147   <#macro NbItemsPerPageSelectorRadioList nb_items_per_page>
 148   <#list [ "5" , "10" , "20" , "50" ] as nb>
 149   <label class="form-check form-check-inline">
 150   	<input class="form-check-input" type="radio" value="${nb}" id="items_per_page${nb}" name="items_per_page" <#if nb = nb_items_per_page >checked</#if> ><span class="form-check-label"> ${nb}</span>
 151   </label>
 152   </#list>
 153   </#macro>