diff options
| -rw-r--r-- | app/assets/javascripts/es6_browserified/vehicle_journeys/actions/index.js | 3 | ||||
| -rw-r--r-- | app/assets/javascripts/es6_browserified/vehicle_journeys/components/VehicleJourney.js | 10 | ||||
| -rw-r--r-- | app/assets/stylesheets/modules/_vj_collection.sass | 24 | ||||
| -rw-r--r-- | app/models/netex_import.rb | 2 | ||||
| -rw-r--r-- | app/views/devise/confirmations/new.html.slim | 6 | ||||
| -rw-r--r-- | app/views/devise/sessions/new.html.slim | 12 | ||||
| -rw-r--r-- | app/views/devise/shared/_form_registration.html.slim | 6 | ||||
| -rw-r--r-- | app/views/routes/show.html.slim | 4 | ||||
| -rw-r--r-- | app/views/shared/_lines_search_form.html.slim | 4 | ||||
| -rw-r--r-- | app/views/vehicle_journeys/show.rabl | 2 | ||||
| -rw-r--r-- | config/locales/lines.en.yml | 1 | ||||
| -rw-r--r-- | config/locales/lines.fr.yml | 1 | ||||
| -rw-r--r-- | config/locales/stop_areas.en.yml | 2 | ||||
| -rw-r--r-- | config/locales/stop_areas.fr.yml | 2 | ||||
| -rw-r--r-- | lib/stif/reflex_synchronization.rb | 1 |
15 files changed, 54 insertions, 26 deletions
diff --git a/app/assets/javascripts/es6_browserified/vehicle_journeys/actions/index.js b/app/assets/javascripts/es6_browserified/vehicle_journeys/actions/index.js index 7e4665e57..65576f094 100644 --- a/app/assets/javascripts/es6_browserified/vehicle_journeys/actions/index.js +++ b/app/assets/javascripts/es6_browserified/vehicle_journeys/actions/index.js @@ -297,7 +297,8 @@ const actions = { timeTables.push({ objectid: tt.objectid, comment: tt.comment, - id: tt.id + id: tt.id, + color: tt.color }) } let vjasWithDelta = val.vehicle_journey_at_stops.map((vjas, i) => { diff --git a/app/assets/javascripts/es6_browserified/vehicle_journeys/components/VehicleJourney.js b/app/assets/javascripts/es6_browserified/vehicle_journeys/components/VehicleJourney.js index 63a666d90..d795d76e3 100644 --- a/app/assets/javascripts/es6_browserified/vehicle_journeys/components/VehicleJourney.js +++ b/app/assets/javascripts/es6_browserified/vehicle_journeys/components/VehicleJourney.js @@ -17,12 +17,12 @@ class VehicleJourney extends Component { return bool } - timeTableURL(id) { + timeTableURL(tt) { let refURL = window.location.pathname.split('/', 3).join('/') - let ttURL = refURL + '/time_tables/' + id + let ttURL = refURL + '/time_tables/' + tt.id return ( - <a href={ttURL} title='Voir le calendrier'><span className='fa fa-calendar'></span></a> + <a href={ttURL} title='Voir le calendrier'><span className='fa fa-calendar' style={{color: (tt.color ? tt.color : '')}}></span></a> ) } @@ -46,12 +46,12 @@ class VehicleJourney extends Component { this.previousCity = undefined return ( - <div className={'t2e-item' + (this.props.value.deletable ? ' disabled' : '')}> + <div className={'t2e-item' + (this.props.value.deletable ? ' disabled' : '') + (this.props.value.errors ? ' has-error': '')}> <div className='th'> <div className='strong mb-xs'>{this.props.value.objectid ? this.props.value.objectid : '-'}</div> <div>{this.props.value.journey_pattern.objectid}</div> {this.props.value.time_tables.map((tt, i)=> - <div key={i}>{this.timeTableURL(tt.id)}</div> + <div key={i}>{this.timeTableURL(tt)}</div> )} {(this.props.filters.policy['vehicle_journeys.edit'] == true) && diff --git a/app/assets/stylesheets/modules/_vj_collection.sass b/app/assets/stylesheets/modules/_vj_collection.sass index ea5f78b5a..50ad1cd54 100644 --- a/app/assets/stylesheets/modules/_vj_collection.sass +++ b/app/assets/stylesheets/modules/_vj_collection.sass @@ -78,3 +78,27 @@ &:after bottom: -6px + + // Errors + .table-2entries .t2e-item-list + .t2e-item + position: relative + + &.has-error + &:before + content: '' + position: absolute + top: 0 + left: 0 + right: 0 + bottom: 0 + z-index: 5 + border: 2px solid $red + + > .th + > div:first-child, > div:first-child + div + color: $red + + // Reset default behaviour + .form-control + border-color: #ccc diff --git a/app/models/netex_import.rb b/app/models/netex_import.rb index 595f7f82b..de5b84537 100644 --- a/app/models/netex_import.rb +++ b/app/models/netex_import.rb @@ -1,6 +1,6 @@ require 'net/http' class NetexImport < Import - after_create :launch_java_import + after_commit :launch_java_import def launch_java_import logger.warn "Call iev get #{Rails.configuration.iev_url}/boiv_iev/referentials/importer/new?id=#{id}" diff --git a/app/views/devise/confirmations/new.html.slim b/app/views/devise/confirmations/new.html.slim index caaf7ae10..30194fdfa 100644 --- a/app/views/devise/confirmations/new.html.slim +++ b/app/views/devise/confirmations/new.html.slim @@ -4,9 +4,9 @@ .col-md-4.login .panel.panel-default .panel-heading = t('.title') - + .panel-body - = simple_form_for(resource, :as => resource_name, :url => confirmation_path(resource_name), :wrapper => "form_without_label", html: { :class => 'form-horizontal user', method: :post } ) do |form| + = simple_form_for(resource, :as => resource_name, :url => confirmation_path(resource_name), html: { :class => 'form-horizontal user', method: :post } ) do |form| = form.input :email, :label => false, input_html: { :class => "form-control" } .row .col-md-12 @@ -14,4 +14,4 @@ .row.options .col-md-12.new_password - = link_to t('devise.links.sign_in'), new_session_path(resource_name)
\ No newline at end of file + = link_to t('devise.links.sign_in'), new_session_path(resource_name) diff --git a/app/views/devise/sessions/new.html.slim b/app/views/devise/sessions/new.html.slim index c69f9dc3b..5f4fec741 100644 --- a/app/views/devise/sessions/new.html.slim +++ b/app/views/devise/sessions/new.html.slim @@ -4,10 +4,10 @@ .col-md-4.login .panel.panel-default .panel-body - = simple_form_for(resource, :as => resource_name, :url => session_path(resource_name), :wrapper => "form_without_label", html: { :class => 'form-horizontal session_new' } ) do |form| - + = simple_form_for(resource, :as => resource_name, :url => session_path(resource_name), html: { :class => 'form-horizontal session_new' } ) do |form| + = form.input :email, :label => false, input_html: { :class => "form-control" } - + .row .col-md-6 = form.input :password, :as => :password, :label => false, input_html: { :class => "form-control" } @@ -19,7 +19,7 @@ .col-md-6 - if devise_mapping.rememberable? = form.input :remember_me, :as => :boolean if devise_mapping.rememberable? - + .col-md-6.new_password = link_to t("devise.links.new_password"), new_password_path(resource_name) @@ -28,7 +28,7 @@ - if devise_mapping.confirmable? && controller_name != 'confirmations' br = link_to t("devise.links.new_confirmation"), new_confirmation_path(resource_name) - + / FIXME ref #819 - if false - = render partial: 'devise/shared/form_registration', locals: { organisation: (resource.organisation || Organisation.new) }
\ No newline at end of file + = render partial: 'devise/shared/form_registration', locals: { organisation: (resource.organisation || Organisation.new) } diff --git a/app/views/devise/shared/_form_registration.html.slim b/app/views/devise/shared/_form_registration.html.slim index 5421ddc29..5f18ece87 100644 --- a/app/views/devise/shared/_form_registration.html.slim +++ b/app/views/devise/shared/_form_registration.html.slim @@ -2,12 +2,12 @@ .panel.panel-default .panel-heading = t('devise.registrations.new.title') .panel-body - = simple_form_for(resource, :as => resource_name, :url => registration_path(resource_name), :wrapper => "form_without_label", html: { class: "form-horizontal registration_new" } ) do |form| + = simple_form_for(resource, :as => resource_name, :url => registration_path(resource_name), html: { class: "form-horizontal registration_new" } ) do |form| = form.simple_fields_for :organisation, organisation do |organisation| = organisation.input :name, :label => false, input_html: { :class => "form-control" } - + = form.input :name, :label => false, input_html: { :class => "form-control" } = form.input :email, :label => false, input_html: { :class => "form-control" } = form.input :password, :as => :password, :label => false, input_html: { :class => "form-control" } = form.input :password_confirmation, :as => :password, :label => false, input_html: { :class => "form-control" } - = form.button :submit, t("devise.registrations.new.commit"), :class => "btn-info"
\ No newline at end of file + = form.button :submit, t("devise.registrations.new.commit"), :class => "btn-info" diff --git a/app/views/routes/show.html.slim b/app/views/routes/show.html.slim index 9f84b31ad..2bdf78119 100644 --- a/app/views/routes/show.html.slim +++ b/app/views/routes/show.html.slim @@ -11,7 +11,7 @@ = link_to t('journey_patterns.index.title'), [@referential, @line, @route, :journey_patterns_collection], class: 'btn btn-primary' - if @route.journey_patterns.present? = link_to t('vehicle_journeys.actions.index'), [@referential, @line, @route, :vehicle_journeys], class: 'btn btn-primary' - + = link_to t('vehicle_journey_exports.new.title'), referential_line_route_vehicle_journey_exports_path(@referential, @line, @route, format: :zip), class: 'btn btn-primary' - if policy(@route).destroy? @@ -26,7 +26,7 @@ .col-lg-6.col-md-6.col-sm-12.col-xs-12 = definition_list t('metadatas'), { 'OiD' => @route.try(:objectid).try(:local_id), - 'Direction' => (@route.published_name ? @route.published_name : '-'), + 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 : '-') } diff --git a/app/views/shared/_lines_search_form.html.slim b/app/views/shared/_lines_search_form.html.slim index 0d4fedbc0..3bc84a3ad 100644 --- a/app/views/shared/_lines_search_form.html.slim +++ b/app/views/shared/_lines_search_form.html.slim @@ -19,6 +19,6 @@ .col-xs-3 = f.select(:company_id_eq, referential.companies.collect { |c| [c.name, c.id] }.unshift([t("lines.index.no_networks"), -1]), { include_blank: '' }, { class: 'form-control', style: 'width: 100%', 'data-select2ed': 'true', 'data-select2ed-placeholder': t("lines.index.all_companies") }) .col-xs-3 - = f.select(:transport_mode_eq, Chouette::Line.transport_mode.values.collect { |v| [ I18n.t("enumerize.line.transport_mode.#{v}"), v] }.unshift([t("lines.index.no_transport_modes"), -1]), { include_blank: '' }, { class: 'form-control', style: 'width: 100%', 'data-select2ed': 'true', 'data-select2ed-placeholder': t("lines.index.all_transport_modes") }) + = f.select(:transport_mode_eq, Chouette::Line.transport_mode.values.collect { |v| [ I18n.t("enumerize.line.transport_mode.#{v}"), v] }.sort.unshift([t("lines.index.no_transport_modes"), -1]), { include_blank: '' }, { class: 'form-control', style: 'width: 100%', 'data-select2ed': 'true', 'data-select2ed-placeholder': t("lines.index.all_transport_modes") }) .col-xs-3 - = f.select(:transport_submode_eq, Chouette::Line.transport_submode.values.collect { |v| [ I18n.t("enumerize.line.transport_submode.#{v}"), v] }.unshift([t("lines.index.no_transport_submodes"), -1]), { include_blank: '' }, { class: 'form-control', style: 'width: 100%', 'data-select2ed': 'true', 'data-select2ed-placeholder': t("lines.index.all_transport_submodes") }) + = f.select(:transport_submode_eq, Chouette::Line.transport_submode.values.collect { |v| [ I18n.t("enumerize.line.transport_submode.#{v}"), v] }.sort.unshift([t("lines.index.no_transport_submodes"), -1]), { include_blank: '' }, { class: 'form-control', style: 'width: 100%', 'data-select2ed': 'true', 'data-select2ed-placeholder': t("lines.index.all_transport_submodes") }) diff --git a/app/views/vehicle_journeys/show.rabl b/app/views/vehicle_journeys/show.rabl index 6b7608342..7db9b531d 100644 --- a/app/views/vehicle_journeys/show.rabl +++ b/app/views/vehicle_journeys/show.rabl @@ -19,7 +19,7 @@ child(:journey_pattern) do |journey_pattern| end child(:time_tables, :object_root => false) do |time_tables| - attributes :id, :objectid, :comment + attributes :id, :objectid, :comment, :color child(:calendar) do attributes :id, :name, :date_ranges, :dates, :shared end diff --git a/config/locales/lines.en.yml b/config/locales/lines.en.yml index bcb50aa9a..f3e0ee4a2 100644 --- a/config/locales/lines.en.yml +++ b/config/locales/lines.en.yml @@ -59,6 +59,7 @@ en: other: "lines" attributes: line: + id: "ID" network: "Network" networks: name: "Network" diff --git a/config/locales/lines.fr.yml b/config/locales/lines.fr.yml index 869ac8ce2..978e516dd 100644 --- a/config/locales/lines.fr.yml +++ b/config/locales/lines.fr.yml @@ -59,6 +59,7 @@ fr: other: "lignes" attributes: line: + id: "ID" network: "Réseau" networks: name: "Réseau" diff --git a/config/locales/stop_areas.en.yml b/config/locales/stop_areas.en.yml index 6c08b6681..3d6b65350 100644 --- a/config/locales/stop_areas.en.yml +++ b/config/locales/stop_areas.en.yml @@ -90,7 +90,7 @@ en: registration_number: "Registration number" published_name: "Published name" deleted: "Deleted" - comment: "Comments" + comment: "Description" stop_area_type: "Area type" area_type: "Area type" nearest_topic_name: "Nearest point of interest" diff --git a/config/locales/stop_areas.fr.yml b/config/locales/stop_areas.fr.yml index 3e49cdf7c..60ab3fa3d 100644 --- a/config/locales/stop_areas.fr.yml +++ b/config/locales/stop_areas.fr.yml @@ -90,7 +90,7 @@ fr: published_name: "Nom public" deleted: "Supprimé" deleted_at: "Activé" - comment: "Commentaire" + comment: "Description" stop_area_type: "Type d'arrêt" area_type: "Type d'arrêt" nearest_topic_name: "Point d'intérêt le plus proche" diff --git a/lib/stif/reflex_synchronization.rb b/lib/stif/reflex_synchronization.rb index a7dda7e30..6d8497bce 100644 --- a/lib/stif/reflex_synchronization.rb +++ b/lib/stif/reflex_synchronization.rb @@ -146,6 +146,7 @@ module Stif stop.deleted_at = nil stop.stop_area_referential = self.defaut_referential { + :comment => 'Description', :name => 'Name', :area_type => 'TypeOfPlaceRef', :object_version => 'version', |
