kobo-wall-calendar/templates.py

57 lines
1.5 KiB
Python
Raw Normal View History

2023-09-17 16:06:20 +00:00
TEMPLATE_INDEX = '''
<!DOCTYPE HTML>
<html>
<head>
<title>My calendar</title>
<link href="static/style.css" rel="stylesheet">
<meta http-equiv="refresh" content="60">
</head>
<body>
<h1 class="month-header">August 2022</h1>
<table class="calendar-grid">
<thead>
<tr class="week-row">
<td class="week-counter"></td>
<td class="calendar-weekday-header">Monday</td>
<td class="calendar-weekday-header">Tuesday</td>
<td class="calendar-weekday-header">Wednesday</td>
<td class="calendar-weekday-header">Thursday</td>
<td class="calendar-weekday-header">Friday</td>
<td class="calendar-weekday-header">Saturday</td>
<td class="calendar-weekday-header">Sunday</td>
</tr>
</thead>
<tbody>
% for day_info in days:
% if day_info['day_of_week'] == 1:
</tr><tr class="week-row">
<td class="week-counter
">W{{ day_info['week_of_year'] }}</td>
% end
<td class="calendar-day
% if day_info['is_weekend']:
weekend-day
% end
% if day_info['already_past']:
crossed-out
% end
"><div class="day-num
% if day_info['today']:
today
% end
">{{ day_info['day_of_month'] }}</div>
% for event_text in day_info['events']:
<div class="event">{{ event_text }}</div>
% end
</td>
% end
</tr>
</tbody>
</table>
</body>
</html>
'''