search_results.html

 1   <@cContainer class='section'>
 2       <@cRow>
 3           <@cCol>
 4               <@cForm action='jsp/site/Portal.jsp' >
 5                   <@cInput type='hidden' name='page' value='search' />
 6                   <@cField label='#i18n{portal.search.search_results.buttonSearch}' for='query' >
 7                       <@cInputGroup>
 8                           <@cInput name='query' placeholder='Exemple: composant' value='${query!}' />
 9                           <@cInputGroupAddon>
 10                               <@cBtn label='#i18n{portal.search.search_results.buttonSearch}' nestedPos='after' >
 11                               <svg  xmlns="http://www.w3.org/2000/svg"  width="24"  height="24"  viewBox="0 0 24 24"  fill="none"  stroke="currentColor"  stroke-width="2"  stroke-linecap="round"  stroke-linejoin="round"  class="icon icon-tabler icons-tabler-outline icon-tabler-search"><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>
 12                               </@cBtn>
 13                           </@cInputGroupAddon>
 14                       </@cInputGroup>
 15                   </@cField>
 16                   <#if type_filter != "none">
 17                       <@cField label='#i18n{portal.search.search_results.typeFilter}' for='type_filter' >
 18                           <#-- type_filter -->
 19                           <#if type_filter == "option">
 20                               <@cSelect name='type_filter'>
 21                                   <#list list_type_and_link as map>
 22                                       <#assign labelOption><#if map_index != 0>${map.type}<#else>#i18n{portal.search.search_results.typeFilterNone}</#if></#assign>
 23                                       <@cOption value=map.type label=labelOption />
 24                                   </#list>
 25                               </@cSelect>
 26                           <#else>
 27                               <#list list_type_and_link as map>
 28                                   <#if type_filter != "checkbox" || map_index != 0>
 29                                       <input type=${type_filter} name="type_filter" value="${map.type}" />
 30                                       <#if map.link?exists && map.link != "">
 31                                           <a href="${map.link!}"  ><#if map_index != 0>${map.type}<#else>#i18n{portal.search.search_results.typeFilterNone}</#if></a>
 32                                       <#else>
 33                                           <#if map_index != 0>${map.type}<#else>#i18n{portal.search.search_results.typeFilterNone}</#if>
 34                                       </#if>
 35                                   </#if>
 36                               </#list>
 37                           </#if>
 38                       </@cField>
 39                   </#if>
 40                   <#if date_filter == '1'>
 41                       <#-- date_filter 0/1 -->
 42                       <@cFieldset legend='#i18n{portal.search.search_results.dateFilter}'>
 43                           <@cField label='#i18n{ i18nLabelKey="portal.search.search_results.dateFilterAfter" }' for='date_after'>
 44                               <@input name='date_after' />
 45                           </@cField>
 46                           <@cField label='#i18n{ i18nLabelKey="portal.search.search_results.dateFilterBefore" }' for='date_before'>
 47                               <@input name='date_before' />
 48                           </@cField>
 49                       </@cFieldset>
 50                   </#if>
 51                   <#if taglist?has_content>
 52                       <#if tag_filter == "1" && taglist?trim != "">
 53                           <@cFormRow>
 54                               <#-- tag_filter -->
 55                               <#list taglist?split(" ") as tag>
 56                                   <#if tag?exists && tag?trim !="">
 57                                       <@cBtn label=tag class='btn btn-outline-action' name='tag_filter' value=tag />
 58                                   </#if>
 59                               </#list>
 60                           </@cFormRow>
 61                       </#if>
 62                   </#if>
 63               </@cForm>
 64           </@cCol>
 65       </@cRow>
 66       <@cRow>
 67           <@cCol class='p-sm-4'>
 68               <@cTitle level=2 class='h3'>#i18n{portal.search.search_results.title}</@cTitle>
 69               <@cCard>
 70                   <#if error?has_content><@cAlert title=error class='danger' /></#if>
 71                   <#-- included sponsored links if available - might be null -->
 72                   ${sponsoredlinks_set!}
 73                   <#if results_list??>
 74                       <#if results_list?size gt 0>
 75                           <ul class="list-group list-group-flush">
 76                           <#list results_list as result>
 77                               <#assign imgUrl='' >
 78                               <#assign resultHeader='<small>[ ${result.type} ]</small> - ${result.title}' >
 79                               <#list result.url?split("=") as x><#assign imgUrl=x ></#list>
 80                               <#assign resultUrl = result.url! />
 81                               <#assign resultTitle = '[ ${result.type!} ] ${result.title!}' />
 82                               <#assign resultDate = '<small class="mx-3">${result.date?date?string.short!}</small>' />
 83                               <li class="list-group-item d-flex justify-content-between">
 84                                   <@cLink href=resultUrl label='${resultTitle} ${resultDate}' title='${resultTitle}' />
 85                               </li>
 86                           </#list>
 87                           </ul>
 88                       <#else>
 89                           <@cAlert title='#i18n{portal.util.labelNoItem}' dismissible=false class='warning' classText='' outline=true />
 90                       </#if>
 91                   </#if>
 92               </@cCard>
 93               <@cRow class='mt-5'>
 94                   <@cCol>
 95                       <@cPagination paginator=paginator  />
 96                   </@cCol>
 97                   <@cCol class='d-flex justify-content-end'>
 98                       <@cText>#i18n{portal.search.search_results.labelResultsCount} : <strong>${paginator.itemsCount}</strong> #i18n{portal.search.search_results.labelResultsRange} : <strong>${paginator.rangeMin} - ${paginator.rangeMax}</strong></@cText>
 99                   </@cCol>
 100               </@cRow>
 101           </@cCol>
 102       </@cRow>
 103   </@cContainer>
 104   <script>
 105   <@cSearchSetResultPageTitle />
 106   </script>