Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
La Quadrature du Net
rpteam
Revue de Press
Commits
c0d4e1a3
Verified
Commit
c0d4e1a3
authored
Sep 06, 2017
by
Thibaut Broggi
Browse files
Fill the "search" field with previous research
parent
70762b56
Pipeline
#1198
passed with stages
in 2 minutes and 2 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
apps/rp/templates/rp/article_list_public.html
View file @
c0d4e1a3
...
...
@@ -67,7 +67,7 @@
<li
class=
"nav-item ml-auto"
>
<form
method=
"get"
action=
"{% url 'rp:public-article-list' %}"
>
<div
class=
"input-group"
>
<input
type=
"search"
placeholder=
"Rechercher"
name=
"q"
class=
"fa fa-search"
/>
<input
type=
"search"
placeholder=
"Rechercher"
name=
"q"
class=
"fa fa-search"
value=
"{{ search }}"
/>
<button
type=
"submit"
class=
"btn btn-default input-group-addon"
><i
class=
"fa fa-search"
></i></button>
</div>
</form>
...
...
apps/rp/views/articles.py
View file @
c0d4e1a3
...
...
@@ -52,6 +52,7 @@ class ArticleList(ListView):
qs
=
Tag
.
objects
.
annotate
(
num_times
=
Count
(
'taggit_taggeditem_items'
)).
all
()
qs
=
qs
.
order_by
(
'-num_times'
)
context
[
"tags"
]
=
qs
context
[
"search"
]
=
self
.
request
.
GET
.
get
(
'q'
,
''
)
return
context
...
...
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