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
27ad2b72
Commit
27ad2b72
authored
Dec 19, 2013
by
Jean Michel Rouly
Browse files
Use a custom, styled search input.
parent
d2f19ffa
Changes
2
Hide whitespace changes
Inline
Side-by-side
bookshare/settings/urls.py
View file @
27ad2b72
...
...
@@ -6,6 +6,8 @@ from django.conf.urls.static import static
from
django.contrib
import
admin
from
django.contrib
import
auth
from
django.conf.urls
import
patterns
,
include
,
url
from
website.forms
import
StyledSearchForm
from
haystack.views
import
SearchView
# Uncomment the next two lines to enable the admin:
admin
.
autodiscover
()
...
...
@@ -40,7 +42,15 @@ urlpatterns = patterns('website.views',
#### SEARCH PAGES ####
# points to a SearchView Instance
url
(
r
'^search/'
,
include
(
'haystack.urls'
)),
#url(r'^search/', include('haystack.urls')),
url
(
r
'^search/?'
,
SearchView
(
form_class
=
StyledSearchForm
,
results_per_page
=
20
,
),
name
=
'haystack_search'
,
),
#### ADMIN PAGES ####
# Uncomment the admin/doc line below to enable admin documentation:
...
...
bookshare/website/forms.py
View file @
27ad2b72
...
...
@@ -3,6 +3,17 @@ from django import forms
from
django.db
import
models
from
django.forms
import
ModelForm
,
Textarea
,
TextInput
,
NumberInput
,
Select
,
FileInput
from
website.models
import
Seller
,
Listing
from
haystack.forms
import
SearchForm
class
StyledSearchForm
(
SearchForm
):
q
=
forms
.
CharField
(
required
=
False
,
label
=
'Search'
,
widget
=
forms
.
TextInput
(
attrs
=
{
'class'
:
'form-control'
,
}),
)
class
FinalPriceForm
(
forms
.
Form
):
...
...
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