tasks work better now

This commit is contained in:
2026-02-10 19:20:19 +01:00
parent 758767a4d4
commit 6344975f7e
3 changed files with 108 additions and 30 deletions

View File

@@ -5,33 +5,44 @@
<p>No activities recorded yet.</p>
{% else %}
{% for entry in log %}
<div class="card" style="border-left: 5px solid {{ entry.activity.color }};">
<div style="display: flex; justify-content: space-between; align-items: center;">
<div>
<h3 style="margin: 0;">{{ entry.activity.name }}</h3>
<small style="color: #666;">
{{ entry.start_time.strftime('%Y-%m-%d %H:%M') }} - {{ entry.end_time.strftime('%H:%M') }}
</small>
{% if entry.note %}
<p style="margin: 5px 0; font-style: italic;">"{{ entry.note }}"</p>
{% endif %}
<!-- Wrapped whole card in a link to the detail view -->
<a href="{{ url_for('log_entry_detail', entry_id=entry._id) }}" style="text-decoration: none; color: inherit; display: block;">
<div class="card" style="border-left: 5px solid {{ entry.activity.color }}; transition: transform 0.1s;">
<div style="display: flex; justify-content: space-between; align-items: center;">
<div>
<h3 style="margin: 0;">{{ entry.activity.name }}</h3>
<small style="color: #666;">
{{ entry.start_time.strftime('%Y-%m-%d %H:%M') }} - {{ entry.end_time.strftime('%H:%M') }}
</small>
{% if entry.note %}
<p style="margin: 5px 0; font-style: italic; color: #555;">"{{ entry.note }}"</p>
{% endif %}
</div>
<div style="font-weight: bold; font-size: 1.2rem;">
{{ entry.duration_str }}
</div>
</div>
<div style="font-weight: bold; font-size: 1.2rem;">
{{ entry.duration_str }}
{% if entry.tasks %}
<div style="margin-top: 10px; padding-top: 10px; border-top: 1px solid #eee;">
<strong>Tasks Completed:</strong>
<ul style="margin: 5px 0; padding-left: 20px;">
{% for task in entry.tasks %}
<li>{{ task.name }} <small>({{ task.completed_at.strftime('%H:%M') if task.completed_at else 'Done' }})</small></li>
{% endfor %}
</ul>
</div>
{% endif %}
</div>
{% if entry.tasks %}
<div style="margin-top: 10px; padding-top: 10px; border-top: 1px solid #eee;">
<strong>Tasks Completed:</strong>
<ul style="margin: 5px 0; padding-left: 20px;">
{% for task in entry.tasks %}
<li>{{ task.name }} <small>({{ task.completed_at.strftime('%H:%M') if task.completed_at else 'Done' }})</small></li>
{% endfor %}
</ul>
</div>
{% endif %}
</div>
</a>
{% endfor %}
{% endif %}
<style>
/* Small hover effect to indicate clickability */
a .card:hover {
transform: scale(1.01);
box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}
</style>
{% endblock %}