Repository: OCHA-DAP/hdx-ckan

Issue:
Search and Dataset List Pages:  Move the filter button
Move the filter button on /search and /dataset so that it apears as part of the search input in main nav:
https://cloud.githubusercontent.com/assets/1654485/5780030/a25eaeb6-9da7-11e4-9e5e-bdca79e549ab.png

When open, the filter button remains in the same place but has a "-" added to indicate that it can be closed.  SVGs will be linked below shortly.
- Open filter button: https://drive.google.com/file/d/0Bx1KWNTx8Ij3SW42UEFNaTdFQXc/view?usp=sharing
- Close filter button: https://drive.google.com/file/d/0Bx1KWNTx8Ij3NzdEXzFmRlJZZU0/view?usp=sharing

Let me know if these SVGs cause any problem.  They are filled black, but I can easily change that. 

Default Country Page: graphs section 
Blocked by #2102 and #2103 
Annotated (very annotated) design is here: 
https://docs.google.com/drawings/d/1qOBKZ7IO7zkEMHh2g3ZiAynh5PiAbO-_-SL4rd9uO_M/edit
Implement the section with 5 graphs



Discussion:
Design proposals below.

On hover says "Filter results":

![image](https://cloud.githubusercontent.com/assets/1654485/5780030/a25eaeb6-9da7-11e4-9e5e-bdca79e549ab.png)
We can maybe add a "-" to the icon when the filter is open to indicate that it can be closed.

![image](https://cloud.githubusercontent.com/assets/1654485/5780070/e235b21e-9da7-11e4-8833-46b26fe7d5fd.png)
We can maybe add a "-" to the icon when the filter is open to indicate that it can be closed.

![image](https://cloud.githubusercontent.com/assets/1654485/5780091/035f635e-9da8-11e4-82b6-7817c7c9beed.png)
In this case, the filter drawer would cover the breadcrumb when open.  The blue tab will look a bit awkward hanging there in the middle when the drawer is open however. 



Resolving patch:
diff --git a/ckanext-hdx_org_group/ckanext/hdx_org_group/controllers/country_controller.py b/ckanext-hdx_org_group/ckanext/hdx_org_group/controllers/country_controller.py
--- a/ckanext-hdx_org_group/ckanext/hdx_org_group/controllers/country_controller.py
+++ b/ckanext-hdx_org_group/ckanext/hdx_org_group/controllers/country_controller.py
@@ -107,18 +107,35 @@ def get_dataset_results(self, country_id):
             ind_type = el.get('indicatorTypeCode', None)
             if ind_type:
                 # d = dt.datetime.strptime(el.get('time', ''), '%Y-%m-%d')
+                el_time = el.get('time')
+                el_value = el.get('value')
                 val = {
-                    'date': el.get('time'),
-                    'value': el.get('value')
+                    'date': el_time,
+                    'value': el_value
                 }
 
                 if ind_type in chart_data_dict:
                     chart_data_dict[ind_type]['data'].append(val);
+
+                    last_date = dt.datetime.strptime(chart_data_dict[ind_type]['lastDate'], '%Y-%m-%d')
+                    curr_date = dt.datetime.strptime(el_time, '%Y-%m-%d')
+
+                    if last_date < curr_date:
+                        chart_data_dict[ind_type]['lastDate'] = el_time
+                        chart_data_dict[ind_type]['lastValue'] = el_value
+
                 else:
                     newel = {
-                        'title': el.get('unitName'),
+                        'title': el.get('indicatorTypeName'),
+                        'sourceName': el.get('sourceName'),
+                        'sourceCode': el.get('sourceCode'),
+                        'lastDate': el_time,
+                        'lastValue': el_value,
+                        'unit': el.get('unitName'),
                         'code': ind_type,
-                        'data': [val]
+                        'data': [val],
+                        'datasetLink': '/todo/changeme',
+                        'datasetUpdateDate': 'Jun 21, 1985'
                     }
                     chart_data_dict[ind_type] = newel
 


Test patch: