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