1 {% extends
"base.html" %}
3 <title>Product Search Demo App
</title>
10 {% if ratings_links %}
11 <h3>Filter on Rating
</h3>
14 {% for elt in ratings_links %}
16 <a href=
"{{elt.0}}">{{elt
.1}}
</a>
27 <h2>Product Search Demo
</h2>
31 <p><a target=
"_blank" href=
"/static/instrs.html">Click for information
</a> about the demo app. Log in as an app admin to load sample data.
</p>
36 <h4>Product Search
</h4>
39 <form name=
"searchform" action=
"/psearch" method=
"post">
40 <input type=
"hidden" name=
"qtype" value=
"product"/>
47 <select id=
"category" name=
"category">
48 <option value=
"">Any Category
</option>
49 {% for cat in cat_info %}
50 {% if cat
.0 == pcategory %}
51 <option value=
"{{cat.0}}" selected=
"selected">{{cat
.1}}
</option>
53 <option value=
"{{cat.0}}">{{cat
.1}}
</option>
61 <input type=
"text" id=
"query" name=
"query" size=
"80" value=
"{{base_pquery}}" />
67 Sort by:
<select id=
"sort" name=
"sort">
68 {% for sort in sort_info %}
69 {% if sort
.0 == sort_order %}
70 <option value=
"{{sort.0}}" selected=
"selected">{{sort
.1}}
</option>
72 <option value=
"{{sort.0}}">{{sort
.1}}
</option>
81 <input type=
"submit" class=
"btn primary" name=
"psearchsub" value=
"Product Search"/>
82 <input type=
"reset" class=
"btn primary" name=
"psearchreset" value=
"Clear"/>
83 </td><td></td><td></td></tr>
91 {% if search_response %}
93 <h2>Product Search Results
</h2>
97 <a href=
"{{prev_link}}">Previous Results
</a>
103 <a href=
"{{next_link}}">Next Results
</a>
110 {% if returned_count
> 0 %}
112 {{first_res}} - {{last_res}} of {{number_found}} {{qtype}}s shown for query:
<i>{{print_query}}
</i>.
116 {% for result in search_response %}
118 <b>Product Description
</b>: {{result
.3|safe}}
<br/>
119 <b>Product name
</b>: {{result
.5}}
<br/>
120 <b>Category
</b>: {{result
.6}}
<br/>
121 <b>Price
</b>: {{result
.4}}
<br/>
122 <b>Average Rating
</b>:
123 {% if result
.7 <
1 %}
130 <a href=
"/product?pid={{result.1}}">View product details
</a>
131 <a href=
"/reviews?pid={{result.1}}&pname={{result.5}}">Reviews
</a>
137 <a href=
"{{prev_link}}">Previous Results
</a>
143 <a href=
"{{next_link}}">Next Results
</a>
152 <p>No results found.
</p>
157 <script type=
"text/javascript" language=
"JavaScript">
158 document
.forms
['searchform'].elements
['query'].focus();