Repository: OCHA-DAP/hdx-ckan

Issue:
Align homepage with final wireframes
https://drive.google.com/folderview?id=0B4J8rDnUw80gYUNoYUxaM0ZGT3c&usp=sharing#list



Discussion:
Est: 1 day

Questions: 
- what's the signup for newsletter box behaviour?
- missing icon for "or share your dataset"
- please provide link for new icons: social + partner links

@aalecs :  
- same as at http://docs.hdx.rwlabs.org/  (speak with Luis if you need details)
- Leave it out for now.  I think they are working on something better
- I think you found these, right?  I don't see anything missing. The spacing/sizing for the HumanitarianResponse logo seems a bit off, BTW.


Resolving patch:
diff --git a/ckan/lib/helpers.py b/ckan/lib/helpers.py
--- a/ckan/lib/helpers.py
+++ b/ckan/lib/helpers.py
@@ -781,6 +781,7 @@ def _range(self, regexp_match):
         return re.sub(current_page_span, current_page_link, html)
 
 
+
 def render_datetime(datetime_, date_format=None, with_hours=False):
     '''Render a datetime object or timestamp string as a pretty string
     (Y-m-d H:m).
@@ -1308,7 +1309,6 @@ def user_in_org_or_group(group_id):
         .filter(model.Member.table_id == c.userobj.id)
     return len(query.all()) != 0
 
-
 def dashboard_activity_stream(user_id, filter_type=None, filter_id=None,
                               offset=0):
     '''Return the dashboard activity stream of the current user.
diff --git a/ckanext-hdx_theme/ckanext/hdx_theme/helpers.py b/ckanext-hdx_theme/ckanext/hdx_theme/helpers.py
--- a/ckanext-hdx_theme/ckanext/hdx_theme/helpers.py
+++ b/ckanext-hdx_theme/ckanext/hdx_theme/helpers.py
@@ -2,6 +2,8 @@
 from ckan.common import (
      c, request
 )
+import ckan.model as model
+
 
 downloadable_formats = {
     'csv', 'xls', 'txt', 'jpg', 'jpeg', 'png', 'gif', 'zip', 'xml'
@@ -22,3 +24,20 @@ def get_facet_items_dict(facet, limit=10, exclude_active=False):
         return (facets,no_items)
     
     
+
+def get_last_modifier_user(package_id):
+    pkg_list  = model.Session.query(model.Package).filter(model.Package.id == package_id).all()
+    pkg = pkg_list[0]
+    rev_id = pkg.latest_related_revision.id
+    act_list = model.Session.query(model.Activity).filter(model.Activity.revision_id == rev_id).all()
+    act = act_list[0]
+    usr_id = act.user_id
+    return model.User.get(usr_id)
+
+def get_filtered_params_list(params):
+    result = []
+    for (key, value) in params.items():
+        if key not in {'q','sort'} :
+            result.append((key,value))
+    return result;
+    
\ No newline at end of file
diff --git a/ckanext-hdx_theme/ckanext/hdx_theme/plugin.py b/ckanext-hdx_theme/ckanext/hdx_theme/plugin.py
--- a/ckanext-hdx_theme/ckanext/hdx_theme/plugin.py
+++ b/ckanext-hdx_theme/ckanext/hdx_theme/plugin.py
@@ -25,6 +25,8 @@ def get_helpers(self):
         from ckanext.hdx_theme import helpers as hdx_helpers
         return {
             'is_downloadable': hdx_helpers.is_downloadable,
-            'get_facet_items_dict':hdx_helpers.get_facet_items_dict
+            'get_facet_items_dict':hdx_helpers.get_facet_items_dict,
+            'get_last_modifier_user': hdx_helpers.get_last_modifier_user,
+            'get_filtered_params_list':hdx_helpers.get_filtered_params_list
         }
 


Test patch: