Use {% empty %}
instead of if/else in index
This commit is contained in:
parent
48e5ec1ca3
commit
58a5645cdf
@ -4,24 +4,20 @@
|
||||
|
||||
{% block content %}
|
||||
<h1> Tools </h1>
|
||||
{% if tools %}
|
||||
<ul>
|
||||
{% for tool in tools %}
|
||||
<li><a href="{{ tool.get_absolute_url }}">{{ tool.name }}</a></li>
|
||||
{% empty %}
|
||||
<p>No tools are available.</p>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% else %}
|
||||
<p>No tools are available.</p>
|
||||
{% endif %}
|
||||
|
||||
<h1> Tasks </h1>
|
||||
{% if tasks %}
|
||||
<ul>
|
||||
{% for task in tasks %}
|
||||
<li><a href="{{ task.get_absolute_url }}">{{ task.name }}</a> - last at {{ task.last_event.date|date }}, next at {{ task.next_recurrence|date }} </li>
|
||||
{% empty %}
|
||||
<p>No tasks are available.</p>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% else %}
|
||||
<p>No tasks are available.</p>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
Loading…
Reference in New Issue
Block a user