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 %> <%= f.text_area :body %>
<div class="margin-top"> <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> </div>
<% end %> <% end %>

View File

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

View File

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

View File

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

View File

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