Skip to content

Commit

Permalink
Fix(office): Issues timerange filter
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias84 committed Apr 2, 2020
1 parent fadec9a commit ef400a0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
6 changes: 2 additions & 4 deletions office/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@ class IssueFilter(django_filters.FilterSet):
author_email = django_filters.CharFilter(lookup_expr='icontains')
location = django_filters.CharFilter(lookup_expr='icontains')
landowner = django_filters.CharFilter(lookup_expr='icontains')
#year_created__gt = django_filters.NumberFilter(field_name='created_at', lookup_expr='year__gt')
#year_created__lt = django_filters.NumberFilter(field_name='created_at', lookup_expr='year__lt')
create_between = date_between = django_filters.DateFromToRangeFilter(field_name='created_at')
# TODO: useful Date ranges e.g. 30d, 1y, ...
create_between = django_filters.DateFromToRangeFilter(field_name='created_at', widget=django_filters.widgets.RangeWidget(attrs={'type': 'date'}))
# TODO: useful Date ranges e.g. 30d, 1y, ... (daterangefilter)
category__name = django_filters.CharFilter(lookup_expr='icontains')

class Meta:
Expand Down
14 changes: 8 additions & 6 deletions office/templates/office/issue.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,14 @@ <h2 class="mt-4">
{{ issue.created_at|date:"SHORT_DATE_FORMAT" }}
</p>
<q class="usertext">{{ issue.description }}</q>
{% leaflet_map "issuemap" callback="window.map_init_basic" %}
<!-- #TODO: Enable settings as overview map, overlays, ... -->
{% trans '(unknown)' as trans_unkown_location %}
<p>{% trans "Location" %}: {{ issue.location|default_if_none:trans_unkown_location }}</p>
<p>{% trans "Landowner" %}: {{ issue.landowner }}</p>
<div class="bg-info">
<div class="container">
{% leaflet_map "issuemap" callback="window.map_init_basic" %}
<!-- #TODO: Enable settings as overview map, overlays, ... -->
{% trans '(unknown)' as trans_unkown_location %}
<p class="font-weight-light text-left small">{% trans "Location" %}: {{ issue.location|default_if_none:trans_unkown_location }}</p>
<p class="font-weight-light">{% trans "Landowner" %}: {{ issue.landowner }}</p>
</div>
<div>
<p>{% trans "Status" %}:
{% if status_string == 'submitted' %}
<i class="fa fa-share" aria-hidden="true" title="{% trans status_string %}"></i>
Expand Down

0 comments on commit ef400a0

Please sign in to comment.