-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathtasklist_default.html
More file actions
237 lines (207 loc) · 7.92 KB
/
Copy pathtasklist_default.html
File metadata and controls
237 lines (207 loc) · 7.92 KB
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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
{% extends "base.html" %}
{% block title %}{{ task_list.name|escape }} - {{ application_name }}{% endblock %}
{% block head %}
{% if debug %}
<script src="/static/javascript/debug/browser.js" type="text/javascript"></script>
<script src="/static/javascript/debug/dialog.js" type="text/javascript"></script>
<script src="/static/javascript/debug/dom.js" type="text/javascript"></script>
<script src="/static/javascript/debug/drag.js" type="text/javascript"></script>
<script src="/static/javascript/debug/event.js" type="text/javascript"></script>
<script src="/static/javascript/debug/io.js" type="text/javascript"></script>
<script src="/static/javascript/debug/lang.js" type="text/javascript"></script>
<script src="/static/javascript/debug/offscreen.js" type="text/javascript"></script>
<script src="/static/javascript/debug/tasklist.js" type="text/javascript"></script>
{% else %}
<script src="/static/javascript/tasks.js" type="text/javascript"></script>
{% endif %}
{% if task_list.published %}
<link rel="alternate" type="application/atom+xml" title="{{ task_list.name|escape }}" href="{{ request.path }}?id={{ task_list.key|stringformat:"s"|urlencode }}&output=atom"/>
{% endif %}
<script type="text/javascript">
//<![CDATA[
function newCollaborator() {
var form = document.getElementById("memberform");
var dialog = document.getElementById("memberform_dialog");
DialogBox.instance().show(dialog, function() {
form["email"].focus();
});
}
function publishTaskList(button) {
var publish = button.value == "Publish";
if (publish) {
var dialog = document.getElementById("publishform_dialog");
DialogBox.instance().show(dialog);
} else {
doPublish(false);
}
}
function doPublish(publish) {
var dialog = document.getElementById("publishform_dialog");
var info = document.getElementById("publish_info");
// Disable all the publish buttons as we make the request
var buttons = [document.getElementById("publish_button")];
var inputs = dialog.getElementsByTagName("input");
for (var i = 0; i < inputs.length; i++) {
if (inputs[i].type == "button") {
buttons.push(inputs[i]);
}
}
for (var i = 0; i < buttons.length; i++) {
buttons[i].disabled = true;
}
// Make the request
var body = "id={{ task_list.key|stringformat:"s"|urlencode }}";
if (publish) {
body += "&publish=1";
}
download("/publishtasklist.do", function() {
buttons[0].value = publish ? "Unpublish" : "Publish";
if (publish) {
DialogBox.instance().close();
info.style.display = "";
} else {
info.style.display = "none";
}
for (var i = 0; i < buttons.length; i++) {
buttons[i].disabled = false;
}
}, {
post: true,
body: body
});
}
//]]>
</script>
<style type="text/css">
.tasklist .completed td.description .text {
color: gray;
text-decoration: line-through;
}
.collaborators {
float: right;
}
.collaborators .button {
padding-left: 0.5em;
}
h1 {
font-size: large;
margin: 0;
}
.inbox {
clear: both;
margin-top: 0.5em;
}
.inbox .top {
margin-bottom: 5px;
}
.inbox .task table td {
border-bottom: 0;
padding-bottom: 3px;
padding-top: 3px;
}
#publish_info {
padding-top: 5px;
padding-bottom: 5px;
}
.newtasklist {
margin-left: 10px;
margin-top: 5px;
}
.newtasklist img {
vertical-align: middle;
}
.newtasklist .text {
text-decoration: underline;
color: #0000cc;
}
</style>
{% endblock %}
{% block body %}
<div class="collaborators">
<table><tr><td>
<span class="label">Collaborators:</span>
{% for member in task_list.tasklistmember_set %}
{% ifequal member.user.email user.email %}
Me
{% else %}
{{ member.user.nickname }}
{% endifequal %}
{% if not forloop.last %}/{% endif %}
{% endfor %}
</td><td class="button">
<input type="button" value="New" onclick="newCollaborator()"/>
</td></tr></table>
</div>
<h1>{{ task_list.name|escape }}</h1>
<form action="/tasklist.do" method="post">
<div class="inbox">
<input type="hidden" name="next" value="{{ request.uri|escape }}"/>
<div class="buttons top">
<div class="left corner"></div>
<div class="right corner"></div>
<div class="info">
{% if archive %}
<span class="count">{{ tasks|length }} tasks</span>
{% else %}
<span class="count">{{ tasks|length }} active</span>
<span class="link"><a href="{{ request.path }}?id={{ task_list.key|stringformat:"s"|urlencode }}&archive=1">View all</a></span>
{% endif %}
</div>
<span class="button"><input type="submit" name="action" value="Archive Completed"/></span>
<span class="button"><input id="publish_button" type="button" value="{% if task_list.published %}Unpublish{% else %}Publish{% endif %}" onclick="publishTaskList(this)"/></span>
<span id="publish_info" style="margin-left: 0.5em;{% if not task_list.published %}display: none{% endif %}">Published as <a href="{{ request.uri|escape }}&output=html">HTML</a>, <a href="{{ request.uri|escape }}&output=atom">Atom feed</a></span>
</div>
<div class="table">
<div id="container"></div>
<div class="newtasklist" style="cursor: pointer" onclick="taskList.newTask()"><img src="/static/images/zip-plus.gif" style="width: 14px; height: 14px"> <span class="text">New task</span></div>
{% if not tasks %}
<div class="message">You don't have any active tasks in this list. To get started, <a href="javascript:Task.showDialog()">create a new task</a>.</div>
{% else %}
<div class="message">Drag tasks up and down to rearrange them.</div>
{% endif %}
</div>
</div>
</form>
<div id="memberform_dialog" class="dialog" style="display: none">
<div class="title">New Collaborator</div>
<div class="content">
<form action="/addmember.do" method="post" id="memberform">
<div class="form">
<input type="hidden" name="next" value="{{ request.uri|escape }}"/>
<input type="hidden" name="list" value="{{ task_list.key }}"/>
<div class="field">
<div class="name">Username</div>
<div class="value"><input name="email" type="text" size="10"/></div>
</div>
<div class="buttons">
<span class="button"><input type="submit" value="Add Collaborator"/></span>
<span class="button"><input type="button" value="Cancel" onclick="DialogBox.instance().close()"/></span>
</div>
</div>
</form>
</div>
</div>
<div id="publishform_dialog" class="dialog" style="display: none">
<div class="title">Publish Task List</div>
<div class="content">
<div class="form">
<div class="message">Publishing this task list will make it visible to anyone (though only collaborators will be able to add/edit tasks). Are you sure you want to do this?</div>
<div class="buttons">
<span class="button"><input class="publishform_button" type="button" value="Yes, Publish Task List" onclick="doPublish(true)"/></span>
<span class="button"><input class="publishform_button" type="button" value="Cancel" onclick="DialogBox.instance().close()"/></span>
</div>
</div>
</div>
</div>
{% endblock %}
{% block footer %}
<script type="text/javascript">
var k = "{{ task_list.key }}";
var taskList = new TaskList(k, Task.parseList([
{% for task in tasks %}
[k, "{{ task.key }}", "{{ task.description|stringformat:"s"|addslashes }}", {% if task.completed %}true{% else %}false{% endif %}] {% if not forloop.last %},{% endif %}
{% endfor %}
]));
taskList.attach(document.getElementById("container"));
</script>
{% endblock %}