-
Notifications
You must be signed in to change notification settings - Fork 5
/
template-my-tasks.php
269 lines (193 loc) · 4.82 KB
/
template-my-tasks.php
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
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
<?php
/**
* Template Name: My Tasks
*/
wp_enqueue_script( 'angular' );
wp_enqueue_style( 'angular-scp' );
wp_enqueue_script( 'angular-ui-date' );
wp_enqueue_script( 'orbis-tasks-angular' );
get_header();
?>
<style>
.table tr.completed {
color: #999;
text-decoration: line-through;
}
.table tr.completed a {
color: #999;
}
.table td {
vertical-align: middle;
}
.table td.centered { text-align: center; }
.table td.right { text-align: right; }
.table span.label {
display: inline-block;
margin-left: 10px;
width: 80px;
text-align: left;
padding: 0.5em 0.6em 0.5em;
}
.panel footer {
background: #fff;
border-top: 1px solid #ddd;
}
.task-description {
width: 100%;
max-width: 400px;
}
.task-time .form-control {
max-width: 100px;
}
.due-date {
border-bottom: 1px dashed;
display: inline;
position: relative;
top: 2px;
}
a.title {
display: block;
font-size: 18px;
}
span.alt {
color: #999;
}
img.avatar {
-webkit-border-radius: 100px;
-moz-border-radius: 100px;
border-radius: 100px;
}
.form-group.inline {
float: left;
margin-right: 10px;
}
.selectors {
display: inline-block;
margin-left: 15px;
}
.selector {
display: inline-block;
position: relative;
}
.selector > a {
background: #f6f6f6;
-webkit-border-radius: 20px;
-moz-border-radius: 20px;
border-radius: 20px;
color: #999;
display: inline-block;
font-size: 12px;
outline: none;
margin-left: 5px;
padding: 2px 8px;
text-decoration: none;
}
.selector > a:hover {
background: #ddd;
}
.selector > a.active {
background: #333;
color: #fff;
}
.selector .dropdown {
background: #fff;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.15);
border: 1px solid #ccc;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
display: none;
list-style: none;
margin: 0;
padding: 20px;
position: absolute;
left: 10px;
top: 30px;
z-index: 50;
min-width: 220px;
}
.selector .dropdown:before,
.selector .dropdown:after {
content: " ";
display: block;
position: absolute;
left: 10px;
top: -8px;
width: 0;
height: 0;
border-left: 8px solid transparent;
border-right: 8px solid transparent;
border-bottom: 8px solid #ccc;
}
.selector .dropdown:after {
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-bottom: 6px solid #fff;
left: 12px;
top: -6px;
}
.selector ul.dropdown {
padding: 0;
}
.selector .dropdown li {
border-bottom: 1px solid #eee;
}
.selector .dropdown a {
display: block;
padding: 5px;
}
</style>
<?php while ( have_posts() ) : the_post(); ?>
<div ng-controller="OrbisTasksCtrl">
<div class="page-header">
<h1>
<?php the_title(); ?>
</h1>
</div>
<div class="panel">
<header>
<h3>Overview</h3>
</header>
<div class="well">
</div>
<div ng-show="tasks == null" class="well">
<span class="glyphicon glyphicon-refresh"></span>
</div>
<div class="table-responsive" ng-show="tasks != null" ng-cloak>
<table class="table table-striped table-condense table-hover">
<col width="10">
<col width="50">
<tbody>
<tr class="orbis_task type-orbis_task status-publish hentry" ng-repeat="task in tasks" ng-class="{completed: task.done}">
<td class="centered">
<input type="checkbox" ng-model="task.done" ng-change="toggleTask( task );" />
</td>
<td>
<img width="50" height="50" class="avatar avatar-50 photo" ng-src="http://www.gravatar.com/avatar/{{task.assignee.gravatar_hash}}.jpg?s=200" alt="">
</td>
<td>
<a ng-href="{{task.url}}" class="title">{{task.text}}</a>
<span class="entry-meta">
<a ng-href="{{task.project.url}}">{{task.project.title}}</a>
<span class="glyphicon glyphicon-time"></span> {{task.time | orbis_time}}
</span>
</td>
<td class="right">
<div class="due-date" ng-hide="editing" ng-click="editing = true">{{task.due_at | date : 'd MMM yyyy'}}</div>
<form class="form-inline" role="form" ng-show="editing" ng-submit="updateTask( task ); editing = false;">
<input class="form-control" ui-date ng-model="task.due_at" ng-required="true">
<button class="btn btn-default" type="submit">Update</button>
</form>
<span class="label" ng-class="task.done ? 'label-default' : ( task.days_left <= 0 && ! task.done ) ? 'label-danger' : 'label-success'">
<ng-pluralize count="task.days_left" when="{'1': '<?php esc_attr_e( '1 day', 'orbis' ); ?>', 'other': '<?php esc_attr_e( '{} days', 'orbis' ); ?>'}"></ng-pluralize>
</span>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<?php get_template_part( 'templates/task_form' ); ?>
</div>
<?php endwhile; ?>
<?php get_footer(); ?>