1f1943eb
qijun
initial commit
|
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
|
{% extends "base.html" %}
{% block head %}
{{ super() }}
{# <link rel="stylesheet" href="http://cdn.datatables.net/1.10.7/css/jquery.dataTables.min.css">#}
<link rel="stylesheet"
href="http://cdn.datatables.net/plug-ins/1.10.7/integration/bootstrap/3/dataTables.bootstrap.css">
{% endblock %}
{% block scripts %}
{{ super() }}
<script type="text/javascript"
src="http://cdn.datatables.net/1.10.7/js/jquery.dataTables.min.js"></script>
<script type="text/javascript"
src="http://cdn.datatables.net/plug-ins/1.10.7/integration/bootstrap/3/dataTables.bootstrap.js"></script>
{% endblock %}
{% block content %}
{{ super() }}
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="jumbotron">
<p class="h2"><strong>My Tasks</strong></p>
<br>
<table id="datable" class="table clean table-striped table-bordered"
cellspacing="0"
width="100%">
<thead>
<tr>
<th><i class="fa fa-tasks"></i> Task Name</th>
<th><i class="fa fa-calendar-o"></i> Pub Date</th>
<th><i class="fa fa-calendar-o"></i> Due Date</th>
<th><i class="fa fa-star-half-o"></i> Priority</th>
<th><i class="fa fa-flag"></i> Status</th>
{% if current_user.is_authenticated() and current_user.username == 'admin' %}
<th><i class="fa fa-cogs"></i> Actions</th>
{% endif %}
</tr>
</thead>
{# <tfoot>#}
{# <tr>#}
{# <th><i class="fa fa-tasks"></i> Task Name</th>#}
{# <th><i class="fa fa-calendar-o"></i> Pub Date</th>#}
{# <th><i class="fa fa-calendar-o"></i> Due Date</th>#}
{# <th><i class="fa fa-star-half-o"></i> Priority</th>#}
{# <th><i class="fa fa-flag"></i> Status</th>#}
{# <th><i class="fa fa-cogs"></i> Actions</th>#}
{# </tr>#}
{# </tfoot>#}
<tbody>
{% for task in tasks %}
<tr>
<td align="center">
<a href="{{ url_for('info', task_id = task.id) }}">{{ task.name }}</a>
</td>
<td align="center">{{ task.pubdate }}</td>
<td align="center">{{ task.duedate }}</td>
{% if task.priority ==0 %}
<td align="center"
class="text-success">{{ task.enum_priority[task.priority] }}</td>
{% elif task.priority ==1 %}
<td align="center"
class="text-primary">{{ task.enum_priority[task.priority] }}</td>
{% elif task.priority ==2 %}
<td align="center"
class="text-warning">{{ task.enum_priority[task.priority] }}</td>
{% elif task.priority ==3 %}
<td align="center"
class="text-danger">{{ task.enum_priority[task.priority] }}</td>
{% endif %}
{% if task.status ==0 %}
<td align="center" class="text-info">
{{ task.enum_status[task.status] }}
</td>
{% elif task.status ==1 %}
<td align="center" class="text-muted">
{{ task.enum_status[task.status] }}
</td>
{% elif s.status ==-1 %}
<td align="center" class="text-warning">
{{ s.enum_status[s.status] }}
</td>
{% endif %}
{% if current_user.is_authenticated() and current_user.username == 'admin' %}
<td align="center">
<div class="btn-group">
<button type="button" class="btn btn-success btn-sm"
aria-label="Left Align"
onclick="location.href='{{ url_for("complete", task_id = task.id) }}'">
<i class="fa fa-minus"></i>
</button>
<button type="button" class="btn btn-primary btn-sm"
aria-label="Center Align"
onclick="location.href='{{ url_for("incomplete", task_id = task.id) }}'">
<i class="fa fa-plus"></i>
</button>
<button type="button" class="btn btn-danger btn-sm"
aria-label="Right Align"
onclick="location.href='{{ url_for("delete_entry", task_id = task.id) }}'">
<i class="fa fa-close"></i>
</button>
</div>
</td>
{% endif %}
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
</div>
{% endblock %}
|