Commits

Radim Novotny committed c7e54fb

Removed customized templates for search results.

  • Participants
  • Parent commits 95cbaf2

Comments (0)

Files changed (3)

lfs_solr/templates/lfs_solr/livesearch_results.html

-{% load i18n lfs_tags %}
-{% if products %}
-    <table id="livesearch-results-table">
-        {% for product in products %}
-            <tr class="{% cycle 'even' 'odd' %}"
-                onclick="window.location='{{ product.get_absolute_url }}'">
-                <td class="image">
-                    {% if product.get_image %}
-                        <a href="{{ product.get_absolute_url }}">
-                            <img src="{{ product.get_image.url_60x60 }}"
-                                 alt="{{ product.get_name }}"
-                                 title="{{ product.get_name }}" />
-                        </a>
-                    {% endif %}
-                </td>
-                <td class="text">
-                    <a href="{{ product.get_absolute_url }}">
-                        {{ product.get_name }} 
-                    </a>
-                    <div>
-                        {{ product.short_description|safe }}
-                    </div>
-                    {% for property in product.get_displayed_properties %}
-                        <div>
-                            {{ property.title }} : {{ property.value }} {{ property.unit|safe }}
-                        </div>
-                    {% endfor %}
-                </td>
-                <td class="number"
-                    nowrap="nowrap">
-                    {{ product.get_price|currency }}* {% if product.price_unit %}/ {{ product.price_unit }}{% endif %}
-                </td>
-            </tr>
-        {% endfor %}
-        <tr>
-            <td class="all-results"
-                colspan="3">
-                <a href="{% url lfs_search %}?q={{ q }}">
-                    {% trans 'All results' %} ({{ total }})
-                </a>
-            </td>
-        </tr>
-    </table>
-{% else %}
-    <p>{% trans 'No products found' %}</p>
-{% endif %}

lfs_solr/templates/lfs_solr/search_results.html

-{% extends "lfs/base.html" %}
-{% load i18n lfs_tags pagination_tags %}
-
-{% block title %}
-    {% trans 'Search results' %} - {{ block.super }}
-{% endblock %}
-
-{% block section %}search-results{% endblock %}
-
-{% block breadcrumbs %}
-    {% breadcrumbs _("Search results") %}
-{% endblock %}
-
-{% block right-slot-wrapper %}
-
-{% endblock %}
-{% block left-slot %}
-    <div class="portlet">
-
-        {% if categories %}
-            <div class="portlet-header" style="padding-top:4px">
-                {% trans "Categories" %}
-                {% if categories_reset %}
-                    <a href="{% url solr_reset_field %}?q={{ q }}&amp;field=categories">[X]</a>
-                {% endif %}
-            </div>
-            {% for category in categories %}
-                <div style="padding: 2px 0">
-                    <a href='{% url solr_set_filter %}?q={{ q }}&amp;field=categories&amp;value={{ category.url|urlencode }}'>{{ category.name }} ({{ category.amount }})</a>
-                </div>
-            {% endfor %}
-        {% endif %}
-
-        {% if manufacturers %}
-            <div class="portlet-header" style="margin-top:8px">
-                {% trans "Manufacturers" %}
-                {% if manufacturer_reset %}
-                    <a href="{% url solr_reset_field %}?q={{ q }}&amp;field=manufacturer">[X]</a>
-                {% endif %}
-            </div>
-            {% for manufacturer in manufacturers %}
-                <div style="padding: 2px 0">
-                    <a href='{% url solr_set_filter %}?q={{ q }}&amp;field=manufacturer&amp;value={{ manufacturer.url|urlencode }}'>{{ manufacturer.name }} ({{ manufacturer.amount }})</a>
-                </div>
-            {% endfor %}
-        {% endif %}
-        <div style="padding-top: 10px; font-weight:bold; text-align:right">
-            <a href="{% url solr_reset_filter %}?q={{ q }}">Alle Zur&uuml;cksetzen</a>
-        </div>
-    </div>
-{% endblock %}
-
-{% block content %}
-
-    <h1 class="first-heading">{% trans 'Search results' %}</h1>
-
-    <label for="search">{% trans 'Search' %}:</label>
-    <form action="{% url lfs_search %}"
-          class="search-results-form">
-
-        <input type="hidden"
-               name="reset"
-               value="1" />
-
-        <input id="search-input"
-               type="text"
-               name="q" />
-
-        <input type="submit"
-               value="{% trans 'Go!' %}">
-    </form>
-
-    <p class="search-results-description">
-        {% trans 'You searched for' %} <span class="search-results-query">"{{ q }}"</span>.
-        {% blocktrans count total as counter %}There has been found 1 product.{% plural %}There has been found {{ counter }} products.{% endblocktrans %}
-    </p>
-
-    {% if products %}
-
-        {% autopaginate products 10 %}
-        {% paginate %}
-
-        <br clear="both">
-
-        <div class="span-18 append-bottom right last">
-            
-            <form action="{% url solr_set_sorting %}">
-                <div class="sorting">
-                    <select name="sorting"
-                            onchange="this.form.submit()">
-                        <option value=""
-                            {% ifequal "best" sorting %}selected="selected"{% endifequal %}>{% trans 'Bestes Ergebnis' %}</option>
-                        <option value="name asc"
-                            {% ifequal "name asc" sorting %}selected="selected"{% endifequal %}>{% trans 'Name ascending' %}</option>
-                        <option value="name desc"
-                            {% ifequal "name desc" sorting %}selected="selected"{% endifequal %}>{% trans 'Name descending' %}</option>
-                        <option value="price asc"
-                            {% ifequal "price asc" sorting %}selected="selected"{% endifequal %}>{% trans 'Price ascending' %}</option>
-                        <option value="price desc"
-                            {% ifequal "price desc" sorting %}selected="selected"{% endifequal %}>{% trans 'Price descending' %}</option>
-                    </select>
-                    <input type="hidden" name="q" value="{{ q }}" />
-                </div>
-            </form>
-        </div>
-
-        <br clear="both">
-
-
-        <div class="container header append-bottom">
-            <div class="span-4">
-                {% trans 'Image' %}
-            </div>
-            <div class="span-9">
-                {% trans 'Product' %}
-            </div>
-            <div class="span-5 last number">
-                {% trans 'Price' %}
-            </div>
-        </div>
-
-        {% for product in products %}
-            <div class="container append-bottom">
-                <div class="span-4">
-                    <a href="{{ product.get_absolute_url }}">
-                        <img src="{{ product.get_image.url_100x100 }}"
-                             alt="{{ product.get_name }}"
-                             title="{{ product.get_name }}" />
-                    </a>
-                </div>
-
-                <div class="span-9 text">
-                    <a href="{{ product.get_absolute_url }}">
-                        {{ product.get_name }}
-                    </a>
-                    <div>
-                        {{ product.short_description|safe }}
-                    </div>
-                    {% for property in product.get_displayed_properties %}
-                        <div>
-                            {{ property.title }} : {{ property.value }} {{ property.unit|safe }}
-                        </div>
-                    {% endfor %}
-                </div>
-
-                <div class="span-5 number last">
-                    <div class="product-price">
-                        {% if product.for_sale %}
-                           <span class="for-sale-standard-price">{{ product.get_standard_price|currency }}</span>
-                           <span class="for-sale-price">{{ product.get_for_sale_price|currency }}*</span>
-                        {% else %}
-                            <span class="standard-price">{{ product.get_price|currency }}*</span>
-                        {% endif %}
-                        <div class="price-disclaimer">
-                            {% trans '*inc. VAT' %}
-                        </div>
-                    </div>
-
-                    <div class="buttons">
-                        <a class="button emphasized"
-                           href="{% url lfs_product product.slug %}"
-                           type="submit">
-                            {% trans 'Details' %}
-                        </a>
-                    </div>
-
-                </div>
-            </div>
-        {% endfor %}
-    {% endif %}
-{% endblock %}

lfs_solr/views.py

     return HttpResponseRedirect(reverse("solr_search") + "?q=" + q)
 
 
-def livesearch(request, template_name="lfs_solr/livesearch_results.html"):
+def livesearch(request, template_name="lfs/search/livesearch_results.html"):
     """Renders the results for the live search.
     """
     # if not SOLR_ENABLED, urls.py does not call this view
     return HttpResponse(result)
 
 
-def search(request, template_name="lfs_solr/search_results.html"):
+def search(request, template_name="lfs/search/search_results.html"):
     """Provides form and result for search via Solr.
     """
     # if not SOLR_ENABLED, urls.py does not call this view