Skip to content

Commit

Permalink
Merge pull request #2568 from GregP/confirm_delete_flash_msg_record_name
Browse files Browse the repository at this point in the history
Refactor flash message text for consistency across all actions (Add/Edit/Delete/Cancel)
(cherry picked from commit 5aee298)

https://bugzilla.redhat.com/show_bug.cgi?id=1515407
  • Loading branch information
h-kataria authored and simaishi committed Nov 20, 2017
1 parent bdcbae1 commit a235426
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/controllers/pxe_controller/pxe_customization_templates.rb
Expand Up @@ -92,7 +92,7 @@ def template_create_update
changed = (@edit[:new] != @edit[:current])
if params[:button] == "cancel"
@edit = session[:edit] = nil # clean out the saved info
@ct.id ? add_flash(_("Edit of %{model} \"%{name}\" was cancelled by the user") % {:model => ui_lookup(:model => "PxeCustomizationTemplate"), :name => @ct.name}) :
@ct.id ? add_flash(_("Edit of %{model} \"%{name}\" was cancelled by the user") % {:model => ui_lookup(:model => "PxeCustomizationTemplate"), :name => get_record_display_name(@ct)}) :
add_flash(_("Add of new %{model} was cancelled by the user") %
{:model => ui_lookup(:model => "PxeCustomizationTemplate")})
get_node_info(x_node)
Expand All @@ -119,7 +119,7 @@ def template_create_update

if !flash_errors? && ct.valid? && ct.save
flash_key = ct.id ? _("%{model} \"%{name}\" was saved") : _("%{model} \"%{name}\" was added")
add_flash(flash_key % {:model => ui_lookup(:model => "PxeCustomizationTemplate"), :name => ct.name})
add_flash(flash_key % {:model => ui_lookup(:model => "PxeCustomizationTemplate"), :name => get_record_display_name(ct)})
AuditEvent.success(build_created_audit(ct, @edit))
@edit = session[:edit] = nil # clean out the saved info
self.x_node = "xx-xx-#{to_cid(ct.pxe_image_type.id)}"
Expand Down

0 comments on commit a235426

Please sign in to comment.