|
1 | 1 | <!doctype html>
|
2 | 2 | <html lang="en">
|
3 |
| - <head> |
4 |
| - <title>Endless Task List App using Flask</title> |
5 |
| - <link |
6 |
| - rel="stylesheet" |
7 |
| - href="{{ url_for('static', filename='css/index.css') }}" |
8 |
| - /> |
9 |
| - </head> |
10 |
| - <body> |
11 |
| - <h1>Endless Task List App using Flask</h1> |
12 |
| - <ul> |
13 |
| - {% with messages = get_flashed_messages() %}<!--get flashed messages to display--> |
14 |
| - {% if messages %} |
15 |
| - <div class="popup-message"> |
16 |
| - {% for message in messages %} |
17 |
| - <p>{{ message }}</p> |
18 |
| - {% endfor %} |
19 |
| - </div> |
20 |
| - {% endif %} {% endwith %} {{ user.username }}:<br /> |
21 |
| - Level {{ user.level }}<br /> |
22 |
| - Total XP: {{ user.total_xp | short_numeric }}<br /> |
23 |
| - {{ user.xp | short_numeric }} / {{ user.xp_required | short_numeric }} |
24 |
| - XP<br /> |
25 |
| - Rating: {{ user.rating | round_number_with_commas }}<br /> |
26 |
| - <div class="progress-container"> |
27 |
| - <!--get current level progress--> |
28 |
| - <progress value="{{ user.xp }}" max="{{ user.xp_required }}"></progress> |
29 |
| - <div class="progress-text"> |
30 |
| - {{ (user.xp / user.xp_required * 100) | short_numeric }}% |
31 |
| - </div> |
32 |
| - </div> |
33 |
| - Add New Task<br /> |
34 |
| - <form action="{{ url_for('add_task') }}" method="post"> |
35 |
| - <!--form to add task--> |
36 |
| - <label for="name">Name: </label |
37 |
| - ><input |
38 |
| - type="text" |
39 |
| - id="name" |
40 |
| - name="name" |
41 |
| - maxlength="80" |
42 |
| - required |
43 |
| - /><br /> |
44 |
| - <label for="due_date">Due date: </label |
45 |
| - ><input |
46 |
| - type="date" |
47 |
| - id="due_date" |
48 |
| - name="due_date" |
49 |
| - min="{{ today }}" |
50 |
| - max="9999-12-31" |
51 |
| - value="{{ today }}" |
52 |
| - required |
53 |
| - /><br /> |
54 |
| - <label for="priority">Priority: </label |
55 |
| - ><select id="priority" name="priority"> |
56 |
| - <option value="1" selected>Low</option> |
57 |
| - <option value="2">Medium</option> |
58 |
| - <option value="3">High</option></select |
59 |
| - ><br /> |
60 |
| - <label for="difficulty">Difficulty: </label |
61 |
| - ><select id="difficulty" name="difficulty"> |
62 |
| - <option value="1" selected>Easy</option> |
63 |
| - <option value="2">Medium</option> |
64 |
| - <option value="3">Hard</option></select |
65 |
| - ><br /> |
66 |
| - <label for="repeat_interval">Repeat every: </label |
67 |
| - ><input |
68 |
| - type="number" |
69 |
| - id="repeat_interval" |
70 |
| - name="repeat_interval" |
71 |
| - min="1" |
72 |
| - step="1" |
73 |
| - value="1" |
74 |
| - /><br /> |
75 |
| - <label for="repeat_often">Repeat interval: </label |
76 |
| - ><select id="repeat_often" name="repeat_often"> |
77 |
| - <option value="1">Daily</option> |
78 |
| - <option value="2">Weekly</option> |
79 |
| - <option value="3">Monthly</option> |
80 |
| - <option value="4">Yearly</option> |
81 |
| - <option value="5" selected>Once</option></select |
82 |
| - ><br /> |
83 |
| - <input type="submit" value="Add Task" /> |
84 |
| - </form> |
85 |
| - <ul> |
86 |
| - {% for task in tasks %}<!--repeat for each task in task list--> |
87 |
| - <li> |
88 |
| - {{ task.name }}<br /> |
89 |
| - Due: {{ task.due_date }} |
90 |
| - </li> |
91 |
| - Priority: {% if task.priority == 1 %} Low {% elif task.priority == 2 %} |
92 |
| - Medium {% elif task.priority == 3 %} High {% endif %}<br /> |
93 |
| - Difficulty: {% if task.difficulty == 1 %} Easy {% elif task.difficulty |
94 |
| - == 2 %} Medium {% elif task.difficulty == 3 %} Hard {% endif %}<br /> |
95 |
| - Repeat: {% if task.repeat_often != 5 %} {{ task.repeat_interval }} {% |
96 |
| - endif %} {% if task.repeat_often == 1 %} Day{% if task.repeat_interval > |
97 |
| - 1 %}s {% endif %}{% elif task.repeat_often == 2 %} Week{% if |
98 |
| - task.repeat_interval > 1 %}s {% endif %}{% elif task.repeat_often == 3 |
99 |
| - %} Month{% if task.repeat_interval > 1 %}s {% endif %}{% elif |
100 |
| - task.repeat_often == 4 %} Year{% if task.repeat_interval > 1 %}s {% |
101 |
| - endif %}{% elif task.repeat_often == 5 %} Once {% endif %}<br /> |
102 |
| - {% if not task.completed %}<!--show complete button if task is not completed--> |
103 |
| - <a href="/complete_task/{{ task.id }}">Complete</a> |
104 |
| - {% endif %} |
105 |
| - <a |
106 |
| - href="/delete_task/{{ task.id }}" |
107 |
| - onclick="return {{ 'confirm(\'Are you sure you want to delete this task?\')' if not task.completed else 'true' }}" |
108 |
| - >Delete</a |
109 |
| - ><!--confirm user to delete the task if task is not completed, if task is completed don't alert user to confirm task deletion--> |
110 |
| - {% endfor %} |
111 |
| - </ul> |
112 |
| - </ul> |
113 |
| - </body> |
| 3 | + <head> |
| 4 | + <title>Endless Task List App using Flask</title> |
| 5 | + <link |
| 6 | + rel="stylesheet" |
| 7 | + href="{{ url_for('static', filename='css/index.css') }}" |
| 8 | + /> |
| 9 | + </head> |
| 10 | + <body> |
| 11 | + <h1>Endless Task List App using Flask</h1> |
| 12 | + <ul> |
| 13 | + {% with messages = get_flashed_messages() %}<!--get flashed messages to display--> |
| 14 | + {% if messages %} |
| 15 | + <div class="popup-message"> |
| 16 | + {% for message in messages %} |
| 17 | + <p>{{ message }}</p> |
| 18 | + {% endfor %} |
| 19 | + </div> |
| 20 | + {% endif %} {% endwith %} {{ user.username }}:<br /> |
| 21 | + Level {{ user.level }}<br /> |
| 22 | + Total XP: {{ user.total_xp | short_numeric }}<br /> |
| 23 | + {{ user.xp | short_numeric }} / {{ user.xp_required | short_numeric |
| 24 | + }} XP<br /> |
| 25 | + Rating: {{ user.rating | round_number_with_commas }}<br /> |
| 26 | + <div class="progress-container"> |
| 27 | + <!--get current level progress--> |
| 28 | + <progress |
| 29 | + value="{{ user.xp }}" |
| 30 | + max="{{ user.xp_required }}" |
| 31 | + ></progress> |
| 32 | + <div class="progress-text"> |
| 33 | + {{ (user.xp / user.xp_required * 100) | short_numeric }}% |
| 34 | + </div> |
| 35 | + </div> |
| 36 | + Add New Task<br /> |
| 37 | + <form action="{{ url_for('add_task') }}" method="post"> |
| 38 | + <!--form to add task--> |
| 39 | + <label for="name">Name: </label |
| 40 | + ><input |
| 41 | + type="text" |
| 42 | + id="name" |
| 43 | + name="name" |
| 44 | + maxlength="80" |
| 45 | + required |
| 46 | + /><br /> |
| 47 | + <label for="due_date">Due date: </label |
| 48 | + ><input |
| 49 | + type="date" |
| 50 | + id="due_date" |
| 51 | + name="due_date" |
| 52 | + min="{{ today }}" |
| 53 | + max="9999-12-31" |
| 54 | + value="{{ today }}" |
| 55 | + required |
| 56 | + /><br /> |
| 57 | + <label for="priority">Priority: </label |
| 58 | + ><select id="priority" name="priority"> |
| 59 | + <option value="1" selected>Low</option> |
| 60 | + <option value="2">Medium</option> |
| 61 | + <option value="3">High</option></select |
| 62 | + ><br /> |
| 63 | + <label for="difficulty">Difficulty: </label |
| 64 | + ><select id="difficulty" name="difficulty"> |
| 65 | + <option value="1" selected>Easy</option> |
| 66 | + <option value="2">Medium</option> |
| 67 | + <option value="3">Hard</option></select |
| 68 | + ><br /> |
| 69 | + <label for="repeat_interval">Repeat every: </label |
| 70 | + ><input |
| 71 | + type="number" |
| 72 | + id="repeat_interval" |
| 73 | + name="repeat_interval" |
| 74 | + min="1" |
| 75 | + step="1" |
| 76 | + value="1" |
| 77 | + /><br /> |
| 78 | + <label for="repeat_often">Repeat interval: </label |
| 79 | + ><select id="repeat_often" name="repeat_often"> |
| 80 | + <option value="1">Daily</option> |
| 81 | + <option value="2">Weekly</option> |
| 82 | + <option value="3">Monthly</option> |
| 83 | + <option value="4">Yearly</option> |
| 84 | + <option value="5" selected>Once</option></select |
| 85 | + ><br /> |
| 86 | + <input type="submit" value="Add Task" /> |
| 87 | + </form> |
| 88 | + <ul> |
| 89 | + {% for task in tasks %}<!--repeat for each task in task list--> |
| 90 | + <li> |
| 91 | + {{ task.name }}<br /> |
| 92 | + Due: {{ task.due_date }} |
| 93 | + </li> |
| 94 | + Priority: {% if task.priority == 1 %} Low {% elif task.priority |
| 95 | + == 2 %} Medium {% elif task.priority == 3 %} High {% endif %}<br /> |
| 96 | + Difficulty: {% if task.difficulty == 1 %} Easy {% elif |
| 97 | + task.difficulty == 2 %} Medium {% elif task.difficulty == 3 %} |
| 98 | + Hard {% endif %}<br /> |
| 99 | + Repeat: {% if task.repeat_often != 5 %} {{ task.repeat_interval |
| 100 | + }} {% endif %} {% if task.repeat_often == 1 %} Day{% if |
| 101 | + task.repeat_interval > 1 %}s {% endif %}{% elif |
| 102 | + task.repeat_often == 2 %} Week{% if task.repeat_interval > 1 %}s |
| 103 | + {% endif %}{% elif task.repeat_often == 3 %} Month{% if |
| 104 | + task.repeat_interval > 1 %}s {% endif %}{% elif |
| 105 | + task.repeat_often == 4 %} Year{% if task.repeat_interval > 1 %}s |
| 106 | + {% endif %}{% elif task.repeat_often == 5 %} Once {% endif %}<br /> |
| 107 | + {% if not task.completed %}<!--show complete button if task is not completed--> |
| 108 | + <a href="/complete_task/{{ task.id }}">Complete</a> |
| 109 | + {% endif %} |
| 110 | + <a |
| 111 | + href="/delete_task/{{ task.id }}" |
| 112 | + onclick="return {{ 'confirm(\'Are you sure you want to delete this task?\')' if not task.completed else 'true' }}" |
| 113 | + >Delete</a |
| 114 | + ><!--confirm user to delete the task if task is not completed, if task is completed don't alert user to confirm task deletion--> |
| 115 | + {% endfor %} |
| 116 | + </ul> |
| 117 | + </ul> |
| 118 | + </body> |
114 | 119 | </html>
|
0 commit comments