Rename Item model to Task

- With matching model, view, template changes
This commit is contained in:
Scot Hacker 2018-03-28 22:51:10 -07:00
parent a2d02b0a8c
commit d3d8d5e46c
15 changed files with 133 additions and 119 deletions

View file

@ -8,10 +8,10 @@
<p>Category tally:</p>
<ul>
<li>Incomplete: {{ item_count_undone }} </li>
<li>Complete: {{ item_count_done }} </li>
<li>Incomplete: {{ task_count_undone }} </li>
<li>Complete: {{ task_count_done }} </li>
<li>
<strong>Total: {{ item_count_total }}</strong>
<strong>Total: {{ task_count_total }}</strong>
</li>
</ul>

View file

@ -27,7 +27,7 @@
<div class="form-group">
<label for="id_assigned_to">Assigned To</label>
{# See todo.forms.AddEditItemForm #}
{# See todo.forms.AddEditTaskForm #}
{{form.assigned_to}}
</div>

View file

@ -14,7 +14,7 @@
<hr />
{% endif %}
{% if items %}
{% if tasks %}
{% if list_slug == "mine" %}
<h1>Tasks assigned to me (in all groups)</h1>
{% else %}
@ -37,7 +37,7 @@
<th>Del</th>
</tr>
{% for task in items %}
{% for task in tasks %}
<tr id="{{ task.id }}">
<td>
<input type="checkbox" name="toggle_done_tasks"
@ -80,7 +80,7 @@
</form>
{% else %}
<h4>No items on this list yet (add one!)</h4>
<h4>No tasks on this list yet (add one!)</h4>
{% include 'todo/include/toggle_delete.html' %}
{% endif %}

View file

@ -5,16 +5,16 @@
{% block content %}
<h1>Todo Lists</h1>
<p>{{ item_count }} items in {{ list_count }} list{{ list_count|pluralize }}</p>
<p>{{ task_count }} tasks in {{ list_count }} list{{ list_count|pluralize }}</p>
{% regroup lists by group as section_list %}
{% for group in section_list %}
<h3>Group: {{ group.grouper }}</h3>
<ul class="list-group mb-4">
{% for item in group.list %}
{% for task in group.list %}
<li class="list-group-item d-flex justify-content-between align-items-center">
<a href="{% url 'todo:list_detail' item.id item.slug %}">{{ item.name }}</a>
<span class="badge badge-primary badge-pill">{{ item.item_set.count }}</span>
<a href="{% url 'todo:list_detail' task.id task.slug %}">{{ task.name }}</a>
<span class="badge badge-primary badge-pill">{{ task.task_set.count }}</span>
</li>
{% endfor %}
</ul>

View file

@ -4,10 +4,10 @@
{% block content_title %}<h2 class="page_title">Search</h2>{% endblock %}
{% block content %}
{% if found_items %}
<h2>{{found_items.count}} search results for term: "{{ query_string }}"</h2>
{% if found_tasks %}
<h2>{{found_tasks.count}} search results for term: "{{ query_string }}"</h2>
<div class="post_list">
{% for f in found_items %}
{% for f in found_tasks %}
<p>
<strong>
<a href="{% url 'todo:task_detail' f.id %}">{{ f.title }}</a>