multiple task query
This commit is contained in:
@@ -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}},
|
||||
|
||||
@@ -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/<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))
|
||||
|
||||
@@ -15,6 +15,10 @@
|
||||
margin: 0; /* Remove default margin */
|
||||
}
|
||||
|
||||
.grey {
|
||||
color:grey;
|
||||
}
|
||||
|
||||
table {
|
||||
font-size: 84pt
|
||||
}
|
||||
@@ -33,10 +37,11 @@
|
||||
{% block content %}
|
||||
<table>
|
||||
{% for row in rows %}
|
||||
<tr>
|
||||
<td>{{ row["ws"] }}</td>
|
||||
<td>{{ row["total"] }}</td>
|
||||
</tr>
|
||||
{% set my_class = 'grey' if row["ws"] not in ['Active', 'Idle'] else '' %}
|
||||
<tr>
|
||||
<td class="{{my_class}}" >{{ row["ws"] }}</td>
|
||||
<td class="{{my_class}}" >{{ row["total"] }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user