Preserve date range in urls in side menu

This commit is contained in:
CasperVerswijvelt 2021-05-08 12:17:29 +02:00
parent 023e0fde15
commit 2b003b8fa9
3 changed files with 5 additions and 4 deletions

View File

@ -25,7 +25,6 @@ class DateRangeMixin:
else: else:
return timezone.now() return timezone.now()
def get_context_data(self, **kwargs): def get_context_data(self, **kwargs):
data = super().get_context_data(**kwargs) data = super().get_context_data(**kwargs)
data["start_date"] = self.get_start_date() data["start_date"] = self.get_start_date()

View File

@ -42,7 +42,9 @@
{% for service in user.owning_services.all %} {% for service in user.owning_services.all %}
{% url 'dashboard:service' service.uuid as url %} {% url 'dashboard:service' service.uuid as url %}
{% include 'dashboard/includes/sidebar_portal.html' with label=service.name|truncatechars:16 url=url icon=service.link|iconify %} {% with url_full=date_query_params|default:''|prepend_string:url %}
{% include 'dashboard/includes/sidebar_portal.html' with label=service.name|truncatechars:16 url=url_full icon=service.link|iconify %}
{% endwith %}
{% endfor %} {% endfor %}
{% endif %} {% endif %}

View File

@ -186,5 +186,5 @@ def urldisplay(url):
return url return url
@register.filter @register.filter
def add_string(arg1, arg2): def prepend_string(arg1, arg2):
return f"{str(arg1)}{str(arg2)}" return f"{str(arg2)}{str(arg1)}"