start activity from task view
This commit is contained in:
@@ -10,6 +10,17 @@
|
||||
<span style="background: #f39c12; color: white; padding: 3px 8px; border-radius: 5px;">Template (Auto-Add)</span>
|
||||
{% endif %}
|
||||
</p>
|
||||
|
||||
{% if task.activity_id %}
|
||||
<form action="{{ url_for('toggle_timer', activity_id=task.activity_id) }}" method="POST" style="margin-top: 10px;">
|
||||
<input type="hidden" name="note" value="{{ task.name }}">
|
||||
<button type="submit" class="btn" style="background: #27ae60;">
|
||||
▶ Start Timer for this Task
|
||||
</button>
|
||||
</form>
|
||||
{% else %}
|
||||
<small style="color: #999;">No activity linked. Edit task to assign one.</small>
|
||||
{% endif %}
|
||||
</div>
|
||||
<a href="{{ url_for('tasks') }}" class="btn" style="background: #95a5a6;">Back to Tasks</a>
|
||||
</div>
|
||||
|
||||
@@ -39,17 +39,32 @@
|
||||
<ul style="list-style: none; padding: 0;">
|
||||
{% for task in tasks %}
|
||||
<li style="border-bottom: 1px solid #eee; padding: 10px 0;">
|
||||
<div style="display: flex; justify-content: space-between;">
|
||||
<a href="{{ url_for('task_detail', task_id=task._id) }}" style="font-weight: bold;">{{ task.name }}</a>
|
||||
{% if task.activity_name %}
|
||||
<span style="background: {{ task.activity_color }}; color: white; padding: 2px 8px; border-radius: 10px; font-size: 0.8rem;">
|
||||
{{ task.activity_name }}
|
||||
</span>
|
||||
{% endif %}
|
||||
<div style="display: flex; justify-content: space-between; align-items: center;">
|
||||
<div>
|
||||
<a href="{{ url_for('task_detail', task_id=task._id) }}" style="font-weight: bold;">{{ task.name }}</a>
|
||||
{% if task.activity_name %}
|
||||
<span style="background: {{ task.activity_color }}; color: white; padding: 2px 8px; border-radius: 10px; font-size: 0.8rem; margin-left: 5px;">
|
||||
{{ task.activity_name }}
|
||||
</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div style="display: flex; align-items: center; gap: 10px;">
|
||||
{% if task.activity_id %}
|
||||
<form action="{{ url_for('toggle_timer', activity_id=task.activity_id) }}" method="POST" style="margin: 0;">
|
||||
<!-- Automatically use the task name as the session note -->
|
||||
<input type="hidden" name="note" value="{{ task.name }}">
|
||||
<button type="submit" class="btn" style="padding: 2px 8px; font-size: 0.8rem; background: #27ae60;" title="Start Timer for this Task">
|
||||
▶ Start
|
||||
</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
|
||||
{% if task.due_date %}
|
||||
<small style="color: #e74c3c;">Due: {{ task.due_date.strftime('%Y-%m-%d %H:%M') }}</small>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% if task.due_date %}
|
||||
<small style="color: #e74c3c;">Due: {{ task.due_date.strftime('%Y-%m-%d %H:%M') }}</small>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
Reference in New Issue
Block a user