aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/assets/stylesheets/main/layout.css.scss148
-rw-r--r--app/assets/stylesheets/main/vehicle_translation.css.scss15
-rw-r--r--app/assets/stylesheets/vendor/formtastic_changes.css.scss13
-rw-r--r--app/controllers/breadcrumb_controller.rb41
-rw-r--r--app/controllers/chouette_controller.rb38
-rw-r--r--app/controllers/exports_controller.rb2
-rw-r--r--app/controllers/import_tasks_controller.rb2
-rw-r--r--app/controllers/organisations_controller.rb4
-rw-r--r--app/controllers/referentials_controller.rb7
-rw-r--r--app/controllers/rule_parameter_sets_controller.rb2
-rw-r--r--app/controllers/stop_area_copies_controller.rb4
-rw-r--r--app/controllers/time_tables_controller.rb2
-rw-r--r--app/controllers/users_controller.rb4
-rw-r--r--app/controllers/vehicle_journey_imports_controller.rb2
-rw-r--r--app/exporters/chouette/hub/exporter.rb10
-rw-r--r--app/exporters/chouette/hub/physical_stop_area_exporter.rb7
-rw-r--r--app/exporters/chouette/hub/vehicle_journey_at_stop_exporter.rb1
-rw-r--r--app/exporters/chouette/hub/vehicle_journey_exporter.rb31
-rw-r--r--app/exporters/chouette/hub/vehicle_journey_operation_exporter.rb12
-rw-r--r--app/helpers/breadcrumb_helper.rb56
-rw-r--r--app/inputs/tags_input.rb19
-rw-r--r--app/views/access_links/show.html.erb12
-rw-r--r--app/views/access_points/show.html.erb8
-rw-r--r--app/views/api/hub/arrets_generiques.hub.erb2
-rw-r--r--app/views/api/hub/arrets_physiques.hub.erb2
-rw-r--r--app/views/api/hub/chemins.hub.erb2
-rw-r--r--app/views/api/hub/correspondances.hub.erb2
-rw-r--r--app/views/api/hub/courses.hub.erb3
-rw-r--r--app/views/api/hub/courses_operations.hub.erb2
-rw-r--r--app/views/api/hub/horaires.hub.erb4
-rw-r--r--app/views/api/hub/lignes.hub.erb2
-rw-r--r--app/views/api/hub/periodes.hub.erb2
-rw-r--r--app/views/api/hub/reseaux.hub.erb2
-rw-r--r--app/views/api/hub/transporteurs.hub.erb2
-rw-r--r--app/views/companies/show.html.erb4
-rw-r--r--app/views/connection_links/show.html.erb4
-rw-r--r--app/views/group_of_lines/show.html.erb4
-rw-r--r--app/views/journey_patterns/show.html.erb8
-rw-r--r--app/views/lines/show.html.erb4
-rw-r--r--app/views/networks/show.html.erb4
-rw-r--r--app/views/routes/show.html.erb4
-rw-r--r--app/views/shared/_header.erb14
-rw-r--r--app/views/stop_areas/show.html.erb4
-rw-r--r--app/views/time_tables/_form.erb12
-rw-r--r--app/views/time_tables/_show_time_table.html.erb4
-rw-r--r--app/views/vehicle_journeys/_sidebar.html.erb10
-rw-r--r--app/views/vehicle_journeys/show.html.erb10
-rw-r--r--app/views/vehicle_translations/_translate_form.html.erb37
-rw-r--r--config/initializers/formtastic.rb4
-rw-r--r--config/locales/breadcrumbs.yml10
-rw-r--r--config/locales/formtastic.yml2
-rw-r--r--config/locales/vehicle_journeys.yml4
52 files changed, 241 insertions, 367 deletions
diff --git a/app/assets/stylesheets/main/layout.css.scss b/app/assets/stylesheets/main/layout.css.scss
index e11360333..4438769b8 100644
--- a/app/assets/stylesheets/main/layout.css.scss
+++ b/app/assets/stylesheets/main/layout.css.scss
@@ -83,6 +83,7 @@ ol.breadcrumb{
min-height: 500px;
-webkit-box-shadow: 0 0 5px 2px rgba(0, 0, 0, .2);
box-shadow: 0 0 5px 2px rgba(0, 0, 0, .2);
+ padding-top: 10px;
padding-bottom: 10px;
margin-top: 20px;
margin-bottom: 20px;
@@ -197,153 +198,6 @@ ol.breadcrumb{
}
}
-/* #body #workspace { */
-/* width: 70%; */
-/* background: white; */
-/* margin: 0px 30px; */
-/* padding: 0 15px 10px 15px; */
-
-/* -moz-box-shadow: 3px 3px 4px #BBB; */
-/* -webkit-box-shadow: 3px 3px 4px #BBB; */
-/* box-shadow: 3px 3px 4px #BBB; */
-/* border-right: 1px solid #BBB; */
-/* border-bottom: 1px solid #BBB; */
-
-/* li span.author { */
-/* float: right; */
-/* font-size: 12px; */
-/* } */
-
-/* .site_summary { */
-/* float: left; */
-/* margin-bottom: 20px; */
-/* width: 100%; */
-
-/* img { */
-/* float: left; */
-/* margin-right: 20px; */
-/* } */
-/* a { */
-/* display: block; */
-/* margin: 25px 0 0; */
-/* } */
-/* } */
-/* .site_summary:after { */
-/* content: " "; */
-/* display: block; */
-/* height: 0; */
-/* clear: both; */
-/* visibility: hidden; */
-/* } */
-
-/* fieldset.buttons{ */
-/* margin: 10px; */
-/* } */
-
-/* form { */
-/* label { */
-/* color: #555555; */
-/* font-size: 100%; */
-/* text-align: right; */
-/* } */
-
-
-/* } */
-
-/* } */
-
-/* #body
-
-/* #body #sidebar { */
-/* width: 20%; */
-/* padding-top: 20px; */
-
-/* label { */
-/* color: #555555; */
-/* font-weight: normal; */
-/* font-size: 100%; */
-/* } */
-
-/* a { */
-/* color: #666; */
-/* } */
-
-/* .actions { */
-/* margin-bottom: 20px; */
-/* } */
-
-/* p { */
-/* font-size: 12px; */
-/* } */
-
-/* fieldset */
-/* { */
-/* border-color: white; */
-
-/* p{ */
-/* margin-top: 5px; */
-/* label{ font-size: 12px;} */
-/* span{ */
-/* font-style: oblique; */
-/* font-size:12px; */
-/* } */
-/* } */
-/* } */
-
-/* ol { */
-/* padding: 0px; */
-
-/* li { */
-/* list-style: none; */
-/* } */
-/* } */
-
-/* ul { */
-/* padding: 0px; */
-
-/* li { */
-/* list-style: none; */
-/* } */
-/* } */
-
-/* ul.selection li { */
-/* a { */
-/* padding-left: 20px; */
-/* } */
-/* a.current { */
-/* text-decoration: none; */
-/* color: black !important; */
-/* background: url(image-path('icons/accept.png')) no-repeat; */
-/* } */
-/* a.all { */
-/* background-image: none; */
-/* } */
-/* } */
-
-/* div#compact_form { */
-/* form { */
-/* border-bottom: 1px solid #BBB; */
-/* fieldset { */
-/* padding: 0; */
-/* border: 0; */
-/* li { */
-/* padding: 0; */
-/* label { padding-left: 20px; */
-/* width: 70%;} */
-/* input { width: 20px; } */
-/* } */
-/* } */
-/* fieldset.actions { */
-/* margin-bottom: 0; */
-/* padding-left: 20px; */
-/* } */
-/* fieldset.inputs { */
-/* padding-top: 16px; */
-/* } */
-/* } */
-/* } */
-/* } */
-
.info {
font-size: 10px;
color: #777;
diff --git a/app/assets/stylesheets/main/vehicle_translation.css.scss b/app/assets/stylesheets/main/vehicle_translation.css.scss
new file mode 100644
index 000000000..f399d1a4a
--- /dev/null
+++ b/app/assets/stylesheets/main/vehicle_translation.css.scss
@@ -0,0 +1,15 @@
+#translate_form{
+ .repeat_cloning{
+ margin-top: 30px;
+ }
+
+ .modal-footer{
+ .actions {
+ padding-left: 75%;
+
+ li {
+ margin: 0px 0px;
+ }
+ }
+ }
+}
diff --git a/app/assets/stylesheets/vendor/formtastic_changes.css.scss b/app/assets/stylesheets/vendor/formtastic_changes.css.scss
index bdd634384..4e7ea0d37 100644
--- a/app/assets/stylesheets/vendor/formtastic_changes.css.scss
+++ b/app/assets/stylesheets/vendor/formtastic_changes.css.scss
@@ -1,17 +1,16 @@
-input.typeahead{
- & .formtastic .input {
+.formtastic{
+
+ .input.typeahead_wrapper{
overflow: inherit !important;
}
-}
-
-.formtastic{
.label{
white-space: normal;
+ text-align: right;
}
- .input{
- overflow: visible;
+ .stringish input{
+ width: auto;
}
fieldset.inputs {
diff --git a/app/controllers/breadcrumb_controller.rb b/app/controllers/breadcrumb_controller.rb
new file mode 100644
index 000000000..143651b52
--- /dev/null
+++ b/app/controllers/breadcrumb_controller.rb
@@ -0,0 +1,41 @@
+class BreadcrumbController < InheritedResources::Base
+
+ include BreadcrumbHelper
+
+ def show
+ show! do
+ build_breadcrumb :show
+ end
+ end
+
+ def index
+ index! do
+ build_breadcrumb :index
+ end
+ end
+
+ def edit
+ edit! do
+ build_breadcrumb :edit
+ end
+ end
+
+ def update
+ update! do |success, failure|
+ build_breadcrumb :edit
+ end
+ end
+
+ def new
+ new! do
+ build_breadcrumb :new
+ end
+ end
+
+ def create
+ create! do |success, failure|
+ build_breadcrumb :new
+ end
+ end
+
+end
diff --git a/app/controllers/chouette_controller.rb b/app/controllers/chouette_controller.rb
index 6e87a4bf6..753fbd2fc 100644
--- a/app/controllers/chouette_controller.rb
+++ b/app/controllers/chouette_controller.rb
@@ -1,4 +1,4 @@
-class ChouetteController < InheritedResources::Base
+class ChouetteController < BreadcrumbController
include ApplicationHelper
include BreadcrumbHelper
@@ -15,40 +15,4 @@ class ChouetteController < InheritedResources::Base
@referential ||= current_organisation.referentials.find params[:referential_id]
end
- def show
- show! do
- build_breadcrumb :show
- end
- end
-
- def index
- index! do
- build_breadcrumb :index
- end
- end
-
- def edit
- edit! do
- build_breadcrumb :edit
- end
- end
-
- def update
- update! do |success, failure|
- build_breadcrumb :edit
- end
- end
-
- def new
- new! do
- build_breadcrumb :show
- end
- end
-
- def create
- create! do |success, failure|
- build_breadcrumb :show
- end
- end
-
end
diff --git a/app/controllers/exports_controller.rb b/app/controllers/exports_controller.rb
index 8de7e4f1f..cb555a3dd 100644
--- a/app/controllers/exports_controller.rb
+++ b/app/controllers/exports_controller.rb
@@ -8,7 +8,7 @@ class ExportsController < ChouetteController
def new
new! do
- build_breadcrumb :show
+ build_breadcrumb :new
available_exports
end
end
diff --git a/app/controllers/import_tasks_controller.rb b/app/controllers/import_tasks_controller.rb
index a0d17d4d7..bee70d196 100644
--- a/app/controllers/import_tasks_controller.rb
+++ b/app/controllers/import_tasks_controller.rb
@@ -6,7 +6,7 @@ class ImportTasksController < ChouetteController
def new
new! do
- build_breadcrumb :show
+ build_breadcrumb :new
available_imports
end
end
diff --git a/app/controllers/organisations_controller.rb b/app/controllers/organisations_controller.rb
index 7e2edb220..9faea18a5 100644
--- a/app/controllers/organisations_controller.rb
+++ b/app/controllers/organisations_controller.rb
@@ -1,4 +1,6 @@
-class OrganisationsController < InheritedResources::Base
+class OrganisationsController < BreadcrumbController
+
+ defaults :resource_class => Organisation
respond_to :html
def update
diff --git a/app/controllers/referentials_controller.rb b/app/controllers/referentials_controller.rb
index de0b209ca..bf8a2f1ef 100644
--- a/app/controllers/referentials_controller.rb
+++ b/app/controllers/referentials_controller.rb
@@ -1,4 +1,7 @@
-class ReferentialsController < InheritedResources::Base
+class ReferentialsController < BreadcrumbController
+
+ defaults :resource_class => Referential
+
respond_to :html
respond_to :json, :only => :show
respond_to :js, :only => :show
@@ -13,6 +16,8 @@ class ReferentialsController < InheritedResources::Base
:time_tables_count => resource.time_tables.count,
:referential_id => resource.id}
}
+ format.html { build_breadcrumb :show}
+
end
end
diff --git a/app/controllers/rule_parameter_sets_controller.rb b/app/controllers/rule_parameter_sets_controller.rb
index 63265bced..a422bed15 100644
--- a/app/controllers/rule_parameter_sets_controller.rb
+++ b/app/controllers/rule_parameter_sets_controller.rb
@@ -8,7 +8,7 @@ class RuleParameterSetsController < ChouetteController
def new
@rule_parameter_set = RuleParameterSet.default( @referential)
new! do
- build_breadcrumb :show
+ build_breadcrumb :new
end
end
diff --git a/app/controllers/stop_area_copies_controller.rb b/app/controllers/stop_area_copies_controller.rb
index 642932acd..7c1fac8d9 100644
--- a/app/controllers/stop_area_copies_controller.rb
+++ b/app/controllers/stop_area_copies_controller.rb
@@ -1,4 +1,5 @@
class StopAreaCopiesController < ChouetteController
+ defaults :resource_class => StopAreaCopy
belongs_to :referential do
belongs_to :stop_area, :parent_class => Chouette::StopArea
end
@@ -9,8 +10,7 @@ class StopAreaCopiesController < ChouetteController
def new
@stop_area_copy = StopAreaCopy.new(:hierarchy => params[:hierarchy], :source => parent)
new! do
- add_breadcrumb Referential.human_attribute_name("stop_areas"), referential_stop_areas_path(@referential)
- add_breadcrumb @stop_area.name, referential_stop_area_path(@referential, @stop_area)
+ build_breadcrumb :new
end
end
diff --git a/app/controllers/time_tables_controller.rb b/app/controllers/time_tables_controller.rb
index 620bc98c0..54b0a3bac 100644
--- a/app/controllers/time_tables_controller.rb
+++ b/app/controllers/time_tables_controller.rb
@@ -20,7 +20,7 @@ class TimeTablesController < ChouetteController
def new
@autocomplete_items = ActsAsTaggableOn::Tag.all
new! do
- build_breadcrumb :show
+ build_breadcrumb :new
end
end
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index b57b9d54a..2b1c2bd14 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -1,4 +1,6 @@
-class UsersController < InheritedResources::Base
+class UsersController < BreadcrumbController
+
+ defaults :resource_class => User
def create
@user = current_organisation.users.build(params[:user])
diff --git a/app/controllers/vehicle_journey_imports_controller.rb b/app/controllers/vehicle_journey_imports_controller.rb
index ce164c51e..7ce0aca23 100644
--- a/app/controllers/vehicle_journey_imports_controller.rb
+++ b/app/controllers/vehicle_journey_imports_controller.rb
@@ -13,7 +13,7 @@ class VehicleJourneyImportsController < ChouetteController
def new
@vehicle_journey_import = VehicleJourneyImport.new(:route => route)
new! do
- build_breadcrumb :show
+ build_breadcrumb :new
end
end
diff --git a/app/exporters/chouette/hub/exporter.rb b/app/exporters/chouette/hub/exporter.rb
index 2d14d3a3b..091fa75c2 100644
--- a/app/exporters/chouette/hub/exporter.rb
+++ b/app/exporters/chouette/hub/exporter.rb
@@ -82,11 +82,9 @@ class Chouette::Hub::Exporter
@lines = select_lines( options[:o], options[:id] )
@routes = lines.map(&:routes).flatten.sort {|a,b| (a.name && b.name) ? a.name <=> b.name : a.id <=> b.id} if lines_exportable?
- @journey_patterns = Chouette::JourneyPattern.where( :route_id => routes.map(&:id) ).order(:name) if routes_exportable?
-
- @vehicle_journeys = Chouette::VehicleJourney.where( :route_id => routes.map(&:id) ).order(:id) if routes_exportable?
- @vehicle_journeys = Chouette::VehicleJourney.where( :route_id => routes.map(&:id) ).order(:id) if routes_exportable?
-
+ @journey_patterns = Chouette::JourneyPattern.where(:route_id => routes.map(&:id)).order(:name) if routes_exportable?
+ @vehicle_journeys = Chouette::VehicleJourney.where(:route_id => routes.map(&:id)).order(:objectid) if routes_exportable?
+
vjs = []
tts = []
@vehicle_journeys.each do |vj|
@@ -116,7 +114,7 @@ class Chouette::Hub::Exporter
stop_points = Chouette::StopPoint.where( :id => vehicle_journey_at_stops.map(&:stop_point_id)).order(:id)
physical_stop_areas = Chouette::StopArea.where( :id => stop_points.map(&:stop_area_id)).order(:parent_id)
- commercial_stop_areas = Chouette::StopArea.where( :id => physical_stop_areas.map(&:parent_id)).order(:id)
+ commercial_stop_areas = Chouette::StopArea.where( :id => physical_stop_areas.map(&:parent_id)).order(:objectid)
Chouette::Hub::CommercialStopAreaExporter.save(commercial_stop_areas, temp_dir, hub_export)
Chouette::Hub::PhysicalStopAreaExporter.save(physical_stop_areas, temp_dir, hub_export)
diff --git a/app/exporters/chouette/hub/physical_stop_area_exporter.rb b/app/exporters/chouette/hub/physical_stop_area_exporter.rb
index 7669aa64e..23e5d73ec 100644
--- a/app/exporters/chouette/hub/physical_stop_area_exporter.rb
+++ b/app/exporters/chouette/hub/physical_stop_area_exporter.rb
@@ -8,6 +8,13 @@ class Chouette::Hub::PhysicalStopAreaExporter
@template = File.open('app/views/api/hub/arrets_physiques.hub.erb' ){ |f| f.read }
@type = "NNNNNNNNNNNNNNNNNN"
@stop_area.referential.projection_type = "27562"
+
+ wgs84 = '+proj=lonlat +datum=WGS84 +ellps=WGS84'
+ @from_projection = RGeo::CoordSys::Proj4.new(wgs84)
+
+ lambert2_extended = '+proj=lcc +lat_1=46.8 +lat_0=46.8 +lon_0=0 +k_0=0.99987742 +x_0=600000 +y_0=2200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +no_defs'
+ @to_projection = RGeo::CoordSys::Proj4.new(lambert2_extended)
+
end
def render()
diff --git a/app/exporters/chouette/hub/vehicle_journey_at_stop_exporter.rb b/app/exporters/chouette/hub/vehicle_journey_at_stop_exporter.rb
index 546e3cec1..12cb5e1df 100644
--- a/app/exporters/chouette/hub/vehicle_journey_at_stop_exporter.rb
+++ b/app/exporters/chouette/hub/vehicle_journey_at_stop_exporter.rb
@@ -6,6 +6,7 @@ class Chouette::Hub::VehicleJourneyAtStopExporter
@vehicle_journey_at_stop = vehicle_journey_at_stop
@directory = directory
@template = File.open('app/views/api/hub/horaires.hub.erb' ) { |f| f.read }
+ @stop_area_code = Chouette::StopArea.find(@vehicle_journey_at_stop.stop_point.stop_area_id).objectid.sub(/(\w*\:\w*\:)(\w*)/, '\2')
@arrival_time = @vehicle_journey_at_stop.arrival_time.sec + 60 * @vehicle_journey_at_stop.arrival_time.min + 60 * 60 * @vehicle_journey_at_stop.arrival_time.hour
@arrival_type = "A"
@departure_time = @vehicle_journey_at_stop.departure_time.sec + 60 * @vehicle_journey_at_stop.departure_time.min + 60 * 60 * @vehicle_journey_at_stop.departure_time.hour
diff --git a/app/exporters/chouette/hub/vehicle_journey_exporter.rb b/app/exporters/chouette/hub/vehicle_journey_exporter.rb
index df7cda97f..96b458953 100644
--- a/app/exporters/chouette/hub/vehicle_journey_exporter.rb
+++ b/app/exporters/chouette/hub/vehicle_journey_exporter.rb
@@ -2,10 +2,34 @@ class Chouette::Hub::VehicleJourneyExporter
include ERB::Util
attr_accessor :vehicle_journey, :directory, :template
- def initialize(vehicle_journey, directory)
+ def initialize(vehicle_journey, directory, index)
@vehicle_journey = vehicle_journey
@directory = directory
@template = File.open('app/views/api/hub/courses.hub.erb' ) { |f| f.read }
+ @numero = index
+ @journey_pattern = Chouette::JourneyPattern.find(@vehicle_journey.journey_pattern_id)
+ @route = Chouette::Route.find(@vehicle_journey.route_id)
+ @line = Chouette::Line.find(@route.line_id)
+ @departure_stop_point = Chouette::StopPoint.find(@journey_pattern.departure_stop_point_id)
+ @departure_stop_area = Chouette::StopArea.find(@departure_stop_point.stop_area_id)
+ @arrival_stop_point = Chouette::StopPoint.find(@journey_pattern.arrival_stop_point_id)
+ @arrival_stop_area = Chouette::StopArea.find(@arrival_stop_point.stop_area_id)
+ departure_time = Chouette::VehicleJourneyAtStop.where( :vehicle_journey_id => @vehicle_journey.id ).where( :stop_point_id => @departure_stop_point.id )[0].departure_time
+ arrival_time = Chouette::VehicleJourneyAtStop.where( :vehicle_journey_id => @vehicle_journey.id ).where( :stop_point_id => @arrival_stop_point.id )[0].arrival_time
+ @departure_time_sec = departure_time.sec + ( departure_time.min + departure_time.hour * 60 ) * 60
+ @arrival_time_sec = arrival_time.sec + ( arrival_time.min + arrival_time.hour * 60 ) * 60
+ @validity = 0
+ @vehicle_journey.time_tables.map(&:int_day_types).each { |v| @validity += v }
+
+ periods = Chouette::TimeTablePeriod.where( :time_table_id => @vehicle_journey.time_tables.map(&:id) ).map(&:id)
+ @periods = ""
+ unless periods.empty?
+ @periods += periods[0].to_s
+ periods.shift
+ end
+ unless periods.empty?
+ periods.each { |p| @periods += "|" + p.to_s }
+ end
end
def render()
@@ -17,9 +41,8 @@ class Chouette::Hub::VehicleJourneyExporter
end
def self.save( vehicle_journeys, directory, hub_export)
- vehicle_journeys.each do |vehicle_journey|
- #Chouette::Hub::VehicleJourneyAtStopExporter.save(vehicle_journey.vehicle_journey_at_stops, directory, hub_export)
- self.new( vehicle_journey, directory).tap do |specific_exporter|
+ vehicle_journeys.each_index do |index|
+ self.new( vehicle_journeys[index], directory, index).tap do |specific_exporter|
specific_exporter.save
end
end
diff --git a/app/exporters/chouette/hub/vehicle_journey_operation_exporter.rb b/app/exporters/chouette/hub/vehicle_journey_operation_exporter.rb
index e6c5b8d07..3a45f2cab 100644
--- a/app/exporters/chouette/hub/vehicle_journey_operation_exporter.rb
+++ b/app/exporters/chouette/hub/vehicle_journey_operation_exporter.rb
@@ -2,8 +2,9 @@ class Chouette::Hub::VehicleJourneyOperationExporter
include ERB::Util
attr_accessor :vehicle_journey, :directory, :template
- def initialize(vehicle_journey, directory)
+ def initialize(vehicle_journey, directory, index)
@vehicle_journey = vehicle_journey
+ @number = index
@directory = directory
@template = File.open('app/views/api/hub/courses_operations.hub.erb' ) { |f| f.read }
end
@@ -17,11 +18,16 @@ class Chouette::Hub::VehicleJourneyOperationExporter
end
def self.save( vehicle_journeys, directory, hub_export)
- vehicle_journeys.each do |vehicle_journey|
- self.new( vehicle_journey, directory).tap do |specific_exporter|
+ vehicle_journeys.each_index do |index|
+ self.new( vehicle_journeys[index], directory, index).tap do |specific_exporter|
specific_exporter.save
end
end
+ #vehicle_journeys.each do |vehicle_journey|
+ # self.new( vehicle_journey, directory).tap do |specific_exporter|
+ # specific_exporter.save
+ # end
+ #end
hub_export.log_messages.create( :severity => "ok", :key => "EXPORT|VEHICLE_JOURNEY_COUNT", :arguments => {"0" => vehicle_journeys.size})
end
diff --git a/app/helpers/breadcrumb_helper.rb b/app/helpers/breadcrumb_helper.rb
index 718147ce7..23cf6a6f2 100644
--- a/app/helpers/breadcrumb_helper.rb
+++ b/app/helpers/breadcrumb_helper.rb
@@ -28,6 +28,8 @@ module BreadcrumbHelper
connection_link_breadcrumb action
when "Chouette::TimeTable"
time_table_breadcrumb action
+ when "StopAreaCopy"
+ stop_area_copy_breadcrumb action
when "ImportTask"
import_breadcrumb action
when "Export"
@@ -36,33 +38,41 @@ module BreadcrumbHelper
compliance_breadcrumb action
when "RuleParameterSet"
rule_parameter_breadcrumb action
+ when "User"
+ user_breadcrumb action
+ when "Organisation"
+ organisation_breadcrumb action
else
Rails.logger.info "---------"
Rails.logger.info ">>>>>>> "+resource_class.to_s+" unmapped"
Rails.logger.info "---------"
- referential_breadcrumb
+ referential_breadcrumb action
end
end
def network_breadcrumb(action)
referential_breadcrumb
- add_breadcrumb Referential.human_attribute_name("networks"), referential_networks_path(@referential) unless action == :index
+ add_breadcrumb Chouette::Network.model_name.human(:count => 2), referential_networks_path(@referential) unless action == :index
add_breadcrumb breadcrumb_label(@network), referential_line_path(@referential, @network),:title => breadcrumb_tooltip(@network) if action == :edit
end
def group_of_line_breadcrumb(action)
referential_breadcrumb
- add_breadcrumb Referential.human_attribute_name("group_of_lines"), referential_group_of_lines_path(@referential) unless action == :index
+ add_breadcrumb Chouette::GroupOfLine.model_name.human(:count => 2), referential_group_of_lines_path(@referential) unless action == :index
add_breadcrumb breadcrumb_label(@group_of_line), referential_group_of_line_path(@referential, @group_of_line),:title => breadcrumb_tooltip(@group_of_line) if action == :edit
end
def stop_area_breadcrumb(action)
referential_breadcrumb
- add_breadcrumb Referential.human_attribute_name("stop_areas"), referential_stop_areas_path(@referential) unless action == :index
+ add_breadcrumb Chouette::StopArea.model_name.human(:count => 2), referential_stop_areas_path(@referential) unless action == :index
add_breadcrumb breadcrumb_label(@stop_area), referential_stop_area_path(@referential, @stop_area),:title => breadcrumb_tooltip(@stop_area) if action == :edit
end
+ def stop_area_copy_breadcrumb(action)
+ stop_area_breadcrumb :edit
+ end
+
def access_point_breadcrumb(action)
stop_area_breadcrumb :edit
add_breadcrumb breadcrumb_label(@access_point), referential_stop_area_access_point_path(@referential, @stop_area,@access_point),:title => breadcrumb_tooltip(@access_point) if action == :edit
@@ -76,19 +86,19 @@ module BreadcrumbHelper
def connection_link_breadcrumb(action)
referential_breadcrumb
- add_breadcrumb Referential.human_attribute_name("connection_links"), referential_connection_links_path(@referential) unless action == :index
+ add_breadcrumb Chouette::ConnectionLink.model_name.human(:count => 2), referential_connection_links_path(@referential) unless action == :index
add_breadcrumb breadcrumb_label(@connection_link), referential_connection_link_path(@referential, @connection_link),:title => breadcrumb_tooltip(@connection_link) if action == :edit
end
def time_table_breadcrumb(action)
referential_breadcrumb
- add_breadcrumb Referential.human_attribute_name("time_tables"), referential_time_tables_path(@referential) unless action == :index
+ add_breadcrumb Chouette::TimeTable.model_name.human(:count => 2), referential_time_tables_path(@referential) unless action == :index
add_breadcrumb breadcrumb_label(@time_table), referential_time_table_path(@referential, @time_table),:title => breadcrumb_tooltip(@time_table) if action == :edit
end
def line_breadcrumb(action)
referential_breadcrumb
- add_breadcrumb Referential.human_attribute_name("lines"), referential_lines_path(@referential) unless action == :index
+ add_breadcrumb Chouette::Line.model_name.human(:count => 2), referential_lines_path(@referential) unless action == :index
add_breadcrumb breadcrumb_label(@line), referential_line_path(@referential, @line),:title => breadcrumb_tooltip(@line) if action == :edit
end
@@ -103,13 +113,8 @@ module BreadcrumbHelper
end
def vehicle_journey_breadcrumb(action)
- if action == :index
- route_breadcrumb :edit
- else
- @journey_pattern = @vehicle_journey.journey_pattern
- journey_pattern_breadcrumb :edit
- add_breadcrumb Referential.human_attribute_name("vehicle_journeys"), referential_line_route_vehicle_journeys_path(@referential, @line,@route)
- end
+ route_breadcrumb :edit
+ add_breadcrumb I18n.t("breadcrumbs.vehicle_journeys"), referential_line_route_vehicle_journeys_path(@referential, @line,@route) unless action == :index
add_breadcrumb breadcrumb_label(@vehicle_journey), referential_line_route_vehicle_journey_path(@referential, @line,@route,@vehicle_journey),:title => breadcrumb_tooltip(@vehicle_journey) if action == :edit
end
@@ -119,7 +124,7 @@ module BreadcrumbHelper
def company_breadcrumb (action)
referential_breadcrumb
- add_breadcrumb Referential.human_attribute_name("companies"), referential_companies_path(@referential) unless action == :index
+ add_breadcrumb Chouette::Company.model_name.human(:count => 2), referential_companies_path(@referential) unless action == :index
add_breadcrumb breadcrumb_label(@company), referential_company_path(@referential, @company),:title => breadcrumb_tooltip(@company) if action == :edit
end
@@ -146,16 +151,25 @@ module BreadcrumbHelper
add_breadcrumb Referential.human_attribute_name("rule_parameter_sets"), referential_rule_parameter_sets_path(@referential) unless action == :index
end
- def referential_breadcrumb
- if @referential.present?
- add_breadcrumb breadcrumb_label(@referential), referential_path(@referential),:title => breadcrumb_tooltip(@referential)
- end
+ def referential_breadcrumb (action = :edit)
+ organisation_breadcrumb
+ add_breadcrumb breadcrumb_label(@referential), referential_path(@referential),:title => breadcrumb_tooltip(@referential) if action == :edit
end
+ def organisation_breadcrumb (action = :edit)
+ add_breadcrumb I18n.t("breadcrumbs.referentials"), referentials_path
+ end
+
+ def user_breadcrumb (action)
+ organisation_breadcrumb
+ add_breadcrumb I18n.t("breadcrumbs.users"), organisation_path unless action == :index
+ add_breadcrumb breadcrumb_label(@user), organisation_user_path(@user),:title => breadcrumb_tooltip(@user) unless action == :index
+ end
+
def breadcrumb_label(obj)
label = breadcrumb_name(obj)
if label.blank?
- label = obj.id.to_s
+ label = obj.class.model_name.human+" "+obj.id.to_s
end
if label.length > 12
@@ -168,7 +182,7 @@ module BreadcrumbHelper
def breadcrumb_tooltip(obj)
label = breadcrumb_name(obj)
if label.blank?
- label = obj.class.model_name.human+"("+obj.id.to_s+")"
+ label = obj.class.model_name.human+" ("+obj.id.to_s+")"
else
label = obj.class.model_name.human+" : "+label
end
diff --git a/app/inputs/tags_input.rb b/app/inputs/tags_input.rb
new file mode 100644
index 000000000..cee5a8312
--- /dev/null
+++ b/app/inputs/tags_input.rb
@@ -0,0 +1,19 @@
+class TagsInput < Formtastic::Inputs::StringInput
+
+ def to_html
+ input_wrapping do
+ label_html <<
+ '<span id="tagsContainer"></span>'.html_safe <<
+ builder.text_field(method, input_html_options)
+ end
+ end
+
+ def input_html_options
+ super.merge({
+ :required => nil,
+ :autofocus => nil,
+ :class => 'tm-input',
+ })
+ end
+
+end
diff --git a/app/views/access_links/show.html.erb b/app/views/access_links/show.html.erb
index 79294bb38..3999b0287 100644
--- a/app/views/access_links/show.html.erb
+++ b/app/views/access_links/show.html.erb
@@ -5,18 +5,6 @@
<div class="summary">
<p>
- <label><%= @access_link.human_attribute_name(:access_point) %>: </label>
- <%= link_to @access_link.access_point.name, [@referential, @access_link.access_point.stop_area, @access_link.access_point] %>
- </p>
- <p>
- <label><%= @access_link.human_attribute_name(:stop_area) %>: </label>
- <%= link_to @access_link.stop_area.name, [@referential, @access_link.stop_area] %>
- </p>
- <p>
- <label><%= @access_link.human_attribute_name(:name) %>: </label>
- <%= @access_link.name %>
- </p>
- <p>
<label><%= @access_link.human_attribute_name("access_link_type") %>: </label>
<%= t("connection_link_types.label.#{@access_link.access_link_type}") %>
</p>
diff --git a/app/views/access_points/show.html.erb b/app/views/access_points/show.html.erb
index 7cd7b4920..925d73ee7 100644
--- a/app/views/access_points/show.html.erb
+++ b/app/views/access_points/show.html.erb
@@ -5,14 +5,6 @@
<% end %>
<div class="summary">
<p>
- <label><%= @access_point.human_attribute_name(:stop_area) %>: </label>
- <%= link_to @stop_area.name, [@referential, @stop_area] %>
- </p>
- <p>
- <label><%= @access_point.human_attribute_name("name") %>: </label>
- <%= @access_point.name %>
- </p>
- <p>
<label><%= @access_point.human_attribute_name("comment") %>: </label>
<%= @access_point.comment %>
</p>
diff --git a/app/views/api/hub/arrets_generiques.hub.erb b/app/views/api/hub/arrets_generiques.hub.erb
index a7cc7585a..bb989920f 100644
--- a/app/views/api/hub/arrets_generiques.hub.erb
+++ b/app/views/api/hub/arrets_generiques.hub.erb
@@ -1 +1 @@
-<%= @stop_area.id %>;<%= @stop_area.name %>;;<%= @type %>;;;;<%= @stop_area.country_code %>;<%= @stop_area.country_code %>;<%= @stop_area.comment %>;<%= @stop_area.registration_number %>
+<%= @stop_area.objectid.sub(/(\w*\:\w*\:)(\w*)/, '\2') %>;<%= @stop_area.name %>;<%= @stop_area.nearest_topic_name %>;<%= @type %>;;;;;;<%= @stop_area.comment %>;<%= @stop_area.id %>
diff --git a/app/views/api/hub/arrets_physiques.hub.erb b/app/views/api/hub/arrets_physiques.hub.erb
index f2aee2e6d..a63ee2335 100644
--- a/app/views/api/hub/arrets_physiques.hub.erb
+++ b/app/views/api/hub/arrets_physiques.hub.erb
@@ -1 +1 @@
-<%= @stop_area.id %>;<%= @stop_area.name %>;;<%= @type %>;<%= @stop_area.parent_id %>;<%= @stop_area.projection_x %>;<%= @stop_area.projection_y %>;<%= @stop_area.country_code %>;<%= @stop_area.country_code %>;<%= @stop_area.comment %>;<%= @stop_area.registration_number %>
+<%= @stop_area.objectid.sub(/(\w*\:\w*\:)(\w*)/, '\2') %>;<%= @stop_area.name %>;;<%= @type %>;<%= Chouette::StopArea.find(@stop_area.parent_id).objectid.sub(/(\w*\:\w*\:)(\w*)/, '\2') %>;<%= (@stop_area.latitude && @stop_area.longitude) ? RGeo::CoordSys::Proj4::transform_coords(@from_projection, @to_projection, @stop_area.longitude, @stop_area.latitude)[0] : -1 %>;<%= (@stop_area.latitude && @stop_area.longitude) ? RGeo::CoordSys::Proj4::transform_coords(@from_projection, @to_projection, @stop_area.longitude, @stop_area.latitude)[1] : -1 %>;<%= @stop_area.city_name %>;<%= @stop_area.country_code %>;<%= @stop_area.comment %>;<%= @stop_area.id %>
diff --git a/app/views/api/hub/chemins.hub.erb b/app/views/api/hub/chemins.hub.erb
index ed6e9a4d1..37c5b1260 100644
--- a/app/views/api/hub/chemins.hub.erb
+++ b/app/views/api/hub/chemins.hub.erb
@@ -1 +1 @@
-<%= @journey_pattern.route.line_id %>;<%= @journey_pattern.id %>;<%= @journey_pattern.registration_number %>;<%= @journey_pattern.name %>;<%= @journey_pattern.route.wayback == 'A' ? 1 : 2 %>;<%= @type %>;<% @journey_pattern.stop_points.each do |sp| %>;<%= sp.stop_area_id %>;<%= sp.stop_area.registration_number %>;;<% end %>
+<%= Chouette::Line.find(@journey_pattern.route.line_id).objectid.sub(/(\w*\:\w*\:)(\w*)/, '\2') %>;<%= @journey_pattern.objectid.sub(/(\w*\:\w*\:)(\w*)/, '\2') %>;<%= @journey_pattern.registration_number %>;<%= @journey_pattern.name %>;<%= @journey_pattern.route.wayback == 'A' ? 1 : 2 %>;<%= @type %>;<% @journey_pattern.stop_points.each do |sp| %>;<%= Chouette::StopArea.find(sp.stop_area_id).objectid.sub(/(\w*\:\w*\:)(\w*)/, '\2') %>;<%= sp.stop_area_id %>;;<% end %>
diff --git a/app/views/api/hub/correspondances.hub.erb b/app/views/api/hub/correspondances.hub.erb
index 8d4c5ba7c..91fdd9215 100644
--- a/app/views/api/hub/correspondances.hub.erb
+++ b/app/views/api/hub/correspondances.hub.erb
@@ -1 +1 @@
-<%= @connection_link.departure_id %>;<%= @connection_link.departure.registration_number %>;<%= @connection_link.arrival_id %>;<%= @connection_link.arrival.registration_number %>;<%= @connection_link.link_distance %>;<%= @connection_link.default_duration %>;<%= @connection_link.id %>
+<%= Chouette::StopArea.find(@connection_link.departure_id).objectid.sub(/(\w*\:\w*\:)(\w*)/, '\2') %>;<%= @connection_link.departure_id %>;<%= Chouette::StopArea.find(@connection_link.arrival_id).objectid.sub(/(\w*\:\w*\:)(\w*)/, '\2') %>;<%= @connection_link.arrival_id %>;<%= @connection_link.link_distance %>;<%= @connection_link.default_duration %>;<%= @connection_link.id %>
diff --git a/app/views/api/hub/courses.hub.erb b/app/views/api/hub/courses.hub.erb
index d92939dc2..b0ef2fe2b 100644
--- a/app/views/api/hub/courses.hub.erb
+++ b/app/views/api/hub/courses.hub.erb
@@ -1 +1,2 @@
-<%= @vehicle_journey.id %>;;;;;<%= @vehicle_journey.route.line_id %>;<%= @vehicle_journey.journey_pattern.id %>;...
+<%= @numero %>;;;<%= @departure_stop_area.objectid.sub(/(\w*\:\w*\:)(\w*)/, '\2') %>;<%= @departure_time_sec %>;<%= @line.objectid.sub(/(\w*\:\w*\:)(\w*)/, '\2') %>;<%= @journey_pattern.objectid.sub(/(\w*\:\w*\:)(\w*)/, '\2') %>;<%= "D" %>;<%= (@route.wayback == "R") ? 2 : 1 %>;<%= @validity %>;;<%= @departure_stop_area.id %>;;<%= @periods %>;<%= 1 %>;
+<%= @numero %>;;;<%= @arrival_stop_area.objectid.sub(/(\w*\:\w*\:)(\w*)/, '\2') %>;<%= @arrival_time_sec %>;<%= @line.objectid.sub(/(\w*\:\w*\:)(\w*)/, '\2') %>;<%= @journey_pattern.objectid.sub(/(\w*\:\w*\:)(\w*)/, '\2') %>;<%= "A" %>;<%= (@route.wayback == "R") ? 2 : 1 %>;<%= @validity %>;;<%= @arrival_stop_area.id %>;;<%= @periods %>;<%= 1 %>;
diff --git a/app/views/api/hub/courses_operations.hub.erb b/app/views/api/hub/courses_operations.hub.erb
index f85b3508e..ee6b27581 100644
--- a/app/views/api/hub/courses_operations.hub.erb
+++ b/app/views/api/hub/courses_operations.hub.erb
@@ -1 +1 @@
-<%= @vehicle_journey.id %>;<%= @vehicle_journey.published_journey_identifier %>;;;<%= @vehicle_journey.transport_mode %>;;
+<%= @number %>;<%= @vehicle_journey.published_journey_identifier %>;;;<%= @vehicle_journey.transport_mode %>;;
diff --git a/app/views/api/hub/horaires.hub.erb b/app/views/api/hub/horaires.hub.erb
index bebea0959..7716976d6 100644
--- a/app/views/api/hub/horaires.hub.erb
+++ b/app/views/api/hub/horaires.hub.erb
@@ -1,2 +1,2 @@
-<%= @vehicle_journey_at_stop.stop_point.stop_area_id %>;<%= @arrival_time %>;<%= @arrival_type %>;<%= @vehicle_journey_at_stop.vehicle_journey_id %>;<%= @vehicle_journey_at_stop.vehicle_journey.journey_pattern_id %>;<%= @vehicle_journey_at_stop.stop_point.stop_area.registration_number %>;<%= @vehicle_journey_at_stop.id %>
-<%= @vehicle_journey_at_stop.stop_point.stop_area_id %>;<%= @departure_time %>;<%= @departure_type %>;<%= @vehicle_journey_at_stop.vehicle_journey_id %>;<%= @vehicle_journey_at_stop.vehicle_journey.journey_pattern_id %>;<%= @vehicle_journey_at_stop.stop_point.stop_area.registration_number %>;<%= @vehicle_journey_at_stop.id %>
+<%= @stop_area_code %>;<%= @arrival_time %>;<%= @arrival_type %>;<%= @vehicle_journey_at_stop.vehicle_journey_id %>;<%= @vehicle_journey_at_stop.vehicle_journey.journey_pattern_id %>;<%= @vehicle_journey_at_stop.stop_point.stop_area.id %>;<%= @vehicle_journey_at_stop.id %>
+<%= @stop_area_code %>;<%= @departure_time %>;<%= @departure_type %>;<%= @vehicle_journey_at_stop.vehicle_journey_id %>;<%= @vehicle_journey_at_stop.vehicle_journey.journey_pattern_id %>;<%= @vehicle_journey_at_stop.stop_point.stop_area.id %>;<%= @vehicle_journey_at_stop.id %>
diff --git a/app/views/api/hub/lignes.hub.erb b/app/views/api/hub/lignes.hub.erb
index ee6d4de8f..e5d2c4c4c 100644
--- a/app/views/api/hub/lignes.hub.erb
+++ b/app/views/api/hub/lignes.hub.erb
@@ -1 +1 @@
-<%= @line.id %>;<%= @line.objectid %>;<%= @line.name %>;;;<%= @line.company_id %>;<%= @line.network_id %>;;<%= @line.registration_number %>
+<%= @line.objectid.sub(/(\w*\:\w*\:)(\w*)/, '\2') %>;<%= @line.number %>;<%= @line.name %>;;;<%= Chouette::Company.find(@line.company_id).objectid.sub(/(\w*\:\w*\:)(\w*)/, '\2') %>;<%= Chouette::Network.find(@line.network_id).objectid.sub(/(\w*\:\w*\:)(\w*)/, '\2') %>;;<%= @line.id %>
diff --git a/app/views/api/hub/periodes.hub.erb b/app/views/api/hub/periodes.hub.erb
index 342e4016f..dc3e475df 100644
--- a/app/views/api/hub/periodes.hub.erb
+++ b/app/views/api/hub/periodes.hub.erb
@@ -1 +1 @@
-<%= @time_table.id %>;<%= @time_table.comment %>;<%= @time_table.start_date %>;<%= @time_table.end_date %>;<%= @calendar %>
+<%= Chouette::TimeTable.find(@time_table.id).objectid.sub(/(\w*\:\w*\:)(\w*)/, '\2') %>;<%= @time_table.comment %>;<%= @time_table.start_date %>;<%= @time_table.end_date %>;<%= @calendar %>
diff --git a/app/views/api/hub/reseaux.hub.erb b/app/views/api/hub/reseaux.hub.erb
index 25f24dc6d..634b10b30 100644
--- a/app/views/api/hub/reseaux.hub.erb
+++ b/app/views/api/hub/reseaux.hub.erb
@@ -1 +1 @@
-<%= @network.id %>;<%= @network.name %>;<%= @network.registration_number %>
+<%= @network.objectid.sub(/(\w*\:\w*\:)(\w*)/, '\2') %>;<%= @network.name %>;<%= @network.id %>
diff --git a/app/views/api/hub/transporteurs.hub.erb b/app/views/api/hub/transporteurs.hub.erb
index 3f175b053..fdabda5b1 100644
--- a/app/views/api/hub/transporteurs.hub.erb
+++ b/app/views/api/hub/transporteurs.hub.erb
@@ -1 +1 @@
-<%= @company.id %>;<%= @company.name %>;<%= @company.registration_number %>
+<%= @company.objectid.sub(/(\w*\:\w*\:)(\w*)/, '\2') %>;<%= @company.name %>;<%= @company.id %>
diff --git a/app/views/companies/show.html.erb b/app/views/companies/show.html.erb
index 0ac132511..0c8585a6c 100644
--- a/app/views/companies/show.html.erb
+++ b/app/views/companies/show.html.erb
@@ -4,10 +4,6 @@
<div class="summary">
<p>
- <label><%= @company.human_attribute_name(:name) %>: </label>
- <%= @company.name %>
- </p>
- <p>
<label><%= Chouette::Company.human_attribute_name("short_name") %>: </label>
<%= @company.short_name %>
</p>
diff --git a/app/views/connection_links/show.html.erb b/app/views/connection_links/show.html.erb
index 2414f3dbd..f9689bf55 100644
--- a/app/views/connection_links/show.html.erb
+++ b/app/views/connection_links/show.html.erb
@@ -21,10 +21,6 @@
<% end %>
</p>
<p>
- <label><%= @connection_link.human_attribute_name(:name) %>: </label>
- <%= @connection_link.name %>
- </p>
- <p>
<label><%= @connection_link.human_attribute_name("connection_link_type") %>: </label>
<%= t("connection_link_types.label.#{@connection_link.connection_link_type}") %>
</p>
diff --git a/app/views/group_of_lines/show.html.erb b/app/views/group_of_lines/show.html.erb
index e5923d539..7ce5ddc46 100644
--- a/app/views/group_of_lines/show.html.erb
+++ b/app/views/group_of_lines/show.html.erb
@@ -4,10 +4,6 @@
<%= @map.to_html %>
<div class="summary">
<p>
- <label><%= @group_of_line.human_attribute_name(:name) %>: </label>
- <%= @group_of_line.name %>
- </p>
- <p>
<label><%= @group_of_line.human_attribute_name("comment") %>: </label>
<%= @group_of_line.comment %>
</p>
diff --git a/app/views/journey_patterns/show.html.erb b/app/views/journey_patterns/show.html.erb
index a5f75e7c9..4ac057161 100644
--- a/app/views/journey_patterns/show.html.erb
+++ b/app/views/journey_patterns/show.html.erb
@@ -5,14 +5,6 @@
<div class="summary">
<p>
- <label><%= @route.human_attribute_name(:line) %>: </label>
- <%= link_to line_formatted_name( @line), [@referential, @line] %>
- </p>
- <p>
- <label><%= @journey_pattern.human_attribute_name(:route) %>: </label>
- <%= link_to @route.name, [@referential, @line, @route] %>
- </p>
- <p>
<label><%= @journey_pattern.human_attribute_name(:name) %>: </label>
<%= @journey_pattern.name %>
</p>
diff --git a/app/views/lines/show.html.erb b/app/views/lines/show.html.erb
index d1a13aacf..cec5dc2f0 100644
--- a/app/views/lines/show.html.erb
+++ b/app/views/lines/show.html.erb
@@ -21,10 +21,6 @@
<% end %>
</p>
<p>
- <label><%= @line.human_attribute_name(:name) %>: </label>
- <%= @line.name %>
- </p>
- <p>
<label><%= @line.human_attribute_name("published_name") %>: </label>
<%= @line.published_name %>
</p>
diff --git a/app/views/networks/show.html.erb b/app/views/networks/show.html.erb
index 1999c9869..e7b103dda 100644
--- a/app/views/networks/show.html.erb
+++ b/app/views/networks/show.html.erb
@@ -4,10 +4,6 @@
<%= @map.to_html %>
<div class="summary">
<p>
- <label><%= @network.human_attribute_name(:name) %>: </label>
- <%= @network.name %>
- </p>
- <p>
<label><%= Chouette::Network.human_attribute_name("registration_number") %>: </label>
<%= @network.registration_number %>
</p>
diff --git a/app/views/routes/show.html.erb b/app/views/routes/show.html.erb
index b935a6f34..22ef7fff8 100644
--- a/app/views/routes/show.html.erb
+++ b/app/views/routes/show.html.erb
@@ -5,10 +5,6 @@
<div class="summary">
<p>
- <label><%= @route.human_attribute_name(:line) %>: </label>
- <%= link_to line_formatted_name( @line), [@referential, @line] %>
- </p>
- <p>
<label><%= @route.human_attribute_name(:name) %>: </label>
<%= @route.name %>
</p>
diff --git a/app/views/shared/_header.erb b/app/views/shared/_header.erb
index 53975556b..81d75d1ae 100644
--- a/app/views/shared/_header.erb
+++ b/app/views/shared/_header.erb
@@ -38,31 +38,31 @@
<li class="divider"></li>
<li role="presentation" class="dropdown-header"><%= t("layouts.navbar.select_referential_datas") %></li>
<li><%= link_to referential_networks_path(@referential) do %>
- <span class="pull-left"><%= Referential.human_attribute_name("networks") %></span><span class="badge pull-right"><%= @referential.networks.size %></span>
+ <span class="badge pull-right"><%= @referential.networks.size %></span><%= Referential.human_attribute_name("networks") %>
<% end %>
</li>
<li><%= link_to referential_companies_path(@referential) do %>
- <span class="pull-left"><%= Referential.human_attribute_name("companies") %></span><span class="badge pull-right"><%= @referential.companies.size %></span>
+ <span class="badge pull-right"><%= @referential.companies.size %></span><%= Referential.human_attribute_name("companies") %>
<% end %>
</li>
<li><%= link_to referential_group_of_lines_path(@referential) do %>
- <span class="pull-left"><%= Referential.human_attribute_name("group_of_lines") %></span><span class="badge pull-right"><%= @referential.group_of_lines.size %></span>
+ <span class="badge pull-right"><%= @referential.group_of_lines.size %></span><%= Referential.human_attribute_name("group_of_lines") %>
<% end %>
</li>
<li><%= link_to referential_lines_path(@referential) do %>
- <span class="pull-left"><%= Referential.human_attribute_name("lines") %></span><span class="badge pull-right"><%= @referential.lines.size %></span>
+ <span class="badge pull-right"><%= @referential.lines.size %></span><%= Referential.human_attribute_name("lines") %>
<% end %>
</li>
<li><%= link_to referential_stop_areas_path(@referential) do %>
- <span class="pull-left"><%= Referential.human_attribute_name("stop_areas") %></span><span class="badge pull-right"><%= @referential.stop_areas.size %></span>
+ <span class="badge pull-right"><%= @referential.stop_areas.size %></span><%= Referential.human_attribute_name("stop_areas") %>
<% end %>
</li>
<li><%= link_to referential_connection_links_path(@referential) do %>
- <span class="pull-left"><%= Referential.human_attribute_name("connection_links") %></span><span class="badge pull-right"><%= @referential.connection_links.size %></span>
+ <span class="badge pull-right"><%= @referential.connection_links.size %></span><%= Referential.human_attribute_name("connection_links") %>
<% end %>
</li>
<li><%= link_to referential_time_tables_path(@referential) do %>
- <span class="pull-left"><%= Referential.human_attribute_name("time_tables") %></span><span class="badge pull-right"><%= @referential.time_tables.size %></span>
+ <span class="badge pull-right"><%= @referential.time_tables.size %></span><%= Referential.human_attribute_name("time_tables") %>
<% end %>
</li>
</ul>
diff --git a/app/views/stop_areas/show.html.erb b/app/views/stop_areas/show.html.erb
index 6659b703f..3cef99be8 100644
--- a/app/views/stop_areas/show.html.erb
+++ b/app/views/stop_areas/show.html.erb
@@ -6,10 +6,6 @@
<% end %>
<div class="summary">
<p>
- <label><%= @stop_area.human_attribute_name("name") %>: </label>
- <%= @stop_area.name %>
- </p>
- <p>
<label><%= @stop_area.human_attribute_name("comment") %>: </label>
<%= @stop_area.comment %>
</p>
diff --git a/app/views/time_tables/_form.erb b/app/views/time_tables/_form.erb
index bb98d2d1e..003bfb09f 100644
--- a/app/views/time_tables/_form.erb
+++ b/app/views/time_tables/_form.erb
@@ -1,9 +1,8 @@
<%= semantic_form_for [@referential, @time_table] do |form| %>
<%= form.inputs do %>
<%= form.input :comment %>
- <%= form.input :version %>
-
- <%= form.input :tag_search, :input_html => { class: "tm-input typeahead", :placeholder => t("formtastic.placeholders.time_table.tag_search") } %>
+ <%= form.input :version %>
+ <%= form.input :tag_search, :as => :tags, :input_html => { :id => "tag_search",:placeholder => t("formtastic.placeholders.time_table.tag_search") } %>
<%= form.input :tag_list, :as => :hidden, :input_html => { :id => "tag_list" } %>
<%= form.input :objectid, :required => !@time_table.new_record?, :input_html => { :title => t("formtastic.titles.time_table.objectid")} %>
@@ -66,10 +65,11 @@
<%= javascript_tag "var items = #{ @time_table.tag_list.to_a };" %>
<script>
- $(".tm-input").tagsManager(
+ $("#tag_search").tagsManager(
{
prefilled: items,
- output: '#tag_list'
+ output: '#tag_list',
+ tagsContainer: '#tagsContainer'
});
var time_tables_tag_list = new Bloodhound({
@@ -80,7 +80,7 @@
time_tables_tag_list.initialize();
- $(".typeahead").typeahead(null, {
+ $("#tag_search").typeahead(null, {
name: 'time_tables_tag_list',
displayKey: 'name',
source: time_tables_tag_list.ttAdapter()
diff --git a/app/views/time_tables/_show_time_table.html.erb b/app/views/time_tables/_show_time_table.html.erb
index 5095ac918..71fe973c9 100644
--- a/app/views/time_tables/_show_time_table.html.erb
+++ b/app/views/time_tables/_show_time_table.html.erb
@@ -13,10 +13,6 @@
</div>
<div class="summary">
<p>
- <label><%= @time_table.human_attribute_name("comment") %>: </label>
- <%= @time_table.comment %>
- </p>
- <p>
<label><%= @time_table.human_attribute_name("version") %>: </label>
<%= @time_table.version %>
</p>
diff --git a/app/views/vehicle_journeys/_sidebar.html.erb b/app/views/vehicle_journeys/_sidebar.html.erb
index cb3236c18..80f70d574 100644
--- a/app/views/vehicle_journeys/_sidebar.html.erb
+++ b/app/views/vehicle_journeys/_sidebar.html.erb
@@ -1,14 +1,6 @@
<ul class="actions">
<li><%= link_to t('vehicle_journeys.actions.new'), new_referential_line_route_vehicle_journey_path(@referential, @line, @route), :class => "add" %></li>
<li><%= link_to t('vehicle_journey_imports.new.title'), new_referential_line_route_vehicle_journey_import_path( @referential, @line, @route ), :class => "import" %></li>
+ <li><%= link_to image_tag("icons/file_csv.png") + t('vehicle_journey_exports.new.title'), referential_line_route_vehicle_journey_exports_path(@referential, @line, @route, :format => :zip), :class => "with_fa" %></li>
</ul>
- <div class="btn-group">
- <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
- <%= t('vehicle_journey_imports.new.export_vehicle_journeys') %><span class="caret"></span>
- </button>
- <ul class="dropdown-menu" role="menu">
- <li><%= link_to image_tag("icons/file_csv.png") + " Csv" , referential_line_route_vehicle_journey_exports_path(@referential, @line, @route, :format => :csv) %></li>
- <li><%= link_to image_tag("icons/file_excel.png") + " Excel", referential_line_route_vehicle_journey_exports_path(@referential, @line, @route, :format => :xls) %></li>
- </ul>
- </div>
diff --git a/app/views/vehicle_journeys/show.html.erb b/app/views/vehicle_journeys/show.html.erb
index c7ab1e073..f964fc4ea 100644
--- a/app/views/vehicle_journeys/show.html.erb
+++ b/app/views/vehicle_journeys/show.html.erb
@@ -6,7 +6,7 @@
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
<h4 class="modal-title" id="myModalLabel"><%= t('.translation_form') %></h4>
- <p id="translate_form"></p>
+ <div id="translate_form"></div>
</div>
</div>
</div>
@@ -15,14 +15,6 @@
<div class="vehicle_journey">
<div class="summary">
<p>
- <label><%= @route.human_attribute_name(:line) %>: </label>
- <%= link_to line_formatted_name( @line), [@referential, @line] %>
- </p>
- <p>
- <label><%= @vehicle_journey.human_attribute_name(:route) %>: </label>
- <%= link_to @route.name, [@referential, @line, @route] %>
- </p>
- <p>
<label><%= @vehicle_journey.human_attribute_name(:journey_pattern) %>: </label>
<%= link_to journey_name(@vehicle_journey.journey_pattern), [@referential, @line, @route, @vehicle_journey.journey_pattern] %>
</p>
diff --git a/app/views/vehicle_translations/_translate_form.html.erb b/app/views/vehicle_translations/_translate_form.html.erb
index 8759d89f9..0ca6a6b84 100644
--- a/app/views/vehicle_translations/_translate_form.html.erb
+++ b/app/views/vehicle_translations/_translate_form.html.erb
@@ -1,35 +1,24 @@
-<div id="translate_form">
- <%= render "shared/flash_messages" %>
- <%= semantic_form_for [@referential, @line, @route, @vehicle_journey, @vehicle_translation], remote: true do |form| %>
+<%= render "shared/flash_messages" %>
+<%= semantic_form_for [@referential, @line, @route, @vehicle_journey, @vehicle_translation], remote: true do |form| %>
<div class="modal-body">
<%= form.inputs do %>
<%= form.input :departure_or_arrival, as: :select, label: t('.set'), collection: [ [ t('.first_stop_departure_time', stop_name: @vehicle_translation.first_stop_name), "departure"], [t('.first_stop_arrival_time', stop_name: @vehicle_translation.first_stop_name), "arrival"] ], include_blank: false, required: true %>
<%= form.input :first_stop_time,
as: :time_picker, label: t( ".to"),
- input_html: { class: "form-control input-sm timepicker_basic"}, wrapper_html: { class: "input-append bootstrap-timepicker" } %>
- <div class="panel-group" id="accordion">
- <div class="panel panel-default">
- <div class="panel-heading">
- <h4 class="panel-title">
- <a data-toggle="collapse" data-parent="#accordion" href="#collapseOne">
- <%= t('.multiple_cloning_form') %>
- </a>
- </h4>
- </div>
- <div id="collapseOne" class="panel-collapse collapse in">
- <div class="panel-body">
- <%= form.input :duration, as: :number %>
- <%= form.input :count, as: :number %>
- </div>
- </div>
+ input_html: { class: "form-control input-sm timepicker_basic"}, wrapper_html: { class: "input-append bootstrap-timepicker" } %>
+
+ <div class="repeat_cloning">
+ <h4>
+ <%= t('.multiple_cloning_form') %>
+ </h4>
+ <%= form.input :duration, as: :number %>
+ <%= form.input :count, as: :number %>
</div>
- </div>
<% end %>
</div>
<div class="modal-footer">
<%= form.actions do %>
- <%= form.action :submit, as: :button, label: t('.validation') %>
+ <%= form.action :submit, as: :button, label: t('formtastic.clone') %>
<% end %>
- <% end %>
- </div>
-</div>
+ </div>
+<% end %>
diff --git a/config/initializers/formtastic.rb b/config/initializers/formtastic.rb
index c20f77e40..2cdc37243 100644
--- a/config/initializers/formtastic.rb
+++ b/config/initializers/formtastic.rb
@@ -4,10 +4,10 @@
Formtastic::FormBuilder.default_text_field_size = 50
# Set the default text area height when input is a text. Default is 20.
-# Formtastic::FormBuilder.default_text_area_height = 5
+Formtastic::FormBuilder.default_text_area_height = 5
# Set the default text area width when input is a text. Default is nil.
-# Formtastic::FormBuilder.default_text_area_width = 50
+Formtastic::FormBuilder.default_text_area_width = 50
# Should all fields be considered "required" by default?
# Defaults to true.
diff --git a/config/locales/breadcrumbs.yml b/config/locales/breadcrumbs.yml
new file mode 100644
index 000000000..ccf97c414
--- /dev/null
+++ b/config/locales/breadcrumbs.yml
@@ -0,0 +1,10 @@
+en:
+ breadcrumbs:
+ vehicle_journeys: "Passing times"
+ referentials: "Home"
+ users: "Users"
+fr:
+ breadcrumbs:
+ vehicle_journeys: "Horaires"
+ referentials: "Accueil"
+ users: "Utilisateurs"
diff --git a/config/locales/formtastic.yml b/config/locales/formtastic.yml
index 40ea23472..13b82ef2e 100644
--- a/config/locales/formtastic.yml
+++ b/config/locales/formtastic.yml
@@ -12,6 +12,7 @@ en:
export: "Launch export"
validate: "Launch validation"
duplicate: "Duplicate"
+ clone: "Clone"
fr:
formtastic:
@@ -27,3 +28,4 @@ fr:
export: "Lancer l'export"
validate: "Lancer la validation"
duplicate: "Dupliquer"
+ clone: "Cloner" \ No newline at end of file
diff --git a/config/locales/vehicle_journeys.yml b/config/locales/vehicle_journeys.yml
index 810c80ddb..8eec6657d 100644
--- a/config/locales/vehicle_journeys.yml
+++ b/config/locales/vehicle_journeys.yml
@@ -38,7 +38,6 @@ en:
arrival: "Arrival"
time_tables: "Calendars list"
bounding: "From %{start} to %{end}"
- validation: "Clone"
translation_form: "Vehicle journey translations"
index:
title: "Vehicle journeys on route %{route}"
@@ -138,10 +137,9 @@ fr:
arrival: "Arrivée"
time_tables: "Liste des calendriers"
bounding: "De %{start} à %{end}"
- validation: "Cloner"
translation_form: "Cloner la course"
index:
- title: "Courses de la séquence d'arrêts %{route}"
+ title: "Horaires de la séquence d'arrêts %{route}"
vehicle_journeys: "Horaires de départ aux arrêts"
selection: "Filtrer sur"
selection_all: "Tous"