Advertisement
Guest User

Untitled

a guest
Nov 19th, 2013
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 26.63 KB | None | 0 0
  1. %{
  2.  
  3. }%
  4. %{ ###########################################################################
  5. template inheritance and general presets
  6. }%
  7. %TMPL:INCLUDE{"view"}%
  8. %{
  9.  
  10. }%
  11.  
  12. %{
  13.  
  14. }%
  15. %{ ###########################################################################
  16. customization section
  17. }%
  18. %TMPL:DEF{"solr::defaultweb"}%all%TMPL:END%
  19. %TMPL:DEF{"solr::instantsearch"}%false%TMPL:END%
  20. %TMPL:DEF{"solr::defaultrows"}%10%TMPL:END%
  21. %TMPL:DEF{"solr::defaultquerytype"}%edismax%TMPL:END%
  22. %TMPL:DEF{"solr::defaultsort"}%score desc%TMPL:END%
  23. %TMPL:DEF{"solr::dateformat"}%dddd, Do MMMM YYYY, HH:mm%TMPL:END%
  24. %TMPL:DEF{"solr::fields"}%%TMPL:END%
  25. %TMPL:DEF{"solr::extrafilter"}%%IF{
  26. "defined 'SOLR_EXTRAFILTER'"
  27. then="%SOLR_EXTRAFILTER%"
  28. }% %IF{
  29. "not $USERNAME ingroup 'AdminGroup'"
  30. then="-web_search:Applications"
  31. }%%TMPL:END%
  32. %TMPL:DEF{"solr::facet::include::web"}%%TMPL:END%
  33. %TMPL:DEF{"solr::facet::exclude::web"}%^(_.*%IF{
  34. "not $USERNAME ingroup 'AdminGroup'"
  35. then="|Application.*"
  36. }%)$%TMPL:END%
  37. %{
  38.  
  39. }%
  40.  
  41. %{
  42.  
  43. }%
  44. %{ ###########################################################################
  45. content: main definition that puts together all pieces
  46. }%
  47. %TMPL:DEF{"content"}%<noautolink>
  48. <div id='solrSearch' style='display:none' data-more-fields='%TMPL:P{"solr::fields"}%' data-solr-url='%SCRIPTURL{"rest"}%/SolrPlugin/proxy' data-solr-params='{"topic": "%WEB%.%TOPIC%", "qt":"%TMPL:P{"solr::defaultquerytype"}%", "rows": %TMPL:P{"solr::defaultrows"}%}' data-extra-filter='%TMPL:P{"solr::extrafilter"}%%IF{"'%TMPL:P{"solr::defaultweb"}%'!='all'" then=" web:%TMPL:P{"solr::defaultweb"}%"}%'>
  49. %TMPL:P{"solr::title"}%<!-- -->
  50. %TMPL:P{"solr::header"}%<!-- -->
  51. %TMPL:P{"solr::hits"}%<!-- -->
  52. %TMPL:P{"solr::footer"}%<!-- -->
  53. %TMPL:P{"solr::assets"}%<!-- -->
  54. </div>
  55. %TMPL:P{"solr::templates"}%<!-- -->
  56. %TMPL:P{"solr::dictionary"}%<!-- -->
  57. </noautolink>%TMPL:END%
  58. %{
  59.  
  60. }%
  61.  
  62. %{
  63.  
  64. }%
  65. %{ ###########################################################################
  66. solr::assets - css and js to be added to the html head
  67. }%
  68. %TMPL:DEF{"solr::assets"}%<!-- -->
  69. %JQREQUIRE{"livequery,focus, serialpager, scrollto, prettyphoto, tmpl, jqtwisty, moment, blockui"}%<!-- -->
  70. %ADDTOZONE{"script"
  71. id="SOLRPLUGIN::AJAX"
  72. requires="JQUERYPLUGIN::LIVEQUERY, JQUERYPLUGIN::BLOCKUI, JQUERYPLUGIN::MOMENT"
  73. text="<script type='text/javascript' src='%PUBURLPATH%/%SYSTEMWEB%/SolrPlugin/ajax-solr.js'></script>
  74. <script type='text/javascript' src='%PUBURLPATH%/%SYSTEMWEB%/SolrPlugin/ajax-solr-widgets.js'></script>
  75. <script type='text/javascript' src='%PUBURLPATH%/%SYSTEMWEB%/SolrPlugin/ajax-solr-init.js'></script>"
  76. }%<!-- -->
  77. %ADDTOZONE{"head"
  78. id="SOLRPLUGIN"
  79. text="<link rel='stylesheet' href='%PUBURLPATH%/%SYSTEMWEB%/SolrPlugin/solrplugin.css' type='text/css' media='all' />"
  80. }%<!-- -->%TMPL:END%
  81. %{
  82.  
  83. }%
  84.  
  85. %{
  86.  
  87. }%
  88. %{ ###########################################################################
  89. solr::dictionary - defines a set of keys to be displayed using a different lable
  90. }%
  91. %TMPL:DEF{"solr::dictionary"}%<literal>
  92. <div class="solrDictionary solrJsonData" data-id="default">
  93. {
  94. %FLEXWEBLIST{
  95. webs="public"
  96. exclude="Trash.*"
  97. format="\"$web\": \"$percntWEBLINK{\"$web\" format=\"$title\"}$percnt\""
  98. subheader=",$n"
  99. separator=",$n"
  100. }%,
  101. "Filed in": "%MAKETEXT{"Filed in [_1]"}%",
  102. "Tagged": "%MAKETEXT{"Tagged [_1]"}%",
  103. "tagged": "%MAKETEXT{"tagged [_1]"}%",
  104. "field_TopicType_lst": "%MAKETEXT{"topic type"}%",
  105. "type": "%MAKETEXT{"media"}%",
  106. "date": "%MAKETEXT{"recently"}%",
  107. "en": "%MAKETEXT{"English"}%",
  108. "de": "%MAKETEXT{"German"}%",
  109. "language": "%MAKETEXT{"language"}%",
  110. "keyword": "%MAKETEXT{"keyword"}%",
  111. "tag": "%MAKETEXT{"tag"}%"
  112. }
  113. </div>
  114. </literal>%TMPL:END%
  115. %{
  116.  
  117. }%
  118.  
  119. %{
  120.  
  121. }%
  122. %{ ###########################################################################
  123. solr::templates - defines all jquery.tmpl templates required
  124. }%
  125. %TMPL:DEF{"solr::templates"}%<!-- -->
  126. %TMPL:P{"solr::templates::hits"}%
  127. %TMPL:P{"solr::templates::facetfield"}%
  128. %TMPL:P{"solr::templates::currentselection"}%
  129. %TMPL:P{"solr::templates::togglefacet"}%
  130. %TMPL:P{"solr::templates::tagcloud"}%
  131. %TMPL:P{"solr::templates::resultsperpage"}%
  132. %TMPL:P{"solr::templates::spellcorrection"}%
  133. <!-- -->%TMPL:END%
  134. %{
  135.  
  136. }%
  137.  
  138. %{
  139.  
  140. }%
  141. %{ ###########################################################################
  142. solr::templates::hits - defines all jquery.tmpl templates to render search hits
  143. of different types. each type has got a ...::<name-of-type> sup-template that
  144. is customized to that type.
  145. }%
  146. %TMPL:DEF{"solr::templates::hits"}%<!-- -->
  147. %TMPL:P{"solr::templates::hits::topic"}%<!-- -->
  148. %TMPL:P{"solr::templates::hits::image"}%<!-- -->
  149. %TMPL:P{"solr::templates::hits::comment"}%<!-- -->
  150. %TMPL:P{"solr::templates::hits::misc"}%<!-- -->
  151. %TMPL:P{"solr::templates::hits::ClassifiedTopic"}%<!-- -->
  152. <script id="solrHitTemplate" type="text/x-jquery-tmpl">
  153. {{tmpl($data, $item) $item.getTemplateName()}}
  154. </script>%TMPL:END%
  155. %{
  156.  
  157. }%
  158.  
  159. %{
  160.  
  161. }%
  162. %TMPL:DEF{"solr::templates::hits::ClassifiedTopic"}%<script id="solrHitTemplate_ClassifiedTopic" type="text/x-jquery-tmpl">
  163. <div class='solrSearchHit solrTopicHit'>
  164. <h3 style='background-image:url({{if icon}}${icon}{{else}}%PUBURLPATH%/%SYSTEMWEB%/FamFamFamSilkIcons/page_white.png{{/if}})'>
  165. <a href='${url}'>${title}</a>
  166. <span class='foswikiGrayText foswikiSmallish solrContainerLink'>
  167. %MAKETEXT{"in [_1]" args="<a href='${container_url}'>${container_title}</a>"}%
  168. </span>
  169. </h3>
  170. <div class='foswikiGrayText'>
  171. {{html $item.renderTopicInfo()}}
  172. </div>
  173. <div class='solrHilite'>
  174. {{html $item.getHilite(id)}}
  175. </div>
  176. <div class='solrRevision'>
  177. ${$item.formatDate(date,'%TMPL:P{"solr::dateformat"}%')}, ${author}
  178. </div>
  179. </div>
  180. </script>
  181. %TMPL:END%
  182. %{
  183.  
  184. }%
  185.  
  186. %{
  187.  
  188. }%
  189. %TMPL:DEF{"solr::templates::hits::topic"}%<script id="solrHitTemplate_topic" type="text/x-jquery-tmpl">
  190. <div class='solrSearchHit solrTopicHit'>
  191. <h3 style='background-image:url({{if icon}}${icon}{{else}}%PUBURLPATH%/%SYSTEMWEB%/FamFamFamSilkIcons/page_white.png{{/if}})'>
  192. <a href='${url}'>${title}</a>
  193. <span class='foswikiGrayText foswikiSmallish solrContainerLink'>
  194. %MAKETEXT{"in [_1]" args="<a href='${container_url}'>${container_title}</a>"}%
  195. </span>
  196. </h3>
  197. <div class='solrHilite'>
  198. {{html $item.getHilite(id)}}
  199. </div>
  200. <div class='solrRevision'>
  201. ${$item.formatDate(date,'%TMPL:P{"solr::dateformat"}%')}, ${author}
  202. </div>
  203. </div>
  204. </script>%TMPL:END%
  205. %{
  206.  
  207. }%
  208.  
  209. %{
  210.  
  211. }%
  212. %TMPL:DEF{"solr::templates::hits::image"}%<script id="solrHitTemplate_image" type="text/x-jquery-tmpl">
  213. <div class='solrSearchHit solrImageHit'>
  214. <div class='solrImageFrame'>
  215. <a class='imageHref imageSimple' href='${url}' title='${name}'>
  216. <img src='%SCRIPTURLPATH{"rest"}%/ImagePlugin/resize?topic=${web}.${topic};file=${encodeURIComponent(name)};size=64>;crop=on' alt='${name}' />
  217. </a>
  218. </div>
  219. <h3>
  220. <a href='${url}'>${name}</a>
  221. <span class='foswikiGrayText foswikiSmallish solrContainerLink'>
  222. %MAKETEXT{"in [_1]" args="<a href='${container_url}'>${container_title}</a>"}%
  223. </span>
  224. {{if comment}}
  225. <div class='foswikiGrayText foswikiSmallish solrSearchHitSummary'>${comment}</div>
  226. {{/if}}
  227. </h3>
  228. <div class='solrHilite'>
  229. {{html $item.getHilite(id)}}
  230. </div>
  231. <div class='solrRevision'>
  232. ${$item.formatDate(date,'%TMPL:P{"solr::dateformat"}%')}, ${author}
  233. </div>
  234. %CLEAR%
  235. </div>
  236. </script>%TMPL:END%
  237. %{
  238.  
  239. }%
  240.  
  241. %{
  242.  
  243. }%
  244. %TMPL:DEF{"solr::templates::hits::comment"}%<script id="solrHitTemplate_comment" type="text/x-jquery-tmpl">
  245. <div class='solrSearchHit solrCommentHit'>
  246. <h3 style='background-image:url(%PUBURLPATH%/%SYSTEMWEB%/FamFamFamSilkIcons/comment.png)'>
  247. <a href='${url}'>${title}</a>
  248. <span class='foswikiGrayText foswikiSmallish solrContainerLink'>
  249. %MAKETEXT{"in [_1]" args="<a href='${container_url}'>${container_title}</a>"}%
  250. </span>
  251. </h3>
  252. <div class='solrHilite'>
  253. {{html $item.getHilite(id)}}
  254. </div>
  255. <div class='solrRevision'>
  256. ${$item.formatDate(date,'%TMPL:P{"solr::dateformat"}%')}, ${author}
  257. </div>
  258. </div>
  259. </script>%TMPL:END%
  260. %{
  261.  
  262. }%
  263.  
  264. %{
  265.  
  266. }%
  267. %TMPL:DEF{"solr::templates::hits::misc"}%<script id="solrHitTemplate_misc" type="text/x-jquery-tmpl">
  268. <div class='solrSearchHit solrAttachmentHit'>
  269. <h3 style='background-image:url({{if icon}}${icon}{{else}}%PUBURLPATH%/%SYSTEMWEB%/FamFamFamSilkIcons/page_white.png{{/if}})'>
  270. <a href='${url}'>${name}</a>
  271. <span class='foswikiGrayText foswikiSmallish solrContainerLink' >
  272. %MAKETEXT{"in [_1]" args="<a href='${container_url}'>${container_title}</a>"}%
  273. </span>
  274. {{if comment}}
  275. <div class='foswikiGrayText foswikiSmallish'>${comment}</div>
  276. {{/if}}
  277. </h3>
  278. <div class='solrHilite'>
  279. {{html $item.getHilite(id)}}
  280. </div>
  281. <div class='solrRevision'>
  282. ${$item.formatDate(date,'%TMPL:P{"solr::dateformat"}%')}, ${author}
  283. </div>
  284. </div>
  285. </script>%TMPL:END%
  286. %{
  287.  
  288. }%
  289.  
  290. %TMPL:DEF{"solr::templates::facetfield"}%%TMPL:END% %{</verbatim>}%
  291.  
  292. %{
  293.  
  294. }%
  295. %TMPL:DEF{"solr::templates::currentselection"}%<script id="solrCurrentSelectionTemplate" type="text/x-jquery-tmpl">
  296. <li>
  297. <table class='foswikiLayoutTable' width='100%'>
  298. <tr>
  299. <td width='12px'>
  300. <input type='checkbox' class='foswikiCheckbox' id='${id}' name='filter' checked='checked'/>
  301. </td>
  302. <td>
  303. <label for='${id}' style='display:block'>${facet} <nobr>(${field})</nobr></label>
  304. </td>
  305. </tr>
  306. </table>
  307. </li>
  308. </script>%TMPL:END%
  309. %{
  310.  
  311. }%
  312.  
  313. %{
  314.  
  315. }%
  316. %TMPL:DEF{"solr::templates::togglefacet"}%<script id="solrToggleFacetTemplate" type="text/x-jquery-tmpl">
  317. <input type='checkbox' class='foswikiCheckbox' id='${id}' />
  318. <label class='foswikiLabel' for='${id}'>${title}</label>
  319. </script>%TMPL:END%
  320. %{
  321.  
  322. }%
  323.  
  324. %{
  325.  
  326. }%
  327. %TMPL:DEF{"solr::templates::tagcloud"}%<script id="solrTagCloudTemplate" type="text/x-jquery-tmpl">
  328. {{html group}}<span style='font-size:${weight}px'><a href='#' title='${count}' style='color:${color};' class='solrFacetValue ${current} tag_${facet}'>${facet}</a> </span>
  329. </script>%TMPL:END%
  330. %{
  331.  
  332. }%
  333.  
  334. %{
  335.  
  336. }%
  337. %TMPL:DEF{"solr::templates::resultsperpage"}%<script id="solrResultsPerPageTemplate" type="text/x-jquery-tmpl">
  338. <table class='foswikiNullTable' width='100%'>
  339. <tr>
  340. <td>
  341. {{if count > 0}}
  342. %MAKETEXT{"Results [_1] - [_2] of <b>[_3]</b>" args="${from}, ${to}, ${count}"}%
  343. {{else}}
  344. <span class="foswikiAlert">%MAKETEXT{"nothing found"}%</span>
  345. {{/if}}
  346. </td>
  347. <td align="right">
  348. <table class='foswikiNullTable solrRows'>
  349. <tr>
  350. <th>%MAKETEXT{"Results per page"}%:</th>
  351. <td>
  352. <select class='foswikiSelect'>
  353. <option class='foswikiOption' value="5">5</option>
  354. <option class='foswikiOption' value="10">10</option>
  355. <option class='foswikiOption' value="20">20</option>
  356. <option class='foswikiOption' value="30">30</option>
  357. <option class='foswikiOption' value="40">40</option>
  358. <option class='foswikiOption' value="50">50</option>
  359. <option class='foswikiOption' value="100">100</option>
  360. </select>
  361. </td>
  362. </tr>
  363. </table>
  364. </td>
  365. </tr>
  366. </table>
  367. </script>%TMPL:END%
  368. %{
  369.  
  370. }%
  371.  
  372. %{
  373.  
  374. }%
  375. %TMPL:DEF{"solr::templates::spellcorrection"}%<script id="solrSpellCorrectionTemplate" type="text/x-jquery-tmpl">
  376. %MAKETEXT{"Did you mean [_1]?" args="{{each suggestions}}{{if $index > 0}} or {{/if}} <a class='solrCorrection' href='#'>${$value}</a>{{/each}}"}%
  377. </script>%TMPL:END%
  378. %{
  379.  
  380. }%
  381.  
  382. %{
  383.  
  384. }%
  385. %{ ###########################################################################
  386. solr::header - header to be put infront of the search hits. this provides
  387. the containers for spellcheck corrections, pagination, counters and the like.
  388. It also calls the "solr::searchform" to display the search input field.
  389. }%
  390. %TMPL:DEF{"solr::header"}%<div class='solrHeader'>
  391. %TMPL:P{"solr::searchform"}%
  392. %TMPL:P{"solr::spellchecker"}%
  393. %TMPL:P{"solr::resultsperpage"}%
  394. %TMPL:P{"solr::pager"}%
  395. </div>%TMPL:END%
  396. %{
  397.  
  398. }%
  399.  
  400. %{
  401.  
  402. }%
  403. %TMPL:DEF{"solr::spellchecker"}%<div class='solrSpellchecking'></div>%TMPL:END%
  404. %TMPL:DEF{"solr::resultsperpage"}%<div class='solrResultsPerPage'></div>%TMPL:END%
  405. %TMPL:DEF{"solr::pager"}%<div class="solrPager" data-next-text="%MAKETEXT{"Next"}%" data-prev-text="%MAKETEXT{"Previous"}%" data-enable-scroll="%IF{"'%scroll%'=~'^(true|false)$'" then="%scroll%" else="false"}%" ></div>%TMPL:END%
  406. %TMPL:DEF{"solr::footer"}%<div class='solrFooter'>%TMPL:P{"solr::pager" scroll="true"}%</div>%TMPL:END%
  407. %{
  408.  
  409. }%
  410.  
  411. %{
  412.  
  413. }%
  414. %{ ###########################################################################
  415. solr::searchform - this calls the separate steps comprising the form steps.
  416. this macro can be redefined to include more steps as needed.
  417. }%
  418. %TMPL:DEF{"solr::searchform"}%<!-- -->
  419. %TMPL:P{"solr::formstart"}%
  420. %TMPL:P{"solr::inputstep"}%
  421. %TMPL:P{"solr::tagcloudstep"}%<!-- -->
  422. %TMPL:P{"solr::hierarchystep"}%<!-- -->
  423. %TMPL:P{"solr::formend"}%
  424. <!-- -->%TMPL:END%
  425. %{
  426.  
  427. }%
  428.  
  429. %{
  430.  
  431. }%
  432. %{ ###########################################################################
  433. solr::formstart - beginning of the solr::searchform. contains the starting form
  434. }%
  435. %TMPL:DEF{"solr::formstart"}%<!-- -->
  436. <form name="searchform" class='solrSearchForm' id='solrSearchBox' data-instant-search='%TMPL:P{"solr::instantsearch"}%'>
  437. <div class='foswikiFormSteps'>
  438. <!-- -->%TMPL:END%
  439. %{
  440.  
  441. }%
  442.  
  443. %{
  444.  
  445. }%
  446. %{ ###########################################################################
  447. solr::inputstep - this is a part of the solr::searchform defining the
  448. actual input field, as well as some basic select and checkboxes
  449. }%
  450. %TMPL:DEF{"solr::inputstep"}%<!-- -->
  451. <div class='foswikiFormStep'>
  452. <div class='foswikiLeft'>
  453. <table class='foswikiNullTable'>
  454. <tr>
  455. <td>
  456. <input type='text' autocomplete='off' class='foswikiInputField jqFocus solrSearchField' size='50' style='margin-right:8px;' value="%URLPARAM{"search"}%" />
  457. </td>
  458. <td>
  459. %BUTTON{"%MAKETEXT{"Search"}%" type="submit" title="%MAKETEXT{"submit the query"}%" icon="find" class="solrSubmitButton"}%
  460. </td>
  461. </tr>
  462. </table>
  463. %TMPL:P{"solr::input::checkboxes"}%<!-- -->
  464. </div>
  465. <div class='foswikiRight'>
  466. %TMPL:P{"solr::sortby"}%<!-- -->
  467. %TMPL:P{"solr::displayas"}%<!-- -->
  468. </div>
  469. %CLEAR%
  470. </div>
  471. <!-- -->%TMPL:END%
  472. %{
  473.  
  474. }%
  475.  
  476. %{
  477.  
  478. }%
  479. %{ ###########################################################################
  480. solr::formend - closing markup of the solr::searchform
  481. }%
  482. %TMPL:DEF{"solr::formend"}%<!-- -->
  483. </div>
  484. </form>
  485. <!-- -->%TMPL:END%
  486. %{
  487.  
  488. }%
  489.  
  490. %{
  491.  
  492. }%
  493. %{ ###########################################################################
  494. solr::sidebar: this hooks into the skin to display all sidebar facets. the topmost
  495. widget is the "your selection" area displaying a summary of the current filters
  496. followed by the list of facets. Each facet is displayed calling the "facet" macro
  497. }%
  498. %TMPL:DEF{"solr::sidebar"}%<!-- -->
  499. <noautolink>
  500. %TMPL:P{"solr::selection"}%
  501. </noautolink>
  502. %TMPL:P{"solr::facet"
  503. id="web"
  504. class="solrWebFacetField"
  505. title="%MAKETEXT{"Web"}%"
  506. include="%TMPL:P{"solr::facet::include::web"}%"
  507. exclude="%TMPL:P{"solr::facet::exclude::web"}%"
  508. multivalue="true"
  509. union="true"
  510. exclusion="true"
  511. sort="title"
  512. limit="-1"
  513. }%
  514. %TMPL:P{"solr::facet"
  515. id="type"
  516. title="%MAKETEXT{"Media"}%"
  517. }%
  518. %TMPL:P{"solr::facetquery"
  519. id="date"
  520. exclusion="true"
  521. title="%MAKETEXT{"Recent changes"}%"
  522. queries="[
  523. { \"key\": \"%MAKETEXT{"1 hour"}%\", \"value\": \"date:[NOW-1HOUR TO NOW]\" },
  524. { \"key\": \"%MAKETEXT{"4 hours"}%\", \"value\": \"date:[NOW-4HOUR TO NOW]\" },
  525. { \"key\": \"%MAKETEXT{"today"}%\", \"value\": \"date:[NOW/DAY TO NOW]\" },
  526. { \"key\": \"%MAKETEXT{"2 days"}%\", \"value\": \"date:[NOW/DAY-1DAY TO NOW]\" },
  527. { \"key\": \"%MAKETEXT{"7 days"}%\", \"value\": \"date:[NOW/DAY-7DAY TO NOW]\" },
  528. { \"key\": \"%MAKETEXT{"1 month"}%\", \"value\": \"date:[NOW-1MONTH TO NOW]\" },
  529. { \"key\": \"%MAKETEXT{"2 months"}%\", \"value\": \"date:[NOW-2MONTH TO NOW]\" },
  530. { \"key\": \"%MAKETEXT{"1 year"}%\", \"value\": \"date:[NOW-1YEAR TO NOW]\" },
  531. { \"key\": \"%MAKETEXT{"older"}%\", \"value\": \"date:[* TO NOW/YEAR]\" }
  532. ]"
  533. }%
  534. %TMPL:P{"solr::facet"
  535. id="field_TopicType_lst"
  536. exclude="ApplicationLicense|ApplicationTopic|DataForm|DocuTopic|TopicFunction|TopicStub|TopicTemplate|TopicType|TopicView|WebTool|WikiApplication|WikiTopic|TaggedTopic|CategorizedTopic"
  537. title="%MAKETEXT{"Topic type"}%"
  538. }%
  539. %TMPL:P{"solr::facet"
  540. id="language"
  541. title="%MAKETEXT{"Language"}%"
  542. }%
  543. %TMPL:P{"solr::facet"
  544. id="author"
  545. exclude="UnknownUser|AdminUser|RegistrationAgent|AdminGroup|WikiGuest|FoswikiContributor|ProjectContributor|TestUser"
  546. title="%MAKETEXT{"Author"}%"
  547. }%
  548. <!-- -->%TMPL:END%
  549. %{
  550.  
  551. }%
  552.  
  553. %{
  554.  
  555. }%
  556. %{ ###########################################################################
  557. solr::facet - format a facet for the given field id
  558.  
  559. Parameters:
  560. * id - the field name of the facet, e.g. category, author
  561. * title - the heading
  562. * multivalue - boolean
  563. * union - boolean
  564. * exclusion - boolean
  565. * sort - count or title
  566. * reverse - boolean
  567. * exclude - count or title
  568. * include - count or title
  569. * mincount - lower boundary for facet values to display
  570. * hidesingle - boolean
  571. * hidenullvalues - boolean
  572. * limit - max number of facet values to return
  573. }%
  574. %TMPL:DEF{"solr::facet"}%<div data-field='%id%' %IF{
  575. "not '%class%'=~'^([%]class%)?$'"
  576. then="class='%class%'"
  577. else="class='solrFacetField'"
  578. }%%IF{
  579. "not '%hidesingle%'=~'^([%]hidesingle%)?$'"
  580. then=" data-hide-single='%hidesingle%'"
  581. }%%IF{
  582. "not '%hidenullvalues%'=~'^([%]hidenullvalues%)?$'"
  583. then=" data-hide-null-values='%hidenullvalues%'"
  584. }%%IF{
  585. "not '%multivalue%'=~'^([%]multivalue%)?$'"
  586. then=" data-multi-value='%multivalue%'"
  587. }%%IF{
  588. "not '%union%'=~'^[%]union%$'"
  589. then=" data-union='%union%'"
  590. }%%IF{
  591. "not '%exclusion%'=~'^([%]exclusion%)?$'"
  592. then=" data-exclusion='%exclusion%'"
  593. }%%IF{
  594. "not '%sort%'=~'^([%]sort%)?$'"
  595. then=" data-facet-sort='%sort%'"
  596. }%%IF{
  597. "not '%exclude%'=~'^([%]exclude%)?$'"
  598. then=" data-exclude='%exclude%'"
  599. }%%IF{
  600. "not '%mincount%'=~'^([%]mincount%)?$'"
  601. then=" data-facet-mincount='%mincount%'"
  602. }%%IF{
  603. "not '%limit%'=~'^([%]limit%)?$'"
  604. then=" data-facet-limit='%limit%'"
  605. }%%IF{
  606. "not '%include%'=~'^([%]include%)?$'"
  607. then=" data-include='%include%'"
  608. }%%IF{
  609. "not '%reverse%'=~'^([%]reverse%)?$'"
  610. then="data-facet-sort-reverse='%reverse%'"
  611. }%>
  612. <h2 class='jqTwisty' data-initial-state='open' data-open-img='%PUBURLPATH%/%SYSTEMWEB%/SolrPlugin/toggle-collapse.png' data-close-img='%PUBURLPATH%/%SYSTEMWEB%/SolrPlugin/toggle.png'>%title%</h2>
  613. <div class='solrFacetFieldContainer'></div>
  614. </div>%TMPL:END%
  615. %{
  616.  
  617. }%
  618.  
  619. %{
  620.  
  621. }%
  622. %{ ###########################################################################
  623. solr::facetquery - format a facet query
  624.  
  625. Parameters:
  626. * id - the field name
  627. * title - the heading
  628. * queries - json object of the form [ {"key":"some label", "value": "some query"}, ...]
  629. * multivalue - boolean
  630. * union - boolean
  631. * exclusion - boolean
  632. }%
  633. %TMPL:DEF{"solr::facetquery"}%<div class='solrFacetField' data-field='%id%' data-facet-type='facet_queries' %IF{
  634. "not '%multivalue%'=~'^([%]multivalue%)?$'"
  635. then=" data-multi-value='%multivalue%'"
  636. }%%IF{
  637. "not '%union%'=~'^[%]union%$'"
  638. then=" data-union='%union%'"
  639. }%%IF{
  640. "not '%exclusion%'=~'^([%]exclusion%)?$'"
  641. then=" data-exclusion='%exclusion%'"
  642. }%>
  643. <literal>
  644. <div class="solrJsonData">%queries%</div>
  645. </literal>
  646. <h2 class='jqTwisty' data-initial-state='open' data-open-img='%PUBURLPATH%/%SYSTEMWEB%/SolrPlugin/toggle-collapse.png' data-close-img='%PUBURLPATH%/%SYSTEMWEB%/SolrPlugin/toggle.png'>%title%</h2>
  647. <div class='solrFacetFieldContainer'></div>
  648. </div>%TMPL:END%
  649. %{
  650.  
  651. }%
  652.  
  653. %{
  654.  
  655. }%
  656. %{ ###########################################################################
  657. solr::facetrange - renders a range facet
  658.  
  659. Parameters:
  660. * id - the field name
  661. * title - the heading
  662. * start - start of range
  663. * end - end of range
  664. * gap - increment from start to end
  665. * other - TODO: look up solr docu
  666. * include - TODO: look up solr docu
  667. * dateformat - format string used when the facet goes over a date range
  668. * hidesingle - boolean
  669. }%
  670. %TMPL:DEF{"solr::facetrange"}%<div class='solrFacetField' data-field='%id%' data-facet-type='facet_ranges'%IF{
  671. "not '%start%'=~'^([%]start%)?$'"
  672. then=" data-facet-range-start='%start%'"
  673. else=" date-facet-range-start='NOW/DAY-7DAYS'"
  674. }%%IF{
  675. "not '%hidesingle%'=~'^([%]hidesingle%)?$'"
  676. then=" data-hide-single='%hidesingle%'"
  677. }%%IF{
  678. "not '%dateformat%'=~'^([%]dateformat%)?$'"
  679. then=" data-date-format='%dateformat%'"
  680. }%%IF{
  681. "not '%end%'=~'^([%]end%)?$'"
  682. then=" data-facet-range-end='%end%'"
  683. else=" data-facet-range-end='NOW/DAY+1DAYS'"
  684. }%%IF{
  685. "not '%gap%'=~'^([%]gap%)?$'"
  686. then=" data-facet-range-gap='%gap%'"
  687. else=" data-facet-range-gap='+1DAY'"
  688. }%%IF{
  689. "not '%other%'=~'^([%]other%)?$'"
  690. then=" data-facet-range-other='%other%'"
  691. else=" data-facet-range-other='before'"
  692. }%>
  693. <h2 class='jqTwisty' data-initial-state='open' data-open-img='%PUBURLPATH%/%SYSTEMWEB%/SolrPlugin/toggle-collapse.png' data-close-img='%PUBURLPATH%/%SYSTEMWEB%/SolrPlugin/toggle.png'>%title%</h2>
  694. <div class='solrFacetFieldContainer'></div>
  695. </div>%TMPL:END%
  696. %{
  697.  
  698. }%
  699.  
  700. %{
  701.  
  702. }%
  703. %{ ###########################################################################
  704. solr::selection - renders the "your selection" part in the solr::sidebar
  705. }%
  706. %TMPL:DEF{"solr::selection"}%<!-- -->
  707. <h2>%MAKETEXT{"Filter results"}%</h2>
  708. <div id='solrCurrentSelection'>
  709. <h3>%MAKETEXT{"Your selection"}%:</h3>
  710. <ul>
  711. <li class='solrNoSelection'>%MAKETEXT{"(none)"}%</li>
  712. </ul>
  713. <a href='#' class="solrClear">%MAKETEXT{"Clear"}%</a>
  714. <span class='foswikiClear'></span>
  715. </div>
  716. <!-- -->%TMPL:END%
  717. %{
  718.  
  719. }%
  720.  
  721. %{
  722.  
  723. }%
  724. %{ ###########################################################################
  725. solr::hits - display all search hits
  726. }%
  727. %TMPL:DEF{"solr::hits"}%<div class="solrSearchHits jqPrettyPhoto {itemSelector:'.solrImageFrame a'} clearfix" data-block-ui="window"></div>%TMPL:END%
  728. %{
  729.  
  730. }%
  731.  
  732. %{
  733.  
  734. }%
  735. %{ ###########################################################################
  736. solr::sortby - renders the sort interface
  737. }%
  738. %TMPL:DEF{"solr::sortby"}%<!-- -->
  739. <table class='foswikiNullTable'>
  740. <tr>
  741. <th>%MAKETEXT{"Sort by"}%:&nbsp;</th>
  742. <td>
  743. <select class='foswikiSelect' id='solrSorting' data-default-sort="%TMPL:P{"solr::defaultsort"}%">
  744. <option class='foswikiOption' value='score desc'>%MAKETEXT{"Relevance"}%</option>
  745. <option class='foswikiOption' value='date desc'>%MAKETEXT{"Last changed"}%</option>
  746. <option class='foswikiOption' value='title_sort asc'>%MAKETEXT{"Name"}%</option>
  747. </select>
  748. </td>
  749. </tr>
  750. </table>
  751. <!-- -->%TMPL:END%
  752. %{
  753.  
  754. }%
  755.  
  756. %{
  757.  
  758. }%
  759. %{ ###########################################################################
  760. solr::displayas - render the display switcher
  761. }%
  762. %TMPL:DEF{"solr::displayas"}%<!-- -->
  763. <table class='foswikiLayoutTable'>
  764. <tr>
  765. <th>%MAKETEXT{"Display as"}%:</th>
  766. <td>
  767. <input type='radio' class='foswikiRadio solrDisplay' id='display_list' value='list' name='display'>
  768. <label class='foswikiLabel' for='display_list'>%MAKETEXT{"list"}%</label>
  769. </td>
  770. <td>
  771. <input type='radio' class='foswikiRadio solrDisplay' id='display_grid' value='grid' name='display'>
  772. <label class='foswikiLabel' for='display_grid'>%MAKETEXT{"grid"}%</label>
  773. </td>
  774. </tr>
  775. </table>
  776. <!-- -->%TMPL:END%
  777. %{
  778.  
  779. }%
  780.  
  781. %{
  782.  
  783. }%
  784. %{ ###########################################################################
  785. solr::input::checkboxes - some convenience checkbox selections under the input field
  786. }%
  787. %TMPL:DEF{"solr::input::checkboxes"}%<div class='solrCheckboxContainer'>
  788. %IF{"'%TMPL:P{"solr::defaultweb"}%'='all'"
  789. then="$percntTMPL:P{\"solr::input::checkboxes::incurrentweb\"}$percnt"
  790. else="$percntTMPL:P{\"solr::input::checkboxes::inallwebs\"}$percnt"
  791. }%<!-- -->
  792. %TMPL:P{"solr::input::checkboxes::inweb"}%<!-- -->
  793. %TMPL:P{"solr::input::checkboxes::inmycontribs"}%<!-- -->
  794. </div>%TMPL:END%
  795. %{
  796.  
  797. }%
  798.  
  799. %{
  800.  
  801. }%
  802. %{ ###########################################################################
  803. solr::input::checkboxes::inweb - display a "Search in current web only" checkbox
  804. }%
  805. %TMPL:DEF{"solr::input::checkboxes::incurrentweb"}%<!-- -->
  806. <span class='solrToggleFacet' data-field='web' data-value='%FORMATLIST{"%BASEWEB%" split="/" separator="."}%' data-title='%MAKETEXT{"In current web"}%'></span>
  807. <!-- -->%TMPL:END%
  808. %{
  809.  
  810. }%
  811.  
  812. %{
  813.  
  814. }%
  815. %{ ###########################################################################
  816. solr::input::checkboxes::inallwebs - display a "Search in all webs" checkbox
  817. }%
  818. %TMPL:DEF{"solr::input::checkboxes::inallwebs"}%<!-- -->
  819. <span class='solrToggleFacet' data-field='web' data-value='%TMPL:P{"solr::defaultweb"}%' data-inverse='true' data-title='%MAKETEXT{"In all webs"}%'></span>
  820. <!-- -->%TMPL:END%
  821. %{
  822.  
  823. }%
  824.  
  825. %{
  826.  
  827. }%
  828. %{ ###########################################################################
  829. solr::input::checkboxes::inmycontribs - display a "Search in my contribs" checkbox
  830. }%
  831. %TMPL:DEF{"solr::input::checkboxes::inmycontribs"}%<!-- -->
  832. <span class='solrToggleFacet' data-field='contributor' data-value='%USERINFO{format="$wikiname"}%' data-title='%MAKETEXT{"In my contributions"}%'></span>
  833. <!-- -->%TMPL:END%
  834. %{
  835.  
  836. }%
  837.  
  838. %{
  839.  
  840. }%
  841. %{ ###########################################################################
  842. solr::tagcloudstep - part of the solr::searchform. this contains the tagcloud facet
  843. }%
  844. %TMPL:DEF{"solr::tagcloudstep"}%<!-- -->
  845. <div class='foswikiFormStep solrTagCloud' data-field='tag' data-start-color="[%TAGCLOUD_START{default="111, 169, 255"}%]" data-end-color='[%TAGCLOUD_END{default="0, 89, 224"}%]'>
  846. <div class='foswikiFormStep foswikiFormLast'>
  847. <hr />
  848. <h3><a href='#' class='jqTwisty' data-target='.solrTagCloudContainer' data-open-img='%PUBURLPATH%/%SYSTEMWEB%/SolrPlugin/toggle-collapse.png' data-close-img='%PUBURLPATH%/%SYSTEMWEB%/SolrPlugin/toggle.png'>%MAKETEXT{"Popular tags"}%</a></h3>
  849. <div class='solrTagCloudContainer tagCloud'></div>
  850. </div>
  851. </div>
  852. %{
  853.  
  854. }%
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement