Add notices when creating and updating geozones
Just like we do in pretty much every section in the admin area.
This commit is contained in:
@@ -17,7 +17,7 @@ class Admin::GeozonesController < Admin::BaseController
|
||||
@geozone = Geozone.new(geozone_params)
|
||||
|
||||
if @geozone.save
|
||||
redirect_to admin_geozones_path
|
||||
redirect_to admin_geozones_path, notice: t("admin.geozones.create.notice")
|
||||
else
|
||||
render :new
|
||||
end
|
||||
@@ -25,7 +25,7 @@ class Admin::GeozonesController < Admin::BaseController
|
||||
|
||||
def update
|
||||
if @geozone.update(geozone_params)
|
||||
redirect_to admin_geozones_path
|
||||
redirect_to admin_geozones_path, notice: t("admin.geozones.update.notice")
|
||||
else
|
||||
render :edit
|
||||
end
|
||||
|
||||
@@ -1393,6 +1393,8 @@ en:
|
||||
code_help: Response code for this geozone on the census API
|
||||
coordinates: Coordinates
|
||||
coordinates_help: Coordinates that will generate a clickable area on an HTML image map
|
||||
create:
|
||||
notice: "Geozone created successfully"
|
||||
edit:
|
||||
form:
|
||||
submit_button: Save changes
|
||||
@@ -1404,6 +1406,8 @@ en:
|
||||
delete:
|
||||
success: Geozone successfully deleted
|
||||
error: This geozone can't be deleted since there are elements attached to it
|
||||
update:
|
||||
notice: "Geozone updated successfully"
|
||||
signature_sheets:
|
||||
author: Author
|
||||
created_at: Creation date
|
||||
|
||||
@@ -1393,6 +1393,8 @@ es:
|
||||
code_help: Código de respuesta para esta zona en la API del censo
|
||||
coordinates: Coordenadas
|
||||
coordinates_help: Coordenadas que generarán una zona clicable en un mapa de imagen HTML
|
||||
create:
|
||||
notice: "Zona creada correctamente"
|
||||
edit:
|
||||
form:
|
||||
submit_button: Guardar cambios
|
||||
@@ -1404,6 +1406,8 @@ es:
|
||||
delete:
|
||||
success: Zona borrada correctamente
|
||||
error: No se puede borrar la zona porque ya tiene elementos asociados
|
||||
update:
|
||||
notice: "Zona actualizada correctamente"
|
||||
signature_sheets:
|
||||
author: Autor
|
||||
created_at: Fecha de creación
|
||||
|
||||
@@ -27,6 +27,7 @@ describe "Admin geozones", :admin do
|
||||
|
||||
click_button "Save changes"
|
||||
|
||||
expect(page).to have_content "Geozone created successfully"
|
||||
expect(page).to have_content "Fancy District"
|
||||
|
||||
visit admin_geozones_path
|
||||
@@ -46,6 +47,8 @@ describe "Admin geozones", :admin do
|
||||
|
||||
click_button "Save changes"
|
||||
|
||||
expect(page).to have_content "Geozone updated successfully"
|
||||
|
||||
within("#geozone_#{geozone.id}") do
|
||||
expect(page).to have_content "New geozone name"
|
||||
expect(page).to have_content "333"
|
||||
@@ -64,6 +67,8 @@ describe "Admin geozones", :admin do
|
||||
|
||||
click_button "Save changes"
|
||||
|
||||
expect(page).to have_content "Geozone updated successfully"
|
||||
|
||||
within("#geozone_#{geozone.id}") do
|
||||
expect(page).to have_content "New geozone name"
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user