From 7063644b99d31879ad96fc0749c20a88e8f71b17 Mon Sep 17 00:00:00 2001 From: Finn Bacall Date: Tue, 10 Dec 2024 16:31:56 +0000 Subject: [PATCH] DRY up activity partials --- app/controllers/activities_controller.rb | 6 ++-- app/helpers/activity_helper.rb | 20 +++++++++++ app/views/activities/_activity_log.html.erb | 24 +++++-------- app/views/activities/index.html.erb | 11 +----- app/views/activities/show.html.erb | 7 ---- .../collection/_add_event.html.erb | 12 ------- .../collection/_add_item.html.erb | 15 -------- .../collection/_add_material.html.erb | 12 ------- .../collection/_create.html.erb | 9 ----- .../collection/_destroy.html.erb | 6 ---- .../collection/_update.html.erb | 8 ----- .../collection/_update_parameter.html.erb | 3 -- .../public_activity/common/_add_data.html.erb | 5 +++ .../common/_add_event.html.erb | 6 ++++ .../public_activity/common/_add_item.html.erb | 8 +++++ .../common/_add_material.html.erb | 6 ++++ .../public_activity/common/_add_term.html.erb | 5 +++ .../common/_add_to_collection.html.erb | 6 ++++ .../common/_add_to_topic.html.erb | 6 ++++ .../common/_add_topic.html.erb | 6 ++++ .../common/_approval_status_changed.html.erb | 6 ++++ .../common/_change_role.html.erb | 7 ++++ .../public_activity/common/_create.html.erb | 4 +++ .../public_activity/common/_destroy.html.erb | 4 +++ .../_modify_diagram.html.erb | 11 +++--- .../common/_parameter_change.html.erb | 8 ----- .../common/_reject_data.html.erb | 5 +++ .../common/_reject_term.html.erb | 5 +++ .../public_activity/common/_report.html.erb | 4 +++ .../public_activity/common/_update.html.erb | 4 +++ .../common/_update_parameter.html.erb | 18 ++++++++++ .../content_provider/_create.html.erb | 8 ----- .../content_provider/_destroy.html.erb | 6 ---- .../content_provider/_update.html.erb | 7 ---- .../_update_parameter.html.erb | 3 -- .../public_activity/event/_add_data.html.erb | 8 ----- .../public_activity/event/_add_term.html.erb | 8 ----- .../event/_add_to_collection.html.erb | 12 ------- .../public_activity/event/_create.html.erb | 10 ------ .../public_activity/event/_destroy.html.erb | 6 ---- .../event/_reject_data.html.erb | 7 ---- .../event/_reject_term.html.erb | 7 ---- .../public_activity/event/_report.html.erb | 8 ----- .../public_activity/event/_update.html.erb | 8 ----- .../event/_update_parameter.html.erb | 4 --- .../learning_path/_add_topic.html.erb | 12 ------- .../learning_path/_create.html.erb | 9 ----- .../learning_path/_destroy.html.erb | 6 ---- .../learning_path/_update.html.erb | 8 ----- .../learning_path/_update_parameter.html.erb | 3 -- .../learning_path_topic/_add_item.html.erb | 15 -------- .../learning_path_topic/_create.html.erb | 9 ----- .../learning_path_topic/_destroy.html.erb | 6 ---- .../learning_path_topic/_update.html.erb | 8 ----- .../_update_parameter.html.erb | 3 -- .../public_activity/material/_add_data.erb | 8 ----- .../material/_add_term.html.erb | 8 ----- .../material/_add_to_collection.html.erb | 12 ------- .../public_activity/material/_create.html.erb | 10 ------ .../material/_destroy.html.erb | 6 ---- .../public_activity/material/_reject_data.erb | 7 ---- .../material/_reject_term.html.erb | 7 ---- .../public_activity/material/_update.html.erb | 8 ----- .../material/_update_parameter.html.erb | 3 -- .../public_activity/node/_create.html.erb | 10 ------ .../public_activity/node/_destroy.html.erb | 6 ---- .../public_activity/node/_update.html.erb | 8 ----- .../node/_update_parameter.html.erb | 3 -- .../source/_approval_status_changed.html.erb | 7 ---- .../public_activity/source/_create.html.erb | 10 ------ .../public_activity/source/_destroy.html.erb | 6 ---- .../public_activity/source/_update.html.erb | 7 ---- .../source/_update_parameter.html.erb | 3 -- .../public_activity/workflow/_create.html.erb | 10 ------ .../workflow/_destroy.html.erb | 6 ---- .../public_activity/workflow/_update.html.erb | 7 ---- .../workflow/_update_parameter.html.erb | 3 -- config/locales/en.yml | 28 +++++++++++++++ .../controllers/activities_controller_test.rb | 36 ++++++++++++++++--- test/fixtures/events.yml | 5 +-- test/fixtures/materials.yml | 1 + 81 files changed, 205 insertions(+), 458 deletions(-) create mode 100644 app/helpers/activity_helper.rb delete mode 100644 app/views/activities/show.html.erb delete mode 100644 app/views/public_activity/collection/_add_event.html.erb delete mode 100644 app/views/public_activity/collection/_add_item.html.erb delete mode 100644 app/views/public_activity/collection/_add_material.html.erb delete mode 100644 app/views/public_activity/collection/_create.html.erb delete mode 100644 app/views/public_activity/collection/_destroy.html.erb delete mode 100644 app/views/public_activity/collection/_update.html.erb delete mode 100644 app/views/public_activity/collection/_update_parameter.html.erb create mode 100644 app/views/public_activity/common/_add_data.html.erb create mode 100644 app/views/public_activity/common/_add_event.html.erb create mode 100644 app/views/public_activity/common/_add_item.html.erb create mode 100644 app/views/public_activity/common/_add_material.html.erb create mode 100644 app/views/public_activity/common/_add_term.html.erb create mode 100644 app/views/public_activity/common/_add_to_collection.html.erb create mode 100644 app/views/public_activity/common/_add_to_topic.html.erb create mode 100644 app/views/public_activity/common/_add_topic.html.erb create mode 100644 app/views/public_activity/common/_approval_status_changed.html.erb create mode 100644 app/views/public_activity/common/_change_role.html.erb create mode 100644 app/views/public_activity/common/_create.html.erb create mode 100644 app/views/public_activity/common/_destroy.html.erb rename app/views/public_activity/{workflow => common}/_modify_diagram.html.erb (51%) delete mode 100644 app/views/public_activity/common/_parameter_change.html.erb create mode 100644 app/views/public_activity/common/_reject_data.html.erb create mode 100644 app/views/public_activity/common/_reject_term.html.erb create mode 100644 app/views/public_activity/common/_report.html.erb create mode 100644 app/views/public_activity/common/_update.html.erb create mode 100644 app/views/public_activity/common/_update_parameter.html.erb delete mode 100644 app/views/public_activity/content_provider/_create.html.erb delete mode 100644 app/views/public_activity/content_provider/_destroy.html.erb delete mode 100644 app/views/public_activity/content_provider/_update.html.erb delete mode 100644 app/views/public_activity/content_provider/_update_parameter.html.erb delete mode 100644 app/views/public_activity/event/_add_data.html.erb delete mode 100644 app/views/public_activity/event/_add_term.html.erb delete mode 100644 app/views/public_activity/event/_add_to_collection.html.erb delete mode 100644 app/views/public_activity/event/_create.html.erb delete mode 100644 app/views/public_activity/event/_destroy.html.erb delete mode 100644 app/views/public_activity/event/_reject_data.html.erb delete mode 100644 app/views/public_activity/event/_reject_term.html.erb delete mode 100644 app/views/public_activity/event/_report.html.erb delete mode 100644 app/views/public_activity/event/_update.html.erb delete mode 100644 app/views/public_activity/event/_update_parameter.html.erb delete mode 100644 app/views/public_activity/learning_path/_add_topic.html.erb delete mode 100644 app/views/public_activity/learning_path/_create.html.erb delete mode 100644 app/views/public_activity/learning_path/_destroy.html.erb delete mode 100644 app/views/public_activity/learning_path/_update.html.erb delete mode 100644 app/views/public_activity/learning_path/_update_parameter.html.erb delete mode 100644 app/views/public_activity/learning_path_topic/_add_item.html.erb delete mode 100644 app/views/public_activity/learning_path_topic/_create.html.erb delete mode 100644 app/views/public_activity/learning_path_topic/_destroy.html.erb delete mode 100644 app/views/public_activity/learning_path_topic/_update.html.erb delete mode 100644 app/views/public_activity/learning_path_topic/_update_parameter.html.erb delete mode 100644 app/views/public_activity/material/_add_data.erb delete mode 100644 app/views/public_activity/material/_add_term.html.erb delete mode 100644 app/views/public_activity/material/_add_to_collection.html.erb delete mode 100644 app/views/public_activity/material/_create.html.erb delete mode 100644 app/views/public_activity/material/_destroy.html.erb delete mode 100644 app/views/public_activity/material/_reject_data.erb delete mode 100644 app/views/public_activity/material/_reject_term.html.erb delete mode 100644 app/views/public_activity/material/_update.html.erb delete mode 100644 app/views/public_activity/material/_update_parameter.html.erb delete mode 100644 app/views/public_activity/node/_create.html.erb delete mode 100644 app/views/public_activity/node/_destroy.html.erb delete mode 100644 app/views/public_activity/node/_update.html.erb delete mode 100644 app/views/public_activity/node/_update_parameter.html.erb delete mode 100644 app/views/public_activity/source/_approval_status_changed.html.erb delete mode 100644 app/views/public_activity/source/_create.html.erb delete mode 100644 app/views/public_activity/source/_destroy.html.erb delete mode 100644 app/views/public_activity/source/_update.html.erb delete mode 100644 app/views/public_activity/source/_update_parameter.html.erb delete mode 100644 app/views/public_activity/workflow/_create.html.erb delete mode 100644 app/views/public_activity/workflow/_destroy.html.erb delete mode 100644 app/views/public_activity/workflow/_update.html.erb delete mode 100644 app/views/public_activity/workflow/_update_parameter.html.erb 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) -%>.