From 5496a0f5333a24f6025da6e02be440363c538003 Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Sat, 8 Dec 2018 09:26:43 +0100 Subject: [PATCH] search form in list view --- rowers/forms.py | 7 ++++++- rowers/templates/list_workouts.html | 6 +++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/rowers/forms.py b/rowers/forms.py index 7de91fdb..05fc77a8 100644 --- a/rowers/forms.py +++ b/rowers/forms.py @@ -27,7 +27,12 @@ class LoginForm(forms.Form): # search form class SearchForm(forms.Form): - q = forms.CharField(max_length=255,required=False,initial='Search') + q = forms.CharField(max_length=255,required=False, + widget=forms.TextInput( + attrs={'placeholder': 'Search'}), + label='Search') + + # simple form for Contact page. Sends email to info@rowsandall.com class EmailForm(forms.Form): diff --git a/rowers/templates/list_workouts.html b/rowers/templates/list_workouts.html index a46e7fdd..2ccb8c53 100644 --- a/rowers/templates/list_workouts.html +++ b/rowers/templates/list_workouts.html @@ -85,9 +85,9 @@ {% else %}
- {% endif %} - - + {% endif %} + {{ searchform }} +