Update Events (#10)

This update restructures the events page code and provides additional functionality.
- Overwrite old entries on re-submission of previously used emails
- Build data and stats caches on launch for use in submission checks and stats regeneration
- Update to form content
- Move stats function to separate utils file

Reviewed-on: ayo/website#10
Co-authored-by: Jimmy Vargo <james@ayo.tokyo>
Co-committed-by: Jimmy Vargo <james@ayo.tokyo>
This commit is contained in:
Jimmy Vargo 2024-05-07 18:59:57 +09:00 committed by james
commit dae67ce653
8 changed files with 128 additions and 53 deletions

View file

@ -13,7 +13,7 @@
<h1>AYO Events</h1>
<p>Thank you for your feedback submission!</p>
<p>アンケートご協力いただき、ありがとうございました!</p>
<p>アンケートご協力いただき、ありがとうございました!</p>
<br>
<p class="instructions">Here are some insights into what others have said.</p>
@ -21,7 +21,7 @@
<br>
<div class="stats-table">
<span class="stats-header">Times ご都合の良い時間</span>
<span class="stats-header">Times ご都合の良い時間</span>
{% for id, label in times.items() %}
<div class="stat-item">
<div class="stat-chart">
@ -32,7 +32,7 @@
</div>
{% endfor %}
<span class="stats-header">Topics of Interest 興味あるテーマ</span>
<span class="stats-header">Topics of Interest 興味あるテーマ</span>
{% for id, label in topics.items() %}
<div class="stat-item">
<div class="stat-chart">
@ -50,6 +50,17 @@
{% endfor %}
</div>
<span class="stats-header">Backgrounds 履歴・業種</span>
{% for id, label in background.items() %}
<div class="stat-item">
<div class="stat-chart">
<div class="pie-chart" style="background: conic-gradient(var(--color) 0%, var(--color) {{ data[id]['percent'] }}%, var(--bg) {{ data[id]['percent'] }}%, var(--bg) 100%);"></div>
<span class="stat-percent">{{ data[id]['percent'] }}%</span>
</div>
<div><p class="stat-label">{{ label }}</p></div>
</div>
{% endfor %}
<span class="stats-header">Languages 言語</span>
{% for id, label in languages.items() %}
<div class="stat-item">