Permalink
Browse files

Simplify search results template.

  • Loading branch information...
1 parent ec80044 commit 5f8f0bd1997a9bc53c37732fb725a66b4d99d6ae @docyes committed Mar 19, 2010
@@ -1,3 +0,0 @@
-<input type="hidden" name="q" id="q" value="{{ encode_uri_component(search) }}"/>
-<h2>{{ _("Blockage in cave!") }}</h2>
-<p>{{ error }}</p>
@@ -1,5 +0,0 @@
-{% if sid %}
- <input type="hidden" name="sid" id="sid" value="{{ sid }}" />
-{% else %}
- <!-- no sid. -->
-{% end %}
@@ -1,2 +0,0 @@
-<input type="hidden" name="q" id="q" value="{{ encode_uri_component(search) }}"/>
-<h2 class="none">No Results Found</h2>
@@ -1,27 +0,0 @@
-<div style="margin:24px;">
- <input type="hidden" name="q" id="q" value="{{ encode_uri_component(search) }}"/>
- <div style="float:left; text-align:left; width:40%;">
- {% comment +&nbsp;<a href="">Show options...</a> %}
- (&nbsp;<em style="border:1px solid #3f3f3f; font-family:serif;">&#8592;</em> <em style="border:1px solid #3f3f3f; font-family:serif;">&#8593;</em> <em style="border:1px solid #3f3f3f; font-family:serif;">&#8595;</em> <em style="border:1px solid #3f3f3f; font-family:serif;">&#8594;</em> <em style="text-decoration:underline;">OR</em> sele<em style="padding-top:2px; background:#B3D9FF;">ct te</em>xt&nbsp;) + <em style="border:1px solid #3f3f3f; padding:2px 2px 0px 2px;">enter</em> = search
- </div>
- <div style="float:left; text-align:right; width:60%;">
- <h2 style="color:#333; font-weight:normal; font-size:12px;">Results <em style="font-weight:bold;">1</em> - <em style="font-weight:bold;">{{ len(xml_doc.findall("result")) }}</em> of
- {% if len(xml_doc.findall("result"))<count %}
- <em style="font-weight:bold;">{{ len(xml_doc.findall("result")) }}</em>
- {% else %}
- <em style="font-weight:bold;">many</em>
- {% end %}
- for <em style="font-weight:bold;">{{ escape(search) }}</em>.
- (<em style="font-weight:bold;">{{ round(request.request_time(), 3) }}</em> seconds)</h2>
- </div>
- <div style="clear:both;"></div>
-</div>
-<div class="events">
- <ul class="events">
- {% for result in xml_doc.findall("result") %}
- <li class="default">
- {{ modules.Event(result, display_time=display_event_time) }}
- </li>
- {% end %}
- </ul>
-</div>
@@ -0,0 +1,39 @@
+<input type="hidden" name="q" id="q" value="{{ encode_uri_component(search) }}"/>
+{% if sid %}
+ <input type="hidden" name="sid" id="sid" value="{{ sid }}" />
+{% end %}
+{% if error %}
+ <h2>{{ _("Blockage in cave!") }}</h2>
+ <p>{{ error }}</p>
+{% else %}
+ {% if results %}
+ <div style="margin:24px;">
+ <div style="float:left; text-align:left; width:40%;">
+ {% comment +&nbsp;<a href="">Show options...</a> %}
+ (&nbsp;<em style="border:1px solid #3f3f3f; font-family:serif;">&#8592;</em> <em style="border:1px solid #3f3f3f; font-family:serif;">&#8593;</em> <em style="border:1px solid #3f3f3f; font-family:serif;">&#8595;</em> <em style="border:1px solid #3f3f3f; font-family:serif;">&#8594;</em> <em style="text-decoration:underline;">OR</em> sele<em style="padding-top:2px; background:#B3D9FF;">ct te</em>xt&nbsp;) + <em style="border:1px solid #3f3f3f; padding:2px 2px 0px 2px;">enter</em> = search
+ </div>
+ <div style="float:left; text-align:right; width:60%;">
+ <h2 style="color:#333; font-weight:normal; font-size:12px;">Results <em style="font-weight:bold;">1</em> - <em style="font-weight:bold;">{{ len(results) }}</em> of
+ {% if len(results)<count %}
+ <em style="font-weight:bold;">{{ len(results) }}</em>
+ {% else %}
+ <em style="font-weight:bold;">many</em>
+ {% end %}
+ for <em style="font-weight:bold;">{{ escape(search) }}</em>.
+ (<em style="font-weight:bold;">{{ round(request.request_time(), 3) }}</em> seconds)</h2>
+ </div>
+ <div style="clear:both;"></div>
+ </div>
+ <div class="events">
+ <ul class="events">
+ {% for result in results %}
+ <li class="default">
+ {{ modules.Event(result, display_time=display_event_time) }}
+ </li>
+ {% end %}
+ </ul>
+ </div>
+ {% else %}
+ <h2 class="none">{{ _("No Results Found") }}</h2>
+ {% end %}
+{% end %}

0 comments on commit 5f8f0bd

Please sign in to comment.