Commit Message: feat: Implement web calendar application with Flask, Docker, and calendar integration Description: 1. Server Refactor: • Moved application logic from main.py to a structured directory server/app/. • Added server/app/__init__.py for Flask app initialization. • Introduced server/app/views.py to handle routes (dashboard and dashboard_image). • Created server/app/models.py for event modeling, supporting CalDAV and iCalendar events. • Added server/app/weather.py to fetch weather data using OpenWeatherMap API. 2. New Features: • Added an image generation route (/image) to render calendar views as BMP images. • Integrated OpenWeatherMap API for weather data on the dashboard. 3. Environment and Configurations: • Added a Dockerfile to build and deploy the app using uwsgi-nginx-flask. • Introduced compose.yml for running the app with Docker Compose. • Moved uwsgi.ini configuration to server/uwsgi.ini for modular organization. 4. Dependencies: • Updated requirements.txt to include new dependencies: imgkit, pillow, and Werkzeug==2.2.2. 5. Static Assets: • Added placeholder images out.png and test.png. 6. Code Cleanup: • Removed old files (main.py and root-level uwsgi.ini). • Updated .gitignore to include .idea/ folder. Additional Notes: • Enhanced event parsing to handle all-day and time-specific events using server/app/models.py. • Utilized Flask’s render_template for dynamic HTML rendering and imgkit for HTML-to-image conversion. • Integrated multiple calendar sources (CalDAV and public iCal feeds). Let me know if you need further adjustments!
43 lines
1.4 KiB
HTML
43 lines
1.4 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>Dashboard ({{today.strftime('%-m/%-d, %-H:%M')}})</title>
|
|
<link rel="stylesheet" href="style.css">
|
|
<meta name="viewport" content="width=600, height=800" />
|
|
</head>
|
|
<body>
|
|
<div class="dashboard">
|
|
<div style="height:1em"></div>
|
|
<div class="panel top">
|
|
<div class="subpanel">
|
|
<div><i class="wi wi-owm-{{ weather.id }} weather-icon"></i></div>
|
|
<div>{{weather.main}}</div>
|
|
</div>
|
|
<div class="subpanel" style="font-size: 60px;font-weight: bold;vertical-align:top; text-align:right;">
|
|
{{ today.strftime('%a') }}<br>
|
|
{{ today.strftime('%b %-d') }}<br>
|
|
{{ today.strftime('%Y') }}<br>
|
|
</div>
|
|
</div>
|
|
<div class="panel bottom week">
|
|
|
|
{% for day, events in days %}
|
|
<div class="day">
|
|
<div id="dotw-1" class="day-title">
|
|
{{ day.strftime('%A') }}
|
|
</div>
|
|
{% for event in events %}
|
|
<div class="event">
|
|
{{ event.summary }}<br>
|
|
{% if not event.is_all_day %}
|
|
<span class="daterange">{{ event.range_str }}</span>
|
|
{% endif %}
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>
|