mirror of
https://github.com/daniviga/django-ram.git
synced 2025-08-04 05:07:50 +02:00
Minor improvements
This commit is contained in:
@@ -4,8 +4,12 @@
|
|||||||
Bookshelf
|
Bookshelf
|
||||||
</a>
|
</a>
|
||||||
<ul class="dropdown-menu" aria-labelledby="bookshelfDropdownMenuLink">
|
<ul class="dropdown-menu" aria-labelledby="bookshelfDropdownMenuLink">
|
||||||
|
{% if books_menu %}
|
||||||
<li><a class="dropdown-item" href="{% url 'books' %}">Books</a></li>
|
<li><a class="dropdown-item" href="{% url 'books' %}">Books</a></li>
|
||||||
|
{% endif %}
|
||||||
|
{% if catalogs_menu %}
|
||||||
<li><a class="dropdown-item" href="{% url 'catalogs' %}">Catalogs</a></li>
|
<li><a class="dropdown-item" href="{% url 'catalogs' %}">Catalogs</a></li>
|
||||||
|
{% endif %}
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@@ -7,8 +7,11 @@ register = template.Library()
|
|||||||
|
|
||||||
@register.inclusion_tag('bookshelf/bookshelf_menu.html')
|
@register.inclusion_tag('bookshelf/bookshelf_menu.html')
|
||||||
def show_bookshelf_menu():
|
def show_bookshelf_menu():
|
||||||
|
# FIXME: Filter out unpublished books and catalogs?
|
||||||
return {
|
return {
|
||||||
"bookshelf_menu": (Book.objects.exists() or Catalog.objects.exists())
|
"bookshelf_menu": (Book.objects.exists() or Catalog.objects.exists()),
|
||||||
|
"books_menu": Book.objects.exists(),
|
||||||
|
"catalogs_menu": Catalog.objects.exists(),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user