Fixes calls to filter

This commit is contained in:
Mouse Reeve 2022-02-28 11:17:52 -08:00
parent ffb4098cfb
commit 7d6032e110
3 changed files with 5 additions and 4 deletions

View file

@ -72,7 +72,7 @@
<input type="hidden" name="book" value="{{ book.id }}">
<input type="hidden" name="shelf" value="{{ user_shelf.id }}">
<button class="button is-fullwidth is-small is-radiusless is-danger is-light" type="submit">
{% blocktrans with name=user_shelf|translated_shelf_name %}Remove from {{ name }}{% endblocktrans %}
{% blocktrans with name=user_shelf|translate_shelf_name %}Remove from {{ name }}{% endblocktrans %}
</button>
</form>
</li>

View file

@ -63,7 +63,7 @@
<input type="hidden" name="book" value="{{ active_shelf.book.id }}">
<input type="hidden" name="shelf" value="{{ active_shelf.shelf.id }}">
<button class="button is-fullwidth is-small{% if dropdown %} is-radiusless{% endif %} is-danger is-light" type="submit">
{% blocktrans with name=active_shelf.shelf|translated_shelf_name %}Remove from {{ name }}{% endblocktrans %}
{% blocktrans with name=active_shelf.shelf|translate_shelf_name %}Remove from {{ name }}{% endblocktrans %}
</button>
</form>
</li>

View file

@ -38,7 +38,8 @@ def get_translated_shelf_name(shelf):
"""produced translated shelf nidentifierame"""
if not shelf:
return ""
identifier = shelf.identifier
# support obj or dict
identifier = shelf["identifier"] if isinstance(shelf, dict) else shelf.identifier
if identifier == "all":
return _("All books")
if identifier == "to-read":
@ -47,7 +48,7 @@ def get_translated_shelf_name(shelf):
return _("Currently Reading")
if identifier == "read":
return _("Read")
return shelf.name
return shelf["name"] if isinstance(shelf, dict) else shelf.name
@register.simple_tag(takes_context=True)