Blame view

FlaskT.v0.3/templates/tasks.html 13.5 KB
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
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
{% 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="{{ url_for('static', filename='css/jquery.dataTables.min.css') }}">#}
    <link rel="stylesheet"
          href="{{ url_for('static', filename='css/dataTables.bootstrap.css') }}">

{% endblock %}

{% block scripts %}
    {{ super() }}
    <script src="{{ url_for('static',filename='js/jquery.dataTables.min.js') }}"></script>
    <script src="{{ url_for('static',filename='js/dataTables.bootstrap.js') }}"></script>
{% endblock %}

{% block content %}
    {{ super() }}
    <div class="container">
        <div class="row">
            <div class="col-md-12">
                <table id="datable" class="table default 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 o in open_tasks %}
                        <tr>
                            <td align="center">
                                <a href="{{ url_for('info', task_id = o.id) }}">{{ o.name }}</a>
                            </td>
                            <td align="center">{{ o.pubdate }}</td>
                            <td align="center">{{ o.duedate }}</td>
                            {% if o.priority ==0 %}
                                <td align="center"
                                    class="text-success">{{ o.enum_priority[o.priority] }}</td>
                            {% elif o.priority ==1 %}
                                <td align="center"
                                    class="text-primary">{{ o.enum_priority[o.priority] }}</td>
                            {% elif o.priority ==2 %}
                                <td align="center"
                                    class="text-warning">{{ o.enum_priority[o.priority] }}</td>
                            {% elif o.priority ==3 %}
                                <td align="center"
                                    class="text-danger">{{ o.enum_priority[o.priority] }}</td>
                            {% endif %}


                            {% if o.status ==0 %}
                                <td align="center" class="text-info">
                                    {{ o.enum_status[o.status] }}
                                </td>
                            {% elif o.status ==1 %}
                                <td align="center" class="text-muted">
                                    {{ o.enum_status[o.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 = o.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 = o.id) }}'"
                                                disabled>
                                            <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 = o.id) }}'">
                                            <i class="fa fa-close"></i>
                                        </button>
                                    </div>
                                </td>
                            {% endif %}
                        </tr>
                    {% endfor %}
                    {% for c in closed_tasks %}
                        <tr>
                            <td align="center">
                                <a href="{{ url_for('info', task_id = c.id) }}">{{ c.name }}</a>
                            </td>
                            <td align="center">{{ c.pubdate }}</td>
                            <td align="center">{{ c.duedate }}</td>
                            {% if c.priority ==0 %}
                                <td align="center"
                                    class="text-success">{{ c.enum_priority[c.priority] }}</td>
                            {% elif c.priority ==1 %}
                                <td align="center"
                                    class="text-primary">{{ c.enum_priority[c.priority] }}</td>
                            {% elif c.priority ==2 %}
                                <td align="center"
                                    class="text-warning">{{ c.enum_priority[c.priority] }}</td>
                            {% elif c.priority ==3 %}
                                <td align="center"
                                    class="text-danger">{{ c.enum_priority[c.priority] }}</td>
                            {% endif %}

                            {% if c.status ==0 %}
                                <td align="center" class="text-info">
                                    {{ c.enum_status[c.status] }}
                                </td>
                            {% elif c.status ==1 %}
                                <td align="center" class="text-muted">
                                    {{ c.enum_status[c.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 = c.id) }}'"
                                                disabled>
                                            <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 = c.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 = c.id) }}'">
                                            <i class="fa fa-close"></i>
                                        </button>
                                    </div>
                                </td>
                            {% endif %}
                        </tr>
                    {% endfor %}
                    {% if current_user.is_authenticated() and current_user.username == 'admin' %}
                        {% for s in secret_tasks %}
                            <tr>
                                <td align="center">
                                    <a href="{{ url_for('info', task_id = s.id) }}">{{ s.name }}</a>
                                </td>
                                <td align="center">{{ s.pubdate }}</td>
                                <td align="center">{{ s.duedate }}</td>
                                {% if s.priority ==0 %}
                                    <td align="center"
                                        class="text-success">{{ s.enum_priority[s.priority] }}</td>
                                {% elif s.priority ==1 %}
                                    <td align="center"
                                        class="text-primary">{{ s.enum_priority[s.priority] }}</td>
                                {% elif s.priority ==2 %}
                                    <td align="center"
                                        class="text-warning">{{ s.enum_priority[s.priority] }}</td>
                                {% elif s.priority ==3 %}
                                    <td align="center"
                                        class="text-danger">{{ s.enum_priority[s.priority] }}</td>
                                {% endif %}

                                {% if s.status ==0 %}
                                    <td align="center" class="text-info">
                                        {{ s.enum_status[s.status] }}
                                    </td>
                                {% elif s.status ==1 %}
                                    <td align="center" class="text-muted">
                                        {{ s.enum_status[s.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 = s.id) }}'"
                                                    disabled>
                                                <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 = s.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 = s.id) }}'">
                                                <i class="fa fa-close"></i>
                                            </button>
                                        </div>
                                    </td>
                                {% endif %}
                            </tr>
                        {% endfor %}
                    {% endif %}
                    </tbody>
                </table>
            </div>
        </div>
    </div>
{% endblock %}