Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Jean Michel Rouly
bookshare
Commits
bab643f7
Commit
bab643f7
authored
Jan 28, 2015
by
Daniel W Bond
Browse files
search working
parent
a893d0b5
Changes
5
Hide whitespace changes
Inline
Side-by-side
bookshare/settings/settings.py
View file @
bab643f7
...
...
@@ -43,7 +43,7 @@ INSTALLED_APPS = (
'django_gravatar'
,
'crispy_forms'
,
'easy_thumbnails'
,
#
'haystack',
'haystack'
,
'piwik'
,
'django.contrib.admindocs'
,
)
...
...
bookshare/settings/urls.py
View file @
bab643f7
...
...
@@ -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'
),
...
...
bookshare/templates/search/indexes/
website
/listing_text.txt
→
bookshare/
trades/
templates/search/indexes/
trades
/listing_text.txt
View file @
bab643f7
{{ object.title }}
{{ object.author }}
{{ object.
ISBN
}}
{{ object.
isbn
}}
{{ object.year }}
{{ object.edition }}
{{ object.description }}
{{ object.created }}
bookshare/templates/search/results.html
→
bookshare/
trades/
templates/search/results.html
View file @
bab643f7
File moved
bookshare/templates/search/search.html
→
bookshare/
trades/
templates/search/search.html
View file @
bab643f7
{% 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>
​
BOOKSHARE
</h1>
<h1
class=
"text-center"
><strong>
SRCT
</strong>
​
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 %}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment