added gitea activity for fun
This commit is contained in:
@@ -11,7 +11,13 @@
|
||||
</div>
|
||||
</section>
|
||||
<div class="health-layout">
|
||||
{% include 'planner/partials/neck_headache_checkin.html' %}
|
||||
{% include 'planner/partials/bowel_health_checkin.html' %}
|
||||
<div class="health-layout__main">
|
||||
{% include 'planner/partials/neck_headache_checkin.html' %}
|
||||
{% include 'planner/partials/bowel_health_checkin.html' %}
|
||||
</div>
|
||||
<aside class="health-layout__sidebar" aria-label="Health routines">
|
||||
{% include 'planner/partials/fasting_widget.html' %}
|
||||
{% include 'planner/partials/hydration_widget.html' %}
|
||||
</aside>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
<section class="gitea-activity" id="gitea-activity" aria-labelledby="gitea-activity-heading">
|
||||
<div class="gitea-activity__header">
|
||||
<div><p class="eyebrow">Code garden</p><h2 id="gitea-activity-heading">Gitea activity</h2></div>
|
||||
{% if activity_profile_url %}<a class="text-link" href="{{ activity_profile_url }}" target="_blank" rel="noopener noreferrer">View profile<span class="visually-hidden"> on Gitea</span></a>{% endif %}
|
||||
</div>
|
||||
{% if activity_unavailable %}
|
||||
<p class="gitea-activity__message">Activity is unavailable right now.</p>
|
||||
{% else %}
|
||||
<p class="gitea-activity__summary"><strong>{{ activity_total }}</strong> contributions in the last year</p>
|
||||
<div class="gitea-activity__scroller">
|
||||
<div class="gitea-activity__chart" role="img" aria-label="Gitea contribution calendar: {{ activity_total }} contributions in the last year">
|
||||
<div class="gitea-activity__day-labels" aria-hidden="true"><span></span><span>Mon</span><span></span><span>Wed</span><span></span><span>Fri</span><span></span></div>
|
||||
{% for week in activity_weeks %}
|
||||
<div class="gitea-activity__week" aria-hidden="true">
|
||||
<span class="gitea-activity__month">{{ week.month }}</span>
|
||||
{% for day in week.days %}<time class="gitea-activity__cell gitea-activity__cell--{{ day.level }}{% if day.future %} gitea-activity__cell--future{% endif %}" datetime="{{ day.date|date:'Y-m-d' }}" title="{{ day.date|date:'j M Y' }}: {{ day.count }} contribution{{ day.count|pluralize }}"></time>{% endfor %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="gitea-activity__legend" aria-hidden="true"><span>Less</span>{% for level in '01234' %}<i class="gitea-activity__cell gitea-activity__cell--{{ level }}"></i>{% endfor %}<span>More</span></div>
|
||||
{% endif %}
|
||||
</section>
|
||||
@@ -0,0 +1,9 @@
|
||||
<svg class="hydration-bottle" viewBox="0 0 112 184" width="112" height="184" aria-hidden="true" focusable="false">
|
||||
<defs><clipPath id="hydration-bottle-clip"><path d="M35 42 Q30 47 30 58 V151 Q30 168 47 168 H77 Q94 168 94 151 V58 Q94 47 89 42 Z"/></clipPath></defs>
|
||||
<path d="M46 16 Q46 9 53 9 H71 Q78 9 78 16 V32 H46 Z" fill="none" stroke="var(--bottle-stroke)" stroke-width="2"/>
|
||||
<rect x="44" y="27" width="36" height="12" rx="3" fill="var(--bottle-cap)" stroke="var(--bottle-stroke)" stroke-width="2"/>
|
||||
<path d="M35 42 Q30 47 30 58 V151 Q30 168 47 168 H77 Q94 168 94 151 V58 Q94 47 89 42 Z" fill="var(--bottle-shell)" stroke="var(--bottle-stroke)" stroke-width="2"/>
|
||||
<g clip-path="url(#hydration-bottle-clip)" class="hydration-bottle__water"><rect x="30" y="{{ hydration_fill_y }}" width="64" height="{{ hydration_fill_height }}" fill="var(--bottle-fill)" opacity=".85"/><ellipse cx="62" cy="{{ hydration_fill_y }}" rx="33" ry="3" fill="var(--bottle-fill)" opacity=".85"/></g>
|
||||
<path d="M35 42 Q30 47 30 58 V151 Q30 168 47 168 H77 Q94 168 94 151 V58 Q94 47 89 42 Z" fill="none" stroke="var(--bottle-stroke)" stroke-width="2"/>
|
||||
{% for marker in hydration_markers %}<path d="M22 {{ marker.y }} h6" stroke="var(--bottle-stroke)" stroke-width="1.5"/><text x="20" y="{{ marker.y|add:3 }}" text-anchor="end" fill="var(--bottle-stroke)" font-size="8">{{ marker.value }}</text>{% endfor %}
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.4 KiB |
@@ -0,0 +1,19 @@
|
||||
<article id="hydration-widget" class="hydration-widget" aria-labelledby="hydration-heading" aria-live="polite">
|
||||
<p class="eyebrow">Daily hydration</p>
|
||||
<h2 id="hydration-heading">Water</h2>
|
||||
<div class="hydration-widget__main">
|
||||
<div class="hydration-widget__stats">
|
||||
<p class="hydration-widget__total">{{ hydration_total|floatformat:0 }} <span>/ {{ hydration_goal }} ml</span></p>
|
||||
<p>{{ hydration_percent }}% of daily goal</p>
|
||||
<div class="hydration-widget__track" role="progressbar" aria-label="Daily water goal" aria-valuenow="{{ hydration_visual }}" aria-valuemin="0" aria-valuemax="100"><span style="width:{{ hydration_visual }}%"></span></div>
|
||||
</div>
|
||||
{% include 'planner/partials/hydration_bottle.html' %}
|
||||
</div>
|
||||
<div class="hydration-widget__actions">
|
||||
<form method="post" action="{% url 'planner:hydration-add' %}" hx-post="{% url 'planner:hydration-add' %}" hx-target="#hydration-widget" hx-swap="outerHTML">{% csrf_token %}<button type="submit" name="amount_ml" value="250">+250 ml</button><button type="submit" name="amount_ml" value="500">+500 ml</button></form>
|
||||
<details class="hydration-widget__other"><summary>Other</summary><form method="post" action="{% url 'planner:hydration-add' %}" hx-post="{% url 'planner:hydration-add' %}" hx-target="#hydration-widget" hx-swap="outerHTML">{% csrf_token %}<label for="hydration-amount">Amount (ml)</label><input id="hydration-amount" name="amount_ml" type="number" min="1" max="3000" step="1" required inputmode="numeric"><button type="submit">Add</button></form></details>
|
||||
</div>
|
||||
{% if hydration_error %}<p class="hydration-widget__error" role="alert">Enter a whole amount from 1 to 3000 ml.</p>{% endif %}
|
||||
<div class="hydration-widget__info">{% if hydration_last %}<span>Last: {{ hydration_last.amount_ml }} ml at {{ hydration_last_time }}</span><form method="post" action="{% url 'planner:hydration-undo' %}" hx-post="{% url 'planner:hydration-undo' %}" hx-target="#hydration-widget" hx-swap="outerHTML">{% csrf_token %}<button type="submit">Undo last</button></form>{% else %}<span>No water logged today</span>{% endif %}</div>
|
||||
<div class="hydration-widget__week"><p>This week</p><div class="hydration-widget__days">{% for day in hydration_days %}<span class="hydration-widget__day hydration-widget__day--{{ day.state }}{% if day.today %} hydration-widget__day--today{% endif %}" title="{{ day.date|date:'l' }}: {{ day.total }} ml, {{ day.state_label }}" aria-label="{{ day.date|date:'l' }}: {{ day.total }} ml, {{ day.state_label }}">{{ day.label }}</span>{% endfor %}</div></div>
|
||||
</article>
|
||||
@@ -0,0 +1 @@
|
||||
{% if success %}<p class="ntfy-result ntfy-result--success">Test notification sent successfully.</p>{% else %}<p class="ntfy-result ntfy-result--error">Could not send the test notification: {{ error }}</p>{% endif %}
|
||||
@@ -41,11 +41,17 @@
|
||||
</section>
|
||||
|
||||
{% include 'planner/partials/workout_section.html' %}
|
||||
{% if gitea_activity_enabled %}
|
||||
<div id="gitea-activity" hx-get="{% url 'planner:gitea-activity' %}" hx-trigger="load" hx-swap="outerHTML" aria-live="polite">
|
||||
<section class="gitea-activity" aria-label="Gitea activity"><p>Loading Gitea activity…</p></section>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if user.is_authenticated %}
|
||||
<aside class="homepage-sidebar" aria-label="Personal routines">
|
||||
<div class="desktop-weather-slot">{% include 'planner/partials/weather_widget.html' %}</div>
|
||||
{% include 'planner/partials/tooth_brushing_widget.html' %}
|
||||
{% include 'planner/partials/hydration_widget.html' %}
|
||||
{% include 'planner/partials/fasting_widget.html' %}
|
||||
</aside>
|
||||
{% endif %}
|
||||
|
||||
@@ -7,6 +7,18 @@
|
||||
<section class="settings-card"><h2>First-run help</h2><p>{% if onboarding_enabled %}The guided tour is ready to continue on your dashboard.{% else %}Help is off. You can run the tour again whenever you want.{% endif %}</p><form method="post">{% csrf_token %}<input type="hidden" name="section" value="onboarding"><button class="button" type="submit" name="action" value="restart">Run feature tour</button><button class="text-link" type="submit" name="action" value="disable">Turn help off</button></form></section>
|
||||
<section class="settings-card"><h2>Location & weather</h2><p>Location is optional and private. It is used only to retrieve your forecast.</p><form method="post" data-geolocation-form>{% csrf_token %}<input type="hidden" name="section" value="location">{% for field in profile_form %}<div class="form-field">{{ field.label_tag }}{{ field }}{% if field.help_text %}<small>{{ field.help_text }}</small>{% endif %}{{ field.errors }}</div>{% endfor %}<button class="button button--secondary" type="button" data-use-location>Use my current location</button><span data-location-status role="status"></span><button class="button" type="submit">Save location</button></form></section>
|
||||
<section class="settings-card"><h2>Sick Day Mode</h2><p>Temporarily defer routine work while you recover.</p><form method="post">{% csrf_token %}<input type="hidden" name="section" value="sick-day">{% for field in sick_form %}<div class="form-field">{{ field.label_tag }}{{ field }}{% if field.help_text %}<small>{{ field.help_text }}</small>{% endif %}{{ field.errors }}</div>{% endfor %}<button class="button" type="submit">Save Sick Day settings</button></form></section>
|
||||
<section class="settings-card"><h2>Hydration</h2><p>Set your daily water goal.</p><form method="post">{% csrf_token %}<input type="hidden" name="section" value="hydration">{% for field in hydration_goal_form %}<div class="form-field">{{ field.label_tag }}{{ field }}{{ field.errors }}</div>{% endfor %}<button class="button" type="submit">Save water goal</button></form></section>
|
||||
<section class="settings-card" aria-labelledby="ntfy-title">
|
||||
<h2 id="ntfy-title">Notifications / ntfy</h2>
|
||||
<p>Enter your private topic URL, test it, then enable notifications.</p>
|
||||
<form method="post" data-ntfy-form>{% csrf_token %}<input type="hidden" name="section" value="ntfy">
|
||||
<div class="form-field">{{ ntfy_form.ntfy_url.label_tag }}{{ ntfy_form.ntfy_url }}{{ ntfy_form.ntfy_url.errors }}</div>
|
||||
<div class="ntfy-check">{{ ntfy_form.ntfy_enabled }}<label for="{{ ntfy_form.ntfy_enabled.id_for_label }}">Enable ntfy notifications</label></div>
|
||||
<button class="button button--secondary" type="button" hx-post="{% url 'planner:ntfy-test' %}" hx-include="closest form" hx-target="#ntfy-test-result" hx-swap="innerHTML">Test notification</button>
|
||||
<div id="ntfy-test-result" role="status" aria-live="polite"></div>
|
||||
<button class="button" type="submit">Save notification settings</button>
|
||||
</form>
|
||||
</section>
|
||||
<section class="settings-card"><h2>Fasting</h2><form method="post">{% csrf_token %}<input type="hidden" name="section" value="fasting">{% for field in fasting_form %}<div class="form-field">{{ field.label_tag }}{{ field }}{% if field.help_text %}<small>{{ field.help_text }}</small>{% endif %}{{ field.errors }}</div>{% endfor %}<button class="button" type="submit">Save fasting settings</button></form></section>
|
||||
</section>
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user