aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/javascript/journey_patterns/actions/index.js3
-rw-r--r--app/javascript/journey_patterns/components/EditModal.js13
-rw-r--r--app/javascript/vehicle_journeys/components/tools/EditVehicleJourney.js63
-rw-r--r--app/models/chouette/journey_pattern.rb3
-rw-r--r--app/models/chouette/vehicle_journey.rb3
-rw-r--r--app/views/api/v1/journey_patterns/show.rabl2
-rw-r--r--app/views/line_footnotes/show.html.slim4
-rw-r--r--app/views/purchase_windows/show.html.slim3
-rw-r--r--app/views/routes/show.html.slim3
-rw-r--r--app/views/routing_constraint_zones/show.html.slim3
-rw-r--r--app/views/time_tables/show.html.slim3
-rw-r--r--app/views/vehicle_journeys/show.rabl2
-rw-r--r--config/locales/footnotes.en.yml1
-rw-r--r--config/locales/footnotes.fr.yml1
-rw-r--r--config/locales/routes.en.yml1
-rw-r--r--config/locales/routes.fr.yml1
-rw-r--r--config/locales/routing_constraint_zones.en.yml1
-rw-r--r--config/locales/routing_constraint_zones.fr.yml1
-rw-r--r--config/locales/time_tables.en.yml1
-rw-r--r--config/locales/time_tables.fr.yml1
20 files changed, 76 insertions, 37 deletions
diff --git a/app/javascript/journey_patterns/actions/index.js b/app/javascript/journey_patterns/actions/index.js
index 4ff3f77ea..1c2eb68b2 100644
--- a/app/javascript/journey_patterns/actions/index.js
+++ b/app/javascript/journey_patterns/actions/index.js
@@ -198,6 +198,7 @@ const actions = {
name: val.name,
object_id: val.object_id,
short_id: val.short_id,
+ checksum: val.checksum,
published_name: val.published_name,
registration_number: val.registration_number,
stop_points: val.route_short_description.stop_points,
@@ -217,4 +218,4 @@ const actions = {
}
}
-export default actions \ No newline at end of file
+export default actions
diff --git a/app/javascript/journey_patterns/components/EditModal.js b/app/javascript/journey_patterns/components/EditModal.js
index e7ce24aa1..7a5d24fba 100644
--- a/app/javascript/journey_patterns/components/EditModal.js
+++ b/app/javascript/journey_patterns/components/EditModal.js
@@ -36,7 +36,6 @@ export default class EditModal extends Component {
{this.renderModalTitle()}
<span type="button" className="close modal-close" data-dismiss="modal">&times;</span>
</div>
-
{(this.props.modal.type == 'edit') && (
<form>
<div className='modal-body'>
@@ -85,6 +84,16 @@ export default class EditModal extends Component {
</div>
</div>
</div>
+ <div>
+ <label className='control-label'>Signature métier</label>
+ <input
+ type='text'
+ ref='checksum'
+ className='form-control'
+ disabled='disabled'
+ defaultValue={this.props.modal.modalProps.journeyPattern.checksum}
+ />
+ </div>
</div>
{
this.props.editMode &&
@@ -121,4 +130,4 @@ EditModal.propTypes = {
modal: PropTypes.object,
onModalClose: PropTypes.func.isRequired,
saveModal: PropTypes.func.isRequired
-} \ No newline at end of file
+}
diff --git a/app/javascript/vehicle_journeys/components/tools/EditVehicleJourney.js b/app/javascript/vehicle_journeys/components/tools/EditVehicleJourney.js
index f8d6add03..cad04ed0e 100644
--- a/app/javascript/vehicle_journeys/components/tools/EditVehicleJourney.js
+++ b/app/javascript/vehicle_journeys/components/tools/EditVehicleJourney.js
@@ -52,32 +52,32 @@ export default class EditVehicleJourney extends Component {
{(this.props.modal.type == 'edit') && (
<form>
<div className='modal-body'>
- <div className='row'>
- <div className='col-lg-6 col-md-6 col-sm-6 col-xs-12'>
- <div className='form-group'>
- <label className='control-label'>Nom de la course</label>
- <input
- type='text'
- ref='published_journey_name'
- className='form-control'
- disabled={!this.props.editMode}
- defaultValue={this.props.modal.modalProps.vehicleJourney.published_journey_name}
- onKeyDown={(e) => actions.resetValidation(e.currentTarget)}
- />
+ <div className='row'>
+ <div className='col-lg-6 col-md-6 col-sm-6 col-xs-12'>
+ <div className='form-group'>
+ <label className='control-label'>Nom de la course</label>
+ <input
+ type='text'
+ ref='published_journey_name'
+ className='form-control'
+ disabled={!this.props.editMode}
+ defaultValue={this.props.modal.modalProps.vehicleJourney.published_journey_name}
+ onKeyDown={(e) => actions.resetValidation(e.currentTarget)}
+ />
+ </div>
</div>
- </div>
- <div className='col-lg-6 col-md-6 col-sm-6 col-xs-12'>
- <div className='form-group'>
- <label className='control-label'>Mission</label>
- <input
- type='text'
- className='form-control'
- value={this.props.modal.modalProps.vehicleJourney.journey_pattern.short_id + ' - ' + (this.props.modal.modalProps.vehicleJourney.journey_pattern.name)}
- disabled={true}
- />
+ <div className='col-lg-6 col-md-6 col-sm-6 col-xs-12'>
+ <div className='form-group'>
+ <label className='control-label'>Mission</label>
+ <input
+ type='text'
+ className='form-control'
+ value={this.props.modal.modalProps.vehicleJourney.journey_pattern.short_id + ' - ' + (this.props.modal.modalProps.vehicleJourney.journey_pattern.name)}
+ disabled={true}
+ />
+ </div>
</div>
</div>
- </div>
<div className='row'>
<div className='col-lg-6 col-md-6 col-sm-6 col-xs-12'>
@@ -131,9 +131,20 @@ export default class EditVehicleJourney extends Component {
</div>
</div>
</div>
+ <div className='form-group'>
+ <label className='control-label'>Signature métier</label>
+ <input
+ type='text'
+ ref='checksum'
+ className='form-control'
+ disabled='disabled'
+ defaultValue={this.props.modal.modalProps.vehicleJourney.checksum}
+ />
+ </div>
+
</div>
{
- this.props.editMode &&
+ this.props.editMode &&
<div className='modal-footer'>
<button
className='btn btn-link'
@@ -151,7 +162,7 @@ export default class EditVehicleJourney extends Component {
Valider
</button>
</div>
- }
+ }
</form>
)}
@@ -171,4 +182,4 @@ EditVehicleJourney.propTypes = {
onOpenEditModal: PropTypes.func.isRequired,
onModalClose: PropTypes.func.isRequired,
disabled: PropTypes.bool.isRequired
-} \ No newline at end of file
+}
diff --git a/app/models/chouette/journey_pattern.rb b/app/models/chouette/journey_pattern.rb
index 03967abfa..366fde188 100644
--- a/app/models/chouette/journey_pattern.rb
+++ b/app/models/chouette/journey_pattern.rb
@@ -40,7 +40,8 @@ module Chouette
# Update attributes and stop_points associations
jp.update_attributes(state_permited_attributes(item)) unless item['new_record']
jp.state_stop_points_update(item) if !jp.errors.any? && jp.persisted?
- item['errors'] = jp.errors if jp.errors.any?
+ item['errors'] = jp.errors if jp.errors.any?
+ item['checksum'] = jp.checksum
end
if state.any? {|item| item['errors']}
diff --git a/app/models/chouette/vehicle_journey.rb b/app/models/chouette/vehicle_journey.rb
index 332ddb7b8..d4dc82a56 100644
--- a/app/models/chouette/vehicle_journey.rb
+++ b/app/models/chouette/vehicle_journey.rb
@@ -170,7 +170,8 @@ module Chouette
vj.update_attributes(state_permited_attributes(item))
vj.update_has_and_belongs_to_many_from_state(item)
- item['errors'] = vj.errors.full_messages.uniq if vj.errors.any?
+ item['errors'] = vj.errors.full_messages.uniq if vj.errors.any?
+ item['checksum'] = vj.checksum
end
# Delete ids of new object from state if we had to rollback
diff --git a/app/views/api/v1/journey_patterns/show.rabl b/app/views/api/v1/journey_patterns/show.rabl
index 3ea1bb6ff..86876f3fb 100644
--- a/app/views/api/v1/journey_patterns/show.rabl
+++ b/app/views/api/v1/journey_patterns/show.rabl
@@ -1,7 +1,7 @@
object @journey_pattern
extends "api/v1/trident_objects/show"
-[:id, :name, :published_name, :registration_number, :comment].each do |attr|
+[:id, :name, :published_name, :registration_number, :comment, :checksum].each do |attr|
attributes attr, :unless => lambda { |m| m.send( attr).nil?}
end
diff --git a/app/views/line_footnotes/show.html.slim b/app/views/line_footnotes/show.html.slim
index e4f2a1d42..29e1f5708 100644
--- a/app/views/line_footnotes/show.html.slim
+++ b/app/views/line_footnotes/show.html.slim
@@ -16,7 +16,11 @@
.panel-heading = footnote.code
.panel-body
p = footnote.label
+
.panel-footer.text-right
+ div
+ p.text-muted.small = Chouette::Footnote.human_attribute_name(:checksum)
+ p.text-muted.small = footnote.checksum
p.text-muted
em.small = "Dernière mise à jour le #{l(footnote.updated_at, format: :short)}"
diff --git a/app/views/purchase_windows/show.html.slim b/app/views/purchase_windows/show.html.slim
index 9f3abb267..4ddde1706 100644
--- a/app/views/purchase_windows/show.html.slim
+++ b/app/views/purchase_windows/show.html.slim
@@ -17,4 +17,5 @@
= definition_list t('metadatas'),
{ Chouette::PurchaseWindow.human_attribute_name(:name) => @purchase_window.try(:name),
'Organisation' => @purchase_window.referential.organisation.name,
- Chouette::PurchaseWindow.human_attribute_name(:date_ranges) => @purchase_window.periods.map{|d| t('validity_range', debut: l(d.begin, format: :short), end: l(d.end, format: :short))}.join('<br>').html_safe }
+ Chouette::PurchaseWindow.human_attribute_name(:date_ranges) => @purchase_window.periods.map{|d| t('validity_range', debut: l(d.begin, format: :short), end: l(d.end, format: :short))}.join('<br>').html_safe,
+ Chouette::PurchaseWindow.human_attribute_name(:checksum) => @purchase_window.checksum }
diff --git a/app/views/routes/show.html.slim b/app/views/routes/show.html.slim
index 2b4ebf159..644f79022 100644
--- a/app/views/routes/show.html.slim
+++ b/app/views/routes/show.html.slim
@@ -22,7 +22,8 @@
{ t('objectid') => @route.get_objectid.short_id,
t('activerecord.attributes.route.published_name') => (@route.published_name ? @route.published_name : '-'),
@route.human_attribute_name(:wayback) => (@route.wayback ? @route.wayback_text : '-' ),
- @route.human_attribute_name(:opposite_route) => (@route.opposite_route ? @route.opposite_route.name : '-') }
+ @route.human_attribute_name(:opposite_route) => (@route.opposite_route ? @route.opposite_route.name : '-'),
+ @route.human_attribute_name(:checksum) => @route.checksum }
- if @route_sp.any?
.col-lg-6.col-md-6.col-sm-12.col-xs-12
diff --git a/app/views/routing_constraint_zones/show.html.slim b/app/views/routing_constraint_zones/show.html.slim
index 6235ade68..3d1988545 100644
--- a/app/views/routing_constraint_zones/show.html.slim
+++ b/app/views/routing_constraint_zones/show.html.slim
@@ -17,7 +17,8 @@
= definition_list t('metadatas'),
{ @routing_constraint_zone.human_attribute_name(:name) => @routing_constraint_zone.try(:name),
@routing_constraint_zone.human_attribute_name(:route) => link_to(@routing_constraint_zone.try(:route_name), [@referential, @line, @routing_constraint_zone.route]),
- @routing_constraint_zone.human_attribute_name(:line) => link_to(@line.name, [@referential, @line])}
+ @routing_constraint_zone.human_attribute_name(:line) => link_to(@line.name, [@referential, @line]),
+ @routing_constraint_zone.human_attribute_name(:checksum) => @routing_constraint_zone.checksum}
.row
.col-lg-12
diff --git a/app/views/time_tables/show.html.slim b/app/views/time_tables/show.html.slim
index 036581268..df9789055 100644
--- a/app/views/time_tables/show.html.slim
+++ b/app/views/time_tables/show.html.slim
@@ -28,7 +28,8 @@
'Couleur associée' => (@time_table.color.nil? ? '-' : content_tag(:span, '', class: 'fa fa-circle', style: "color:#{@time_table.try(:color)}")),
'Etiquettes' => @time_table.tag_list,
'Modèle de calendrier' => (@time_table.calendar ? link_to(@time_table.calendar.name, @time_table.calendar) : '-'),
- "Journées d'application pour les périodes ci-dessous" => %w(monday tuesday wednesday thursday friday saturday sunday).collect{ |d| content_tag(:span, t("calendars.days.#{d}"), class: "label label-default #{@time_table.send(d) ? '' : 'disabled'}") }.join.html_safe }
+ "Journées d'application pour les périodes ci-dessous" => %w(monday tuesday wednesday thursday friday saturday sunday).collect{ |d| content_tag(:span, t("calendars.days.#{d}"), class: "label label-default #{@time_table.send(d) ? '' : 'disabled'}") }.join.html_safe,
+ Chouette::TimeTable.human_attribute_name(:checksum) => @time_table.checksum}
.row
.col-lg-12.mb-sm
diff --git a/app/views/vehicle_journeys/show.rabl b/app/views/vehicle_journeys/show.rabl
index 01175a85d..eeed79b34 100644
--- a/app/views/vehicle_journeys/show.rabl
+++ b/app/views/vehicle_journeys/show.rabl
@@ -1,6 +1,6 @@
object @vehicle_journey
-[:objectid, :published_journey_name, :published_journey_identifier, :company_id, :comment].each do |attr|
+[:objectid, :published_journey_name, :published_journey_identifier, :company_id, :comment, :checksum].each do |attr|
attributes attr, :unless => lambda { |m| m.send( attr).nil?}
end
diff --git a/config/locales/footnotes.en.yml b/config/locales/footnotes.en.yml
index dba8edd0b..5b86f0806 100644
--- a/config/locales/footnotes.en.yml
+++ b/config/locales/footnotes.en.yml
@@ -16,4 +16,5 @@ en:
attributes:
footnote:
code: "number"
+ checksum: checksum
label: "line text"
diff --git a/config/locales/footnotes.fr.yml b/config/locales/footnotes.fr.yml
index f5cd71c21..692098046 100644
--- a/config/locales/footnotes.fr.yml
+++ b/config/locales/footnotes.fr.yml
@@ -16,4 +16,5 @@ fr:
attributes:
footnote:
code: "numéro"
+ checksum: Signature métier
label: "ligne de texte"
diff --git a/config/locales/routes.en.yml b/config/locales/routes.en.yml
index 7b82e788b..bd8358bdd 100644
--- a/config/locales/routes.en.yml
+++ b/config/locales/routes.en.yml
@@ -69,6 +69,7 @@ en:
other: "routes"
attributes:
route:
+ checksum: Checksum
wayback:
positive: "forward"
negative: "backward"
diff --git a/config/locales/routes.fr.yml b/config/locales/routes.fr.yml
index 1d151e60b..c08e64cfd 100644
--- a/config/locales/routes.fr.yml
+++ b/config/locales/routes.fr.yml
@@ -72,6 +72,7 @@ fr:
other: "itinéraires"
attributes:
route:
+ checksum: Signature métier
wayback:
positive: "Aller"
negative: "Retour"
diff --git a/config/locales/routing_constraint_zones.en.yml b/config/locales/routing_constraint_zones.en.yml
index 34a10ac67..5675fd5db 100644
--- a/config/locales/routing_constraint_zones.en.yml
+++ b/config/locales/routing_constraint_zones.en.yml
@@ -7,6 +7,7 @@ en:
other: routing constraint zones
attributes:
routing_constraint_zone:
+ checksum: Checksum
name: Name
stop_areas: Stop areas
line: Line
diff --git a/config/locales/routing_constraint_zones.fr.yml b/config/locales/routing_constraint_zones.fr.yml
index 80bbad8cf..024dd3288 100644
--- a/config/locales/routing_constraint_zones.fr.yml
+++ b/config/locales/routing_constraint_zones.fr.yml
@@ -7,6 +7,7 @@ fr:
other: zone de contraintes
attributes:
routing_constraint_zone:
+ checksum: Signature métier
name: Nom
stop_areas: Arrêts
line: Ligne associée
diff --git a/config/locales/time_tables.en.yml b/config/locales/time_tables.en.yml
index ff36a6d7d..ce890942d 100644
--- a/config/locales/time_tables.en.yml
+++ b/config/locales/time_tables.en.yml
@@ -102,6 +102,7 @@ en:
other: "timetables"
attributes:
time_table:
+ checksum: Checksum
comment: "Name"
color: "Associated color"
bounding_dates: 'Global validity period'
diff --git a/config/locales/time_tables.fr.yml b/config/locales/time_tables.fr.yml
index 631ecca95..8abc0e0af 100644
--- a/config/locales/time_tables.fr.yml
+++ b/config/locales/time_tables.fr.yml
@@ -102,6 +102,7 @@ fr:
other: "calendriers"
attributes:
time_table:
+ checksum: Signature métier
comment: "Nom du calendrier"
color: "Couleur associée"
bounding_dates: 'Période contenue dans le calendrier'