Skip to content

Commit

Permalink
update report filters
Browse files Browse the repository at this point in the history
  • Loading branch information
Greg Lind committed Dec 2, 2016
1 parent e387b4d commit 37496af
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
3 changes: 2 additions & 1 deletion indicators/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ def get(self, request, *args, **kwargs):
# if we have an indicator type active
if int(type) != 0:
r = {
'indicator_type__id': type,
'indicator__indicator_type__id': type,
}
q.update(r)
# redress the indicator list based on type
Expand Down Expand Up @@ -660,6 +660,7 @@ def get(self, request, *args, **kwargs):

return render(request, self.template_name, {'indicators': indicators, 'getPrograms': getPrograms,
'getIndicatorTypes': getIndicatorTypes, 'getIndicators':getIndicators,
'program':program, 'indicator': indicator, 'type': type,
'filter_program':program_name,'filter_indicator': indicator_name,
'indicator': indicator,'program': program,'type': type,'indicator_name':indicator_name,
'program_name': program_name, 'type_name': type_name})
Expand Down
8 changes: 4 additions & 4 deletions templates/indicators/collecteddata_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -193,12 +193,12 @@
window.location.href = '/indicators/collecteddata/'+program_id+'/0/0/';
}

function indicator_filter(indicator) {
window.location.href = '/indicators/collecteddata/0/'+indicator+'/0';
function indicator_filter(program,indicator,type) {
window.location.href = '/indicators/collecteddata/'+program+'/'+indicator+'/'+type;
}

function indicator_type_filter(type) {
window.location.href = '/indicators/collecteddata/0/0/'+type;
function indicator_type_filter(program,indicator,type) {
window.location.href = '/indicators/collecteddata/'+program+'/'+indicator+'/'+type;
}
</script>

Expand Down
8 changes: 4 additions & 4 deletions templates/indicators/filter.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
<span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu2">
<li role="presentation"><a role="menuitem" tabindex="-1" href=" "> -- All -- </a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" onclick="indicator_filter({{ program }},0,{{ type }} )"> -- All -- </a></li>
{% for item in getIndicators %}
<li role="presentation"><a role="menuitem" tabindex="-1" onclick="indicator_filter({{item.id}})">{{ item.number}} - {{ item.name }}</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" onclick="indicator_filter({{ program }},{{ item.id }},{{ type }} )">{{ item.number}} - {{ item.name }}</a></li>
{% endfor %}
</ul>
</div>
Expand All @@ -28,9 +28,9 @@
<span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu2">
<li role="presentation"><a role="menuitem" tabindex="1" href=""> -- All -- </a></li>
<li role="presentation"><a role="menuitem" tabindex="1" onclick="indicator_type_filter({{program}},0,{{ indicator}})"> -- All -- </a></li>
{% for item in getIndicatorTypes %}
<li role="presentation"><a role="menuitem" tabindex="-1" onclick="indicator_type_filter({{item.id}})">{{ item.indicator_type}}</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" onclick="indicator_type_filter({{program}},{{indicator}},{{ item.id}})">{{ item.indicator_type}}</a></li>
{% endfor %}
</ul>
</div>
Expand Down

0 comments on commit 37496af

Please sign in to comment.