|
| 1 | +# -*- coding: utf-8 -*- |
| 2 | +<%inherit file="/base.html" /> |
| 3 | + |
| 4 | +<%def name="head_tags()"> |
| 5 | + <title> Advanced Search</title> |
| 6 | + |
| 7 | +% if c.search and c.q: |
| 8 | + <link rel="alternate" type="application/atom+xml" href="${c.add_facet}&format=atom&rows=c.rows&sort=score+desc" title="Search results for \"${c.q}\""/> |
| 9 | +% endif |
| 10 | + |
| 11 | +</%def> |
| 12 | +<%def name="header()"> |
| 13 | +</%def> |
| 14 | +<%def name="footer()"> |
| 15 | +</%def> |
| 16 | + |
| 17 | +<div id="facet_wrapper"> |
| 18 | +<% count = 0 %> |
| 19 | +<div id="facet_container_adv"> |
| 20 | +% if c.returned_facets: |
| 21 | +% for facet in c.returned_facets: |
| 22 | +<% count = count + 1 %> |
| 23 | +% if c.returned_facets[facet] and len(c.returned_facets[facet]) > 1: |
| 24 | +<div class="facet_results"> |
| 25 | +<div id="fs${count}" class="subheading"><a id="fh${count}" href="#" >${c.field_names[facet]}</a></div> |
| 26 | +<div id="fl${count}" class="facetlist"> |
| 27 | +<ul> |
| 28 | +% for result,value in c.returned_facets[facet]: |
| 29 | +<li><span class="label"> |
| 30 | +<% |
| 31 | +from urllib import quote |
| 32 | +try: |
| 33 | + res = quote(result) |
| 34 | +except: |
| 35 | + res = result |
| 36 | +if len(result) > 40: |
| 37 | + res_label = result[:40] + '...' |
| 38 | +else: |
| 39 | + res_label = result |
| 40 | +%> |
| 41 | +<a href="${c.add_facet + u'&filter%s="%s"&rows=%d&sort=%s' % (facet, res, c.rows, c.sort)}" title="${result}">${res_label} |
| 42 | +<span class="value">(${value})</span> <a/></span></li> |
| 43 | +% endfor |
| 44 | +</ul> |
| 45 | +</div> |
| 46 | +</div> |
| 47 | +% endif |
| 48 | +% endfor |
| 49 | +</div> |
| 50 | +% endif |
| 51 | +</div> |
| 52 | +</div> |
| 53 | + |
| 54 | +<![if !IE]> |
| 55 | +<script type="text/javascript"> |
| 56 | + $(document).ready(function() { |
| 57 | + |
| 58 | + function fhAdjust(){ |
| 59 | + //Make sure facets do not stick beneath footer |
| 60 | + $navh = $('#facet_wrapper').height(); |
| 61 | + $navh = $navh + 211; |
| 62 | + $wrah = $('#wrapper').height(); |
| 63 | + if ($navh > $wrah) { |
| 64 | + $('#wrapper').css("height", $navh + 100); |
| 65 | + } else { |
| 66 | + $mainh = $('#main').height(); |
| 67 | + $mainh = $mainh + 91; |
| 68 | + if ($mainh > $navh){ |
| 69 | + $('#wrapper').css("height", $mainh + 100); |
| 70 | + } else { |
| 71 | + $('#wrapper').css("height", $navh + 100); |
| 72 | + } |
| 73 | + } |
| 74 | + } |
| 75 | + |
| 76 | + function bindItem(ind){ |
| 77 | + $('#fh' + ind).click(function(event) { |
| 78 | + event.preventDefault(); |
| 79 | + if ($('#fl' + ind).hasClass("closed")){ |
| 80 | + $('#fl' + ind).show(); |
| 81 | + $('#fl' + ind).removeClass("closed"); |
| 82 | + $('#fh' + ind).css("background-image", "url('/fminus.png')"); |
| 83 | + $('#fs' + ind).css("background-color", "#EEE"); |
| 84 | + } else { |
| 85 | + $('#fl' + ind).hide(); |
| 86 | + $('#fl' + ind).addClass("closed"); |
| 87 | + $('#fh' + ind).css("background-image", "url('/fplus.png')"); |
| 88 | + $('#fs' + ind).css("background-color", "#BBB"); |
| 89 | + } |
| 90 | + fhAdjust(); |
| 91 | + }); |
| 92 | + } |
| 93 | + |
| 94 | + for (i=1;i<=${count};i++){ |
| 95 | + //Facet Toggle |
| 96 | + $('#fl'+i).hide(); |
| 97 | + $('#fl'+i).addClass("closed"); |
| 98 | + bindItem(i); |
| 99 | + } |
| 100 | + |
| 101 | +}); |
| 102 | +</script> |
| 103 | +<![endif]> |
| 104 | + |
| 105 | +<!--[if lte IE 8]> |
| 106 | +<script type="text/javascript"> |
| 107 | + $(document).ready(function() { |
| 108 | + |
| 109 | + function fhAdjust(){ |
| 110 | + //Make sure facets do not stick beneath footer |
| 111 | + $navh = $('#facet_wrapper').height(); |
| 112 | + $navh = $navh + 211; |
| 113 | + $wrah = $('#wrapper').height(); |
| 114 | + if ($navh > $wrah) { |
| 115 | + $('#wrapper').css("height", $navh + 100); |
| 116 | + } else { |
| 117 | + $mainh = $('#main').height(); |
| 118 | + $mainh = $mainh + 91; |
| 119 | + if ($mainh > $navh){ |
| 120 | + $('#wrapper').css("height", $mainh + 100); |
| 121 | + } else { |
| 122 | + $('#wrapper').css("height", $navh + 100); |
| 123 | + } |
| 124 | + } |
| 125 | + } |
| 126 | +
|
| 127 | + function bindItem(ind){ |
| 128 | + $('#fh' + ind).click(function(event) { |
| 129 | + event.preventDefault(); |
| 130 | + if ($('#fl' + ind).hasClass("closed")){ |
| 131 | + $('#fl' + ind).show(); |
| 132 | + $('#fl' + ind).removeClass("closed"); |
| 133 | + $('#fh' + ind).css("background-image", "url('/fminus.png')"); |
| 134 | + $('#fs' + ind).css("background-color", "#EEE"); |
| 135 | + } else { |
| 136 | + $('#fl' + ind).hide(); |
| 137 | + $('#fl' + ind).addClass("closed"); |
| 138 | + $('#fh' + ind).css("background-image", "url('/fplus.png')"); |
| 139 | + $('#fs' + ind).css("background-color", "#BBB"); |
| 140 | + } |
| 141 | + fhAdjust(); |
| 142 | + }); |
| 143 | + } |
| 144 | +
|
| 145 | + for (i=1;i<=${count};i++){ |
| 146 | + //Facet Toggle |
| 147 | + $('#fl'+i).addClass("closed"); |
| 148 | + bindItem(i); |
| 149 | + } |
| 150 | +
|
| 151 | +}); |
| 152 | +</script> |
| 153 | +<![endif]--> |
0 commit comments