diff --git a/ctrl/deploy.sh b/ctrl/deploy.sh
new file mode 100644
index 0000000..59dcd27
--- /dev/null
+++ b/ctrl/deploy.sh
@@ -0,0 +1,19 @@
+#!/bin/bash
+# Deploy deskmeter to server
+# Usage: ./ctrl/deploy.sh
+
+set -e
+cd "$(dirname "$0")/.."
+
+echo "Building dmweb image..."
+docker build -t registry.mcrn.ar/dmweb:latest .
+
+echo "Pushing to registry..."
+docker push registry.mcrn.ar/dmweb:latest
+
+echo "Deploying on server..."
+rsync -avz docker-compose.yml mcrn.ar:~/dm/
+ssh mcrn.ar "cd ~/dm && docker compose pull && docker compose up -d --remove-orphans"
+
+echo "Deploy complete"
+ssh mcrn.ar "cd ~/dm && docker compose ps"
diff --git a/dmapp/dmdb/sync.py b/dmapp/dmdb/sync.py
index 0c41188..f532125 100644
--- a/dmapp/dmdb/sync.py
+++ b/dmapp/dmdb/sync.py
@@ -59,6 +59,7 @@ def sync():
log.info("Resuming from saved token")
watch_kwargs = {"resume_after": resume_token} if resume_token else {}
+ watch_kwargs["full_document"] = "updateLookup" # Get full doc on updates
# Watch for inserts, updates, and replaces on the database
pipeline = [{"$match": {"operationType": {"$in": ["insert", "update", "replace"]}}}]
diff --git a/dmapp/dmweb/templates/calendar_view.html b/dmapp/dmweb/templates/calendar_view.html
index cdb3aed..6c13095 100644
--- a/dmapp/dmweb/templates/calendar_view.html
+++ b/dmapp/dmweb/templates/calendar_view.html
@@ -1,6 +1,4 @@
-{% extends 'layout.html' %}
-
-{% block head %}
+{% extends 'layout.html' %} {% block head %}
-{% endblock head %}
+{% endblock head %} {% block content %}
-{% block content %}
-
-
+
-
←
+
←
{% if scope == 'daily' %}
-
{{ base_date.strftime('%Y-%m-%d %A') }}
+
{{ base_date.strftime('%Y-%m-%d %A') }}
{% elif scope == 'weekly' %}
-
Week of {{ start.strftime('%Y-%m-%d') }}
+
Week of {{ start.strftime('%Y-%m-%d') }}
{% elif scope == 'monthly' %}
-
{{ base_date.strftime('%B %Y') }}
+
{{ base_date.strftime('%B %Y') }}
{% endif %}
-
→
+
→
-
+
{% for hour in range(0, 24, grid) %}
-
{{ '%02d:00'|format(hour) }}
+
+ {{ '%02d:00'|format(hour) }}
+
{% endfor %}
@@ -235,64 +273,54 @@
{% for day in days %}
{% for hour in range(0, 24, grid) %}
-
- {% endfor %}
+
+ {% endfor %} {% set day_blocks = [] %} {% for block in blocks %}
+ {% if block.start.date() == day.date() %} {% set _ =
+ day_blocks.append(block) %} {% endif %} {% endfor %} {# Group
+ blocks by hour for stacking #} {% set hour_groups = {} %} {% for
+ block in day_blocks %} {% set hour_key = block.hour %} {% if
+ hour_key not in hour_groups %} {% set _ =
+ hour_groups.update({hour_key: []}) %} {% endif %} {% set _ =
+ hour_groups[hour_key].append(block) %} {% endfor %} {# Render
+ blocks stacked within each hour #} {% for hour_key, hour_blocks
+ in hour_groups.items() %} {% for block in hour_blocks %} {% set
+ idx = loop.index0 %} {% set base_top_px = block.hour * 60 %} {%
+ set duration_hours = block.duration / 3600.0 %} {% set height_px
+ = duration_hours * 60 %} {% if height_px < 2 %}{% set height_px
+ = 2 %}{% endif %} {% set task_hash = block.task_path|hash if
+ block.task_path else 0 %} {% set base_color_hue = task_hash %
+ 360 %} {% set active_color = 'hsl(%d, 60%%,
+ 45%%)'|format(base_color_hue) %} {# Cascade effect: shift right
+ and down for overlapping blocks #} {# Each block shifts 8% right
+ and 4px down #} {% set offset_pct = idx * 8 %} {% set width_pct
+ = 100 - (idx * 8) - 2 %} {% set vertical_offset_px = idx * 4 %}
+ {% set top_px = base_top_px + vertical_offset_px %}
- {% set day_blocks = [] %}
- {% for block in blocks %}
- {% if block.start.date() == day.date() %}
- {% set _ = day_blocks.append(block) %}
- {% endif %}
- {% endfor %}
-
- {# Group blocks by hour for stacking #}
- {% set hour_groups = {} %}
- {% for block in day_blocks %}
- {% set hour_key = block.hour %}
- {% if hour_key not in hour_groups %}
- {% set _ = hour_groups.update({hour_key: []}) %}
- {% endif %}
- {% set _ = hour_groups[hour_key].append(block) %}
- {% endfor %}
-
- {# Render blocks stacked within each hour #}
- {% for hour_key, hour_blocks in hour_groups.items() %}
- {% for block in hour_blocks %}
- {% set idx = loop.index0 %}
- {% set base_top_px = block.hour * 60 %}
- {% set duration_hours = block.duration / 3600.0 %}
- {% set height_px = duration_hours * 60 %}
- {% if height_px < 2 %}{% set height_px = 2 %}{% endif %}
-
- {% set task_hash = block.task_path|hash if block.task_path else 0 %}
- {% set base_color_hue = task_hash % 360 %}
- {% set active_color = 'hsl(%d, 60%%, 45%%)'|format(base_color_hue) %}
-
- {# Cascade effect: shift right and down for overlapping blocks #}
- {# Each block shifts 8% right and 4px down #}
- {% set offset_pct = idx * 8 %}
- {% set width_pct = 100 - (idx * 8) - 2 %}
- {% set vertical_offset_px = idx * 4 %}
- {% set top_px = base_top_px + vertical_offset_px %}
-
-
-
{{ block.task_path }}
-
{{ (block.duration // 60)|int }}m
-
- {{ block.task_path }}
- Hour: {{ '%02d:00'|format(block.hour) }}
- Duration: {{ (block.duration // 60)|int }} minutes
-
-
- {% endfor %}
- {% endfor %}
+ background: {{ active_color }}; opacity: 0.9;"
+ >
+
{{ block.task_path }}
+
+ {{ (block.duration // 60)|int }}m
+
+
+ {{ block.task_path }}
+ Hour: {{ '%02d:00'|format(block.hour) }}
+ Duration: {{ (block.duration // 60)|int }} minutes
+
+
+ {% endfor %} {% endfor %}
{% endfor %}
diff --git a/dmapp/dmweb/templates/main.html b/dmapp/dmweb/templates/main.html
index 2d98a8b..f4319d8 100644
--- a/dmapp/dmweb/templates/main.html
+++ b/dmapp/dmweb/templates/main.html
@@ -106,7 +106,6 @@
Today
Calendar
Switches
-
Work
All Time
diff --git a/dmapp/dmweb/templates/switches_view.html b/dmapp/dmweb/templates/switches_view.html
index 1291f31..575dcfb 100644
--- a/dmapp/dmweb/templates/switches_view.html
+++ b/dmapp/dmweb/templates/switches_view.html
@@ -1,6 +1,4 @@
-{% extends 'layout.html' %}
-
-{% block head %}
+{% extends 'layout.html' %} {% block head %}
-{% endblock head %}
+{% endblock head %} {% block content %}
-{% block content %}
-
-
+
-
←
+
←
{% if scope == 'daily' %}
-
{{ base_date.strftime('%Y-%m-%d %A') }}
+
{{ base_date.strftime('%Y-%m-%d %A') }}
{% elif scope == 'weekly' %}
-
Week of {{ start.strftime('%Y-%m-%d') }}
+
Week of {{ start.strftime('%Y-%m-%d') }}
{% elif scope == 'monthly' %}
-
{{ base_date.strftime('%B %Y') }}
+
{{ base_date.strftime('%B %Y') }}
{% endif %}
-
→
+
→
@@ -175,7 +197,10 @@
Total Time:
- {{ (switches|sum(attribute='delta') // 3600)|int }}h {{ ((switches|sum(attribute='delta') % 3600) // 60)|int }}m
+ {{ (switches|sum(attribute='delta') // 3600)|int }}h {{
+ ((switches|sum(attribute='delta') % 3600) // 60)|int }}m
@@ -184,34 +209,36 @@
{% set max_delta = switches|map(attribute='delta')|max if switches else 1 %}
- {% set base_height = 30 %}
- {% set max_height = 200 %}
- {% for switch in switches %}
- {% set is_active = switch.workspace in ['Plan', 'Think', 'Work'] %}
- {% set task_hash = switch.task_path|hash if switch.task_path else 0 %}
- {% set border_hue = task_hash % 360 %}
- {% set border_color = 'hsl(%d, 70%%, 50%%)'|format(border_hue) %}
- {% set bg_color = 'hsl(%d, 30%%, 20%%)'|format(border_hue) %}
- {% set height_ratio = (switch.delta / max_delta) if max_delta > 0 else 0 %}
- {% set cell_height = (base_height + (height_ratio * (max_height - base_height)))|int %}
-
-
{{ switch.date.strftime('%m/%d %H:%M:%S') }}
+ {% set base_height = 30 %} {% set max_height = 200 %} {% for switch in
+ switches %} {% set is_active = switch.workspace in ['Plan', 'Think', 'Work']
+ %} {% set task_hash = switch.task_path|hash if switch.task_path else 0 %} {%
+ set border_hue = task_hash % 360 %} {% set border_color = 'hsl(%d, 70%%,
+ 50%%)'|format(border_hue) %} {% set bg_color = 'hsl(%d, 30%%,
+ 20%%)'|format(border_hue) %} {% set height_ratio = (switch.delta /
+ max_delta) if max_delta > 0 else 0 %} {% set cell_height = (base_height +
+ (height_ratio * (max_height - base_height)))|int %}
+
+
+ {{ switch.date.strftime('%m/%d %H:%M:%S') }}
+
{{ switch.workspace }}
{{ switch.task_path }}
- {% if switch.delta >= 3600 %}
- {{ (switch.delta // 3600)|int }}h {{ ((switch.delta % 3600) // 60)|int }}m
- {% else %}
- {{ (switch.delta // 60)|int }}m {{ (switch.delta % 60)|int }}s
- {% endif %}
+ {% if switch.delta >= 3600 %} {{ (switch.delta // 3600)|int }}h {{
+ ((switch.delta % 3600) // 60)|int }}m {% else %} {{ (switch.delta //
+ 60)|int }}m {{ (switch.delta % 60)|int }}s {% endif %}
{% endfor %}
{% if not switches %}
-
No switches in this period
+
+ No switches in this period
+
{% endif %}