tasks work better now
This commit is contained in:
@@ -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 %}
|
||||
|
||||
55
templates/logbook_detail.html
Normal file
55
templates/logbook_detail.html
Normal file
@@ -0,0 +1,55 @@
|
||||
{% extends "layout.html" %}
|
||||
{% block content %}
|
||||
<div class="card" style="border-left: 5px solid {{ entry.activity.color }};">
|
||||
<div style="display: flex; justify-content: space-between; align-items: start;">
|
||||
<div>
|
||||
<h2>{{ entry.activity.name }}</h2>
|
||||
<p style="color: #666;">
|
||||
{{ entry.start_time.strftime('%A, %d. %B %Y') }}<br>
|
||||
{{ entry.start_time.strftime('%H:%M') }}
|
||||
{% if entry.end_time %} - {{ entry.end_time.strftime('%H:%M') }} {% endif %}
|
||||
</p>
|
||||
</div>
|
||||
<div style="text-align: right;">
|
||||
<div style="font-weight: bold; font-size: 2rem; color: #333;">{{ entry.duration_str }}</div>
|
||||
<a href="{{ url_for('logbook') }}" class="btn" style="background: #95a5a6; font-size: 0.8rem; margin-top: 15px; display:inline-block;">Back to Log</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<h3>Session Notes</h3>
|
||||
<form method="POST">
|
||||
<textarea name="note" rows="4" style="width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 5px; font-family: inherit;">{{ entry.note }}</textarea>
|
||||
<div style="margin-top: 10px; text-align: right;">
|
||||
<button type="submit" class="btn">Update Note</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<h3>Tasks in this Session</h3>
|
||||
{% if not tasks %}
|
||||
<p style="color: #999;">No tasks were tracked for this session.</p>
|
||||
{% else %}
|
||||
<ul style="list-style: none; padding: 0;">
|
||||
{% for task in tasks %}
|
||||
<li style="border-bottom: 1px solid #eee; padding: 15px 0; display: flex; align-items: center;">
|
||||
<span style="margin-right: 15px; font-size: 1.2rem;">
|
||||
{% if task.status == 'completed' %}✅{% else %}⬜{% endif %}
|
||||
</span>
|
||||
<div style="flex-grow: 1;">
|
||||
<a href="{{ url_for('task_detail', task_id=task._id) }}" style="font-weight: bold; display: block; font-size: 1.1rem;">{{ task.name }}</a>
|
||||
{% if task.completed_at %}
|
||||
<small style="color: #27ae60;">Completed at {{ task.completed_at.strftime('%H:%M') }}</small>
|
||||
{% else %}
|
||||
<small style="color: #e67e22;">Not completed</small>
|
||||
{% endif %}
|
||||
</div>
|
||||
<a href="{{ url_for('task_detail', task_id=task._id) }}" class="btn" style="font-size: 0.8rem; padding: 5px 10px;">View Task ></a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user