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
|
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}},
|
||||||
|
|||||||
@@ -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))
|
|
||||||
|
|||||||
@@ -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,10 +37,11 @@
|
|||||||
{% block content %}
|
{% block content %}
|
||||||
<table>
|
<table>
|
||||||
{% for row in rows %}
|
{% for row in rows %}
|
||||||
<tr>
|
{% set my_class = 'grey' if row["ws"] not in ['Active', 'Idle'] else '' %}
|
||||||
<td>{{ row["ws"] }}</td>
|
<tr>
|
||||||
<td>{{ row["total"] }}</td>
|
<td class="{{my_class}}" >{{ row["ws"] }}</td>
|
||||||
</tr>
|
<td class="{{my_class}}" >{{ row["total"] }}</td>
|
||||||
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</table>
|
</table>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
Reference in New Issue
Block a user