Merge pull request #332

feat: add today button to MonthYearPicker
This commit is contained in:
Herculino Trotta
2025-08-15 22:54:21 -03:00
committed by GitHub
2 changed files with 51 additions and 40 deletions
+7
View File
@@ -91,6 +91,12 @@ def month_year_picker(request):
for date in all_months for date in all_months
] ]
today_url = (
reverse(url, kwargs={"month": current_date.month, "year": current_date.year})
if url
else ""
)
return render( return render(
request, request,
"common/fragments/month_year_picker.html", "common/fragments/month_year_picker.html",
@@ -98,6 +104,7 @@ def month_year_picker(request):
"month_year_data": result, "month_year_data": result,
"current_month": current_month, "current_month": current_month,
"current_year": current_year, "current_year": current_year,
"today_url": today_url,
}, },
) )
@@ -48,4 +48,8 @@
</div> </div>
{% endfor %} {% endfor %}
</div> </div>
<hr>
<div class="w-full text-end">
<a class="btn btn-outline-primary btn-sm" href="{{ today_url }}" role="button" hx-boost="true">{% trans 'Today' %}</a>
</div>
{% endblock %} {% endblock %}