blob: 15548c595e20593f3718677e96807f58567b528f (
plain)
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
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Toot Scheduler</title>
<style>
body {
font-family: Arial, sans-serif;
line-height: 1.6;
margin: 20px;
padding: 0;
background-color: #f4f4f9;
color: #333;
}
h1, h2 {
color: #0056b3;
}
form {
margin-bottom: 20px;
}
ul {
list-style: none;
padding: 0;
}
li {
background: #fff;
margin: 10px 0;
padding: 10px;
border: 1px solid #ddd;
border-radius: 5px;
}
button {
background: #0056b3;
color: #fff;
border: none;
padding: 5px 10px;
border-radius: 3px;
cursor: pointer;
}
button:hover {
background: #003d80;
}
label {
display: block;
margin-top: 10px;
}
input, select {
width: 100%;
padding: 8px;
margin-top: 5px;
margin-bottom: 15px;
border: 1px solid #ddd;
border-radius: 5px;
}
</style>
</head>
<body>
<h1>Toot Scheduler</h1>
<h2>Welcome, {{ current_user.username }}</h2>
<!-- Form to add a new toot -->
<form action="{{ url_for('add_toot') }}" method="post">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<label for="message">Message:</label>
<input type="text" id="message" name="message" required>
<label for="toot_time">Time:</label>
<input type="time" id="toot_time" name="toot_time" required>
<label for="day">Day:</label>
<select id="day" name="day" required>
<option value="monday">Monday</option>
<option value="tuesday">Tuesday</option>
<option value="wednesday">Wednesday</option>
<option value="thursday">Thursday</option>
<option value="friday">Friday</option>
<option value="saturday">Saturday</option>
<option value="sunday">Sunday</option>
<option value="everyday">Everyday</option>
</select>
<button type="submit">Add Toot</button>
</form>
<!-- List of scheduled toots -->
<h2>Scheduled Toots</h2>
<ul>
{% for toot in toots %}
<li>
<strong>{{ toot.message }}</strong> at {{ toot.toot_time }} on {{ toot.day }}
{% if toot.suspended %}
<em>(Suspended)</em>
<form action="{{ url_for('resume_toot', toot_id=toot.id) }}" method="post" style="display:inline;">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<button type="submit">Resume</button>
</form>
{% else %}
<form action="{{ url_for('suspend_toot', toot_id=toot.id) }}" method="post" style="display:inline;">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<button type="submit">Suspend</button>
</form>
{% endif %}
<form action="{{ url_for('delete_toot', toot_id=toot.id) }}" method="post" style="display:inline;">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<button type="submit">Delete</button>
</form>
</li>
{% endfor %}
</ul>
<!-- Logout form -->
<form action="{{ url_for('logout') }}" method="post">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<button type="submit">Logout</button>
</form>
</body>
</html>
|