diff --git a/app/lib/actions/foreman_template_tasks/template_action.rb b/app/lib/actions/foreman_template_tasks/template_action.rb index 6530a7cfe49e011fbd665b981d52af4c97d09e0b..83b6c715f234e2fe6d001df76542286217128602 100644 --- a/app/lib/actions/foreman_template_tasks/template_action.rb +++ b/app/lib/actions/foreman_template_tasks/template_action.rb @@ -8,6 +8,7 @@ module Actions middleware.use Actions::Middleware::KeepCurrentUser def plan(template_params = {}) + input.update context: template_params.delete(:context) input.update task_params: template_params plan_self end @@ -50,6 +51,12 @@ module Actions raise NotImplementedError end + def humanized_name + format N_('%<action>s Foreman Templates%<context>s'), + action: humanized_action, + context: input[:context] ? " (#{input[:context]})" : '' + end + def task_output (output[:results] || []).map do |r| { diff --git a/app/lib/actions/foreman_template_tasks/template_export_action.rb b/app/lib/actions/foreman_template_tasks/template_export_action.rb index 131d64ea5d11a0d094c2b81a78a1ea4eca3a8cd2..0b97739e5ce05a9a49d61285e998816bf4902174 100644 --- a/app/lib/actions/foreman_template_tasks/template_export_action.rb +++ b/app/lib/actions/foreman_template_tasks/template_export_action.rb @@ -12,10 +12,6 @@ module Actions def humanized_action 'Export' end - - def humanized_name - _('Export Foreman Templates') - end end end end diff --git a/app/lib/actions/foreman_template_tasks/template_import_action.rb b/app/lib/actions/foreman_template_tasks/template_import_action.rb index 0f171067ee6f3695054ce00402ca246bc2ff16de..c405f2bb96e7ea4b737da41b06e9d77ee1d00784 100644 --- a/app/lib/actions/foreman_template_tasks/template_import_action.rb +++ b/app/lib/actions/foreman_template_tasks/template_import_action.rb @@ -12,10 +12,6 @@ module Actions def humanized_action 'Import' end - - def humanized_name - _('Import Foreman Templates') - end end end end