Rename old python folder.

This commit is contained in:
2023-05-15 13:36:16 -04:00
parent b45d4fa8dc
commit 0f2f3094e0
25 changed files with 95 additions and 15 deletions
@@ -0,0 +1,27 @@
{% extends "layout.html" %}
{% block content %}
<h2>
Category Editor
</h2>
<table>
<thead>
<tr>
<th scope="col">Code</th>
<th scope="col">Name</th>
<th scope="col">Color</th>
</tr>
</thead>
<tbody>
{%for activity in activities %}
<tr class="activity-{{activity.code}} color-{{activity.color}}" hx-target="closest tr" hx-swap="beforeend">
<td>{{ activity.code }}</td>
<td>{{ activity.name }}</td>
<td hx-get="/get-color-form/{{activity.activity_id}}">{{ activity.color }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endblock %}
+51
View File
@@ -0,0 +1,51 @@
:root{
--black: #273036;
--red: #c71634;
--cyan: #005744;
--pink: #ff65ae;
--blue: #00a9b3;
--green: #189749;
--yellow: #fff336;
--orange: #ff6d01;
--purple: #5b3ab1;
--darkred: #ff2816;
--lime: #bfff55;
}
tr.color-black{
background: var(--black);
}
tr.color-red{
background: var(--red);
}
tr.color-blue{
background: var(--blue);
}
tr.color-green{
background: var(--green);
}
tr.color-purple{
background: var(--purple);
}
tr.color-lime{
background: var(--lime);
color: var(--black);
}
tr.color-cyan{
background: var(--cyan);
}
tr.color-darkred{
background: var(--darkred);
}
tr.color-pink{
background: var(--pink);
}
tr.color-orange{
background: var(--orange);
}
tr.color-yellow{
background: var(--yellow);
color: var(--black);
}
h2{
color:green;
}
@@ -0,0 +1,15 @@
<div id="color-chooser">
{% for color in [
"black", "red", "cyan", "blue", "green",
"purple", "yellow", "darkred", "orange",
"pink", "lime"] %}
<div
class="color-choice color-{{color}}"
hx-post="/change-color"
hx-vals='{"activity_id": "{{activity.activity_id}}", "color": "{{color}}"}'
hx-target="body"
>
{{ color.capitalize() }}
</div>
{% endfor %}
</div>
@@ -0,0 +1,14 @@
<td class="activity-{{hour.activity.code}}">
<input
id="update-hour-{{hour.hour_id}}"
class="update-entry-form"
type="text"
value="{{hour.activity.code}}"
hx-trigger="change"
hx-post="/update-entry"
>
</input>
</td>
<script language="javascript">
document.querySelector("#update-hour-{{hour.hour_id}}").focus()
</script>
+20
View File
@@ -0,0 +1,20 @@
<!DOCTYPE html>
<html lang="en" hx-boost="true">
<head>
<title>Life Tracker Expanded</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta1/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-giJF6kkoqNQ00vy+HMDP7azOuL0xtbfIcaT9wjKHr8RbDVddVHyTfAAsrekwKmP1" crossorigin="anonymous">
<!-- HTMX -->
<script src="https://unpkg.com/htmx.org@1.5.0"></script>
<script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/handsontable/dist/handsontable.full.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/handsontable/dist/handsontable.full.min.css" />
<link rel="stylesheet" href="/colors.css"/>
<link rel="stylesheet" href="/static/ltx.css"/>
</head>
<body>
<h1 hx-get="/" hx-target="body" hx-push-url="true">Life Tracker, Expanded</h1>
{% block content %}{% endblock %}
</body>
</html>
+8
View File
@@ -0,0 +1,8 @@
{% extends "layout.html" %}
{% block content %}
<div id="app">
{{ message }}
</div>
{% endblock %}
+56
View File
@@ -0,0 +1,56 @@
{% extends "layout.html" %}
{% block content %}
<h2>
{{ days[0].date.strftime("%h %d") }}
&ndash;
{{ days[-1].date.strftime("%h %d") }}
</h2>
<div id="table">
<div class="cell upcase">Date</div>
<div class="cell upcase">Day</div>
{% for m in ["am", "pm"]%}
{% for t in [12, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11] %}
{% if now.strftime("%P") == m and now.strftime("%l").strip() == "{}".format(t) %}
<div class="now cell upcase">
{% else %}
<div class="cell upcase">
{% endif %}
{{t}} {{m}}
</div>
{% endfor %}
{% endfor %}
<div class="cell">Mood</div>
<div class="cell">Comments</div>
{%for day in days%}
{% if day.date.strftime("%x") == now.strftime("%x") %}
<div class="now">
{% else %}
<div>
{% endif %}
{{day.date.strftime("%m/%d")}}
</div>
{% if day.date.strftime("%x") == now.strftime("%x") %}
<div class="now">
{% else %}
<div>
{% endif %}
{{day.date.strftime("%a").upper()}}
</div>
{%for hour in day.hours%}
<div class="activity-{{hour.activity.code}}"
hx-get="/get-activity-form/{{hour.hour_id}}">
{% if hour.activity.code != -1 %}
{{hour.activity.code}}
{% endif %}
</div>
{% endfor %}
<div class="cell">{{day.mood}}</div>
<div class="day-note">{{day.note}}</div>
{%endfor%}
</div>
{% endblock %}
+57
View File
@@ -0,0 +1,57 @@
{% extends "layout.html" %}
{% block content %}
<h2>
{{ days[0].date.strftime("%h %d") }}
&ndash;
{{ days[-1].date.strftime("%h %d") }}
</h2>
<table>
<thead>
<tr>
<th scope="col">Date</th>
<th scope="col">Day</th>
{% for m in ["am", "pm"]%}
{% for t in [12, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11] %}
{% if now.strftime("%P") == m and now.strftime("%l").strip() == "{}".format(t) %}
<th scope="col" class="now">
{% else %}
<th scope="col">
{% endif %}
{{t}} {{m}}
</th>
{% endfor %}
{% endfor %}
</tr>
</thead>
<tbody hx-target="closest td" hx-swap="outerHTML swap:0.5s">
{%for day in days%}
<tr>
{% if day.date.strftime("%x") == now.strftime("%x") %}
<td class="now">
{% else %}
<td>
{% endif %}
{{day.date.strftime("%m/%d")}}
</td>
{% if day.date.strftime("%x") == now.strftime("%x") %}
<td class="now">
{% else %}
<td>
{% endif %}
{{day.date.strftime("%a").upper()}}
</td>
{%for hour in day.hours%}
<td class="activity-{{hour.activity.code}}"
hx-get="/get-activity-form/{{hour.hour_id}}">
{% if hour.activity.code != -1 %}
{{hour.activity.code}}
{% endif %}
</td>
{% endfor %}
<td class="day-note">{{day.note}}</td>
</tr>
{%endfor%}
</tbody>
</table>
{% endblock %}