From 68f91f06de0d5fb19955350bc4928d8dd0d99cba Mon Sep 17 00:00:00 2001 From: buenosairesam Date: Sat, 25 Jan 2025 07:33:37 -0300 Subject: [PATCH] multiple task query --- dmapp/dmweb/dm.py | 2 +- dmapp/dmweb/dmcal.py | 16 ---------------- dmapp/dmweb/templates/main.html | 13 +++++++++---- 3 files changed, 10 insertions(+), 21 deletions(-) diff --git a/dmapp/dmweb/dm.py b/dmapp/dmweb/dm.py index 5d45580..9ebd4e3 100644 --- a/dmapp/dmweb/dm.py +++ b/dmapp/dmweb/dm.py @@ -116,7 +116,7 @@ def get_period_totals(start, end, task=None): refactor to pass in the timezone and make the variable names clearer """ - task_query = {"task": task} if task else {} + task_query = {"task": {"$in": task.split(",")}} if task else {} queries = { "period": {"date": {"$gt": start, "$lt": end}}, diff --git a/dmapp/dmweb/dmcal.py b/dmapp/dmweb/dmcal.py index 036a113..1397121 100644 --- a/dmapp/dmweb/dmcal.py +++ b/dmapp/dmweb/dmcal.py @@ -130,19 +130,3 @@ def month(month=None, year=None, task=None): cal.setcalyear(useyear) return render_template("calendar.html", content=cal.formatmonth(useyear, usemonth)) - - -@dmbp.route("/week") -@dmbp.route("/week/") -def week(month=None): - usemonth = datetime.today().month - useyear = datetime.today().year - if month: - usemonth = month - - cal = DMHTMLCalendar(calendar.SATURDAY) - - cal.setcalmonth(usemonth) - cal.setcalyear(useyear) - - return render_template("calendar.html", content=cal.formatmonth(useyear, usemonth)) diff --git a/dmapp/dmweb/templates/main.html b/dmapp/dmweb/templates/main.html index 50fae73..b3de627 100644 --- a/dmapp/dmweb/templates/main.html +++ b/dmapp/dmweb/templates/main.html @@ -15,6 +15,10 @@ margin: 0; /* Remove default margin */ } + .grey { + color:grey; + } + table { font-size: 84pt } @@ -33,10 +37,11 @@ {% block content %} {% for row in rows %} - - - - + {% set my_class = 'grey' if row["ws"] not in ['Active', 'Idle'] else '' %} + + + + {% endfor %}
{{ row["ws"] }}{{ row["total"] }}
{{ row["ws"] }}{{ row["total"] }}
{% endblock %}