Split tool/task list items into component templates
This commit is contained in:
parent
58a5645cdf
commit
7c14e4733c
6
tasks/templates/tasks/components/task_li.djhtml
Normal file
6
tasks/templates/tasks/components/task_li.djhtml
Normal 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>
|
3
tasks/templates/tasks/components/tool_li.djhtml
Normal file
3
tasks/templates/tasks/components/tool_li.djhtml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
<li>
|
||||||
|
<a href="{{ tool.get_absolute_url }}">{{ tool.name }}</a>
|
||||||
|
</li>
|
@ -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 %}
|
||||||
|
Loading…
Reference in New Issue
Block a user