Skip to content
Browse files

change date dropdown to user specified dates

  • Loading branch information...
1 parent bdea58e commit fbd69de4d925b43fc4544daa779ca68a4eccba6e Lengani Kaunda committed Mar 16, 2012
View
21 mwana/apps/nutrition/templates/nutrition/graphs.html
@@ -154,7 +154,7 @@
datePickerController.addEvent(window, "load", function() {
var start_opts = {
// The ID of the associated form element
- id:"start_date",
+ id:"startdate",
// The date format to use
format:"Y-ds-m-ds-d",
@@ -168,7 +168,7 @@
};
var end_opts = {
// The ID of the associated form element
- id:"start_date",
+ id:"enddate",
// The date format to use
format:"Y-ds-m-ds-d",
@@ -226,17 +226,12 @@
{% endfor %}
</select>
</td>
- <td><label for="age">Age:</label></td>
- <td>
- <select name="age" id="age" value="{{age}}">
- {% for age in age_opts %}
- <option value="{{ age }}"
- {% ifequal selected_age age %}
- selected="selected"
- {% endifequal %}>{{ age }}</option>
- {% endfor %}
- </select>
- </td>
+ <td><label for="startage">Age from:</label></td>
+ <td><input type="textbox" name="startage" value="{{ startage }}" id="{{startage}}" /></td>
+ <td><label for="endage">Age to:</label></td>
+ <td><input type="textbox" name="endage" value="{{ endage }}" id="{{endage}}" /></td>
+ </tr>
+ <tr>
<td><label for="percent">As percentage:</label></td>
<td><input type="checkbox" name="percent"
value="checked" id="percent"
View
9 mwana/apps/nutrition/views.py
@@ -39,12 +39,11 @@ def graphs(request):
location, startdate, enddate = get_report_criteria(request)
selected_location = str(location)
gender_opts = sorted(["All", "Male", "Female"])
- age_opts = sorted(["All", "0 - 1", "0 - 2", "0 - 5", "1 - 5", "2 - 5"])
context = {'districts': sorted(DISTRICTS), 'gender_opts': gender_opts,
- 'age_opts': age_opts, 'selected_gender': request.GET.get('gender', "All"),
- 'selected_age': request.GET.get('age', "All"), 'enddate': enddate,
- 'selected_location': selected_location, 'startdate': startdate,
- 'selected_percent': request.GET.get('percent', "checked") }
+ 'selected_gender': request.GET.get('gender', "All"),'enddate': enddate,
+ 'selected_location': selected_location, 'startdate': startdate,
+ 'selected_percent': request.GET.get('percent', "checked"),
+ 'startage': request.GET.get('startage', 0), 'endage': request.GET.get('endage', 5)}
return render_to_response(template_name, context,
context_instance=RequestContext(request))
View
2 mwana/malawi/settings_country.py
@@ -53,7 +53,7 @@
INSTALLED_APPS.insert(-1, 'eav')
INSTALLED_APPS.insert(-1, 'uni_form')
INSTALLED_APPS.insert(-1, 'pagination')
-#INSTALLED_APPS.insert(-1, 'rapidsms_xforms')
+INSTALLED_APPS.insert(-1, 'rapidsms_xforms')
RAPIDSMS_TABS.append(('mwana_reports', 'Reports'))
#RAPIDSMS_TABS.append(('xforms', 'XForms'))

0 comments on commit fbd69de

Please sign in to comment.
Something went wrong with that request. Please try again.