diff --git a/app/components/moderation/shared/index_component.html.erb b/app/components/moderation/shared/index_component.html.erb
index 56f1ce090..275bfc6c4 100644
--- a/app/components/moderation/shared/index_component.html.erb
+++ b/app/components/moderation/shared/index_component.html.erb
@@ -21,18 +21,18 @@
<%= submit_tag t("moderation.#{i18n_namespace}.index.block_authors"),
name: "block_authors",
class: "button hollow alert",
- data: { confirm: t("moderation.#{i18n_namespace}.index.confirm") } %>
+ data: { confirm: t("moderation.actions.confirm_action", action: t("moderation.#{i18n_namespace}.index.block_authors")) } %>
<%= submit_tag t("moderation.#{i18n_namespace}.index.hide"),
name: "hide_#{table_name}",
class: "button hollow alert",
- data: { confirm: t("moderation.#{i18n_namespace}.index.confirm") } %>
+ data: { confirm: t("moderation.actions.confirm_action", action: t("moderation.#{i18n_namespace}.index.hide")) } %>
<%= submit_tag t("moderation.#{i18n_namespace}.index.ignore_flags"),
name: "ignore_flags",
class: "button hollow",
- data: { confirm: t("moderation.#{i18n_namespace}.index.confirm") } %>
+ data: { confirm: t("moderation.actions.confirm_action", action: t("moderation.#{i18n_namespace}.index.ignore_flags")) } %>
<%= paginate records %>
diff --git a/app/views/admin/poll/questions/answers/images/index.html.erb b/app/views/admin/poll/questions/answers/images/index.html.erb
index 15af0ef1f..f031f2b1f 100644
--- a/app/views/admin/poll/questions/answers/images/index.html.erb
+++ b/app/views/admin/poll/questions/answers/images/index.html.erb
@@ -18,6 +18,6 @@
class: "delete float-right",
method: :delete,
remote: true,
- data: { confirm: t("admin.actions.confirm") } %>
+ data: { confirm: t("admin.actions.confirm_action", action: t("images.remove_image"), name: image.title) } %>
<% end %>
diff --git a/app/views/budgets/investments/_actions.html.erb b/app/views/budgets/investments/_actions.html.erb
index a464d7495..9711a8268 100644
--- a/app/views/budgets/investments/_actions.html.erb
+++ b/app/views/budgets/investments/_actions.html.erb
@@ -1,10 +1,10 @@
<% if can? :hide, investment %>
<%= link_to t("admin.actions.hide").capitalize, hide_moderation_budget_investment_path(investment),
- method: :put, remote: true, data: { confirm: t("admin.actions.confirm") } %>
+ method: :put, remote: true, data: { confirm: t("admin.actions.confirm_action", action: t("admin.actions.hide"), name: investment.title) } %>
<% end %>
<% if can? :hide, investment.author %>
|
<%= link_to t("admin.actions.hide_author").capitalize, hide_moderation_user_path(investment.author_id),
- method: :put, data: { confirm: t("admin.actions.confirm") } %>
+ method: :put, data: { confirm: t("admin.actions.confirm_action", action: t("admin.actions.hide_author"), name: investment.author.name) } %>
<% end %>
diff --git a/app/views/comments/_actions.html.erb b/app/views/comments/_actions.html.erb
index 8b9488201..13a97c96a 100644
--- a/app/views/comments/_actions.html.erb
+++ b/app/views/comments/_actions.html.erb
@@ -12,13 +12,13 @@
data: { confirm: t("comments.actions.confirm_delete") } %>
<% else %>
<%= link_to t("admin.actions.hide").capitalize, hide_moderation_comment_path(comment),
- method: :put, remote: true, data: { confirm: t("admin.actions.confirm") } %>
+ method: :put, remote: true, data: { confirm: t("admin.actions.confirm_action", action: t("admin.actions.hide"), name: comment.body.truncate(32)) } %>
<% end %>
<% end %>
<% if can? :hide, comment.user %>
•
<%= link_to t("admin.actions.hide_author").capitalize, hide_moderation_user_path(comment.user_id),
- method: :put, data: { confirm: t("admin.actions.confirm") } %>
+ method: :put, data: { confirm: t("admin.actions.confirm_action", action: t("admin.actions.hide_author"), name: comment.author.name) } %>
<% end %>
diff --git a/app/views/debates/_actions.html.erb b/app/views/debates/_actions.html.erb
index 276d5b2f7..1959ef29a 100644
--- a/app/views/debates/_actions.html.erb
+++ b/app/views/debates/_actions.html.erb
@@ -1,21 +1,21 @@
<% if can? :hide, debate %>
<%= link_to t("admin.actions.hide").capitalize, hide_moderation_debate_path(debate),
- method: :put, remote: true, data: { confirm: t("admin.actions.confirm") } %>
+ method: :put, remote: true, data: { confirm: t("admin.actions.confirm_action", action: t("admin.actions.hide"), name: debate.title) } %>
<% end %>
<% if can? :hide, debate.author %>
|
<%= link_to t("admin.actions.hide_author").capitalize, hide_moderation_user_path(debate.author_id),
- method: :put, data: { confirm: t("admin.actions.confirm") } %>
+ method: :put, data: { confirm: t("admin.actions.confirm_action", action: t("admin.actions.hide_author"), name: debate.author.name) } %>
<% end %>
<% if can? :mark_featured, debate %>
|
<% if debate.featured? %>
<%= link_to t("admin.actions.unmark_featured").capitalize, unmark_featured_debate_path(debate),
- method: :put, data: { confirm: t("admin.actions.confirm") } %>
+ method: :put, data: { confirm: t("admin.actions.confirm_action", action: t("admin.actions.unmark_featured"), name: debate.title) } %>
<% else %>
<%= link_to t("admin.actions.mark_featured").capitalize, mark_featured_debate_path(debate),
- method: :put, data: { confirm: t("admin.actions.confirm") } %>
+ method: :put, data: { confirm: t("admin.actions.confirm_action", action: t("admin.actions.mark_featured"), name: debate.title) } %>
<% end %>
<% end %>
diff --git a/app/views/legislation/proposals/_actions.html.erb b/app/views/legislation/proposals/_actions.html.erb
index 91c4afedd..a887f422c 100644
--- a/app/views/legislation/proposals/_actions.html.erb
+++ b/app/views/legislation/proposals/_actions.html.erb
@@ -1,10 +1,10 @@
<% if can? :hide, proposal %>
<%= link_to t("admin.actions.hide").capitalize, hide_moderation_legislation_proposal_path(proposal),
- method: :put, remote: true, data: { confirm: t("admin.actions.confirm") } %>
+ method: :put, remote: true, data: { confirm: t("admin.actions.confirm_action", action: t("admin.actions.hide"), name: proposal.title) } %>
<% end %>
<% if can? :hide, proposal.author %>
|
<%= link_to t("admin.actions.hide_author").capitalize, hide_moderation_user_path(proposal.author_id),
- method: :put, data: { confirm: t("admin.actions.confirm") } %>
+ method: :put, data: { confirm: t("admin.actions.confirm_action", action: t("admin.actions.hide_author"), name: proposal.author.name) } %>
<% end %>
diff --git a/app/views/proposal_notifications/_actions.html.erb b/app/views/proposal_notifications/_actions.html.erb
index 25ab0a8a7..5c3f96ff1 100644
--- a/app/views/proposal_notifications/_actions.html.erb
+++ b/app/views/proposal_notifications/_actions.html.erb
@@ -3,13 +3,13 @@
<% if can? :hide, notification %>
<%= link_to t("admin.actions.hide").capitalize, hide_moderation_proposal_notification_path(notification),
- method: :put, remote: true, data: { confirm: t("admin.actions.confirm") } %>
+ method: :put, remote: true, data: { confirm: t("admin.actions.confirm_action", action: t("admin.actions.hide"), name: notification.title) } %>
<% end %>
<% if can? :hide, notification.author %>
•
<%= link_to t("admin.actions.hide_author").capitalize, hide_moderation_user_path(notification.author_id),
- method: :put, data: { confirm: t("admin.actions.confirm") } %>
+ method: :put, data: { confirm: t("admin.actions.confirm_action", action: t("admin.actions.hide_author"), name: notification.author.name) } %>
<% end %>
diff --git a/app/views/proposals/_actions.html.erb b/app/views/proposals/_actions.html.erb
index 5a02d96ec..a568c04df 100644
--- a/app/views/proposals/_actions.html.erb
+++ b/app/views/proposals/_actions.html.erb
@@ -1,10 +1,10 @@
<% if can? :hide, proposal %>
<%= link_to t("admin.actions.hide").capitalize, hide_moderation_proposal_path(proposal),
- method: :put, remote: true, data: { confirm: t("admin.actions.confirm") } %>
+ method: :put, remote: true, data: { confirm: t("admin.actions.confirm_action", action: t("admin.actions.hide"), name: proposal.title) } %>
<% end %>
<% if can? :hide, proposal.author %>
|
<%= link_to t("admin.actions.hide_author").capitalize, hide_moderation_user_path(proposal.author_id),
- method: :put, data: { confirm: t("admin.actions.confirm") } %>
+ method: :put, data: { confirm: t("admin.actions.confirm_action", action: t("admin.actions.hide_author"), name: proposal.author.name) } %>
<% end %>
diff --git a/config/locales/en/admin.yml b/config/locales/en/admin.yml
index f8fd6fc64..ea4897c6a 100644
--- a/config/locales/en/admin.yml
+++ b/config/locales/en/admin.yml
@@ -4,7 +4,6 @@ en:
title: Administration
actions:
actions: Actions
- confirm: Are you sure?
confirm_action: "Are you sure? %{action} \"%{name}\""
confirm_delete: "Are you sure? This action will delete \"%{name}\" and can't be undone."
confirm_hide: Confirm moderation
diff --git a/config/locales/en/moderation.yml b/config/locales/en/moderation.yml
index 81dc99a41..7f3b8d83c 100644
--- a/config/locales/en/moderation.yml
+++ b/config/locales/en/moderation.yml
@@ -1,9 +1,10 @@
en:
moderation:
+ actions:
+ confirm_action: "Are you sure? %{action}"
comments:
index:
block_authors: Block authors
- confirm: Are you sure?
filter: Filter
filters:
all: All
@@ -24,7 +25,6 @@ en:
debates:
index:
block_authors: Block authors
- confirm: Are you sure?
filter: Filter
filters:
all: All
@@ -51,7 +51,6 @@ en:
proposals:
index:
block_authors: Block authors
- confirm: Are you sure?
filter: Filter
filters:
all: All
@@ -69,7 +68,6 @@ en:
budget_investments:
index:
block_authors: Block authors
- confirm: Are you sure?
filter: Filter
filters:
all: All
@@ -87,7 +85,6 @@ en:
proposal_notifications:
index:
block_authors: Block authors
- confirm: Are you sure?
filter: Filter
filters:
all: All
diff --git a/config/locales/es/admin.yml b/config/locales/es/admin.yml
index 4481c66c2..82a55c334 100644
--- a/config/locales/es/admin.yml
+++ b/config/locales/es/admin.yml
@@ -4,7 +4,6 @@ es:
title: Administración
actions:
actions: Acciones
- confirm: '¿Estás seguro?'
confirm_action: "¿Estás seguro? %{action} \"%{name}\""
confirm_delete: "¿Estás seguro? Esta acción borrará \"%{name}\" y no se puede deshacer."
confirm_hide: Confirmar moderación
diff --git a/config/locales/es/moderation.yml b/config/locales/es/moderation.yml
index 295f98bd9..1cc2f47d0 100644
--- a/config/locales/es/moderation.yml
+++ b/config/locales/es/moderation.yml
@@ -1,9 +1,10 @@
es:
moderation:
+ actions:
+ confirm_action: "¿Estás seguro? %{action}"
comments:
index:
block_authors: Bloquear autores
- confirm: '¿Estás seguro?'
filter: Filtro
filters:
all: Todos
@@ -24,7 +25,6 @@ es:
debates:
index:
block_authors: Bloquear autores
- confirm: '¿Estás seguro?'
filter: Filtrar
filters:
all: Todos
@@ -51,7 +51,6 @@ es:
proposals:
index:
block_authors: Bloquear autores
- confirm: '¿Estás seguro?'
filter: Filtro
filters:
all: Todas
@@ -69,7 +68,6 @@ es:
budget_investments:
index:
block_authors: Bloquear autores
- confirm: '¿Estás seguro?'
filter: Filtro
filters:
all: Todos
@@ -87,7 +85,6 @@ es:
proposal_notifications:
index:
block_authors: Bloquear autores
- confirm: '¿Estás seguro?'
filter: Filtro
filters:
all: Todas
diff --git a/spec/system/admin/poll/questions/answers/images/images_spec.rb b/spec/system/admin/poll/questions/answers/images/images_spec.rb
index a31c4af8a..2d8049f1f 100644
--- a/spec/system/admin/poll/questions/answers/images/images_spec.rb
+++ b/spec/system/admin/poll/questions/answers/images/images_spec.rb
@@ -53,7 +53,7 @@ describe "Images", :admin do
expect(page).to have_css("img[title='#{image.title}']")
expect(page).to have_content(image.title)
- accept_confirm "Are you sure?" do
+ accept_confirm "Are you sure? Remove image \"#{image.title}\"" do
click_link "Remove image"
end