Fix submit button text for Admin Notifications admin form

In Madrid, the button text didn't change depending on whether the form
is for the "new" page or for the "edit" page.

In consul, the buttons texts were "create admin notification" and
"update admin notification" instead of "create notification" and "update
notification".

Also change translation key from "submit" to "submit_button" to
match other instances.
This commit is contained in:
Marko Lovic
2018-08-01 14:36:17 +02:00
committed by Javi Martín
parent eeb7463ff4
commit 5ff85d33d6
5 changed files with 12 additions and 6 deletions

View File

@@ -8,6 +8,7 @@
<%= f.text_area :body %>
<div class="margin-top">
<%= f.submit class: "button success" %>
<%= f.submit t("admin.admin_notifications.#{admin_submit_action(@admin_notification)}.submit_button"),
class: "button success" %>
</div>
<% end %>

View File

@@ -145,6 +145,7 @@ ignore_unused:
- 'admin.settings.index.features.*'
- 'admin.polls.*.submit_button'
- 'admin.booths.*.submit_button'
- 'admin.admin_notifications.*.submit_button'
- 'admin.homepage.*'
- 'moderation.comments.index.filter*'
- 'moderation.comments.index.order*'

View File

@@ -658,8 +658,10 @@ en:
empty_notifications: There are no notifications to show
new:
section_title: New notification
submit_button: Create notification
edit:
section_title: Edit notification
submit_button: Update notification
show:
section_title: Notification preview
send: Send notification

View File

@@ -659,8 +659,10 @@ es:
empty_notifications: No hay notificaciones para mostrar
new:
section_title: Nueva notificación
submit_button: Crear notificación
edit:
section_title: Editar notificación
submit_button: Actualizar notificación
show:
section_title: Vista previa de notificación
send: Enviar notificación

View File

@@ -75,7 +75,7 @@ feature "Admin Notifications" do
body: 'This is a body',
link: 'http://www.dummylink.dev')
click_button "Create Admin notification"
click_button "Create notification"
expect(page).to have_content "Notification created successfully"
expect(page).to have_content "Proposal authors"
@@ -99,7 +99,7 @@ feature "Admin Notifications" do
body: 'Other body',
link: '')
click_button "Update Admin notification"
click_button "Update notification"
expect(page).to have_content "Notification updated successfully"
expect(page).to have_content "All users"
@@ -171,7 +171,7 @@ feature "Admin Notifications" do
scenario 'Errors on create' do
visit new_admin_admin_notification_path
click_button "Create Admin notification"
click_button "Create notification"
expect(page).to have_content error_message
end
@@ -181,7 +181,7 @@ feature "Admin Notifications" do
visit edit_admin_admin_notification_path(notification)
fill_in :admin_notification_title, with: ''
click_button "Update Admin notification"
click_button "Update notification"
expect(page).to have_content error_message
end
@@ -228,7 +228,7 @@ feature "Admin Notifications" do
visit new_admin_admin_notification_path
fill_in_admin_notification_form(segment_recipient: segment_recipient)
click_button "Create Admin notification"
click_button "Create notification"
expect(page).to have_content(I18n.t("admin.segment_recipient.#{user_segment}"))
end