From 7b03179f4b88f7e4f57508300722dba5db3b007d Mon Sep 17 00:00:00 2001
From: cedricnjanga
Date: Mon, 14 May 2018 17:41:39 -0700
Subject: Refs #6955 Add new translation + custom delete confirmation modal
---
app/assets/javascripts/modal_confirmation.js | 31 +++++++++++++++++++++++
app/decorators/network_decorator.rb | 2 +-
app/decorators/referential_line_decorator.rb | 2 +-
app/javascript/vehicle_journeys/actions/index.js | 10 ++++----
app/views/lines/_form.html.slim | 2 +-
app/views/routing_constraint_zones/show.html.slim | 6 ++---
config/breadcrumbs.rb | 3 +--
config/locales/actions.en.yml | 1 +
config/locales/actions.fr.yml | 1 +
config/locales/companies.en.yml | 2 +-
config/locales/layouts.en.yml | 1 +
config/locales/layouts.fr.yml | 1 +
config/locales/lines.en.yml | 4 +--
config/locales/networks.en.yml | 2 +-
config/locales/routing_constraint_zones.en.yml | 2 ++
config/locales/routing_constraint_zones.fr.yml | 2 ++
config/locales/stop_areas.en.yml | 2 +-
17 files changed, 56 insertions(+), 18 deletions(-)
create mode 100644 app/assets/javascripts/modal_confirmation.js
diff --git a/app/assets/javascripts/modal_confirmation.js b/app/assets/javascripts/modal_confirmation.js
new file mode 100644
index 000000000..e82a8a81b
--- /dev/null
+++ b/app/assets/javascripts/modal_confirmation.js
@@ -0,0 +1,31 @@
+$(document).ready(() => {
+ $.rails.allowAction = (link) => {
+ let message = link.data('confirm')
+ if (!message) return true
+ showConfirmModal(link)
+ return false
+ }
+
+ let showConfirmModal = (link) => {
+ let message = link.data('confirm')
+ let html = `
`
+ $(html).modal()
+ }
+})
\ No newline at end of file
diff --git a/app/decorators/network_decorator.rb b/app/decorators/network_decorator.rb
index ea0f73dc2..ab90e4998 100644
--- a/app/decorators/network_decorator.rb
+++ b/app/decorators/network_decorator.rb
@@ -25,7 +25,7 @@ class NetworkDecorator < AF83::Decorator
end
instance_decorator.destroy_action_link do |l|
- l.content h.destroy_link_content('networks.actions.destroy')
+ l.content h.t('networks.actions.destroy')
l.data confirm: h.t('networks.actions.destroy_confirm')
end
end
diff --git a/app/decorators/referential_line_decorator.rb b/app/decorators/referential_line_decorator.rb
index 3ac846d76..a8c210be0 100644
--- a/app/decorators/referential_line_decorator.rb
+++ b/app/decorators/referential_line_decorator.rb
@@ -13,7 +13,7 @@ class ReferentialLineDecorator < AF83::Decorator
instance_decorator.show_action_link
instance_decorator.action_link secondary: true do |l|
- l.content Chouette::Line.human_attribute_name(:footnotes)
+ l.content Chouette::Line.tmf(:footnotes)
l.href { h.referential_line_footnotes_path(context[:referential], object) }
end
diff --git a/app/javascript/vehicle_journeys/actions/index.js b/app/javascript/vehicle_journeys/actions/index.js
index 98594083d..8ac8b5ec5 100644
--- a/app/javascript/vehicle_journeys/actions/index.js
+++ b/app/javascript/vehicle_journeys/actions/index.js
@@ -379,11 +379,11 @@ const actions = {
vehicle_journey_at_stops: vjasWithDelta,
deletable: false,
selected: false,
- published_journey_name: val.published_journey_name || 'non renseigné',
- published_journey_identifier: val.published_journey_identifier || 'non renseigné',
- company: val.company || {name: 'non renseigné'},
- transport_mode: val.route.line.transport_mode || 'undefined',
- transport_submode: val.route.line.transport_submode || 'undefined'
+ published_journey_name: val.published_journey_name || '',
+ published_journey_identifier: val.published_journey_identifier || '',
+ company: val.company || {name: ''},
+ transport_mode: val.route.line.transport_mode || '',
+ transport_submode: val.route.line.transport_submode || ''
})
)
}
diff --git a/app/views/lines/_form.html.slim b/app/views/lines/_form.html.slim
index 909d6512e..4623abf8a 100644
--- a/app/views/lines/_form.html.slim
+++ b/app/views/lines/_form.html.slim
@@ -4,7 +4,7 @@
= f.input :name
= f.input :network_id, as: :select, :collection => @line_referential.networks, include_blank: false
= f.input :company_id, as: :select, :collection => @line_referential.companies, include_blank: true
- = f.input :secondary_company_ids, :collection => @line_referential.companies, include_blank: false, input_html: { multiple: true, 'data-select2ed': true }, label: t('activerecord.attributes.line.secondary_company')
+ = f.input :secondary_company_ids, :collection => @line_referential.companies, include_blank: false, input_html: { multiple: true, 'data-select2ed': true }, label: Chouette::Line.tmf(:secondary_companies)
= f.input :published_name
= f.input :registration_number
= f.input :number
diff --git a/app/views/routing_constraint_zones/show.html.slim b/app/views/routing_constraint_zones/show.html.slim
index 8c8e9b17a..55c952ae6 100644
--- a/app/views/routing_constraint_zones/show.html.slim
+++ b/app/views/routing_constraint_zones/show.html.slim
@@ -16,15 +16,15 @@
= table_builder_2 @routing_constraint_zone.route.stop_points,
[ \
TableBuilderHelper::Column.new( \
- name: "Arrêts de l'itinéraire", \
+ name: t('.route_stop_points'), \
attribute: 'name', \
link_to: lambda do |stop_point| \
referential_stop_area_path(@referential, stop_point.stop_area) \
end \
),
TableBuilderHelper::Column.new( \
- name: "Arrêts inclus dans l'ITL", \
- attribute: Proc.new{ |rsp| (@routing_constraint_zone.stop_point_ids.include? rsp.id) ? 'Oui' : 'Non' } \
+ name: t('.stop_points'), \
+ attribute: Proc.new{ |rsp| (@routing_constraint_zone.stop_point_ids.include? rsp.id) ? t('yes') : t('no') } \
) \
],
sortable: false,
diff --git a/config/breadcrumbs.rb b/config/breadcrumbs.rb
index babaa2c8c..d48ea7e50 100644
--- a/config/breadcrumbs.rb
+++ b/config/breadcrumbs.rb
@@ -3,7 +3,7 @@ crumb :root do
end
crumb :workbench do |workbench|
- link workbench.name, workbench_path(workbench)
+ link I18n.t('workbenches.index.offers.title'), workbench_path(workbench)
end
crumb :workbench_output do |workbench|
@@ -160,7 +160,6 @@ end
crumb :stop_areas do |stop_area_referential|
link I18n.t('stop_areas.index.title'), stop_area_referential_stop_areas_path(stop_area_referential)
- parent :stop_area_referential, stop_area_referential
end
crumb :stop_area do |stop_area_referential, stop_area|
diff --git a/config/locales/actions.en.yml b/config/locales/actions.en.yml
index faf0dcec2..2c48f11a9 100644
--- a/config/locales/actions.en.yml
+++ b/config/locales/actions.en.yml
@@ -35,3 +35,4 @@ en:
no_result_text: "No Results"
searching_term: "Searching..."
are_you_sure: Are you sure?
+ ok: Ok
diff --git a/config/locales/actions.fr.yml b/config/locales/actions.fr.yml
index 9e1a132a7..f02ab2198 100644
--- a/config/locales/actions.fr.yml
+++ b/config/locales/actions.fr.yml
@@ -35,3 +35,4 @@ fr:
no_result_text: "Aucun résultat"
searching_term: "Recherche en cours..."
are_you_sure: Etes vous sûr ?
+ ok: Ok
diff --git a/config/locales/companies.en.yml b/config/locales/companies.en.yml
index f2b19bc19..8a746f6b7 100644
--- a/config/locales/companies.en.yml
+++ b/config/locales/companies.en.yml
@@ -6,7 +6,7 @@ en:
new: "Add a new company"
edit: "Edit this company"
destroy: "Remove this company"
- destroy_confirm: "Are you sure you want destroy this company?"
+ destroy_confirm: "Are you sure you want to destroy this company?"
new:
title: "Add a new company"
edit:
diff --git a/config/locales/layouts.en.yml b/config/locales/layouts.en.yml
index 70e95646e..933a7248d 100644
--- a/config/locales/layouts.en.yml
+++ b/config/locales/layouts.en.yml
@@ -68,6 +68,7 @@ en:
yesterday: "Yestersday"
edit_periods: "Edit periods"
delete_periods: "Delete periods"
+ warning: Warning
attributes:
author: "Edited by"
created_at: "Created at"
diff --git a/config/locales/layouts.fr.yml b/config/locales/layouts.fr.yml
index 810ede34c..62735d3b8 100644
--- a/config/locales/layouts.fr.yml
+++ b/config/locales/layouts.fr.yml
@@ -68,6 +68,7 @@ fr:
yesterday: "Hier"
edit_periods: "Editer Périodes"
delete_periods: "Supprimer Périodes"
+ warning: Avertissement
attributes:
author: "Edité par"
created_at: "Créé le"
diff --git a/config/locales/lines.en.yml b/config/locales/lines.en.yml
index 6501faa57..0f3eaadd9 100644
--- a/config/locales/lines.en.yml
+++ b/config/locales/lines.en.yml
@@ -8,7 +8,7 @@ en:
activate: "Activate this line"
deactivate: "Deactivate this line"
activate_confirm: "Are you sure you want to activate this line ?"
- deactivate_confirm: "Are you sure you want tode activate this line ?"
+ deactivate_confirm: "Are you sure you want to deactivate this line ?"
destroy_confirm: "Are you sure you want to destroy this line ?"
destroy_selection_confirm: "Are you sure you want to destroy those lines ?"
import: "Import lines"
@@ -117,7 +117,7 @@ en:
updated_at: Updated at
creator_id: "Created by"
footnotes: "Footnotes"
- stable_id: External permanent idenifier"
+ stable_id: External permanent identifier
status: Status
activated: Activated
deactivated: Deactivated
diff --git a/config/locales/networks.en.yml b/config/locales/networks.en.yml
index 2046a30ae..d4164f9a6 100644
--- a/config/locales/networks.en.yml
+++ b/config/locales/networks.en.yml
@@ -5,7 +5,7 @@ en:
new: "Add a new network"
edit: "Edit this network"
destroy: "Remove this network"
- destroy_confirm: "Are you sure you want destroy this network?"
+ destroy_confirm: "Are you sure you want to destroy this network ?"
new:
title: "Add a new network"
edit:
diff --git a/config/locales/routing_constraint_zones.en.yml b/config/locales/routing_constraint_zones.en.yml
index 2143ce1e1..a4bb9b36c 100644
--- a/config/locales/routing_constraint_zones.en.yml
+++ b/config/locales/routing_constraint_zones.en.yml
@@ -39,6 +39,8 @@ en:
title: "Update routing constraint zone %{name}"
show:
title: "Routing constraint zone %{name}"
+ route_stop_points: Route stop points
+ stop_points: Stop points included in the RCZ
index:
title: "Routing constraint zones"
search_no_results: "No ITL matches your query"
diff --git a/config/locales/routing_constraint_zones.fr.yml b/config/locales/routing_constraint_zones.fr.yml
index b5e0fa7fb..8de1bc225 100644
--- a/config/locales/routing_constraint_zones.fr.yml
+++ b/config/locales/routing_constraint_zones.fr.yml
@@ -39,6 +39,8 @@ fr:
title: "Editer l'ITL : %{name}"
show:
title: "Zone de contrainte %{name}"
+ route_stop_points: Arrêts de l'itinéraire
+ stop_points: Arrêts inclus dans l'ITL
index:
title: "Interdictions de trafic local"
search_no_results: "Aucune ITL ne correspond à votre recherche"
diff --git a/config/locales/stop_areas.en.yml b/config/locales/stop_areas.en.yml
index 7f460381c..3a26f93b2 100644
--- a/config/locales/stop_areas.en.yml
+++ b/config/locales/stop_areas.en.yml
@@ -28,7 +28,7 @@ en:
activate: "Activate this stop"
deactivate: "Deactivate this stop"
activate_confirm: "Are you sure you want to activate this stop ?"
- deactivate_confirm: "Are you sure you want tode activate this stop ?"
+ deactivate_confirm: "Are you sure you want to deactivate this stop ?"
deleted_at: "Activated"
destroy_confirm: "Are you sure you want destroy this stop and all of his children ?"
select_parent: "Create or modify the relation child -> parent"
--
cgit v1.2.3
From 329bf9e86a966b666f3911e0abdefb5f70a45998 Mon Sep 17 00:00:00 2001
From: Zog
Date: Mon, 28 May 2018 10:51:35 +0200
Subject: Refs #6955; :lipstick:
---
config/locales/time_tables.en.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/config/locales/time_tables.en.yml b/config/locales/time_tables.en.yml
index ce890942d..234f36e81 100644
--- a/config/locales/time_tables.en.yml
+++ b/config/locales/time_tables.en.yml
@@ -90,7 +90,7 @@ en:
to: " to: "
start_date: "mm/jj/aaaa"
end_date: "mm/jj/aaaa"
- title: "timetables"
+ title: "Timetables"
selection: "Selection"
selection_all: "All"
advanced_search: "Advanced Search"
--
cgit v1.2.3
From f8df5fedc7f440d6dda5bfad6d9703a3a586ee38 Mon Sep 17 00:00:00 2001
From: Zog
Date: Mon, 28 May 2018 11:17:00 +0200
Subject: Refs #6955; Fix I18n in decorators.
---
app/decorators/compliance_control_decorator.rb | 4 ++--
app/decorators/compliance_control_set_decorator.rb | 2 +-
app/decorators/line_decorator.rb | 6 +++---
app/decorators/network_decorator.rb | 4 ++--
app/decorators/purchase_window_decorator.rb | 2 +-
app/decorators/referential_line_decorator.rb | 4 ++--
app/decorators/referential_network_decorator.rb | 4 ++--
app/decorators/route_decorator.rb | 12 ++++++------
app/decorators/routing_constraint_zone_decorator.rb | 2 +-
app/decorators/stop_area_decorator.rb | 14 +++++++-------
app/decorators/stop_area_referential_decorator.rb | 4 ++--
11 files changed, 29 insertions(+), 29 deletions(-)
diff --git a/app/decorators/compliance_control_decorator.rb b/app/decorators/compliance_control_decorator.rb
index fd2dbd9ce..7cdb4a890 100644
--- a/app/decorators/compliance_control_decorator.rb
+++ b/app/decorators/compliance_control_decorator.rb
@@ -5,7 +5,7 @@ class ComplianceControlDecorator < AF83::Decorator
with_instance_decorator do |instance_decorator|
instance_decorator.show_action_link do |l|
- l.content h.t('compliance_control_sets.actions.show')
+ l.content t('compliance_control_sets.actions.show')
l.href do
h.compliance_control_set_compliance_control_path(
object.compliance_control_set.id,
@@ -17,7 +17,7 @@ class ComplianceControlDecorator < AF83::Decorator
instance_decorator.edit_action_link
instance_decorator.destroy_action_link do |l|
- l.data confirm: h.t('compliance_controls.actions.destroy_confirm')
+ l.data confirm: t('compliance_controls.actions.destroy_confirm')
end
end
diff --git a/app/decorators/compliance_control_set_decorator.rb b/app/decorators/compliance_control_set_decorator.rb
index b16a06886..ad38c492c 100644
--- a/app/decorators/compliance_control_set_decorator.rb
+++ b/app/decorators/compliance_control_set_decorator.rb
@@ -20,7 +20,7 @@ class ComplianceControlSetDecorator < AF83::Decorator
instance_decorator.destroy_action_link do |l|
l.content h.destroy_link_content
l.href { h.compliance_control_set_path(object.id) }
- l.data confirm: h.t('compliance_control_sets.actions.destroy_confirm')
+ l.data confirm: t('compliance_control_sets.actions.destroy_confirm')
end
end
end
diff --git a/app/decorators/line_decorator.rb b/app/decorators/line_decorator.rb
index 077978c36..0fdb7cc0b 100644
--- a/app/decorators/line_decorator.rb
+++ b/app/decorators/line_decorator.rb
@@ -44,7 +44,7 @@ class LineDecorator < AF83::Decorator
l.content { h.deactivate_link_content('lines.actions.deactivate') }
l.href { h.deactivate_line_referential_line_path(context[:line_referential], object) }
l.method :put
- l.data confirm: h.t('lines.actions.deactivate_confirm')
+ l.data {{ confirm: h.t('lines.actions.deactivate_confirm') }}
l.add_class "delete-action"
end
@@ -52,13 +52,13 @@ class LineDecorator < AF83::Decorator
l.content { h.activate_link_content('lines.actions.activate') }
l.href { h.activate_line_referential_line_path(context[:line_referential], object) }
l.method :put
- l.data confirm: h.t('lines.actions.activate_confirm')
+ l.data {{ confirm: h.t('lines.actions.activate_confirm') }}
l.add_class "delete-action"
end
instance_decorator.destroy_action_link do |l|
l.content { h.destroy_link_content('lines.actions.destroy') }
- l.data confirm: h.t('lines.actions.destroy_confirm')
+ l.data {{ confirm: h.t('lines.actions.destroy_confirm') }}
l.add_class "delete-action"
end
end
diff --git a/app/decorators/network_decorator.rb b/app/decorators/network_decorator.rb
index ab90e4998..55cd37082 100644
--- a/app/decorators/network_decorator.rb
+++ b/app/decorators/network_decorator.rb
@@ -25,8 +25,8 @@ class NetworkDecorator < AF83::Decorator
end
instance_decorator.destroy_action_link do |l|
- l.content h.t('networks.actions.destroy')
- l.data confirm: h.t('networks.actions.destroy_confirm')
+ l.content { h.destroy_link_content('networks.actions.destroy') }
+ l.data {{ confirm: h.t('networks.actions.destroy_confirm') }}
end
end
end
diff --git a/app/decorators/purchase_window_decorator.rb b/app/decorators/purchase_window_decorator.rb
index 9b58577b2..8e6ca9d36 100644
--- a/app/decorators/purchase_window_decorator.rb
+++ b/app/decorators/purchase_window_decorator.rb
@@ -15,7 +15,7 @@ class PurchaseWindowDecorator < AF83::Decorator
instance_decorator.edit_action_link
instance_decorator.destroy_action_link do |l|
- l.data confirm: h.t('purchase_windows.actions.destroy_confirm')
+ l.data confirm: t('purchase_windows.actions.destroy_confirm')
end
end
diff --git a/app/decorators/referential_line_decorator.rb b/app/decorators/referential_line_decorator.rb
index a8c210be0..4416e133e 100644
--- a/app/decorators/referential_line_decorator.rb
+++ b/app/decorators/referential_line_decorator.rb
@@ -18,7 +18,7 @@ class ReferentialLineDecorator < AF83::Decorator
end
instance_decorator.action_link secondary: true do |l|
- l.content h.t('routing_constraint_zones.index.title')
+ l.content t('routing_constraint_zones.index.title')
l.href do
h.referential_line_routing_constraint_zones_path(
scope,
@@ -36,7 +36,7 @@ class ReferentialLineDecorator < AF83::Decorator
},
secondary: true
) do |l|
- l.content h.t('routes.actions.new')
+ l.content t('routes.actions.new')
l.href { h.new_referential_line_route_path(scope, object) }
end
end
diff --git a/app/decorators/referential_network_decorator.rb b/app/decorators/referential_network_decorator.rb
index c508452c0..f8c656e7c 100644
--- a/app/decorators/referential_network_decorator.rb
+++ b/app/decorators/referential_network_decorator.rb
@@ -20,8 +20,8 @@ class ReferentialNetworkDecorator < AF83::Decorator
end
instance_decorator.destroy_action_link do |l|
- l.content h.destroy_link_content('networks.actions.destroy')
- l.data confirm: h.t('networks.actions.destroy_confirm')
+ l.content { h.destroy_link_content('networks.actions.destroy') }
+ l.data confirm: t('networks.actions.destroy_confirm')
end
end
end
diff --git a/app/decorators/route_decorator.rb b/app/decorators/route_decorator.rb
index 646bc1620..801e139b0 100644
--- a/app/decorators/route_decorator.rb
+++ b/app/decorators/route_decorator.rb
@@ -18,7 +18,7 @@ class RouteDecorator < AF83::Decorator
if: ->() { object.stop_points.any? },
secondary: :show
) do |l|
- l.content h.t('journey_patterns.actions.index')
+ l.content t('journey_patterns.actions.index')
l.href do
[
context[:referential],
@@ -33,7 +33,7 @@ class RouteDecorator < AF83::Decorator
if: ->() { object.journey_patterns.present? },
secondary: :show
) do |l|
- l.content h.t('vehicle_journeys.actions.index')
+ l.content t('vehicle_journeys.actions.index')
l.href do
[
context[:referential],
@@ -45,7 +45,7 @@ class RouteDecorator < AF83::Decorator
end
instance_decorator.action_link secondary: :show do |l|
- l.content h.t('vehicle_journey_exports.new.title')
+ l.content t('vehicle_journey_exports.new.title')
l.href do
h.referential_line_route_vehicle_journey_exports_path(
context[:referential],
@@ -60,7 +60,7 @@ class RouteDecorator < AF83::Decorator
secondary: :show,
policy: :duplicate
) do |l|
- l.content h.t('routes.duplicate.title')
+ l.content t('routes.duplicate.title')
l.method :post
l.href do
h.duplicate_referential_line_route_path(
@@ -76,7 +76,7 @@ class RouteDecorator < AF83::Decorator
policy: :create_opposite,
if: ->{h.has_feature?(:create_opposite_routes)}
) do |l|
- l.content h.t('routes.create_opposite.title')
+ l.content t('routes.create_opposite.title')
l.method :post
l.disabled { object.opposite_route.present? }
l.href do
@@ -90,7 +90,7 @@ class RouteDecorator < AF83::Decorator
end
instance_decorator.destroy_action_link do |l|
- l.data confirm: h.t('routes.actions.destroy_confirm')
+ l.data confirm: t('routes.actions.destroy_confirm')
end
end
end
diff --git a/app/decorators/routing_constraint_zone_decorator.rb b/app/decorators/routing_constraint_zone_decorator.rb
index de73068be..3ff286cc1 100644
--- a/app/decorators/routing_constraint_zone_decorator.rb
+++ b/app/decorators/routing_constraint_zone_decorator.rb
@@ -21,7 +21,7 @@ class RoutingConstraintZoneDecorator < AF83::Decorator
instance_decorator.edit_action_link
instance_decorator.destroy_action_link do |l|
- l.data confirm: h.t('routing_constraint_zones.actions.destroy_confirm')
+ l.data confirm: t('routing_constraint_zones.actions.destroy_confirm')
end
end
end
diff --git a/app/decorators/stop_area_decorator.rb b/app/decorators/stop_area_decorator.rb
index 525681971..c7f10b13b 100644
--- a/app/decorators/stop_area_decorator.rb
+++ b/app/decorators/stop_area_decorator.rb
@@ -11,11 +11,11 @@ class StopAreaDecorator < AF83::Decorator
instance_decorator.show_action_link
instance_decorator.edit_action_link do |l|
- l.content h.t('stop_areas.actions.edit')
+ l.content t('stop_areas.actions.edit')
end
instance_decorator.action_link policy: :deactivate, secondary: true do |l|
- l.content h.deactivate_link_content('stop_areas.actions.deactivate')
+ l.content { h.deactivate_link_content('stop_areas.actions.deactivate') }
l.href do
h.deactivate_stop_area_referential_stop_area_path(
object.stop_area_referential,
@@ -23,12 +23,12 @@ class StopAreaDecorator < AF83::Decorator
)
end
l.method :put
- l.data confirm: h.t('stop_areas.actions.deactivate_confirm')
+ l.data confirm: t('stop_areas.actions.deactivate_confirm')
l.add_class 'delete-action'
end
instance_decorator.action_link policy: :activate, secondary: true do |l|
- l.content h.activate_link_content('stop_areas.actions.activate')
+ l.content { h.activate_link_content('stop_areas.actions.activate') }
l.href do
h.activate_stop_area_referential_stop_area_path(
object.stop_area_referential,
@@ -36,13 +36,13 @@ class StopAreaDecorator < AF83::Decorator
)
end
l.method :put
- l.data confirm: h.t('stop_areas.actions.activate_confirm')
+ l.data confirm: t('stop_areas.actions.activate_confirm')
l.add_class 'delete-action'
end
instance_decorator.destroy_action_link do |l|
- l.content h.destroy_link_content('stop_areas.actions.destroy')
- l.data confirm: h.t('stop_areas.actions.destroy_confirm')
+ l.content { h.destroy_link_content('stop_areas.actions.destroy') }
+ l.data confirm: t('stop_areas.actions.destroy_confirm')
end
end
diff --git a/app/decorators/stop_area_referential_decorator.rb b/app/decorators/stop_area_referential_decorator.rb
index d30501ec9..36e45abca 100644
--- a/app/decorators/stop_area_referential_decorator.rb
+++ b/app/decorators/stop_area_referential_decorator.rb
@@ -5,9 +5,9 @@ class StopAreaReferentialDecorator < AF83::Decorator
instance_decorator.action_link policy: :synchronize, primary: :show do |l|
l.content t('actions.sync')
- l.href { h. sync_stop_area_referential_path(object.id) }
+ l.href { h.sync_stop_area_referential_path(object.id) }
l.method :post
end
-
+
end
end
--
cgit v1.2.3
From 6b4fed48e666ba06975756f8723a51c7b80f6c43 Mon Sep 17 00:00:00 2001
From: Zog
Date: Mon, 28 May 2018 13:01:53 +0200
Subject: Refs #6965; Fix specs
---
config/breadcrumbs.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/config/breadcrumbs.rb b/config/breadcrumbs.rb
index d48ea7e50..5a16853f8 100644
--- a/config/breadcrumbs.rb
+++ b/config/breadcrumbs.rb
@@ -3,7 +3,7 @@ crumb :root do
end
crumb :workbench do |workbench|
- link I18n.t('workbenches.index.offers.title'), workbench_path(workbench)
+ link workbench.name, workbench_path(workbench)
end
crumb :workbench_output do |workbench|
--
cgit v1.2.3
From 6e0df2b0abeae8b80b73e81bdcf1dab81523857f Mon Sep 17 00:00:00 2001
From: Zog
Date: Mon, 28 May 2018 13:19:49 +0200
Subject: Refs #7059; Mark Referentil s filed if the cloning failed
---
app/models/referential_cloning.rb | 3 +++
spec/models/referential_cloning_spec.rb | 1 +
2 files changed, 4 insertions(+)
diff --git a/app/models/referential_cloning.rb b/app/models/referential_cloning.rb
index cb8ad3630..72f8342b0 100644
--- a/app/models/referential_cloning.rb
+++ b/app/models/referential_cloning.rb
@@ -90,6 +90,9 @@ class ReferentialCloning < ApplicationModel
event :failed, after: :update_ended_at do
transitions :from => :pending, :to => :failed
+ after do
+ target_referential.failed!
+ end
end
end
diff --git a/spec/models/referential_cloning_spec.rb b/spec/models/referential_cloning_spec.rb
index b017a37e9..6e1063251 100644
--- a/spec/models/referential_cloning_spec.rb
+++ b/spec/models/referential_cloning_spec.rb
@@ -74,6 +74,7 @@ RSpec.describe ReferentialCloning, :type => :model do
expect(referential_cloning).to receive(:clone!).and_raise("#fail")
referential_cloning.clone_with_status!
expect(referential_cloning.status).to eq("failed")
+ expect(referential_cloning.target_referential.state).to eq(:failed)
end
end
--
cgit v1.2.3