/
task_list.html
171 lines (158 loc) · 7.7 KB
/
task_list.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
{% extends "tasks/base.html" %}
{% load i18n %}
{% load shorttimesince_tag %}
{% load order_by %}
{% load humanize %}
{% load tasks_tags %}
{% load tagging_tags %}
{% load group_tags %}
{% load extra_tagging_tags %}
{#}{% block head_title %}Tasks {% if project %} for {{ project.name }}{% endif %}{% endblock %}#}
{% block head_title %}Tasks{% endblock %}
{% block body_class %}{{ block.super }} task_list{% endblock %}
{% block body %}
{#<h1>{% trans "Tasks for Project" %} <a href="@@@">{{ group.name }}</a></h1> #}
<h1>Tasks{% if group %} for {{ group }}{% endif %}</h1>
<form action="" method="GET">
<div class="task_filter">
<ul>
{{ task_filter.form.as_ul }}
<li><input type="submit" value="filter"/></li>
</ul>
</div>
{% if group_by %}
<input type="hidden" name="group_by" value="{{ group_by }}" />
{% endif %}
</form>
<p>Group by:
{% ifequal group_by "state" %}
<a href="?{% if gbqs %}{{ gbqs }}&{% endif %}group_by=modified">last modified</a>
or
<b>state</b>
or
<a href="?{% if gbqs %}{{ gbqs }}&{% endif %}group_by=assignee">assignee</a>
or
<a href="?{% if gbqs %}{{ gbqs }}&{% endif %}group_by=tag">tag</a>
{% order tasks by state %}
{% regroup tasks by get_state_display as grouped_tasks %}
{% else %}
{% ifequal group_by "assignee" %}
<a href="?{% if gbqs %}{{ gbqs }}&{% endif %}group_by=modified">last modified</a>
or
<a href="?{% if gbqs %}{{ gbqs }}&{% endif %}group_by=state">state</a>
or
<b>assignee</b>
or
<a href="?{% if gbqs %}{{ gbqs }}&{% endif %}group_by=tag">tag</a>
{% order tasks by assignee %}
{% regroup tasks by assignee as grouped_tasks %}
{% else %}
{% ifequal group_by "tag" %}
<a href="?{% if gbqs %}{{ gbqs }}&{% endif %}group_by=modified">last modified</a>
or
<a href="?{% if gbqs %}{{ gbqs }}&{% endif %}group_by=state">state</a>
or
<a href="?{% if gbqs %}{{ gbqs }}&{% endif %}group_by=assignee">assignee</a>
or
<b>tag</b>
{# do no manipulation here as we'll special case below #}
{% else %}
<b>last modified</b>
or
<a href="?{% if gbqs %}{{ gbqs }}&{% endif %}group_by=state">state</a>
or
<a href="?{% if gbqs %}{{ gbqs }}&{% endif %}group_by=assignee">assignee</a>
or
<a href="?{% if gbqs %}{{ gbqs }}&{% endif %}group_by=tag">tag</a>
{% order tasks by -modified %}
{% regroup tasks by modified.date as grouped_tasks %}
{% endifequal %}
{% endifequal %}
{% endifequal %}
</p>
<p class="expand_collapse_all"><a class="expand_all">expand all</a> – <a class="collapse_all">collapse all</a></p>
<table class="task_list">
<tr>
<th>ID</th>
<th>Summary</th>
<th>Last Modified</th>
<th>Assignee</th>
<th>Tags</th>
<th>Status</th>
</tr>
{% ifequal group_by "tag" %}
{% tags_for_model tasks.Task as task_tags %}
{% for section in task_tags %}
{% tasks_for_tag section as tagtasks in tasks %}
<tbody><tr class="task_grouping">
<td colspan="6">
<span class="focus"><a href="{% focus_url group_by section group %}">focus</a></span>
<span class="toggle">
<span class="arrow">▾</span>
{{ section }}
<span class="count">({{ tagtasks|length }})</span>
</span>
</td>
</tr></tbody>
<tbody class="task_group" id="group_{{ forloop.counter }}">
{% for item in tagtasks %}
<tr class="task_{{ item.get_state_display }} {% cycle odd,even %}">
<td>{{ item.id }}</td>
<td><a href="{% groupurl task_detail group id=item.id %}">{{ item.summary }}</a></td>
<td style="white-space: nowrap">{{ item.modified|shorttimesince }} ago</td>
<td>
{% if item.assignee %}
<a href="{% groupurl tasks_for_user group username=item.assignee %}">{{ item.assignee }}</a>
{% else %}
<span class="warning">unassigned</span>
{% endif %}
</td>
<td>{% show_tags_for item %}</td>
<td>{{ item.status }}</td>
</tr>
{% endfor %}
</tbody>
{% endfor %}
{% else %}
{% for section in grouped_tasks %}
<tbody><tr class="task_grouping">
<td colspan="6">
<span class="focus"><a href="{% focus_url group_by section.grouper group %}">focus</a></span>
<span class="toggle">
<span class="arrow">▾</span>
{% ifequal group_by "state" %}
{{ section.grouper }}
{% else %}
{% ifequal group_by "assignee" %}
{% if section.grouper %}{{ section.grouper }}{% else %}unassigned{% endif %}
{% else %}
{{ section.grouper|naturalday:_("MONTH_DAY_FORMAT")|capfirst }}
{% endifequal %}
{% endifequal %}
<span class="count">({{ section.list|length }})</span>
</span>
</td>
</tr></tbody>
<tbody class="task_group" id="group_{{ forloop.counter }}">
{% for task in section.list %}
<tr class="task_{{ task.get_state_display }} {% cycle odd,even %}">
<td>{{ task.id }}</td>
<td><a href="{% groupurl task_detail group id=task.id %}">{{ task.summary }}</a></td>
<td style="white-space: nowrap">{{ task.modified|shorttimesince }} ago</td>
<td>
{% if task.assignee %}
<a href="{% groupurl tasks_for_user group username=task.assignee %}">{{ task.assignee }}</a>
{% else %}
<span class="warning">unassigned</span>
{% endif %}
</td>
<td>{% show_tags_for task %}</td>
<td>{{ task.status }}</td>
</tr>
{% endfor %}
</tbody>
{% endfor %}
{% endifequal %}
</table>
<p class="expand_collapse_all"><a class="expand_all">expand all</a> – <a class="collapse_all">collapse all</a></p>
{% endblock %}