Add full event log to toolDetail
This commit is contained in:
parent
eb0e58c9f4
commit
32609b000d
@ -1,5 +1,7 @@
|
|||||||
{% extends "base.djhtml" %}
|
{% extends "base.djhtml" %}
|
||||||
|
|
||||||
|
{% load markdownify %}
|
||||||
|
|
||||||
{% block title %} {{ tool }} | {{ block.super }} {% endblock %}
|
{% block title %} {{ tool }} | {{ block.super }} {% endblock %}
|
||||||
|
|
||||||
{% block admin_link %}{% url 'admin:tasks_tool_change' tool.id %}{% endblock %}
|
{% block admin_link %}{% url 'admin:tasks_tool_change' tool.id %}{% endblock %}
|
||||||
@ -20,4 +22,28 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
<section>
|
||||||
|
<h2>Event Log</h2>
|
||||||
|
<table class="table table-striped table-hover">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th> Date </th>
|
||||||
|
<th> Task </th>
|
||||||
|
<th> User </th>
|
||||||
|
<th> Notes </th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{% for event in events|dictsortreversed:"date" %}
|
||||||
|
<tr>
|
||||||
|
<td class="text-nowrap"> {{ event.date }} </td>
|
||||||
|
<td> {{ event.task.name }} </td>
|
||||||
|
<td> {{ event.user }} </td>
|
||||||
|
<td> {{ event.notes|markdownify }} </td>
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</section>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -16,9 +16,11 @@ def index(request):
|
|||||||
def toolDetail(request, tool_slug):
|
def toolDetail(request, tool_slug):
|
||||||
tool = get_object_or_404(Tool, slug=tool_slug)
|
tool = get_object_or_404(Tool, slug=tool_slug)
|
||||||
tasks = tool.task_set.all()
|
tasks = tool.task_set.all()
|
||||||
|
events = Event.objects.filter(task__tool=tool)
|
||||||
context = {
|
context = {
|
||||||
'tool': tool,
|
'tool': tool,
|
||||||
'tasks': tasks,
|
'tasks': tasks,
|
||||||
|
'events': events,
|
||||||
}
|
}
|
||||||
return render(request, 'tasks/toolDetail.djhtml', context)
|
return render(request, 'tasks/toolDetail.djhtml', context)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user