deploy updates
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
{% extends 'layout.html' %}
|
||||
|
||||
{% block head %}
|
||||
{% extends 'layout.html' %} {% block head %}
|
||||
<style>
|
||||
body {
|
||||
margin: 20px;
|
||||
@@ -104,8 +102,12 @@
|
||||
}
|
||||
|
||||
/* Active vs idle workspace indicator */
|
||||
.ws-active { font-weight: bold; }
|
||||
.ws-idle { opacity: 0.5; }
|
||||
.ws-active {
|
||||
font-weight: bold;
|
||||
}
|
||||
.ws-idle {
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
.stats {
|
||||
margin: 20px 0;
|
||||
@@ -135,36 +137,56 @@
|
||||
color: #e0e0e0;
|
||||
}
|
||||
</style>
|
||||
{% endblock head %}
|
||||
{% endblock head %} {% block content %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class="nav-bar" style="margin-bottom: 15px; padding-bottom: 10px; border-bottom: 2px solid #444;">
|
||||
<div
|
||||
class="nav-bar"
|
||||
style="
|
||||
margin-bottom: 15px;
|
||||
padding-bottom: 10px;
|
||||
border-bottom: 2px solid #444;
|
||||
"
|
||||
>
|
||||
<a href="/">Today</a>
|
||||
<a href="/calendar/{{ scope }}/{{ base_date.year }}/{{ base_date.month }}/{{ base_date.day }}">Calendar</a>
|
||||
<a href="/work">Work</a>
|
||||
<a href="/calendar/daily">Calendar</a>
|
||||
<a href="/switches/daily">Switches</a>
|
||||
<a href="/totals">All Time</a>
|
||||
</div>
|
||||
|
||||
<div class="nav-tabs">
|
||||
<a href="/switches/daily/{{ base_date.year }}/{{ base_date.month }}/{{ base_date.day }}"
|
||||
class="{% if scope == 'daily' %}active{% endif %}">Daily</a>
|
||||
<a href="/switches/weekly/{{ base_date.year }}/{{ base_date.month }}/{{ base_date.day }}"
|
||||
class="{% if scope == 'weekly' %}active{% endif %}">Weekly</a>
|
||||
<a href="/switches/monthly/{{ base_date.year }}/{{ base_date.month }}/{{ base_date.day }}"
|
||||
class="{% if scope == 'monthly' %}active{% endif %}">Monthly</a>
|
||||
<a
|
||||
href="/switches/daily/{{ base_date.year }}/{{ base_date.month }}/{{ base_date.day }}"
|
||||
class="{% if scope == 'daily' %}active{% endif %}"
|
||||
>Daily</a
|
||||
>
|
||||
<a
|
||||
href="/switches/weekly/{{ base_date.year }}/{{ base_date.month }}/{{ base_date.day }}"
|
||||
class="{% if scope == 'weekly' %}active{% endif %}"
|
||||
>Weekly</a
|
||||
>
|
||||
<a
|
||||
href="/switches/monthly/{{ base_date.year }}/{{ base_date.month }}/{{ base_date.day }}"
|
||||
class="{% if scope == 'monthly' %}active{% endif %}"
|
||||
>Monthly</a
|
||||
>
|
||||
</div>
|
||||
|
||||
<div class="date-nav">
|
||||
<a href="/switches/{{ scope }}/{{ prev_date.year }}/{{ prev_date.month }}/{{ prev_date.day }}">←</a>
|
||||
<a
|
||||
href="/switches/{{ scope }}/{{ prev_date.year }}/{{ prev_date.month }}/{{ prev_date.day }}"
|
||||
>←</a
|
||||
>
|
||||
{% if scope == 'daily' %}
|
||||
<span class="date-info">{{ base_date.strftime('%Y-%m-%d %A') }}</span>
|
||||
<span class="date-info">{{ base_date.strftime('%Y-%m-%d %A') }}</span>
|
||||
{% elif scope == 'weekly' %}
|
||||
<span class="date-info">Week of {{ start.strftime('%Y-%m-%d') }}</span>
|
||||
<span class="date-info">Week of {{ start.strftime('%Y-%m-%d') }}</span>
|
||||
{% elif scope == 'monthly' %}
|
||||
<span class="date-info">{{ base_date.strftime('%B %Y') }}</span>
|
||||
<span class="date-info">{{ base_date.strftime('%B %Y') }}</span>
|
||||
{% endif %}
|
||||
<a href="/switches/{{ scope }}/{{ next_date.year }}/{{ next_date.month }}/{{ next_date.day }}">→</a>
|
||||
<a
|
||||
href="/switches/{{ scope }}/{{ next_date.year }}/{{ next_date.month }}/{{ next_date.day }}"
|
||||
>→</a
|
||||
>
|
||||
</div>
|
||||
|
||||
<div class="stats">
|
||||
@@ -175,7 +197,10 @@
|
||||
</div>
|
||||
<div class="stat-item">
|
||||
<span class="stat-label">Total Time:</span>
|
||||
<span class="stat-value">{{ (switches|sum(attribute='delta') // 3600)|int }}h {{ ((switches|sum(attribute='delta') % 3600) // 60)|int }}m</span>
|
||||
<span class="stat-value"
|
||||
>{{ (switches|sum(attribute='delta') // 3600)|int }}h {{
|
||||
((switches|sum(attribute='delta') % 3600) // 60)|int }}m</span
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -184,34 +209,36 @@
|
||||
|
||||
<div class="switches-container">
|
||||
{% 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 %}
|
||||
<div class="switch-row {{ 'ws-active' if is_active else 'ws-idle' }}"
|
||||
style="border-left-color: {{ border_color }}; background-color: {{ bg_color }}; height: {{ cell_height }}px;">
|
||||
<div class="switch-time">{{ switch.date.strftime('%m/%d %H:%M:%S') }}</div>
|
||||
{% 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 %}
|
||||
<div
|
||||
class="switch-row {{ 'ws-active' if is_active else 'ws-idle' }}"
|
||||
style="border-left-color: {{ border_color }}; background-color: {{ bg_color }}; height: {{ cell_height }}px;"
|
||||
>
|
||||
<div class="switch-time">
|
||||
{{ switch.date.strftime('%m/%d %H:%M:%S') }}
|
||||
</div>
|
||||
<div class="switch-workspace">{{ switch.workspace }}</div>
|
||||
<div class="switch-task">{{ switch.task_path }}</div>
|
||||
<div class="switch-duration">
|
||||
{% 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 %}
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
{% if not switches %}
|
||||
<p style="text-align: center; color: #666; margin-top: 40px;">No switches in this period</p>
|
||||
<p style="text-align: center; color: #666; margin-top: 40px">
|
||||
No switches in this period
|
||||
</p>
|
||||
{% endif %}
|
||||
|
||||
<style>
|
||||
|
||||
Reference in New Issue
Block a user