search_results.html

 1   <@cContainer>
 2       <@cRow>
 3           <@cCol class='mt-5 pt-5'>
 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                                   <@cIcon label='#i18n{portal.search.search_results.buttonSearch}' class='search ml-2' />
 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>#i18n{portal.search.search_results.title}</@cTitle>
 69               <#if error?has_content><@cAlert title=error class='danger' /></#if>
 70               <#-- included sponsored links if available - might be null -->
 71               ${sponsoredlinks_set!}
 72               <#if results_list??>
 73                   <#if results_list?size gt 0>
 74                       <@cCardLayout class='mt-5' type='deck'>
 75                           <#list results_list as result>
 76                               <#assign imgUrl='' >
 77                               <#assign headerCard='<small>[ ${result.type} ]</small> - ${result.title}' >
 78                               <#list result.url?split("=") as x><#assign imgUrl=x ></#list>
 79                               <@cCard header=headerCard headerImg='image?resource_type=page_thumbnail&amp;id=${imgUrl!}' footer=result.date?date?string.short! >
 80                                   <#-- if result.url??>
 81                                       <a href="${result.url!}">
 82                                           [ ${result.type!} ] ${result.title!}
 83                                           <#if result.summary?has_content> <strong>${result.summary!}</strong></#if>
 84                                           <#if result.date?has_content>
 85                                               <em class="pull-right">${result.date?date?string.short!}</em>
 86                                           </#if>
 87                                       </a>
 88                                   </#if -->
 89                                   <#if result.summary?has_content> <@cText>${result.summary!}</@cText></#if>
 90                                   <@cLink href=result.url label='#i18n{portal.util.labelMore}' class='btn btn-action card-link' target='_blank' />
 91                               </@cCard>
 92                           </#list>
 93                       </@cCardLayout>
 94                   <#else>
 95                       <@cAlert title='#i18n{portal.util.labelNoItem}' dismissible=false class='warning' classText='' outline=true />
 96                   </#if>
 97               </#if>
 98               <@cRow class='mt-5'>
 99                   <@cCol>
 100                       <@cPagination paginator=paginator  />
 101                   </@cCol>
 102                   <@cCol class='d-flex justify-content-end'>
 103                       <@cText>#i18n{portal.search.search_results.labelResultsCount} : <strong>${paginator.itemsCount}</strong> #i18n{portal.search.search_results.labelResultsRange} : <strong>${paginator.rangeMin} - ${paginator.rangeMax}</strong></@cText>
 104                   </@cCol>
 105               </@cRow>
 106           </@cCol>
 107       </@cRow>
 108   </@cContainer>