Split tool/task list items into component templates

This commit is contained in:
Adam Goldsmith 2021-01-21 17:12:05 -05:00
parent 58a5645cdf
commit 7c14e4733c
3 changed files with 11 additions and 2 deletions

View File

@ -0,0 +1,6 @@
<li>
<a href="{{ task.get_absolute_url }}">
{{ task.name }}
</a>
- last completed {{ task.last_event.date|date|default:"never"}}, next required {{ task.next_recurrence|date|default:"never" }}
</li>

View File

@ -0,0 +1,3 @@
<li>
<a href="{{ tool.get_absolute_url }}">{{ tool.name }}</a>
</li>

View File

@ -6,7 +6,7 @@
<h1> Tools </h1> <h1> Tools </h1>
<ul> <ul>
{% for tool in tools %} {% for tool in tools %}
<li><a href="{{ tool.get_absolute_url }}">{{ tool.name }}</a></li> {% include "./components/tool_li.djhtml" with tool=tool %}
{% empty %} {% empty %}
<p>No tools are available.</p> <p>No tools are available.</p>
{% endfor %} {% endfor %}
@ -15,7 +15,7 @@
<h1> Tasks </h1> <h1> Tasks </h1>
<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> {% include "./components/task_li.djhtml" with task=task %}
{% empty %} {% empty %}
<p>No tasks are available.</p> <p>No tasks are available.</p>
{% endfor %} {% endfor %}