diff options
Diffstat (limited to 'app/javascript')
24 files changed, 88 insertions, 65 deletions
diff --git a/app/javascript/helpers/save_button.js b/app/javascript/helpers/save_button.js index 7e0bd5bbe..af5ee54a8 100644 --- a/app/javascript/helpers/save_button.js +++ b/app/javascript/helpers/save_button.js @@ -35,7 +35,7 @@ export default class SaveButton extends Component{ this.props.editMode ? this.submitForm() : this.props.onEnterEditMode() }} > - {this.props.editMode ? "Valider" : "Editer"} + {this.props.editMode ? I18n.t('actions.submit') : I18n.t('actions.edit')} </button> </div> </form> diff --git a/app/javascript/journey_patterns/actions/index.js b/app/javascript/journey_patterns/actions/index.js index b90908264..666157ea4 100644 --- a/app/javascript/journey_patterns/actions/index.js +++ b/app/javascript/journey_patterns/actions/index.js @@ -220,7 +220,16 @@ const actions = { }) }, fetchRouteCosts: (dispatch, key, index) => { - if (actions.routeCostsCache) { + if(actions.fetchingRouteCosts){ + // A request is already sent, wait for it + if(!actions.waitingForRouteCosts){ + actions.waitingForRouteCosts = [] + } + actions.waitingForRouteCosts.push([key, index]) + return + } + + if(actions.routeCostsCache) { // Dispatch asynchronously to prevent warning when // this executes during `render()` requestAnimationFrame(() => { @@ -231,6 +240,7 @@ const actions = { )) }) } else { + actions.fetchingRouteCosts = true fetch(window.routeCostsUrl, { credentials: 'same-origin', }).then(response => { @@ -240,6 +250,12 @@ const actions = { actions.routeCostsCache = costs dispatch(actions.receiveRouteCosts(costs, key, index)) + if(actions.waitingForRouteCosts){ + actions.waitingForRouteCosts.map(function(item, i) { + dispatch(actions.receiveRouteCosts(costs, item[0], item[1])) + }) + } + actions.fetchingRouteCosts = false }) } }, diff --git a/app/javascript/journey_patterns/components/JourneyPattern.js b/app/javascript/journey_patterns/components/JourneyPattern.js index e912b7660..d381b0d50 100644 --- a/app/javascript/journey_patterns/components/JourneyPattern.js +++ b/app/javascript/journey_patterns/components/JourneyPattern.js @@ -80,7 +80,6 @@ export default class JourneyPattern extends Component{ let from = null this.props.value.stop_points.map((stopPoint, i) =>{ let usePoint = stopPoint.checked - console.log(stopPoint) if(onlyCommercial && (i == 0 || i == this.props.value.stop_points.length - 1) && stopPoint.kind == "non_commercial"){ usePoint = false } @@ -131,12 +130,9 @@ export default class JourneyPattern extends Component{ } } - componentWillUpdate() { - [this.totalTime, this.totalDistance] = this.totals(false) - } - render() { this.previousSpId = undefined + let [totalTime, totalDistance] = this.totals(false) let [commercialTotalTime, commercialTotalDistance] = this.totals(true) return ( <div className={'t2e-item' + (this.props.value.deletable ? ' disabled' : '') + (this.props.value.object_id ? '' : ' to_record') + (this.props.value.errors ? ' has-error': '') + (this.hasFeature('costs_in_journey_patterns') ? ' with-costs' : '')}> @@ -146,8 +142,8 @@ export default class JourneyPattern extends Component{ <div>{I18n.t('journey_patterns.show.stop_points_count', {count: actions.getChecked(this.props.value.stop_points).length})}</div> {this.hasFeature('costs_in_journey_patterns') && <div className="small row totals"> - <span className="col-md-6"><i className="fa fa-arrows-h"></i>{this.totalDistance}</span> - <span className="col-md-6"><i className="fa fa-clock-o"></i>{this.totalTime}</span> + <span className="col-md-6"><i className="fa fa-arrows-h"></i>{totalDistance}</span> + <span className="col-md-6"><i className="fa fa-clock-o"></i>{totalTime}</span> </div> } {this.hasFeature('costs_in_journey_patterns') && diff --git a/app/javascript/packs/routes/edit.js b/app/javascript/packs/routes/edit.js index b787bec97..fc7aa203d 100644 --- a/app/javascript/packs/routes/edit.js +++ b/app/javascript/packs/routes/edit.js @@ -29,6 +29,7 @@ const getInitialState = () => { state.push({ stoppoint_id: v.stoppoint_id, stoparea_id: v.stoparea_id, + stoparea_kind: v.stoparea_kind, user_objectid: v.user_objectid, short_name: v.short_name ? v.short_name.replace("'", "\'") : '', area_type: v.area_type, @@ -39,8 +40,8 @@ const getInitialState = () => { name: v.name ? v.name.replace("'", "\'") : '', registration_number: v.registration_number, text: fancyText, - for_boarding: v.for_boarding || "normal", - for_alighting: v.for_alighting || "normal", + for_boarding: v.for_boarding, + for_alighting: v.for_alighting, longitude: v.longitude || 0, latitude: v.latitude || 0, comment: v.comment ? v.comment.replace("'", "\'") : '', diff --git a/app/javascript/routes/actions/index.js b/app/javascript/routes/actions/index.js index 13b2d60b2..5fbf5bce9 100644 --- a/app/javascript/routes/actions/index.js +++ b/app/javascript/routes/actions/index.js @@ -56,7 +56,12 @@ const actions = { unselectMarker: (index) => ({ type: 'UNSELECT_MARKER', index - }) + }), + defaultAttribute: (attribute, stopAreaKind) => { + if (attribute !== '') return attribute + if (stopAreaKind === undefined) return '' + return stopAreaKind === "commercial" ? "normal" : "forbidden" + } } module.exports = actions diff --git a/app/javascript/routes/components/BSelect2.js b/app/javascript/routes/components/BSelect2.js index 035bce155..89e1b6cfa 100644 --- a/app/javascript/routes/components/BSelect2.js +++ b/app/javascript/routes/components/BSelect2.js @@ -17,6 +17,7 @@ export default class BSelect3 extends Component { this.props.onChange(this.props.index, { text: e.currentTarget.textContent, stoparea_id: e.currentTarget.value, + stoparea_kind: e.params.data.kind, user_objectid: e.params.data.user_objectid, longitude: e.params.data.longitude, latitude: e.params.data.latitude, diff --git a/app/javascript/routes/components/StopPoint.js b/app/javascript/routes/components/StopPoint.js index af51a6bb4..368ec8261 100644 --- a/app/javascript/routes/components/StopPoint.js +++ b/app/javascript/routes/components/StopPoint.js @@ -4,6 +4,8 @@ import PropTypes from 'prop-types' import BSelect2 from './BSelect2' import OlMap from './OlMap' +import { defaultAttribute } from '../actions' + export default function StopPoint(props, {I18n}) { return ( <div className='nested-fields'> @@ -17,14 +19,14 @@ export default function StopPoint(props, {I18n}) { </div> <div> - <select className='form-control' value={props.value.for_boarding} id="for_boarding" onChange={props.onSelectChange}> + <select className='form-control' value={defaultAttribute(props.value.for_boarding, props.value.stoparea_kind)} id="for_boarding" onChange={props.onSelectChange}> <option value="normal">{I18n.t('routes.edit.stop_point.boarding.normal')}</option> <option value="forbidden">{I18n.t('routes.edit.stop_point.boarding.forbidden')}</option> </select> </div> <div> - <select className='form-control' value={props.value.for_alighting} id="for_alighting" onChange={props.onSelectChange}> + <select className='form-control' value={defaultAttribute(props.value.for_alighting, props.value.stoparea_kind)} id="for_alighting" onChange={props.onSelectChange}> <option value="normal">{I18n.t('routes.edit.stop_point.alighting.normal')}</option> <option value="forbidden">{I18n.t('routes.edit.stop_point.alighting.forbidden')}</option> </select> diff --git a/app/javascript/routes/index.js b/app/javascript/routes/index.js index febae7d54..3c7322953 100644 --- a/app/javascript/routes/index.js +++ b/app/javascript/routes/index.js @@ -26,6 +26,7 @@ const getInitialState = () => { state.push({ stoppoint_id: v.stoppoint_id, stoparea_id: v.stoparea_id, + stoparea_kind: v.stoparea_kind, user_objectid: v.user_objectid, short_name: v.short_name ? v.short_name.replace("'", "\'") : '', area_type: v.area_type, @@ -36,8 +37,8 @@ const getInitialState = () => { name: v.name ? v.name.replace("'", "\'") : '', registration_number: v.registration_number, text: fancyText, - for_boarding: v.for_boarding || "normal", - for_alighting: v.for_alighting || "normal", + for_boarding: v.for_boarding || '', + for_alighting: v.for_alighting || '', longitude: v.longitude || 0, latitude: v.latitude || 0, comment: v.comment ? v.comment.replace("'", "\'") : '', diff --git a/app/javascript/routes/reducers/stopPoints.js b/app/javascript/routes/reducers/stopPoints.js index 0b42b504f..ba183d002 100644 --- a/app/javascript/routes/reducers/stopPoints.js +++ b/app/javascript/routes/reducers/stopPoints.js @@ -8,8 +8,8 @@ const stopPoint = (state = {}, action, length) => { text: '', index: length, edit: true, - for_boarding: 'normal', - for_alighting: 'normal', + for_boarding: '', + for_alighting: '', olMap: { isOpened: false, json: {} @@ -68,6 +68,7 @@ const stopPoints = (state = [], action) => { stoppoint_id: t.stoppoint_id, text: action.text.text, stoparea_id: action.text.stoparea_id, + stoparea_kind: action.text.stoparea_kind, user_objectid: action.text.user_objectid, latitude: action.text.latitude, longitude: action.text.longitude, diff --git a/app/javascript/time_tables/components/SaveTimetable.js b/app/javascript/time_tables/components/SaveTimetable.js index 704590abd..468f1773b 100644 --- a/app/javascript/time_tables/components/SaveTimetable.js +++ b/app/javascript/time_tables/components/SaveTimetable.js @@ -26,7 +26,7 @@ export default class SaveTimetable extends Component{ } }} > - Valider + {I18n.t('actions.submit')} </button> </form> </div> diff --git a/app/javascript/vehicle_journeys/components/ConfirmModal.js b/app/javascript/vehicle_journeys/components/ConfirmModal.js index 75e8a3932..330b4e02f 100644 --- a/app/javascript/vehicle_journeys/components/ConfirmModal.js +++ b/app/javascript/vehicle_journeys/components/ConfirmModal.js @@ -16,7 +16,7 @@ export default function ConfirmModal({dispatch, modal, onModalAccept, onModalCan type='button' onClick={() => { onModalCancel(modal.confirmModal.callback) }} > - Ne pas valider + {I18n.t('cancel')} </button> <button className='btn btn-danger' @@ -24,7 +24,7 @@ export default function ConfirmModal({dispatch, modal, onModalAccept, onModalCan type='button' onClick={() => { onModalAccept(modal.confirmModal.callback, vehicleJourneys) }} > - Valider + {I18n.t('actions.submit')} </button> </div> </div> diff --git a/app/javascript/vehicle_journeys/components/Navigate.js b/app/javascript/vehicle_journeys/components/Navigate.js index 24843babc..e79823e49 100644 --- a/app/javascript/vehicle_journeys/components/Navigate.js +++ b/app/javascript/vehicle_journeys/components/Navigate.js @@ -1,5 +1,6 @@ import React, { Component } from 'react' import PropTypes from 'prop-types' +import capitalize from 'lodash/capitalize' import actions from'../actions' export default function Navigate({ dispatch, vehicleJourneys, pagination, status, filters}) { @@ -17,7 +18,7 @@ export default function Navigate({ dispatch, vehicleJourneys, pagination, status if(status.fetchSuccess == true) { return ( <div className="pagination"> - {I18n.t("vehicle_journeys.vehicle_journeys_matrix.pagination", {minVJ, maxVJ, total:pagination.totalCount})} + {I18n.t('will_paginate.page_entries_info.multi_page', { model: capitalize(I18n.model_name('vehicle_journey', { plural: true })), from: minVJ, to: maxVJ, count: pagination.totalCount })} <form className='page_links' onSubmit={e => {e.preventDefault()}}> <button onClick={e => { diff --git a/app/javascript/vehicle_journeys/components/tools/CreateModal.js b/app/javascript/vehicle_journeys/components/tools/CreateModal.js index a60429765..f49b51f08 100644 --- a/app/javascript/vehicle_journeys/components/tools/CreateModal.js +++ b/app/javascript/vehicle_journeys/components/tools/CreateModal.js @@ -47,7 +47,7 @@ export default class CreateModal extends Component { <div className='modal-dialog'> <div className='modal-content'> <div className='modal-header'> - <h4 className='modal-title'>Ajouter une course</h4> + <h4 className='modal-title'>{I18n.t('vehicle_journeys.actions.new')}</h4> <span type="button" className="close modal-close" data-dismiss="modal">×</span> </div> @@ -57,7 +57,7 @@ export default class CreateModal extends Component { <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> + <label className='control-label'>{I18n.attribute_name('vehicle_journey', 'journey_name')}</label> <input type='text' ref='published_journey_name' @@ -68,7 +68,7 @@ export default class CreateModal extends Component { </div> <div className='col-lg-6 col-md-6 col-sm-6 col-xs-12'> <div className='form-group'> - <label className='control-label'>Nom du transporteur</label> + <label className='control-label'>{I18n.attribute_name('vehicle_journey', 'company_name')}</label> <CompanySelect2 company = {this.props.modal.modalProps.vehicleJourney && this.props.modal.modalProps.vehicleJourney.company || undefined} onSelect2Company = {(e) => this.props.onSelect2Company(e)} @@ -78,7 +78,7 @@ export default class CreateModal extends Component { </div> <div className='col-lg-6 col-md-6 col-sm-6 col-xs-12'> <div className='form-group'> - <label className='control-label is-required'>Nom public de la mission</label> + <label className='control-label is-required'>{I18n.attribute_name('vehicle_journey', 'journey_pattern_published_name')}</label> <MissionSelect2 selection={this.props.modal.modalProps} onSelect2JourneyPattern={this.props.onSelect2JourneyPattern} @@ -89,7 +89,7 @@ export default class CreateModal extends Component { </div> <div className='col-lg-6 col-md-6 col-sm-6 col-xs-12'> <div className='form-group'> - <label className='control-label'>Numéro de train</label> + <label className='control-label'>{I18n.attribute_name('vehicle_journey', 'published_journey_identifier')}</label> <input type='text' ref='published_journey_identifier' @@ -105,7 +105,7 @@ export default class CreateModal extends Component { /> { this.props.modal.modalProps.selectedJPModal && this.props.modal.modalProps.selectedJPModal.full_schedule && <div className='col-lg-6 col-md-6 col-sm-6 col-xs-12'> <div className='form-group'> - <label className='control-label'>Heure de départ</label> + <label className='control-label'>{I18n.attribute_name('vehicle_journey', 'start_time')}</label> <div className='input-group time'> <input type='number' @@ -142,14 +142,14 @@ export default class CreateModal extends Component { type='button' onClick={this.props.onModalClose} > - Annuler + {I18n.t('cancel')} </button> <button className='btn btn-primary' type='button' onClick={this.handleSubmit.bind(this)} > - Valider + {I18n.t('actions.submit')} </button> </div> </form> diff --git a/app/javascript/vehicle_journeys/components/tools/DeleteVehicleJourneys.js b/app/javascript/vehicle_journeys/components/tools/DeleteVehicleJourneys.js index 4815003d3..b1ce3786b 100644 --- a/app/javascript/vehicle_journeys/components/tools/DeleteVehicleJourneys.js +++ b/app/javascript/vehicle_journeys/components/tools/DeleteVehicleJourneys.js @@ -13,7 +13,7 @@ export default function DeleteVehicleJourneys({onDeleteVehicleJourneys, vehicleJ e.preventDefault() onDeleteVehicleJourneys() }} - title='Supprimer' + title={ I18n.t('actions.delete') } > <span className='fa fa-trash'></span> </button> diff --git a/app/javascript/vehicle_journeys/components/tools/DuplicateVehicleJourney.js b/app/javascript/vehicle_journeys/components/tools/DuplicateVehicleJourney.js index 102a87d85..d7e48bf08 100644 --- a/app/javascript/vehicle_journeys/components/tools/DuplicateVehicleJourney.js +++ b/app/javascript/vehicle_journeys/components/tools/DuplicateVehicleJourney.js @@ -93,7 +93,7 @@ export default class DuplicateVehicleJourney extends Component { <div className='modal-content'> <div className='modal-header'> <h4 className='modal-title'> - Dupliquer { actions.getSelected(this.props.vehicleJourneys).length > 1 ? 'plusieurs courses' : 'une course' } + {I18n.t('vehicle_journeys.vehicle_journeys_matrix.duplicate', { count: actions.getSelected(this.props.vehicleJourneys).length })} </h4> <span type="button" className="close modal-close" data-dismiss="modal">×</span> </div> @@ -102,7 +102,7 @@ export default class DuplicateVehicleJourney extends Component { <form className='form-horizontal'> <div className='modal-body'> <div className={'form-group ' + (actions.getSelected(this.props.vehicleJourneys).length > 1 ? 'hidden' : '' )}> - <label className='control-label is-required col-sm-8'>Horaire de départ indicatif</label> + <label className='control-label is-required col-sm-8'>{I18n.t('vehicle_journeys.vehicle_journeys_matrix.duplicate.start_time')}</label> <span className="col-sm-4"> <span className={'input-group time' + (actions.getSelected(this.props.vehicleJourneys).length > 1 ? ' disabled' : '')}> <input @@ -133,7 +133,7 @@ export default class DuplicateVehicleJourney extends Component { </div> <div className='form-group'> - <label className='control-label is-required col-sm-8'>Nombre de courses à créer et dupliquer</label> + <label className='control-label is-required col-sm-8'>{I18n.t('vehicle_journeys.vehicle_journeys_matrix.duplicate.number')}</label> <div className="col-sm-4"> <input type='number' @@ -152,7 +152,7 @@ export default class DuplicateVehicleJourney extends Component { </div> <div className='form-group'> - <label className='control-label is-required col-sm-8'>Décalage à partir duquel on créé les courses</label> + <label className='control-label is-required col-sm-8'>{I18n.t('vehicle_journeys.vehicle_journeys_matrix.duplicate.delta')}</label> <span className="col-sm-4"> <input type='number' @@ -178,7 +178,7 @@ export default class DuplicateVehicleJourney extends Component { type='button' onClick={this.props.onModalClose} > - Annuler + {I18n.t('cancel')} </button> <button className={'btn btn-primary ' + (this.state.additional_time == 0 && this.state.originalDT.hour == this.state.duplicate_time_hh && this.state.originalDT.minute == this.state.duplicate_time_mm ? 'disabled' : '')} @@ -186,7 +186,7 @@ export default class DuplicateVehicleJourney extends Component { onClick={this.handleSubmit} disabled={this.disableValidateButton()} > - Valider + {I18n.t('actions.submit')} </button> </div> </form> diff --git a/app/javascript/vehicle_journeys/components/tools/EditVehicleJourney.js b/app/javascript/vehicle_journeys/components/tools/EditVehicleJourney.js index 795c2ecff..e4e266c79 100644 --- a/app/javascript/vehicle_journeys/components/tools/EditVehicleJourney.js +++ b/app/javascript/vehicle_journeys/components/tools/EditVehicleJourney.js @@ -173,14 +173,14 @@ export default class EditVehicleJourney extends Component { type='button' onClick={this.props.onModalClose} > - Annuler + {I18n.t('cancel')} </button> <button className='btn btn-primary' type='button' onClick={this.handleSubmit.bind(this)} > - Valider + {I18n.t('actions.submit')} </button> </div> } diff --git a/app/javascript/vehicle_journeys/components/tools/NotesEditVehicleJourney.js b/app/javascript/vehicle_journeys/components/tools/NotesEditVehicleJourney.js index 880542216..5d300f70c 100644 --- a/app/javascript/vehicle_journeys/components/tools/NotesEditVehicleJourney.js +++ b/app/javascript/vehicle_journeys/components/tools/NotesEditVehicleJourney.js @@ -43,11 +43,11 @@ export default class NotesEditVehicleJourney extends Component { renderAssociatedFN() { if (this.footnotes().associated.length == 0) { - return <h3>Aucune note associée</h3> + return <h3>{I18n.t('vehicle_journeys.vehicle_journeys_matrix.no_associated_footnotes')}</h3> } else { return ( <div> - <h3>Notes associées :</h3> + <h3>{I18n.t('vehicle_journeys.form.purchase_windows')} :</h3> {this.footnotes().associated.map((lf, i) => <div key={i} @@ -68,13 +68,13 @@ export default class NotesEditVehicleJourney extends Component { } renderToAssociateFN() { - if (window.line_footnotes.length == 0) return <h3>La ligne ne possède pas de notes</h3> + if (window.line_footnotes.length == 0) return <h3>{I18n.t('vehicle_journeys.vehicle_journeys_matrix.no_line_footnotes')}</h3> if (this.footnotes().to_associate.length == 0) return false return ( <div> - <h3 className='mt-lg'>Sélectionnez les notes à associer à cette course :</h3> + <h3 className='mt-lg'>{I18n.t('vehicle_journeys.vehicle_journeys_matrix.select_footnotes')} :</h3> {this.footnotes().to_associate.map((lf, i) => <div key={i} className='panel panel-default'> <div className='panel-heading'> @@ -111,7 +111,7 @@ export default class NotesEditVehicleJourney extends Component { <div className='modal-dialog'> <div className='modal-content'> <div className='modal-header'> - <h4 className='modal-title'>Notes</h4> + <h4 className='modal-title'>{I18n.t('vehicle_journeys.form.footnotes')}</h4> <span type="button" className="close modal-close" data-dismiss="modal">×</span> </div> @@ -130,14 +130,14 @@ export default class NotesEditVehicleJourney extends Component { type='button' onClick={this.props.onModalClose} > - Annuler + {I18n.t('cancel')} </button> <button className='btn btn-primary' type='button' onClick={this.handleSubmit.bind(this)} > - Valider + {I18n.t('actions.submit')} </button> </div> } diff --git a/app/javascript/vehicle_journeys/components/tools/PurchaseWindowsEditVehicleJourney.js b/app/javascript/vehicle_journeys/components/tools/PurchaseWindowsEditVehicleJourney.js index ce9a4cde9..30c511302 100644 --- a/app/javascript/vehicle_journeys/components/tools/PurchaseWindowsEditVehicleJourney.js +++ b/app/javascript/vehicle_journeys/components/tools/PurchaseWindowsEditVehicleJourney.js @@ -44,7 +44,7 @@ export default class PurchaseWindowsEditVehicleJourney extends Component { <div className='modal-dialog'> <div className='modal-content'> <div className='modal-header'> - <h4 className='modal-title'>Calendriers commerciaux associés</h4> + <h4 className='modal-title'>{I18n.t('vehicle_journeys.form.purchase_windows')}s</h4> <span type="button" className="close modal-close" data-dismiss="modal">×</span> </div> @@ -58,7 +58,7 @@ export default class PurchaseWindowsEditVehicleJourney extends Component { <div className='wrapper'> <div> <div className='form-group'> - <label className='control-label'>{this.props.modal.modalProps.purchase_windows.length == 0 ? "Aucun calendrier commercial associé" : "Calendriers commerciaux associés"}</label> + <label className='control-label'>{this.props.modal.modalProps.purchase_windows.length == 0 ? I18n.t('vehicle_journeys.vehicle_journeys_matrix.no_associated_purchase_windows') : I18n.t('vehicle_journeys.form.purchase_windows')}</label> </div> </div> <div></div> @@ -117,14 +117,14 @@ export default class PurchaseWindowsEditVehicleJourney extends Component { type='button' onClick={this.props.onModalClose} > - Annuler + {I18n.t('cancel')} </button> <button className='btn btn-primary' type='button' onClick={this.handleSubmit} > - Valider + {I18n.t('actions.submit')} </button> </div> } diff --git a/app/javascript/vehicle_journeys/components/tools/ShiftVehicleJourney.js b/app/javascript/vehicle_journeys/components/tools/ShiftVehicleJourney.js index 6574bfa2d..bc3d8db34 100644 --- a/app/javascript/vehicle_journeys/components/tools/ShiftVehicleJourney.js +++ b/app/javascript/vehicle_journeys/components/tools/ShiftVehicleJourney.js @@ -27,6 +27,7 @@ export default class ShiftVehicleJourney extends Component { } render() { + let id = this.props.modal.type == 'shift' && actions.getSelected(this.props.vehicleJourneys)[0].short_id if(this.props.status.isFetching == true) { return false } @@ -48,10 +49,7 @@ export default class ShiftVehicleJourney extends Component { <div className='modal-dialog'> <div className='modal-content'> <div className='modal-header'> - <h4 className='modal-title'>Mettre à jour une course</h4> - {(this.props.modal.type == 'shift') && ( - <em>Mettre à jour les horaires de la course {actions.getSelected(this.props.vehicleJourneys)[0].short_id}</em> - )} + <h4 className='modal-title'>{I18n.t('vehicle_journeys.form.slide_title', {id: id})}</h4> <span type="button" className="close modal-close" data-dismiss="modal">×</span> </div> @@ -61,7 +59,7 @@ export default class ShiftVehicleJourney extends Component { <div className='row'> <div className='col-lg-4 col-lg-offset-4 col-md-4 col-md-offset-4 col-sm-4 col-sm-offset-4 col-xs-12'> <div className='form-group'> - <label className='control-label is-required'>Avec un décalage de</label> + <label className='control-label is-required'>{I18n.t('vehicle_journeys.form.slide_delta')}</label> <input type='number' style={{'width': 104}} @@ -85,14 +83,14 @@ export default class ShiftVehicleJourney extends Component { type='button' onClick={this.props.onModalClose} > - Annuler + {I18n.t('cancel')} </button> <button className={'btn btn-primary ' + (this.state.additional_time == 0 ? 'disabled' : '')} type='button' onClick={this.handleSubmit.bind(this)} > - Valider + {I18n.t('actions.submit')} </button> </div> </form> diff --git a/app/javascript/vehicle_journeys/components/tools/TimetablesEditVehicleJourney.js b/app/javascript/vehicle_journeys/components/tools/TimetablesEditVehicleJourney.js index f21480563..7a2686c13 100644 --- a/app/javascript/vehicle_journeys/components/tools/TimetablesEditVehicleJourney.js +++ b/app/javascript/vehicle_journeys/components/tools/TimetablesEditVehicleJourney.js @@ -44,7 +44,7 @@ export default class TimetablesEditVehicleJourney extends Component { <div className='modal-dialog'> <div className='modal-content'> <div className='modal-header'> - <h4 className='modal-title'>Calendriers associés</h4> + <h4 className='modal-title'>{I18n.t('vehicle_journeys.form.time_tables')}</h4> <span type="button" className="close modal-close" data-dismiss="modal">×</span> </div> @@ -58,7 +58,7 @@ export default class TimetablesEditVehicleJourney extends Component { <div className='wrapper'> <div> <div className='form-group'> - <label className='control-label'>{this.props.modal.modalProps.timetables.length == 0 ? "Aucun calendrier associé" : "Calendriers associés"}</label> + <label className='control-label'>{this.props.modal.modalProps.timetables.length == 0 ? I18n.t('vehicle_journeys.vehicle_journeys_matrix.no_associated_timetables'): I18n.t('vehicle_journeys.form.timetables')}</label> </div> </div> <div></div> @@ -119,14 +119,14 @@ export default class TimetablesEditVehicleJourney extends Component { type='button' onClick={this.props.onModalClose} > - Annuler + {I18n.t('cancel')} </button> <button className='btn btn-primary' type='button' onClick={this.handleSubmit} > - Valider + {I18n.t('actions.submit')} </button> </div> } diff --git a/app/javascript/vehicle_journeys/components/tools/select2s/CompanySelect2.js b/app/javascript/vehicle_journeys/components/tools/select2s/CompanySelect2.js index 5c7f75d99..b7e9691c1 100644 --- a/app/javascript/vehicle_journeys/components/tools/select2s/CompanySelect2.js +++ b/app/javascript/vehicle_journeys/components/tools/select2s/CompanySelect2.js @@ -16,6 +16,7 @@ export default class BSelect4 extends Component { } render() { + let placeHolder = I18n.t('') return ( <Select2 data={(this.props.company) ? [this.props.company.name] : undefined} @@ -29,7 +30,7 @@ export default class BSelect4 extends Component { allowClear: true, theme: 'bootstrap', width: '100%', - placeholder: 'Filtrer par transporteur...', + placeholder: I18n.t('vehicle_journeys.vehicle_journeys_matrix.affect_company'), language: require('./fr'), ajax: { url: origin + path + '/companies.json' + '?line_id=' + line, diff --git a/app/javascript/vehicle_journeys/components/tools/select2s/MissionSelect2.js b/app/javascript/vehicle_journeys/components/tools/select2s/MissionSelect2.js index 72dbd0152..96b34125d 100644 --- a/app/javascript/vehicle_journeys/components/tools/select2s/MissionSelect2.js +++ b/app/javascript/vehicle_journeys/components/tools/select2s/MissionSelect2.js @@ -74,7 +74,7 @@ export default class BSelect4 extends Component { width: '100%', escapeMarkup: function (markup) { return markup; }, templateResult: formatRepo, - placeholder: 'Filtrer par code, nom ou OID de mission...', + placeholder: I18n.t('vehicle_journeys.vehicle_journeys_matrix.filters.journey_pattern'), language: require('./fr'), allowClear: false, escapeMarkup: function (markup) { return markup; }, diff --git a/app/javascript/vehicle_journeys/components/tools/select2s/TimetableSelect2.js b/app/javascript/vehicle_journeys/components/tools/select2s/TimetableSelect2.js index 0339455ca..9a345b464 100644 --- a/app/javascript/vehicle_journeys/components/tools/select2s/TimetableSelect2.js +++ b/app/javascript/vehicle_journeys/components/tools/select2s/TimetableSelect2.js @@ -26,7 +26,7 @@ export default class BSelect4 extends Component { allowClear: false, theme: 'bootstrap', width: '100%', - placeholder: 'Filtrer par calendrier...', + placeholder: I18n.t('vehicle_journeys.vehicle_journeys_matrix.filters.timetable'), language: require('./fr'), ajax: { url: origin + path + this.props.chunkURL, diff --git a/app/javascript/vehicle_journeys/components/tools/select2s/VJSelect2.js b/app/javascript/vehicle_journeys/components/tools/select2s/VJSelect2.js index ccb4c9595..f5881cef7 100644 --- a/app/javascript/vehicle_journeys/components/tools/select2s/VJSelect2.js +++ b/app/javascript/vehicle_journeys/components/tools/select2s/VJSelect2.js @@ -25,7 +25,7 @@ export default class BSelect4b extends Component { options={{ allowClear: false, theme: 'bootstrap', - placeholder: 'Filtrer par ID course...', + placeholder: I18n.t('vehicle_journeys.vehicle_journeys_matrix.filters.id'), width: '100%', language: require('./fr'), ajax: { |
