multiple task query

This commit is contained in:
buenosairesam
2025-01-25 07:33:37 -03:00
parent 2da2f2641a
commit 68f91f06de
3 changed files with 10 additions and 21 deletions

View File

@@ -116,7 +116,7 @@ def get_period_totals(start, end, task=None):
refactor to pass in the timezone and make the variable names clearer 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 = { queries = {
"period": {"date": {"$gt": start, "$lt": end}}, "period": {"date": {"$gt": start, "$lt": end}},

View File

@@ -130,19 +130,3 @@ def month(month=None, year=None, task=None):
cal.setcalyear(useyear) cal.setcalyear(useyear)
return render_template("calendar.html", content=cal.formatmonth(useyear, usemonth)) return render_template("calendar.html", content=cal.formatmonth(useyear, usemonth))
@dmbp.route("/week")
@dmbp.route("/week/<int: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))

View File

@@ -15,6 +15,10 @@
margin: 0; /* Remove default margin */ margin: 0; /* Remove default margin */
} }
.grey {
color:grey;
}
table { table {
font-size: 84pt font-size: 84pt
} }
@@ -33,9 +37,10 @@
{% block content %} {% block content %}
<table> <table>
{% for row in rows %} {% for row in rows %}
{% set my_class = 'grey' if row["ws"] not in ['Active', 'Idle'] else '' %}
<tr> <tr>
<td>{{ row["ws"] }}</td> <td class="{{my_class}}" >{{ row["ws"] }}</td>
<td>{{ row["total"] }}</td> <td class="{{my_class}}" >{{ row["total"] }}</td>
</tr> </tr>
{% endfor %} {% endfor %}
</table> </table>