Commit 22addc01 authored by Daniel W Bond's avatar Daniel W Bond
Browse files

default searchy template

parent caa95ea2
......@@ -24,6 +24,10 @@ Make sure to install everything you need in your virtual environment from the re
When you run `$ pip install -r requirements.txt` to install all Python modules, make sure to run `$ pip migrate website && pip migrate bids && pip migrate easy_thumbnails`.
Make sure you have elasticsearch installed on your machine. (Not pyelasticsearch). Furthermore:
> Using the standard SearchIndex, your search index content is only updated whenever you run either ./manage.py update_index or start afresh with ./manage.py rebuild_index.
Debian and Ubuntu Installation Instructions
---
`$ sudo apt-get update && sudo apt-get install libldap2-dev python-dev libmysqlclient-dev python-mysqldb`elasticsearch
......@@ -31,7 +35,7 @@ Debian and Ubuntu Installation Instructions
To-do
---
* Set up Haystack with ElasticSearch
* Regarding Haystack-- something about RealTimeSignalProcessor, or a search cronjob
* Save searches, and display saved search results on user's home page
* Make links more prevalent on the site.
* Seller's rating
......@@ -52,6 +52,10 @@ urlpatterns = patterns('website.views',
# Uncomment the next line to enable the admin:
url(r'^admin/', include(admin.site.urls)),
#### SEARCHES ####
url(r'^search/', include(haystack.urls)),
# points to a SearchView Instance
#### COMMENTS APP ####
(r'^comments/', include('django.contrib.comments.urls')),
......
{% extends 'layouts/base.html' %}
{% block title %}
GMU Bookshare • Search
{% endblock %}
{% block content %}
<h2>Search</h2>
<form method="get" action=".">
<table>
{{ form.as_table }}
<tr>
<td>&nbsp;</td>
<td>
<input type="submit" value="Search">
</td>
</tr>
</table>
{% if query %}
<h3>Results</h3>
{% for result in listing.object_list %}
<p>
<a href="{{ result.object.get_absolute_url }}">{{ result.object.title }}</a>
</p>
{% empty %}
<p>No results found.</p>
{% endfor %}
{% if page.has_previous or page.has_next %}
<div>
{% if page.has_previous %}<a href="?q={{ query }}&amp;page={{ page.previous_page_number }}">{% endif %}&laquo; Previous{% if page.has_previous %}</a>{% endif %}
|
{% if page.has_next %}<a href="?q={{ query }}&amp;page={{ page.next_page_number }}">{% endif %}Next &raquo;{% if page.has_next %}</a>{% endif %}
</div>
{% endif %}
{% else %}
{# Show some example queries to run, maybe query syntax, something else? #}
{% endif %}
</form>
{% endblock %}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment