diff --git a/app/controllers/activities_controller.rb b/app/controllers/activities_controller.rb
index 4a1589d25..37bd76d7c 100644
--- a/app/controllers/activities_controller.rb
+++ b/app/controllers/activities_controller.rb
@@ -8,12 +8,12 @@ class ActivitiesController < ApplicationController
def index
if request.xhr?
- @activities = PublicActivity::Activity.order('created_at desc')
+ @activities = @resource.activities.order('created_at desc')
respond_to do |format|
- format.html { render partial: 'activities/activity_log', locals: { resource: @resource } }
+ format.html { render partial: 'activities/activity_log', locals: { activities: @activities } }
end
else
- @activities = PublicActivity::Activity.order('created_at desc').paginate(page: params[:page], per_page: 50)
+ @activities = @resource.activities.order('created_at desc').paginate(page: params[:page], per_page: 50)
respond_to do |format|
format.html
end
diff --git a/app/helpers/activity_helper.rb b/app/helpers/activity_helper.rb
new file mode 100644
index 000000000..9a1c897e0
--- /dev/null
+++ b/app/helpers/activity_helper.rb
@@ -0,0 +1,20 @@
+# The helper for PublicActivity
+
+module ActivityHelper
+ def activity_owner(activity)
+ if activity.owner
+ link_to activity.owner.username, activity.owner
+ else
+ t('activity.deleted_owner')
+ end
+ end
+
+ def activity_resource(activity)
+ if activity.trackable
+ title_field = activity.trackable.is_a?(User) ? :name : :title
+ link_to activity.trackable.send(title_field), activity.trackable
+ else
+ t('activity.deleted_trackable')
+ end
+ end
+end
\ No newline at end of file
diff --git a/app/views/activities/_activity_log.html.erb b/app/views/activities/_activity_log.html.erb
index c5f845c42..99c7c5764 100644
--- a/app/views/activities/_activity_log.html.erb
+++ b/app/views/activities/_activity_log.html.erb
@@ -1,16 +1,8 @@
-<%# Activity log partial that renders activity log for a resource.
-
-Variables that should be available
-- resource - resource whose activity log is being displayed (a material, a content provider, etc...)
-%>
-<% unless resource.blank? %>
-
- <% if resource.activities.blank? %>
-
No activities recorded.
- <% else %>
- <% resource.activities.order(created_at: :desc).each do |activity| %>
- <%= render_activity(activity, layout: :activity) %>
- <% end %>
- <% end %>
-
-<% end %>
\ No newline at end of file
+<%# Activity log partial that renders activity log for a resource.%>
+<% if activities.blank? %>
+ <%= t('activity.empty') %>
+<% else %>
+ <% activities.each do |activity| %>
+ <%= render_activity(activity, layout: :activity, display: "common/#{activity.key.split('.').last}") %>
+ <% end %>
+<% end %>
diff --git a/app/views/activities/index.html.erb b/app/views/activities/index.html.erb
index 85e208256..c2d43fe50 100644
--- a/app/views/activities/index.html.erb
+++ b/app/views/activities/index.html.erb
@@ -2,15 +2,6 @@
<%= will_paginate @activities, param_name: 'page', renderer: BootstrapPagination::Rails %>
-<% @activities.each do |activity| %>
-
- <% if activity.owner -%>
- <%= link_to activity.owner[:username], activity.owner %>
- <% else -%>
- Someone
- <% end -%>
- <%= render_activity activity %>
-
-<% end %>
+<%= render partial: 'activities/activity_log', locals: { activities: @activities } %>
<%= will_paginate @activities, param_name: 'page', renderer: BootstrapPagination::Rails %>
diff --git a/app/views/activities/show.html.erb b/app/views/activities/show.html.erb
deleted file mode 100644
index 5059b06f6..000000000
--- a/app/views/activities/show.html.erb
+++ /dev/null
@@ -1,7 +0,0 @@
-<%#= render_activities(@activities, layout: :activity) %>
-
-<% @resource.activities.each do |activity| %>
-
- <%= render_activity(activity) %>
-
-<% end %>
\ No newline at end of file
diff --git a/app/views/public_activity/collection/_add_event.html.erb b/app/views/public_activity/collection/_add_event.html.erb
deleted file mode 100644
index 4b5ad87e4..000000000
--- a/app/views/public_activity/collection/_add_event.html.erb
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-<% if activity.owner %>
- <%= link_to activity.owner.username, activity.owner %>
-<% end %>
-
-added event
-<%= link_to activity.parameters[:event_title], event_path(activity.parameters[:event_id]) %>
-to
-<%= link_to activity.trackable.title, activity.trackable %>
-at
-<%= activity.created_at -%>.
diff --git a/app/views/public_activity/collection/_add_item.html.erb b/app/views/public_activity/collection/_add_item.html.erb
deleted file mode 100644
index a47a737b7..000000000
--- a/app/views/public_activity/collection/_add_item.html.erb
+++ /dev/null
@@ -1,15 +0,0 @@
-<% type = activity.parameters[:resource_type].constantize %>
-
-
-
-<% if activity.owner %>
- <%= link_to activity.owner.username, activity.owner %>
-<% end %>
-
-added <%= type.model_name.human.downcase %>
-<%= link_to activity.parameters[:resource_title], polymorphic_path(type.model_name.singular.to_sym,
- id: activity.parameters[:resource_id]) %>
-to
-<%= link_to activity.trackable.title, activity.trackable %>
-at
-<%= activity.created_at -%>.
diff --git a/app/views/public_activity/collection/_add_material.html.erb b/app/views/public_activity/collection/_add_material.html.erb
deleted file mode 100644
index 7b5201b3f..000000000
--- a/app/views/public_activity/collection/_add_material.html.erb
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-<% if activity.owner %>
- <%= link_to activity.owner.username, activity.owner %>
-<% end %>
-
-added material
-<%= link_to activity.parameters[:material_title], material_path(activity.parameters[:material_id]) %>
-to
-<%= link_to activity.trackable.title, activity.trackable %>
-at
-<%= activity.created_at -%>.
diff --git a/app/views/public_activity/collection/_create.html.erb b/app/views/public_activity/collection/_create.html.erb
deleted file mode 100644
index 3cc158f1b..000000000
--- a/app/views/public_activity/collection/_create.html.erb
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-<% if activity.owner %>
- <%= link_to activity.owner.username, activity.owner %>
-<% end %>
-
-created
-
-<%= link_to activity.trackable.title, activity.trackable %> at <%= activity.created_at -%>.
\ No newline at end of file
diff --git a/app/views/public_activity/collection/_destroy.html.erb b/app/views/public_activity/collection/_destroy.html.erb
deleted file mode 100644
index 32b6b663c..000000000
--- a/app/views/public_activity/collection/_destroy.html.erb
+++ /dev/null
@@ -1,6 +0,0 @@
-
-<% if activity.owner %>
- <%= link_to activity.owner.username, activity.owner %>
-<% end %>
-
-created <%= link_to activity.trackable.title, activity.trackable %> at <%= activity.created_at -%>.
\ No newline at end of file
diff --git a/app/views/public_activity/collection/_update.html.erb b/app/views/public_activity/collection/_update.html.erb
deleted file mode 100644
index b322f8d47..000000000
--- a/app/views/public_activity/collection/_update.html.erb
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-<% if activity.owner %>
- <%= link_to activity.owner.username, activity.owner %>
-<% end %>
-
-updated
-<%= link_to activity.trackable.title, activity.trackable %> at <%= activity.created_at -%>.
\ No newline at end of file
diff --git a/app/views/public_activity/collection/_update_parameter.html.erb b/app/views/public_activity/collection/_update_parameter.html.erb
deleted file mode 100644
index 807c5e188..000000000
--- a/app/views/public_activity/collection/_update_parameter.html.erb
+++ /dev/null
@@ -1,3 +0,0 @@
-<% unless activity.parameters.empty? %>
- <%= render partial: 'public_activity/common/parameter_change', object: activity.parameters %>
-<% end %>
diff --git a/app/views/public_activity/common/_add_data.html.erb b/app/views/public_activity/common/_add_data.html.erb
new file mode 100644
index 000000000..b12f97f6d
--- /dev/null
+++ b/app/views/public_activity/common/_add_data.html.erb
@@ -0,0 +1,5 @@
+
+<%= activity_owner(activity) %>
+<%= t('activity.actions.data_suggestion_add') %> <%= activity.parameters[:name] %>
+<%= t('activity.target_html', resource: activity_resource(activity)) %>
+<%= t('activity.timestamp', time: activity.created_at) -%>.
\ No newline at end of file
diff --git a/app/views/public_activity/common/_add_event.html.erb b/app/views/public_activity/common/_add_event.html.erb
new file mode 100644
index 000000000..8b59a25c5
--- /dev/null
+++ b/app/views/public_activity/common/_add_event.html.erb
@@ -0,0 +1,6 @@
+
+<%= activity_owner(activity) %>
+<%= t('activity.actions.add') %> <%= Event.model_name.human.downcase %> <%= link_to activity.parameters[:event_title],
+ event_path(activity.parameters[:event_id]) %>
+<%= t('activity.target_html', resource: activity_resource(activity)) %>
+<%= t('activity.timestamp', time: activity.created_at) -%>.
diff --git a/app/views/public_activity/common/_add_item.html.erb b/app/views/public_activity/common/_add_item.html.erb
new file mode 100644
index 000000000..fff4e9f65
--- /dev/null
+++ b/app/views/public_activity/common/_add_item.html.erb
@@ -0,0 +1,8 @@
+<% type = activity.parameters[:resource_type].constantize %>
+
+<%= activity_owner(activity) %>
+<%= t('activity.actions.add') %> <%= type.model_name.human.downcase %> <%= link_to activity.parameters[:resource_title],
+ polymorphic_path(type.model_name.singular.to_sym,
+ id: activity.parameters[:resource_id]) %>
+<%= t('activity.target_html', resource: activity_resource(activity)) %>
+<%= t('activity.timestamp', time: activity.created_at) -%>.
diff --git a/app/views/public_activity/common/_add_material.html.erb b/app/views/public_activity/common/_add_material.html.erb
new file mode 100644
index 000000000..f54d0308b
--- /dev/null
+++ b/app/views/public_activity/common/_add_material.html.erb
@@ -0,0 +1,6 @@
+
+<%= activity_owner(activity) %>
+<%= t('activity.actions.add') %> <%= Material.model_name.human.downcase %> <%= link_to activity.parameters[:material_title],
+ material_path(activity.parameters[:material_id]) %>
+<%= t('activity.target_html', resource: activity_resource(activity)) %>
+<%= t('activity.timestamp', time: activity.created_at) -%>.
diff --git a/app/views/public_activity/common/_add_term.html.erb b/app/views/public_activity/common/_add_term.html.erb
new file mode 100644
index 000000000..d81dc202c
--- /dev/null
+++ b/app/views/public_activity/common/_add_term.html.erb
@@ -0,0 +1,5 @@
+
+<%= activity_owner(activity) %>
+<%= t('activity.actions.term_suggestion_add', field: activity.parameters[:field].try(:singularize)) %> <%= activity.parameters[:name] %>
+<%= t('activity.target_html', resource: activity_resource(activity)) %>
+<%= t('activity.timestamp', time: activity.created_at) -%>.
diff --git a/app/views/public_activity/common/_add_to_collection.html.erb b/app/views/public_activity/common/_add_to_collection.html.erb
new file mode 100644
index 000000000..9fda46fbe
--- /dev/null
+++ b/app/views/public_activity/common/_add_to_collection.html.erb
@@ -0,0 +1,6 @@
+<% return unless activity.parameters.present? %>
+
+<%= activity_owner(activity) %>
+<%= t('activity.actions.add') %> <%= activity_resource(activity) %>
+<%= t('activity.target_html', resource: link_to(activity.parameters[:collection_title], collection_path(activity.parameters[:collection_id]))) %>
+<%= t('activity.timestamp', time: activity.created_at) -%>.
diff --git a/app/views/public_activity/common/_add_to_topic.html.erb b/app/views/public_activity/common/_add_to_topic.html.erb
new file mode 100644
index 000000000..5bcf1fc00
--- /dev/null
+++ b/app/views/public_activity/common/_add_to_topic.html.erb
@@ -0,0 +1,6 @@
+<% return unless activity.parameters.present? %>
+
+<%= activity_owner(activity) %>
+<%= t('activity.actions.add') %> <%= activity_resource(activity) %>
+<%= t('activity.target_html', resource: link_to(activity.parameters[:topic_title], learning_path_topic_path(activity.parameters[:topic_id]))) %>
+<%= t('activity.timestamp', time: activity.created_at) -%>.
diff --git a/app/views/public_activity/common/_add_topic.html.erb b/app/views/public_activity/common/_add_topic.html.erb
new file mode 100644
index 000000000..fef4a9466
--- /dev/null
+++ b/app/views/public_activity/common/_add_topic.html.erb
@@ -0,0 +1,6 @@
+
+<%= activity_owner(activity) %>
+<%= t('activity.actions.add_topic_html',
+ resource: activity_resource(activity),
+ topic: link_to(activity.parameters[:topic_title], learning_path_topic_path(activity.parameters[:topic_id]))) %>
+<%= t('activity.timestamp', time: activity.created_at) -%>.
diff --git a/app/views/public_activity/common/_approval_status_changed.html.erb b/app/views/public_activity/common/_approval_status_changed.html.erb
new file mode 100644
index 000000000..e8d4a6e06
--- /dev/null
+++ b/app/views/public_activity/common/_approval_status_changed.html.erb
@@ -0,0 +1,6 @@
+
+<%= activity_owner(activity) %>
+<%= t('activity.actions.approval_status_change_html',
+ source: activity_resource(activity),
+ status: source_approval_badge(activity.parameters[:new])) %>
+<%= t('activity.timestamp', time: activity.created_at) -%>.
diff --git a/app/views/public_activity/common/_change_role.html.erb b/app/views/public_activity/common/_change_role.html.erb
new file mode 100644
index 000000000..f2ed6a192
--- /dev/null
+++ b/app/views/public_activity/common/_change_role.html.erb
@@ -0,0 +1,7 @@
+
+<%= activity_owner(activity) %>
+<%= t('activity.actions.change_role_html',
+ user: activity_resource(activity),
+ old: Role.find_by_id(activity.parameters[:old])&.title || activity.parameters[:old],
+ new: Role.find_by_id(activity.parameters[:new])&.title || activity.parameters[:new]) %>
+<%= t('activity.timestamp', time: activity.created_at) -%>.
diff --git a/app/views/public_activity/common/_create.html.erb b/app/views/public_activity/common/_create.html.erb
new file mode 100644
index 000000000..d8ce18562
--- /dev/null
+++ b/app/views/public_activity/common/_create.html.erb
@@ -0,0 +1,4 @@
+
+<%= activity_owner(activity) %>
+<%= t('activity.actions.create') %> <%= activity_resource(activity) %>
+<%= t('activity.timestamp', time: activity.created_at) -%>.
diff --git a/app/views/public_activity/common/_destroy.html.erb b/app/views/public_activity/common/_destroy.html.erb
new file mode 100644
index 000000000..ca4f35954
--- /dev/null
+++ b/app/views/public_activity/common/_destroy.html.erb
@@ -0,0 +1,4 @@
+
+<%= activity_owner(activity) %>
+<%= t('activity.actions.destroy') %> <%= activity_resource(activity) %>
+<%= t('activity.timestamp', time: activity.created_at) -%>.
diff --git a/app/views/public_activity/workflow/_modify_diagram.html.erb b/app/views/public_activity/common/_modify_diagram.html.erb
similarity index 51%
rename from app/views/public_activity/workflow/_modify_diagram.html.erb
rename to app/views/public_activity/common/_modify_diagram.html.erb
index 31018c213..4a4e9e6de 100644
--- a/app/views/public_activity/workflow/_modify_diagram.html.erb
+++ b/app/views/public_activity/common/_modify_diagram.html.erb
@@ -1,15 +1,12 @@
-
-<% if activity.owner %>
- <%= link_to activity.owner.username, activity.owner %>
-<% end %>
-
-modified the workflow diagram at <%= activity.created_at -%>.
+<%= activity_owner(activity) %>
+<%= t('activity.actions.workflows.modify_diagram') %>
+<%= t('activity.timestamp', time: activity.created_at) -%>.
<% [:added_nodes, :removed_nodes, :modified_nodes].each do |key| %>
<% if activity.parameters[key].any? %>
-
- <%= key.to_s.sub('_nodes','').capitalize %> <%= pluralize(activity.parameters[key].count, 'node') %>:
+ <%= t("activity.actions.workflows.#{key}") %> <%= pluralize(activity.parameters[key].count, t('activity.actions.workflows.node')) %>:
<%= activity.parameters[key].map { |n| "'#{n['data']['name']}'" }.join(', ') %>
<% end %>
diff --git a/app/views/public_activity/common/_parameter_change.html.erb b/app/views/public_activity/common/_parameter_change.html.erb
deleted file mode 100644
index 213019638..000000000
--- a/app/views/public_activity/common/_parameter_change.html.erb
+++ /dev/null
@@ -1,8 +0,0 @@
-
- changed <%= parameter_change[:attr].humanize %>
- <% if parameter_change[:association_name] -%>
- to: <%= parameter_change[:association_name] -%> (<%= parameter_change[:new_val] -%>)
- <% else %>
- to: <%= parameter_change[:new_val] -%>
- <% end %>
-
diff --git a/app/views/public_activity/common/_reject_data.html.erb b/app/views/public_activity/common/_reject_data.html.erb
new file mode 100644
index 000000000..cca5729b7
--- /dev/null
+++ b/app/views/public_activity/common/_reject_data.html.erb
@@ -0,0 +1,5 @@
+
+<%= activity_owner(activity) %>
+<%= t('activity.actions.data_suggestion_reject') %> <%= activity.parameters[:name] %>
+<%= t('activity.target_html', resource: activity_resource(activity)) %>
+<%= t('activity.timestamp', time: activity.created_at) -%>.
diff --git a/app/views/public_activity/common/_reject_term.html.erb b/app/views/public_activity/common/_reject_term.html.erb
new file mode 100644
index 000000000..c50ab79a3
--- /dev/null
+++ b/app/views/public_activity/common/_reject_term.html.erb
@@ -0,0 +1,5 @@
+
+<%= activity_owner(activity) %>
+<%= t('activity.actions.term_suggestion_reject', field: activity.parameters[:field].try(:singularize)) %> <%= activity.parameters[:name] %>
+<%= t('activity.target_html', resource: activity_resource(activity)) %>
+<%= t('activity.timestamp', time: activity.created_at) -%>.
diff --git a/app/views/public_activity/common/_report.html.erb b/app/views/public_activity/common/_report.html.erb
new file mode 100644
index 000000000..1ede2ba78
--- /dev/null
+++ b/app/views/public_activity/common/_report.html.erb
@@ -0,0 +1,4 @@
+
+<%= activity_owner(activity) %>
+<%= t('activity.actions.report') %> <%= activity_resource(activity) %>
+<%= t('activity.timestamp', time: activity.created_at) -%>.
diff --git a/app/views/public_activity/common/_update.html.erb b/app/views/public_activity/common/_update.html.erb
new file mode 100644
index 000000000..42bbb4724
--- /dev/null
+++ b/app/views/public_activity/common/_update.html.erb
@@ -0,0 +1,4 @@
+
+<%= activity_owner(activity) %>
+<%= t('activity.actions.update') %> <%= activity_resource(activity) %>
+<%= t('activity.timestamp', time: activity.created_at) -%>.
diff --git a/app/views/public_activity/common/_update_parameter.html.erb b/app/views/public_activity/common/_update_parameter.html.erb
new file mode 100644
index 000000000..b107e1369
--- /dev/null
+++ b/app/views/public_activity/common/_update_parameter.html.erb
@@ -0,0 +1,18 @@
+<% parameters = activity.parameters %>
+<% return if parameters.empty? %>
+<% return if activity.trackable.is_a?(Event) &&
+ Event::SENSITIVE_FIELDS.include?(parameters[:attr].to_sym) &&
+ !policy(activity.trackable).edit_report? %>
+
+
+ <% if parameters[:association_name] -%>
+ <%= t('activity.actions.association_change_html',
+ parameter: parameters[:attr].humanize,
+ name: parameters[:association_name],
+ value: parameters[:new_val]) %>
+ <% else %>
+ <%= t('activity.actions.parameter_change_html',
+ parameter: parameters[:attr].humanize,
+ value: parameters[:new_val]) %>
+ <% end %>
+
diff --git a/app/views/public_activity/content_provider/_create.html.erb b/app/views/public_activity/content_provider/_create.html.erb
deleted file mode 100644
index b6c951a2b..000000000
--- a/app/views/public_activity/content_provider/_create.html.erb
+++ /dev/null
@@ -1,8 +0,0 @@
-
-<% if activity.owner %>
- <%= link_to activity.owner.username, activity.owner %>
-<% end %>
-created
-<% if !activity.trackable.nil? %>
- <%= link_to activity.trackable.title, activity.trackable %> at <%= activity.created_at -%>.
-<% end %>
diff --git a/app/views/public_activity/content_provider/_destroy.html.erb b/app/views/public_activity/content_provider/_destroy.html.erb
deleted file mode 100644
index 32b6b663c..000000000
--- a/app/views/public_activity/content_provider/_destroy.html.erb
+++ /dev/null
@@ -1,6 +0,0 @@
-
-<% if activity.owner %>
- <%= link_to activity.owner.username, activity.owner %>
-<% end %>
-
-created <%= link_to activity.trackable.title, activity.trackable %> at <%= activity.created_at -%>.
\ No newline at end of file
diff --git a/app/views/public_activity/content_provider/_update.html.erb b/app/views/public_activity/content_provider/_update.html.erb
deleted file mode 100644
index f2ac4c56d..000000000
--- a/app/views/public_activity/content_provider/_update.html.erb
+++ /dev/null
@@ -1,7 +0,0 @@
-
-<% if activity.owner %>
- <%= link_to activity.owner.username, activity.owner%>
-<% end %>
-
-updated
-<%= link_to activity.trackable.title, activity.trackable %> at <%= activity.created_at -%>.
\ No newline at end of file
diff --git a/app/views/public_activity/content_provider/_update_parameter.html.erb b/app/views/public_activity/content_provider/_update_parameter.html.erb
deleted file mode 100644
index 807c5e188..000000000
--- a/app/views/public_activity/content_provider/_update_parameter.html.erb
+++ /dev/null
@@ -1,3 +0,0 @@
-<% unless activity.parameters.empty? %>
- <%= render partial: 'public_activity/common/parameter_change', object: activity.parameters %>
-<% end %>
diff --git a/app/views/public_activity/event/_add_data.html.erb b/app/views/public_activity/event/_add_data.html.erb
deleted file mode 100644
index c2f7746cd..000000000
--- a/app/views/public_activity/event/_add_data.html.erb
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-<% if activity.owner %>
- <%= link_to activity.owner.username, activity.owner %>
-<% end %>
-
-added the data suggestion <%= activity.parameters[:name] %> to
-<%= link_to activity.trackable.title, activity.trackable %> at <%= activity.created_at -%>.
\ No newline at end of file
diff --git a/app/views/public_activity/event/_add_term.html.erb b/app/views/public_activity/event/_add_term.html.erb
deleted file mode 100644
index 0bcedd81f..000000000
--- a/app/views/public_activity/event/_add_term.html.erb
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-<% if activity.owner %>
- <%= link_to activity.owner.username, activity.owner %>
-<% end %>
-
-added the <%= activity.parameters[:field].try(:singularize) -%> suggestion <%= activity.parameters[:name] %> to
-<%= link_to activity.trackable.title, activity.trackable %> at <%= activity.created_at -%>.
\ No newline at end of file
diff --git a/app/views/public_activity/event/_add_to_collection.html.erb b/app/views/public_activity/event/_add_to_collection.html.erb
deleted file mode 100644
index 3bf3a865c..000000000
--- a/app/views/public_activity/event/_add_to_collection.html.erb
+++ /dev/null
@@ -1,12 +0,0 @@
-<% if !activity.parameters.empty? %>
-
-
- <% if activity.owner %>
- <%= link_to activity.owner.username, activity.owner %>
- <% end %>
-
- added to collection
- <%= link_to activity.parameters[:collection_title], collection_path(activity.parameters[:collection_id]) %>to
- at
- <%= activity.created_at -%>.
-<% end %>
diff --git a/app/views/public_activity/event/_create.html.erb b/app/views/public_activity/event/_create.html.erb
deleted file mode 100644
index 1f98f61af..000000000
--- a/app/views/public_activity/event/_create.html.erb
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-<% if activity.owner %>
- <%= link_to activity.owner.username, activity.owner %>
-<% end %>
-
-created
-<% if !activity.trackable.nil? %>
- <%= link_to activity.trackable.title, activity.trackable %> at <%= activity.created_at -%>.
-<% end %>
\ No newline at end of file
diff --git a/app/views/public_activity/event/_destroy.html.erb b/app/views/public_activity/event/_destroy.html.erb
deleted file mode 100644
index 32b6b663c..000000000
--- a/app/views/public_activity/event/_destroy.html.erb
+++ /dev/null
@@ -1,6 +0,0 @@
-
-<% if activity.owner %>
- <%= link_to activity.owner.username, activity.owner %>
-<% end %>
-
-created <%= link_to activity.trackable.title, activity.trackable %> at <%= activity.created_at -%>.
\ No newline at end of file
diff --git a/app/views/public_activity/event/_reject_data.html.erb b/app/views/public_activity/event/_reject_data.html.erb
deleted file mode 100644
index 40c664aa1..000000000
--- a/app/views/public_activity/event/_reject_data.html.erb
+++ /dev/null
@@ -1,7 +0,0 @@
-
-<% if activity.owner %>
- <%= link_to activity.owner.username, activity.owner %>
-<% end %>
-
-rejected the data suggestion <%= activity.parameters[:name] %> from
-<%= link_to activity.trackable.title, activity.trackable %> at <%= activity.created_at -%>.
\ No newline at end of file
diff --git a/app/views/public_activity/event/_reject_term.html.erb b/app/views/public_activity/event/_reject_term.html.erb
deleted file mode 100644
index a94c9e400..000000000
--- a/app/views/public_activity/event/_reject_term.html.erb
+++ /dev/null
@@ -1,7 +0,0 @@
-
-<% if activity.owner %>
- <%= link_to activity.owner.username, activity.owner %>
-<% end %>
-
-rejected the <%= activity.parameters[:field].try(:singularize) -%> suggestion <%= activity.parameters[:name] %> from
-<%= link_to activity.trackable.title, activity.trackable %> at <%= activity.created_at -%>.
\ No newline at end of file
diff --git a/app/views/public_activity/event/_report.html.erb b/app/views/public_activity/event/_report.html.erb
deleted file mode 100644
index 52fba92d0..000000000
--- a/app/views/public_activity/event/_report.html.erb
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-<% if activity.owner %>
- <%= link_to activity.owner.username, activity.owner %>
-<% end %>
-
-reported on
-<%= link_to activity.trackable.title, activity.trackable %> at <%= activity.created_at -%>.
\ No newline at end of file
diff --git a/app/views/public_activity/event/_update.html.erb b/app/views/public_activity/event/_update.html.erb
deleted file mode 100644
index b322f8d47..000000000
--- a/app/views/public_activity/event/_update.html.erb
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-<% if activity.owner %>
- <%= link_to activity.owner.username, activity.owner %>
-<% end %>
-
-updated
-<%= link_to activity.trackable.title, activity.trackable %> at <%= activity.created_at -%>.
\ No newline at end of file
diff --git a/app/views/public_activity/event/_update_parameter.html.erb b/app/views/public_activity/event/_update_parameter.html.erb
deleted file mode 100644
index 5e161eb43..000000000
--- a/app/views/public_activity/event/_update_parameter.html.erb
+++ /dev/null
@@ -1,4 +0,0 @@
-<% unless activity.parameters.empty? ||
- Event::SENSITIVE_FIELDS.include?(activity.parameters[:attr].to_sym) && !policy(activity.trackable).edit_report? %>
- <%= render partial: 'public_activity/common/parameter_change', object: activity.parameters %>
-<% end %>
diff --git a/app/views/public_activity/learning_path/_add_topic.html.erb b/app/views/public_activity/learning_path/_add_topic.html.erb
deleted file mode 100644
index 0dc309256..000000000
--- a/app/views/public_activity/learning_path/_add_topic.html.erb
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-<% if activity.owner %>
- <%= link_to activity.owner.username, activity.owner %>
-<% end %>
-
-added topic
-<%= link_to activity.parameters[:topic_title], learning_path_topic_path(activity.parameters[:topic_id]) %>
-to
-<%= link_to activity.trackable.title, activity.trackable %>
-at
-<%= activity.created_at -%>.
diff --git a/app/views/public_activity/learning_path/_create.html.erb b/app/views/public_activity/learning_path/_create.html.erb
deleted file mode 100644
index 3cc158f1b..000000000
--- a/app/views/public_activity/learning_path/_create.html.erb
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-<% if activity.owner %>
- <%= link_to activity.owner.username, activity.owner %>
-<% end %>
-
-created
-
-<%= link_to activity.trackable.title, activity.trackable %> at <%= activity.created_at -%>.
\ No newline at end of file
diff --git a/app/views/public_activity/learning_path/_destroy.html.erb b/app/views/public_activity/learning_path/_destroy.html.erb
deleted file mode 100644
index 32b6b663c..000000000
--- a/app/views/public_activity/learning_path/_destroy.html.erb
+++ /dev/null
@@ -1,6 +0,0 @@
-
-<% if activity.owner %>
- <%= link_to activity.owner.username, activity.owner %>
-<% end %>
-
-created <%= link_to activity.trackable.title, activity.trackable %> at <%= activity.created_at -%>.
\ No newline at end of file
diff --git a/app/views/public_activity/learning_path/_update.html.erb b/app/views/public_activity/learning_path/_update.html.erb
deleted file mode 100644
index b322f8d47..000000000
--- a/app/views/public_activity/learning_path/_update.html.erb
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-<% if activity.owner %>
- <%= link_to activity.owner.username, activity.owner %>
-<% end %>
-
-updated
-<%= link_to activity.trackable.title, activity.trackable %> at <%= activity.created_at -%>.
\ No newline at end of file
diff --git a/app/views/public_activity/learning_path/_update_parameter.html.erb b/app/views/public_activity/learning_path/_update_parameter.html.erb
deleted file mode 100644
index 807c5e188..000000000
--- a/app/views/public_activity/learning_path/_update_parameter.html.erb
+++ /dev/null
@@ -1,3 +0,0 @@
-<% unless activity.parameters.empty? %>
- <%= render partial: 'public_activity/common/parameter_change', object: activity.parameters %>
-<% end %>
diff --git a/app/views/public_activity/learning_path_topic/_add_item.html.erb b/app/views/public_activity/learning_path_topic/_add_item.html.erb
deleted file mode 100644
index a47a737b7..000000000
--- a/app/views/public_activity/learning_path_topic/_add_item.html.erb
+++ /dev/null
@@ -1,15 +0,0 @@
-<% type = activity.parameters[:resource_type].constantize %>
-
-
-
-<% if activity.owner %>
- <%= link_to activity.owner.username, activity.owner %>
-<% end %>
-
-added <%= type.model_name.human.downcase %>
-<%= link_to activity.parameters[:resource_title], polymorphic_path(type.model_name.singular.to_sym,
- id: activity.parameters[:resource_id]) %>
-to
-<%= link_to activity.trackable.title, activity.trackable %>
-at
-<%= activity.created_at -%>.
diff --git a/app/views/public_activity/learning_path_topic/_create.html.erb b/app/views/public_activity/learning_path_topic/_create.html.erb
deleted file mode 100644
index 3cc158f1b..000000000
--- a/app/views/public_activity/learning_path_topic/_create.html.erb
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-<% if activity.owner %>
- <%= link_to activity.owner.username, activity.owner %>
-<% end %>
-
-created
-
-<%= link_to activity.trackable.title, activity.trackable %> at <%= activity.created_at -%>.
\ No newline at end of file
diff --git a/app/views/public_activity/learning_path_topic/_destroy.html.erb b/app/views/public_activity/learning_path_topic/_destroy.html.erb
deleted file mode 100644
index 32b6b663c..000000000
--- a/app/views/public_activity/learning_path_topic/_destroy.html.erb
+++ /dev/null
@@ -1,6 +0,0 @@
-
-<% if activity.owner %>
- <%= link_to activity.owner.username, activity.owner %>
-<% end %>
-
-created <%= link_to activity.trackable.title, activity.trackable %> at <%= activity.created_at -%>.
\ No newline at end of file
diff --git a/app/views/public_activity/learning_path_topic/_update.html.erb b/app/views/public_activity/learning_path_topic/_update.html.erb
deleted file mode 100644
index b322f8d47..000000000
--- a/app/views/public_activity/learning_path_topic/_update.html.erb
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-<% if activity.owner %>
- <%= link_to activity.owner.username, activity.owner %>
-<% end %>
-
-updated
-<%= link_to activity.trackable.title, activity.trackable %> at <%= activity.created_at -%>.
\ No newline at end of file
diff --git a/app/views/public_activity/learning_path_topic/_update_parameter.html.erb b/app/views/public_activity/learning_path_topic/_update_parameter.html.erb
deleted file mode 100644
index 807c5e188..000000000
--- a/app/views/public_activity/learning_path_topic/_update_parameter.html.erb
+++ /dev/null
@@ -1,3 +0,0 @@
-<% unless activity.parameters.empty? %>
- <%= render partial: 'public_activity/common/parameter_change', object: activity.parameters %>
-<% end %>
diff --git a/app/views/public_activity/material/_add_data.erb b/app/views/public_activity/material/_add_data.erb
deleted file mode 100644
index c2f7746cd..000000000
--- a/app/views/public_activity/material/_add_data.erb
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-<% if activity.owner %>
- <%= link_to activity.owner.username, activity.owner %>
-<% end %>
-
-added the data suggestion <%= activity.parameters[:name] %> to
-<%= link_to activity.trackable.title, activity.trackable %> at <%= activity.created_at -%>.
\ No newline at end of file
diff --git a/app/views/public_activity/material/_add_term.html.erb b/app/views/public_activity/material/_add_term.html.erb
deleted file mode 100644
index 0bcedd81f..000000000
--- a/app/views/public_activity/material/_add_term.html.erb
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-<% if activity.owner %>
- <%= link_to activity.owner.username, activity.owner %>
-<% end %>
-
-added the <%= activity.parameters[:field].try(:singularize) -%> suggestion <%= activity.parameters[:name] %> to
-<%= link_to activity.trackable.title, activity.trackable %> at <%= activity.created_at -%>.
\ No newline at end of file
diff --git a/app/views/public_activity/material/_add_to_collection.html.erb b/app/views/public_activity/material/_add_to_collection.html.erb
deleted file mode 100644
index f9db6958d..000000000
--- a/app/views/public_activity/material/_add_to_collection.html.erb
+++ /dev/null
@@ -1,12 +0,0 @@
-<% if !activity.parameters.empty? %>
-
-
- <% if activity.owner %>
- <%= link_to activity.owner.username, activity.owner %>
- <% end %>
-
- added to collection
- <%= link_to activity.parameters[:collection_title], collection_path(activity.parameters[:collection_id]) %>
- at
- <%= activity.created_at -%>.
-<% end %>
diff --git a/app/views/public_activity/material/_create.html.erb b/app/views/public_activity/material/_create.html.erb
deleted file mode 100644
index 148d17097..000000000
--- a/app/views/public_activity/material/_create.html.erb
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-<% if activity.owner %>
- <%= link_to activity.owner.username, activity.owner %>
-<% end %>
-
-created
-<% if !activity.trackable.nil? %>
-<%= link_to activity.trackable.title, activity.trackable %> at <%= activity.created_at -%>.
-<% end %>
\ No newline at end of file
diff --git a/app/views/public_activity/material/_destroy.html.erb b/app/views/public_activity/material/_destroy.html.erb
deleted file mode 100644
index 32b6b663c..000000000
--- a/app/views/public_activity/material/_destroy.html.erb
+++ /dev/null
@@ -1,6 +0,0 @@
-
-<% if activity.owner %>
- <%= link_to activity.owner.username, activity.owner %>
-<% end %>
-
-created <%= link_to activity.trackable.title, activity.trackable %> at <%= activity.created_at -%>.
\ No newline at end of file
diff --git a/app/views/public_activity/material/_reject_data.erb b/app/views/public_activity/material/_reject_data.erb
deleted file mode 100644
index 40c664aa1..000000000
--- a/app/views/public_activity/material/_reject_data.erb
+++ /dev/null
@@ -1,7 +0,0 @@
-
-<% if activity.owner %>
- <%= link_to activity.owner.username, activity.owner %>
-<% end %>
-
-rejected the data suggestion <%= activity.parameters[:name] %> from
-<%= link_to activity.trackable.title, activity.trackable %> at <%= activity.created_at -%>.
\ No newline at end of file
diff --git a/app/views/public_activity/material/_reject_term.html.erb b/app/views/public_activity/material/_reject_term.html.erb
deleted file mode 100644
index a94c9e400..000000000
--- a/app/views/public_activity/material/_reject_term.html.erb
+++ /dev/null
@@ -1,7 +0,0 @@
-
-<% if activity.owner %>
- <%= link_to activity.owner.username, activity.owner %>
-<% end %>
-
-rejected the <%= activity.parameters[:field].try(:singularize) -%> suggestion <%= activity.parameters[:name] %> from
-<%= link_to activity.trackable.title, activity.trackable %> at <%= activity.created_at -%>.
\ No newline at end of file
diff --git a/app/views/public_activity/material/_update.html.erb b/app/views/public_activity/material/_update.html.erb
deleted file mode 100644
index b322f8d47..000000000
--- a/app/views/public_activity/material/_update.html.erb
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-<% if activity.owner %>
- <%= link_to activity.owner.username, activity.owner %>
-<% end %>
-
-updated
-<%= link_to activity.trackable.title, activity.trackable %> at <%= activity.created_at -%>.
\ No newline at end of file
diff --git a/app/views/public_activity/material/_update_parameter.html.erb b/app/views/public_activity/material/_update_parameter.html.erb
deleted file mode 100644
index 807c5e188..000000000
--- a/app/views/public_activity/material/_update_parameter.html.erb
+++ /dev/null
@@ -1,3 +0,0 @@
-<% unless activity.parameters.empty? %>
- <%= render partial: 'public_activity/common/parameter_change', object: activity.parameters %>
-<% end %>
diff --git a/app/views/public_activity/node/_create.html.erb b/app/views/public_activity/node/_create.html.erb
deleted file mode 100644
index 925af79ad..000000000
--- a/app/views/public_activity/node/_create.html.erb
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-<% if activity.owner %>
- <%= link_to activity.owner.username, activity.owner %>
-<% end %>
-
-created
-<% if !activity.trackable.nil? %>
-<%= link_to activity.trackable.name, activity.trackable %> at <%= activity.created_at -%>.
-<% end %>
\ No newline at end of file
diff --git a/app/views/public_activity/node/_destroy.html.erb b/app/views/public_activity/node/_destroy.html.erb
deleted file mode 100644
index 9952ef094..000000000
--- a/app/views/public_activity/node/_destroy.html.erb
+++ /dev/null
@@ -1,6 +0,0 @@
-
-<% if activity.owner %>
- <%= link_to activity.owner.username, activity.owner %>
-<% end %>
-
-created <%= link_to activity.trackable.name, activity.trackable %> at <%= activity.created_at -%>.
\ No newline at end of file
diff --git a/app/views/public_activity/node/_update.html.erb b/app/views/public_activity/node/_update.html.erb
deleted file mode 100644
index 756e2ee6c..000000000
--- a/app/views/public_activity/node/_update.html.erb
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-<% if activity.owner %>
- <%= link_to activity.owner.username, activity.owner %>
-<% end %>
-
-updated
-<%= link_to activity.trackable.name, activity.trackable %> at <%= activity.created_at -%>.
\ No newline at end of file
diff --git a/app/views/public_activity/node/_update_parameter.html.erb b/app/views/public_activity/node/_update_parameter.html.erb
deleted file mode 100644
index 807c5e188..000000000
--- a/app/views/public_activity/node/_update_parameter.html.erb
+++ /dev/null
@@ -1,3 +0,0 @@
-<% unless activity.parameters.empty? %>
- <%= render partial: 'public_activity/common/parameter_change', object: activity.parameters %>
-<% end %>
diff --git a/app/views/public_activity/source/_approval_status_changed.html.erb b/app/views/public_activity/source/_approval_status_changed.html.erb
deleted file mode 100644
index 39af3e309..000000000
--- a/app/views/public_activity/source/_approval_status_changed.html.erb
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-<% if activity.owner %>
- <%= link_to activity.owner.username, activity.owner %>
-<% end %>
-
-changed approval status to: <%= source_approval_badge(activity.parameters[:new]) %> at <%= activity.created_at -%>.
diff --git a/app/views/public_activity/source/_create.html.erb b/app/views/public_activity/source/_create.html.erb
deleted file mode 100644
index 148d17097..000000000
--- a/app/views/public_activity/source/_create.html.erb
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-<% if activity.owner %>
- <%= link_to activity.owner.username, activity.owner %>
-<% end %>
-
-created
-<% if !activity.trackable.nil? %>
-<%= link_to activity.trackable.title, activity.trackable %> at <%= activity.created_at -%>.
-<% end %>
\ No newline at end of file
diff --git a/app/views/public_activity/source/_destroy.html.erb b/app/views/public_activity/source/_destroy.html.erb
deleted file mode 100644
index 32b6b663c..000000000
--- a/app/views/public_activity/source/_destroy.html.erb
+++ /dev/null
@@ -1,6 +0,0 @@
-
-<% if activity.owner %>
- <%= link_to activity.owner.username, activity.owner %>
-<% end %>
-
-created <%= link_to activity.trackable.title, activity.trackable %> at <%= activity.created_at -%>.
\ No newline at end of file
diff --git a/app/views/public_activity/source/_update.html.erb b/app/views/public_activity/source/_update.html.erb
deleted file mode 100644
index a3fa1b07a..000000000
--- a/app/views/public_activity/source/_update.html.erb
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-<% if activity.owner %>
- <%= link_to activity.owner.username, activity.owner %>
-<% end %>
-
-updated the metadata at <%= activity.created_at -%>.
\ No newline at end of file
diff --git a/app/views/public_activity/source/_update_parameter.html.erb b/app/views/public_activity/source/_update_parameter.html.erb
deleted file mode 100644
index 807c5e188..000000000
--- a/app/views/public_activity/source/_update_parameter.html.erb
+++ /dev/null
@@ -1,3 +0,0 @@
-<% unless activity.parameters.empty? %>
- <%= render partial: 'public_activity/common/parameter_change', object: activity.parameters %>
-<% end %>
diff --git a/app/views/public_activity/workflow/_create.html.erb b/app/views/public_activity/workflow/_create.html.erb
deleted file mode 100644
index 148d17097..000000000
--- a/app/views/public_activity/workflow/_create.html.erb
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-<% if activity.owner %>
- <%= link_to activity.owner.username, activity.owner %>
-<% end %>
-
-created
-<% if !activity.trackable.nil? %>
-<%= link_to activity.trackable.title, activity.trackable %> at <%= activity.created_at -%>.
-<% end %>
\ No newline at end of file
diff --git a/app/views/public_activity/workflow/_destroy.html.erb b/app/views/public_activity/workflow/_destroy.html.erb
deleted file mode 100644
index 32b6b663c..000000000
--- a/app/views/public_activity/workflow/_destroy.html.erb
+++ /dev/null
@@ -1,6 +0,0 @@
-
-<% if activity.owner %>
- <%= link_to activity.owner.username, activity.owner %>
-<% end %>
-
-created <%= link_to activity.trackable.title, activity.trackable %> at <%= activity.created_at -%>.
\ No newline at end of file
diff --git a/app/views/public_activity/workflow/_update.html.erb b/app/views/public_activity/workflow/_update.html.erb
deleted file mode 100644
index a3fa1b07a..000000000
--- a/app/views/public_activity/workflow/_update.html.erb
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-<% if activity.owner %>
- <%= link_to activity.owner.username, activity.owner %>
-<% end %>
-
-updated the metadata at <%= activity.created_at -%>.
\ No newline at end of file
diff --git a/app/views/public_activity/workflow/_update_parameter.html.erb b/app/views/public_activity/workflow/_update_parameter.html.erb
deleted file mode 100644
index 807c5e188..000000000
--- a/app/views/public_activity/workflow/_update_parameter.html.erb
+++ /dev/null
@@ -1,3 +0,0 @@
-<% unless activity.parameters.empty? %>
- <%= render partial: 'public_activity/common/parameter_change', object: activity.parameters %>
-<% end %>
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 89045722a..f65399ec0 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -874,3 +874,31 @@ en:
admin_console: 'Admin console'
log_out: 'Log out'
log_out_confirm: 'Are you sure you want to log out?'
+ activity:
+ empty: No activities recorded.
+ deleted_owner: Someone
+ deleted_trackable: A resource
+ timestamp: at %{time}
+ target_html: to %{resource}
+ actions:
+ add: added
+ change: changed
+ create: created
+ update: updated
+ destroy: deleted
+ data_suggestion_add: added the data suggestion
+ data_suggestion_reject: rejected the data suggestion
+ term_suggestion_add: added the %{field} suggestion
+ term_suggestion_reject: rejected the %{field} suggestion
+ report: reported on
+ add_topic_html: added topic %{topic} to %{resource}
+ approval_status_change_html: changed %{source} approval status to %{status}
+ workflows:
+ modify_diagram: modified the workflow diagram
+ added_nodes: added
+ removed_nodes: removed
+ modified_nodes: modified
+ node: node
+ parameter_change_html: changed %{parameter} to %{value}
+ association_change_html: changed %{parameter} to %{name} (%{value})
+ change_role_html: changed %{user} role from %{old} to %{new}
diff --git a/test/controllers/activities_controller_test.rb b/test/controllers/activities_controller_test.rb
index be4ad5042..1946ce53e 100644
--- a/test/controllers/activities_controller_test.rb
+++ b/test/controllers/activities_controller_test.rb
@@ -5,28 +5,56 @@ class ActivitiesControllerTest < ActionController::TestCase
include Devise::Test::ControllerHelpers
test 'should get activities for a material' do
+ material = materials(:good_material)
+ assert_difference('PublicActivity::Activity.count', 1) do
+ material.description = 'New description'
+ material.save!
+ end
+
+ other_material = materials(:biojs)
+ assert_difference('PublicActivity::Activity.count', 2) do # Slug updates as well
+ other_material.description = 'Other description'
+ other_material.save!
+ end
+
+ assert_equal 1, material.activities.count
get :index, params: { material_id: materials(:good_material).id }
assert_response :success
+ assert_select '.activity', count: 1
+ assert_select '.activity .sub-activity' do
+ assert_select 'em', 'Description'
+ assert_select 'strong', 'New description'
+ end
end
test 'should not show report-related event parameter changes to non-privileged users' do
event = events(:event_with_report)
sign_in users(:another_regular_user)
- event.funding = 'test'
- event.save
+ assert_difference('PublicActivity::Activity.count', 2) do
+ event.title = 'hello'
+ event.funding = 'test'
+ event.save!
+ end
get :index, params: { event_id: event }
+ assert_select '.sub-activity', count: 1
assert_select '.sub-activity em', text: /Funding/, count: 0
+ assert_select '.sub-activity em', text: /Title/, count: 1
end
test 'should show report-related event parameter changes to privileged users' do
event = events(:event_with_report)
sign_in event.user
- event.funding = 'test'
- event.save
+ assert_difference('PublicActivity::Activity.count', 2) do
+ event.title = 'hello'
+ event.funding = 'test'
+ event.save!
+ end
get :index, params: { event_id: event }
+ assert_select '.sub-activity', count: 2
assert_select '.sub-activity em', text: /Funding/, count: 1
+ assert_select '.sub-activity em', text: /Title/, count: 1
end
test 'should show approval status change activities for a source' do
diff --git a/test/fixtures/events.yml b/test/fixtures/events.yml
index c723ddacc..48b98e68b 100644
--- a/test/fixtures/events.yml
+++ b/test/fixtures/events.yml
@@ -263,6 +263,7 @@ no_description_event:
event_with_report:
title: This event happened
+ slug: this-event-happened
url: http://content-provider.org/event-with-report
description: "An event with a report"
user: regular_user
@@ -272,12 +273,12 @@ event_with_report:
funding: Fidget spinner sales
attendee_count: 1
host_institutions: ["MyHost"]
- timezone: Australia/Sydney
+ timezone: Sydney
contact: MyContact
eligibility: [ registration_of_interest ]
venue: MyHall
city: Sydney
- country: AU
+ country: Australia
postcode: 1000
organizer: AnOrganizer
diff --git a/test/fixtures/materials.yml b/test/fixtures/materials.yml
index 4e8b43198..15ea1f753 100644
--- a/test/fixtures/materials.yml
+++ b/test/fixtures/materials.yml
@@ -3,6 +3,7 @@
good_material:
user: regular_user
title: Training Material Example
+ slug: training-material-example
url: http://training.com/trainers/1359023
description: This is a Training Material produced by an example organization
doi: http://dx.doi.ac.uk/2q3093032