Basic book shop support.
[prawokultury.git] / doc / solr-conf / velocity / richtext-doc.vm
1 #if($doc.getFieldValue('title'))
2   #set($title = $esc.html($doc.getFirstValue('title')))
3 #else
4   #set($title = "["+$doc.getFieldValue('id')+"]")
5 #end
6 #if($doc.getFieldValue('url'))
7   #set($url = $doc.getFieldValue('url'))
8 #elseif($doc.getFieldValue('resourcename'))
9   #set($url = "file:///$doc.getFieldValue('resourcename')")
10 #else
11   #set($url = "$doc.getFieldValue('id')")
12 #end
13 #set($supportedtypes = "7z;ai;aiff;asc;audio;bin;bz2;c;cfc;cfm;chm;class;conf;cpp;cs;css;csv;deb;divx;doc;dot;eml;enc;file;gif;gz;hlp;htm;html;image;iso;jar;java;jpeg;jpg;js;lua;m;mm;mov;mp3;mpg;odc;odf;odg;odi;odp;ods;odt;ogg;pdf;pgp;php;pl;png;ppt;ps;py;ram;rar;rb;rm;rpm;rtf;sig;sql;swf;sxc;sxd;sxi;sxw;tar;tex;tgz;txt;vcf;video;vsd;wav;wma;wmv;xls;xml;xpi;xvid;zip")
14 #set($ct = $list.get($doc.getFirstValue('content_type').split(";"),0))
15 #set($filename = $doc.getFieldValue('resourcename'))
16 #set($filetype = $mimeToExt.get($ct))
17 #if(!$filetype)#set($filetype = $filename.substring($filename.lastIndexOf(".")).substring(1))#end
18 #if(!$filetype)#set($filetype = "file")#end
19 #if(!$supportedtypes.contains($filetype))#set($filetype = "file")#end
20 <div class="result-title">
21 ## Small file type icons from http://www.splitbrain.org/projects/file_icons (public domain)
22 <img src="#{url_root}/img/filetypes/${filetype}.png" align="center">
23 <a href="${url}" target="_blank"><b>$title</b></a><span class="mlt">   #if($params.getBool('mlt', false) == false)<a href="#lensNoQ&q=id:%22$docId%22&mlt=true">More Like This</a>#end</span></div>
24 <div>Id: #field('id')</div>
25 <div>
26 #if($doc.getFieldValue('resourcename'))Resource name: $filename 
27 #elseif($url)URL: $url
28 #end
29 #if($ct) ($ct)#end
30 </div>
31 #if($doc.getFieldValue('author'))<div>Author: #field('author')</div>#end
32 #if($doc.getFieldValue('last_modified'))<div>Last-modified: #field('last_modified')</div>#end
33 <div class="result-body">#field('content')</div>
34 <div class="mlt">
35   #set($mlt = $mltResults.get($docId))
36   #set($mltOn = $params.getBool('mlt'))
37   #if($mltOn == true)<div class="field-name">Similar Items</div>#end
38   #if ($mltOn && $mlt && $mlt.size() > 0)
39   <ul>
40     #foreach($mltHit in $mlt)
41       #set($mltId = $mltHit.getFieldValue('id'))
42       <li><div><a href="#url_for_home?q=id:$mltId">$mltId</a></div><div><span class="field-name">Title:</span> $mltHit.getFieldValue('title')</div>
43         <div><span class="field-name">Author:</span> $mltHit.getFieldValue('author') <span class="field-name">Description:</span> $mltHit.getFieldValue('description')</div>
44
45       </li>
46     #end
47   </ul>
48   #elseif($mltOn && $mlt.size() == 0)
49     <div>No Similar Items Found</div>
50   #end
51 </div>
52 #parse('debug.vm')