mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-26 03:21:05 +00:00
Puts string in template
This commit is contained in:
parent
4a4046a704
commit
bd3acdbf31
2 changed files with 5 additions and 5 deletions
|
@ -106,8 +106,8 @@
|
||||||
(showing {{ start }}-{{ end }})
|
(showing {{ start }}-{{ end }})
|
||||||
{% endblocktrans %}
|
{% endblocktrans %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if shelves_filter_msg %}
|
{% if show_shelves_filter_msg %}
|
||||||
- {{ shelves_filter_msg }} "{{ shelves_filter_query }}"
|
- {% trans "We couldn't find any books that matched" %} "{{ shelves_filter_query }}"
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</span>
|
</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
@ -35,7 +35,7 @@ class Shelf(View):
|
||||||
shelves = models.Shelf.privacy_filter(request.user).filter(user=user).all()
|
shelves = models.Shelf.privacy_filter(request.user).filter(user=user).all()
|
||||||
|
|
||||||
shelves_filter_query = request.GET.get("filter")
|
shelves_filter_query = request.GET.get("filter")
|
||||||
shelves_filter_msg = ""
|
show_shelves_filter_msg = False
|
||||||
|
|
||||||
# get the shelf and make sure the logged in user should be able to see it
|
# get the shelf and make sure the logged in user should be able to see it
|
||||||
if shelf_identifier:
|
if shelf_identifier:
|
||||||
|
@ -95,7 +95,7 @@ class Shelf(View):
|
||||||
|
|
||||||
if shelves_filter_query:
|
if shelves_filter_query:
|
||||||
books = search(shelves_filter_query, books=books) or books
|
books = search(shelves_filter_query, books=books) or books
|
||||||
shelves_filter_msg = "We couldn't find any books that matched"
|
show_shelves_filter_msg = True
|
||||||
|
|
||||||
paginated = Paginator(
|
paginated = Paginator(
|
||||||
books,
|
books,
|
||||||
|
@ -115,7 +115,7 @@ class Shelf(View):
|
||||||
page.number, on_each_side=2, on_ends=1
|
page.number, on_each_side=2, on_ends=1
|
||||||
),
|
),
|
||||||
"shelves_filter_query": shelves_filter_query,
|
"shelves_filter_query": shelves_filter_query,
|
||||||
"shelves_filter_msg": shelves_filter_msg,
|
"show_shelves_filter_msg": show_shelves_filter_msg,
|
||||||
}
|
}
|
||||||
|
|
||||||
return TemplateResponse(request, "shelf/shelf.html", data)
|
return TemplateResponse(request, "shelf/shelf.html", data)
|
||||||
|
|
Loading…
Reference in a new issue