diff --git a/app.py b/app.py index f13e864..fc27195 100644 --- a/app.py +++ b/app.py @@ -188,9 +188,10 @@ def start_timer_bg(activity_id): 'user_id': user_id, 'name': t['name'], 'activity_id': ObjectId(activity_id), - 'time_entry_id': new_entry_id, # Link to this specific session + 'time_entry_id': new_entry_id, 'status': 'open', 'is_template': False, + 'source': 'auto', # Mark as auto-generated 'created_at': datetime.now(), 'comments': [] }) @@ -266,9 +267,10 @@ def toggle_timer(activity_id): 'user_id': user_id, 'name': t['name'], 'activity_id': ObjectId(activity_id), - 'time_entry_id': new_entry_id, # Link to this specific session + 'time_entry_id': new_entry_id, 'status': 'open', 'is_template': False, + 'source': 'auto', # Mark as auto-generated 'created_at': datetime.now(), 'comments': [] }) @@ -327,13 +329,11 @@ def tasks(): activities = list(db.activities.find({'user_id': user_id})) # Categorize tasks - # 1. Standalone / Manual Tasks + # Shows Manual Tasks (Open OR Completed). Hides "source: auto" (Session checklists) tasks_list = list(db.tasks.find({ 'user_id': user_id, 'is_template': False, - 'time_entry_id': None, # Don't show session-specific generated tasks here to avoid clutter? or show all? - # Let's show manual tasks only. Session tasks are transient. - 'status': 'open' + 'source': {'$ne': 'auto'} # Show everything except explicitly auto-generated tasks }).sort('due_date', 1)) # 2. Templates @@ -364,6 +364,7 @@ def create_task(): 'name': name, 'status': 'open', 'is_template': is_template, + 'source': 'manual', # Mark as manually created 'created_at': datetime.now(), 'comments': [] } @@ -454,8 +455,12 @@ def log_entry_detail(entry_id): new_note = request.form.get('note') start_str = request.form.get('start_time') end_str = request.form.get('end_time') + subcategory = request.form.get('subcategory', '') - update_fields = {'note': new_note} + update_fields = { + 'note': new_note, + 'subcategory': subcategory + } try: if start_str: diff --git a/templates/dashboard.html b/templates/dashboard.html index 771a06e..f0bc2b2 100644 --- a/templates/dashboard.html +++ b/templates/dashboard.html @@ -1,271 +1,293 @@ {% extends "layout.html" %} {% block content %} - -
-

- Currently Tracking: {{ current_entry.activity_name if current_entry else '' }} -

+
+ + +
+

Start Tracking

-
-
- {{ current_entry.subcategory if current_entry else '' }} -
-
- -

- "{{ current_entry.note if current_entry else '' }}" -

- -
00:00:00
- - - {% if tasks %} -
-

Active Tasks:

- {% for task in tasks %} -
- - +
+ {% for act in activities %} +
+
+ {{ act.name }} +
+ + + Edit +
{% endfor %} -
- {% endif %} - -
- -
-
- - - - - - - -
- {% for act in activities %} -
-
- {{ act.name }} -
- - - Edit - + +
+ + New Activity
- {% endfor %} - - -
- + New Activity
-
- - - - -