Repository: OCHA-DAP/hdx-ckan

Issue:
Dataset/Indicator: License shows the ID and not the display name
Compare the names being shown for the license types below with those that the user chooses when creating a dataset.

![image](https://cloud.githubusercontent.com/assets/1654485/4559997/75bc0624-4ef1-11e4-8d5e-1056b1fe9f0b.png)

Some graphs not loading
Data is present in the CSV preview.  Tested in FF and Chrome.

https://test-data.hdx.rwlabs.org/dataset/population_growth
https://test-data.hdx.rwlabs.org/dataset/number-of-disasters-in-reliefweb
https://test-data.hdx.rwlabs.org/dataset/age_dependency_ratio_young



Discussion:

Resolving patch:
diff --git a/ckanext-hdx_search/ckanext/hdx_search/plugin.py b/ckanext-hdx_search/ckanext/hdx_search/plugin.py
--- a/ckanext-hdx_search/ckanext/hdx_search/plugin.py
+++ b/ckanext-hdx_search/ckanext/hdx_search/plugin.py
@@ -31,8 +31,7 @@ def after_map(self, map):
         return map
 
     def before_search(self, search_params):
-        if 'facet.field' in search_params and \
-            'vocab_Topics' not in search_params['facet.field']:
+        if 'facet.field' in search_params and 'vocab_Topics' not in search_params['facet.field']:
             search_params['facet.field'].append('vocab_Topics')
 
         # If indicator flag is set, search only that type
diff --git a/ckanext-hdx_theme/ckanext/hdx_theme/helpers/helpers.py b/ckanext-hdx_theme/ckanext/hdx_theme/helpers/helpers.py
--- a/ckanext-hdx_theme/ckanext/hdx_theme/helpers/helpers.py
+++ b/ckanext-hdx_theme/ckanext/hdx_theme/helpers/helpers.py
@@ -128,7 +128,7 @@ def markdown_extract_strip(text, extract_length=190):
     is the texted without any html tags.  If extract_length is 0 then it
     will not be truncated.'''
     result_text = h.markdown_extract(text, extract_length)
-    result = result_text.rstrip('\n').replace('\n', ' ').replace('\r', '')
+    result = result_text.rstrip('\n').replace('\n', ' ').replace('\r', '').replace('"',"&quot;")
     return result
 
 def render_date_from_concat_str(str, separator='-'):
@@ -279,6 +279,17 @@ def hdx_follow_link(obj_type, obj_id, extra_text):
                        extra_text=extra_text)
     return ''
 
+def follow_status(obj_type, obj_id):
+    obj_type = obj_type.lower()
+    assert obj_type in h._follow_objects
+    # If the user is logged in show the follow/unfollow button
+    if c.user:
+        context = {'model': model, 'session': model.Session, 'user': c.user}
+        action = 'am_following_%s' % obj_type
+        following = logic.get_action(action)(context, {'id': obj_id})
+        return following
+    return False
+
 def one_active_item(items):
     for i in items:
         if i['active']:
@@ -324,4 +335,4 @@ def hdx_follow_button(obj_type, obj_id, **kw):
                        obj_id=obj_id,
                        obj_type=obj_type,
                        params = kw)
-    return ''
\ No newline at end of file
+    return ''
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
@@ -97,7 +97,8 @@ def get_helpers(self):
             'one_active_item': hdx_helpers.one_active_item,
             'hdx_follow_button': hdx_helpers.hdx_follow_button,
             'get_last_revision_timestamp_group': hdx_helpers.get_last_revision_timestamp_group,
-            'feature_count': hdx_helpers.feature_count
+            'feature_count': hdx_helpers.feature_count,
+            'follow_status': hdx_helpers.follow_status
         }
         
     def get_actions(self):


Test patch: