Commit bab643f7 authored by Daniel W Bond's avatar Daniel W Bond
Browse files

search working

parent a893d0b5
......@@ -43,7 +43,7 @@ INSTALLED_APPS = (
'django_gravatar',
'crispy_forms',
'easy_thumbnails',
#'haystack',
'haystack',
'piwik',
'django.contrib.admindocs',
)
......
......@@ -16,6 +16,9 @@ urlpatterns = patterns('',
url(r'^student/', include('core.urls')),
url(r'^lookouts/', include('lookouts.urls')),
# search
url(r'^search/', include('haystack.urls'), name='search'),
### static pages ###
url(r'^$', TemplateView.as_view(template_name='index.html'), name = 'homepage'),
url(r'^about/?$', TemplateView.as_view(template_name='about.html'), name='about'),
......
{{ object.title }}
{{ object.author }}
{{ object.ISBN }}
{{ object.isbn }}
{{ object.year }}
{{ object.edition }}
{{ object.description }}
{{ object.created }}
{% extends 'layouts/base.html' %}
{% block title %}
GMU Bookshare • Search Listings
SRCT Bookshare • Search Listings
{% endblock %}
{% block content %}
......@@ -9,57 +9,55 @@ GMU Bookshare • Search Listings
<div class="page-header" id="banner">
<div class="row">
<div class="col-lg-12">
<h1 class="text-center"><strong>GMU</strong>&#8203;BOOKSHARE</h1>
<h1 class="text-center"><strong>SRCT</strong>&#8203;BOOKSHARE</h1>
<p class="lead text-center"><strong>Search</strong></p>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-8 col-lg-offset-2">
<div class="col-md-8 col-md-offset-2">
<form class="form-horizontal" role="form" method="get">
<div class="form-group">
<div class="input-group">
<span class="input-group-addon">
<span class="glyphicon glyphicon-search"></span>
<i class="fa fa-search fa-lg"></i>
</span>
{{ form.q }}
</div>
</div>
</form>
</div>
</div>
{% if query %}
<hr />
<div class="row">
<div class="col-lg-8 col-lg-offset-2">
<div class="col-md-8 col-md-offset-2">
{% if page.object_list %}
<h3 class="text-center">Search Results</h3>
<table class="table table-bordered">
<table class="table table-hover">
<thead>
<th class="col-md-1 text-center">ISBN</th>
<th class="col-md-7">Title</th>
<th class="col-md-3 text-center">Author</th>
<th class="col-md-1 text-center">Price</th>
<th class="col-md-1 text-center"><h3><small>ISBN</small></h3></th>
<th class="col-md-7 text-center"><h3><small>Title</small></h3></th>
<th class="col-md-3 text-center"><h3><small>Author</small></h3></th>
<th class="col-md-1 text-center"><h3><small>Price</small></h3></th>
</thead>
{% endif %}
{% for result in page.object_list %}
<tr>
<td class="text-center">
{{ result.object.ISBN }}
<h4>{{ result.object.isbn }}</h4>
</td>
<td>
<a href="{{ result.object.get_absolute_url }}">{{ result.object.title }}</a>
<td class="text-center">
<a href="{{ result.object.get_absolute_url }}"><h4><strong>{{ result.object.title }}</strong></h4></a>
</td>
<td class="text-center">
{{ result.object.author }}
<h4>{{ result.object.author }}</h4>
</td>
<td class="text-center">
${{ result.object.price }}
<h4>${{ result.object.price }}</h4>
</td>
</tr>
{% empty %}
......
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