Repository: ckan/ckan

Issue:
Groups Activity Stream do not have detailed "changes" in UI
**CKAN version**
   2.9

**Describe the bug**
If there is any change in Groups, it only logs that the Groups has been updated.

**Steps to reproduce**
   Make changes to a Group and check the Activity Stream.

**Expected behavior**
   The  Groups Activity Stream should show the differences.

**Additional details**
  This is similar to Dataset detailed Activity Stream. 
   



Discussion:
Only datasets currently have detailed changes view and this needs an implementation similarly as in #5771.
@Zharktas, I am working on this issue.

Resolving patch:
diff --git a/ckan/views/group.py b/ckan/views/group.py
--- a/ckan/views/group.py
+++ b/ckan/views/group.py
@@ -513,6 +513,8 @@ def changes(id, group_type, is_organization):
     Shows the changes to an organization in one particular activity stream
     item.
     '''
+    set_org(is_organization)
+    extra_vars = {}
     activity_id = id
     context = {
         u'model': model, u'session': model.Session,
@@ -541,14 +543,14 @@ def changes(id, group_type, is_organization):
         }
     )
 
-    return base.render(
-        u'organization/changes.html', {
-            u'activity_diffs': [activity_diff],
-            u'group_dict': current_group_dict,
-            u'group_activity_list': group_activity_list,
-            u'group_type': current_group_dict[u'type'],
-        }
-    )
+    extra_vars = {
+        u'activity_diffs': [activity_diff],
+        u'group_dict': current_group_dict,
+        u'group_activity_list': group_activity_list,
+        u'group_type': current_group_dict[u'type'],
+    }
+
+    return base.render(_replace_group_org(u'group/changes.html'), extra_vars)
 
 
 def changes_multiple(is_organization, group_type=None):
@@ -558,7 +560,8 @@ def changes_multiple(is_organization, group_type=None):
     activity diffs for the changes in the given version range, then
     re-renders changes.html with the list.
     '''
-
+    set_org(is_organization)
+    extra_vars = {}
     new_id = h.get_request_param(u'new_id')
     old_id = h.get_request_param(u'old_id')
 
@@ -624,14 +627,14 @@ def changes_multiple(is_organization, group_type=None):
         u'id': group_id,
         u'limit': 100})
 
-    return base.render(
-        u'organization/changes.html', {
-            u'activity_diffs': diff_list,
-            u'group_dict': current_group_dict,
-            u'group_activity_list': group_activity_list,
-            u'group_type': current_group_dict[u'type'],
-        }
-    )
+    extra_vars = {
+        u'activity_diffs': diff_list,
+        u'group_dict': current_group_dict,
+        u'group_activity_list': group_activity_list,
+        u'group_type': current_group_dict[u'type'],
+    }
+
+    return base.render(_replace_group_org(u'group/changes.html'), extra_vars)
 
 
 def about(id, group_type, is_organization):
@@ -1329,7 +1332,7 @@ def register_group_plugin_rules(blueprint):
             view_func=globals()[action])
     blueprint.add_url_rule(u'/changes/<id>', view_func=changes)
     blueprint.add_url_rule(
-        u'/organization.changes_multiple',
+        u'/changes_multiple',
         view_func=changes_multiple)
 
 


Test patch: