aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichel Etienne2012-08-20 08:57:52 +0200
committerMichel Etienne2012-08-20 08:57:52 +0200
commitffcf4060da99de698d1a6eacc170b121f164133e (patch)
treeb8ecc0c025b33aa1183e5b9c3ae53edaef9b7488
parent101f02fb2a0b50071421bc43c68c0580b9a4306f (diff)
parent64413fa0682a9b5bcf376ef01788629a38765b29 (diff)
downloadchouette-core-ffcf4060da99de698d1a6eacc170b121f164133e.tar.bz2
Merge branch 'master' of chouette.dryade.priv:/srv/git/chouette2
-rw-r--r--Gemfile7
-rw-r--r--Gemfile.lock18
-rw-r--r--app/assets/images/icons/stop_area.svg84
-rw-r--r--app/assets/images/icons/stop_area_black.pngbin0 -> 411 bytes
-rw-r--r--app/assets/images/icons/stop_area_black_unselected.pngbin0 -> 379 bytes
-rw-r--r--app/assets/images/icons/stop_area_green.pngbin0 -> 624 bytes
-rw-r--r--app/assets/images/icons/stop_area_green_unselected.pngbin0 -> 485 bytes
-rw-r--r--app/assets/images/icons/stop_area_red.pngbin0 -> 492 bytes
-rw-r--r--app/assets/images/icons/stop_area_red_unselected.pngbin0 -> 425 bytes
-rw-r--r--app/assets/images/icons/stop_area_unselected.svg74
-rw-r--r--app/assets/javascripts/public/vehicle_journey.js.coffee14
-rw-r--r--app/assets/javascripts/route.js.coffee15
-rw-r--r--app/assets/stylesheets/layout.css.scss19
-rw-r--r--app/assets/stylesheets/lines.css.scss1
-rw-r--r--app/assets/stylesheets/pagination.css.scss6
-rw-r--r--app/controllers/connection_links_controller.rb1
-rw-r--r--app/controllers/vehicle_journeys_controller.rb4
-rw-r--r--app/helpers/vehicle_journeys_helper.rb8
-rw-r--r--app/maps/connection_link_map.rb1
-rw-r--r--app/maps/style_map/connection_link_style_map.rb42
-rw-r--r--app/views/connection_links/show.kml.erb20
-rw-r--r--app/views/lines/show.html.erb1
-rw-r--r--app/views/routes/show.html.erb25
-rw-r--r--app/views/vehicle_journeys/index.html.erb6
-rw-r--r--app/views/vehicle_journeys/show.html.erb41
-rw-r--r--db/schema.rb51
26 files changed, 365 insertions, 73 deletions
diff --git a/Gemfile b/Gemfile
index 083872f03..683ac2a7e 100644
--- a/Gemfile
+++ b/Gemfile
@@ -38,19 +38,20 @@ gem "modernizr-rails", "~> 2.0.6"
gem "acts_as_tree", :git => "git://github.com/dryade/acts_as_tree.git"
#gem 'ninoxe', :git => 'git://github.com/dryade/ninoxe.git'
gem 'ninoxe', :git => 'git://chouette.dryade.priv/ninoxe' #, :path => '~/Projects/Ninoxe'
-#gem 'ninoxe', :path => '~/workspace/chouette/ninoxe'
gem 'acts_as_list', '0.1.6'
#gem 'composite_primary_keys', '~> 5.0.8'
gem 'delayed_job_active_record'
gem 'apartment',:git => 'git://github.com/dryade/apartment.git'
+# some views use coffee script
+gem 'coffee-rails', '~> 3.2.1'
+gem 'coffee-script-source'
+
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2.3'
- gem 'coffee-rails', '~> 3.2.1'
- gem 'coffee-script-source'
gem 'uglifier', '>= 1.0.3'
gem 'therubyrhino', :platform => :jruby
gem 'therubyracer', :platform => :ruby
diff --git a/Gemfile.lock b/Gemfile.lock
index 94d1f7ffe..edc8a2fbd 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -1,6 +1,6 @@
GIT
remote: git://chouette.dryade.priv/ninoxe
- revision: 856d82d28152fd72cf6f206cfead8543f07dbf2a
+ revision: a11f513671e1d5c31534a0bc989aaad71d3f8cca
specs:
ninoxe (0.0.8)
GeoRuby
@@ -185,11 +185,11 @@ GEM
jruby-jars (1.6.7.2)
jruby-openssl (0.7.7)
bouncy-castle-java (>= 1.5.0146.1)
- jruby-rack (1.1.6)
- jruby-rack-worker (0.3-java)
- jruby-rack (>= 1.0.1)
- json (1.7.4)
- json (1.7.4-java)
+ jruby-rack (1.1.7)
+ jruby-rack-worker (0.4-java)
+ jruby-rack (>= 1.1.1)
+ json (1.7.3)
+ json (1.7.3-java)
json_pure (1.7.3)
launchy (2.1.0)
addressable (~> 2.2.6)
@@ -197,7 +197,6 @@ GEM
addressable (~> 2.2.6)
ffi (~> 1.0.9)
spoon (~> 0.0.1)
- libv8 (3.3.10.4)
libwebsocket (0.1.4)
addressable
listen (0.4.7)
@@ -222,7 +221,6 @@ GEM
nokogiri (1.5.5)
nokogiri (1.5.5-java)
orm_adapter (0.4.0)
- pg (0.11.0)
polyamorous (0.5.0)
activerecord (~> 3.0)
polyglot (0.3.3)
@@ -303,13 +301,10 @@ GEM
hike (~> 1.2)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
- sqlite3 (1.3.6)
squeel (1.0.7)
activerecord (~> 3.0)
activesupport (~> 3.0)
polyamorous (~> 0.5.0)
- therubyracer (0.10.2)
- libv8 (~> 3.3.10)
therubyrhino (1.73.4)
thor (0.15.4)
tilt (1.3.3)
@@ -333,7 +328,6 @@ GEM
PLATFORMS
java
- ruby
DEPENDENCIES
RedCloth
diff --git a/app/assets/images/icons/stop_area.svg b/app/assets/images/icons/stop_area.svg
new file mode 100644
index 000000000..c46362096
--- /dev/null
+++ b/app/assets/images/icons/stop_area.svg
@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="16px"
+ height="16px"
+ id="svg3632"
+ version="1.1"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="point.svg">
+ <defs
+ id="defs3634">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 8 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="16 : 8 : 1"
+ inkscape:persp3d-origin="8 : 5.3333333 : 1"
+ id="perspective3640" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="22.197802"
+ inkscape:cx="-8.071535"
+ inkscape:cy="7.9961044"
+ inkscape:current-layer="layer1"
+ showgrid="true"
+ inkscape:grid-bbox="true"
+ inkscape:document-units="px"
+ inkscape:window-width="1600"
+ inkscape:window-height="851"
+ inkscape:window-x="0"
+ inkscape:window-y="25"
+ inkscape:window-maximized="1" />
+ <metadata
+ id="metadata3637">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ id="layer1"
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer">
+ <path
+ sodipodi:type="arc"
+ style="fill:none;stroke:#000000;stroke-width:1.9543159;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ id="path3642"
+ sodipodi:cx="9.4153461"
+ sodipodi:cy="8.9047031"
+ sodipodi:rx="7.5232673"
+ sodipodi:ry="7.8160892"
+ d="m 16.938613,8.9047031 a 7.5232673,7.8160892 0 1 1 -15.0465341,0 7.5232673,7.8160892 0 1 1 15.0465341,0 z"
+ transform="matrix(0.94317974,0,0,0.90784447,-0.88036375,-0.08408547)" />
+ <path
+ sodipodi:type="arc"
+ style="fill:#000000;fill-opacity:1;stroke:none"
+ id="path4154"
+ sodipodi:cx="7.9287128"
+ sodipodi:cy="8.4542074"
+ sodipodi:rx="1.6668317"
+ sodipodi:ry="1.6443069"
+ d="m 9.5955446,8.4542074 a 1.6668317,1.6443069 0 1 1 -3.3336635,0 1.6668317,1.6443069 0 1 1 3.3336635,0 z"
+ transform="matrix(2.099792,0,0,2.1285564,-8.6486479,-9.9952573)" />
+ </g>
+</svg>
diff --git a/app/assets/images/icons/stop_area_black.png b/app/assets/images/icons/stop_area_black.png
new file mode 100644
index 000000000..0b3b27156
--- /dev/null
+++ b/app/assets/images/icons/stop_area_black.png
Binary files differ
diff --git a/app/assets/images/icons/stop_area_black_unselected.png b/app/assets/images/icons/stop_area_black_unselected.png
new file mode 100644
index 000000000..1c9643b8c
--- /dev/null
+++ b/app/assets/images/icons/stop_area_black_unselected.png
Binary files differ
diff --git a/app/assets/images/icons/stop_area_green.png b/app/assets/images/icons/stop_area_green.png
new file mode 100644
index 000000000..d46eb01e0
--- /dev/null
+++ b/app/assets/images/icons/stop_area_green.png
Binary files differ
diff --git a/app/assets/images/icons/stop_area_green_unselected.png b/app/assets/images/icons/stop_area_green_unselected.png
new file mode 100644
index 000000000..5f2f9172c
--- /dev/null
+++ b/app/assets/images/icons/stop_area_green_unselected.png
Binary files differ
diff --git a/app/assets/images/icons/stop_area_red.png b/app/assets/images/icons/stop_area_red.png
new file mode 100644
index 000000000..d03efa948
--- /dev/null
+++ b/app/assets/images/icons/stop_area_red.png
Binary files differ
diff --git a/app/assets/images/icons/stop_area_red_unselected.png b/app/assets/images/icons/stop_area_red_unselected.png
new file mode 100644
index 000000000..3b7b97aa6
--- /dev/null
+++ b/app/assets/images/icons/stop_area_red_unselected.png
Binary files differ
diff --git a/app/assets/images/icons/stop_area_unselected.svg b/app/assets/images/icons/stop_area_unselected.svg
new file mode 100644
index 000000000..f7c89ed6d
--- /dev/null
+++ b/app/assets/images/icons/stop_area_unselected.svg
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="16px"
+ height="16px"
+ id="svg3632"
+ version="1.1"
+ inkscape:version="0.48.3.1 r9886"
+ sodipodi:docname="stop_area.svg">
+ <defs
+ id="defs3634">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 8 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="16 : 8 : 1"
+ inkscape:persp3d-origin="8 : 5.3333333 : 1"
+ id="perspective3640" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="22.197802"
+ inkscape:cx="-7.981436"
+ inkscape:cy="7.9961044"
+ inkscape:current-layer="layer1"
+ showgrid="true"
+ inkscape:grid-bbox="true"
+ inkscape:document-units="px"
+ inkscape:window-width="1600"
+ inkscape:window-height="857"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1" />
+ <metadata
+ id="metadata3637">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ id="layer1"
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer">
+ <path
+ sodipodi:type="arc"
+ style="fill:none;stroke:#000000;stroke-width:1.9543159;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ id="path3642"
+ sodipodi:cx="9.4153461"
+ sodipodi:cy="8.9047031"
+ sodipodi:rx="7.5232673"
+ sodipodi:ry="7.8160892"
+ d="m 16.938613,8.9047031 a 7.5232673,7.8160892 0 1 1 -15.0465341,0 7.5232673,7.8160892 0 1 1 15.0465341,0 z"
+ transform="matrix(0.94317974,0,0,0.90784447,-0.88036375,-0.08408547)" />
+ </g>
+</svg>
diff --git a/app/assets/javascripts/public/vehicle_journey.js.coffee b/app/assets/javascripts/public/vehicle_journey.js.coffee
new file mode 100644
index 000000000..4b75bb7c4
--- /dev/null
+++ b/app/assets/javascripts/public/vehicle_journey.js.coffee
@@ -0,0 +1,14 @@
+jQuery ->
+ switch_vehicle_journey_at_stops = (event) ->
+ event.preventDefault()
+ $('.vehicle_journeys.show .vehicle_journey_at_stops.content').toggle('slow')
+ $('a.vehicle_journey_at_stops .switcher').toggle()
+
+ $('.vehicle_journeys.show a.vehicle_journey_at_stops').click(switch_vehicle_journey_at_stops)
+
+ switch_time_tables = (event) ->
+ event.preventDefault()
+ $('.vehicle_journeys.show .vehicle_journey_time_tables.content').toggle('slow')
+ $('a.vehicle_journey_time_tables .switcher').toggle()
+
+ $('.vehicle_journeys.show a.vehicle_journey_time_tables').click(switch_time_tables)
diff --git a/app/assets/javascripts/route.js.coffee b/app/assets/javascripts/route.js.coffee
new file mode 100644
index 000000000..a3dd304d3
--- /dev/null
+++ b/app/assets/javascripts/route.js.coffee
@@ -0,0 +1,15 @@
+jQuery ->
+ switch_journey_patterns = (event) ->
+ event.preventDefault()
+ $('.routes.show .journey_patterns.content').toggle('slow')
+ $('a.journey_patterns .switcher').toggle()
+
+ $('.routes.show a.journey_patterns').click(switch_journey_patterns)
+
+ switch_stop_points = (event) ->
+ event.preventDefault()
+ $('.routes.show .stop_points.content').toggle('slow')
+ $('a.stop_points .switcher').toggle()
+
+ $('.routes.show a.stop_points').click(switch_stop_points)
+
diff --git a/app/assets/stylesheets/layout.css.scss b/app/assets/stylesheets/layout.css.scss
index dced2ebb6..555308c22 100644
--- a/app/assets/stylesheets/layout.css.scss
+++ b/app/assets/stylesheets/layout.css.scss
@@ -7,6 +7,25 @@ $text_color: #222;
@import "user_interface/layout";
+p.after_map {
+ clear: both;
+}
+#header .infos div.title
+{
+ margin: 20px 0 0 30px;
+
+ h1 {
+ font-family: "Comic Sans", "Comic Sans MS", cursive;
+ font-size: 32px;
+ font-weight: bold;
+ padding: 0px;
+ }
+}
+ul.user li.language.selected
+{
+ border-bottom: 2px solid black;
+}
+
#sidebar ul {
padding: 0 8px;
diff --git a/app/assets/stylesheets/lines.css.scss b/app/assets/stylesheets/lines.css.scss
index 56a5572e5..cbd39f90b 100644
--- a/app/assets/stylesheets/lines.css.scss
+++ b/app/assets/stylesheets/lines.css.scss
@@ -63,7 +63,6 @@
.line_color{ color: white;
font-weight: bold;
padding: 0 5px 0 5px;}
- h3.routes { clear: both; }
.route {
@include div_for_object;
diff --git a/app/assets/stylesheets/pagination.css.scss b/app/assets/stylesheets/pagination.css.scss
index 7bb3e9cde..e9f6b7235 100644
--- a/app/assets/stylesheets/pagination.css.scss
+++ b/app/assets/stylesheets/pagination.css.scss
@@ -21,14 +21,12 @@
background: white;
cursor: default;
margin-top: 10px;
- padding-left: 70px;
+ text-align: center;
/* self-clearing method: */
a, span, em {
padding: 0.2em 0.5em;
- display: block;
- float: left;
- margin-right: 1px; }
+ }
.disabled {
color: #999999;
border: 1px solid #dddddd; }
diff --git a/app/controllers/connection_links_controller.rb b/app/controllers/connection_links_controller.rb
index dc6ba78c9..cbb8346c6 100644
--- a/app/controllers/connection_links_controller.rb
+++ b/app/controllers/connection_links_controller.rb
@@ -7,6 +7,7 @@ class ConnectionLinksController < ChouetteController
end
respond_to :html, :xml, :json
+ respond_to :kml, :only => :show
def show
@map = ConnectionLinkMap.new(resource).with_helpers(self)
diff --git a/app/controllers/vehicle_journeys_controller.rb b/app/controllers/vehicle_journeys_controller.rb
index 8c156d259..adad7b107 100644
--- a/app/controllers/vehicle_journeys_controller.rb
+++ b/app/controllers/vehicle_journeys_controller.rb
@@ -10,7 +10,7 @@ class VehicleJourneysController < ChouetteController
end
def timeless
- @vehicle_journeys = parent.vehicle_journeys.select { |v| v.vehicle_journey_at_stops.empty? }
+ @vehicle_journeys = parent.vehicle_journeys.timeless
end
def select_journey_pattern
@@ -43,7 +43,7 @@ class VehicleJourneysController < ChouetteController
def collection
@q = parent.sorted_vehicle_journeys.search(params[:q])
- @vehicle_journeys ||= @q.result(:distinct => true).order( "vehicle_journey_at_stops.departure_time").paginate(:page => params[:page], :per_page => 10)
+ @vehicle_journeys ||= @q.result(:distinct => true).order( "vehicle_journey_at_stops.departure_time").paginate(:page => params[:page], :per_page => 8)
@matrix ||= matrix
end
diff --git a/app/helpers/vehicle_journeys_helper.rb b/app/helpers/vehicle_journeys_helper.rb
index e45978023..1ecfe12b5 100644
--- a/app/helpers/vehicle_journeys_helper.rb
+++ b/app/helpers/vehicle_journeys_helper.rb
@@ -28,18 +28,18 @@ module VehicleJourneysHelper
l(first_vjas.departure_time, :format => :hour).gsub( / /, ' ')
end
def vehicle_title( vehicle)
- return t('vehicle_journeys.vehicle_journey.title_stopless') if vehicle.vehicle_journey_at_stops.empty?
+ return t('vehicle_journeys.vehicle_journey.title_stopless', :name => vehicle_name( vehicle)) if vehicle.vehicle_journey_at_stops.empty?
first_vjas = vehicle.vehicle_journey_at_stops.first
t('vehicle_journeys.vehicle_journey.title',
- :name => vehicle.published_journey_name,
+ :name => vehicle_name( vehicle),
:stop => first_vjas.stop_point.stop_area.name,
:time => vehicle_departure(vehicle))
end
def edit_vehicle_title( vehicle)
- return t('vehicle_journeys.edit.title_stopless') if vehicle.vehicle_journey_at_stops.empty?
+ return t('vehicle_journeys.edit.title_stopless', :name => vehicle_name( vehicle)) if vehicle.vehicle_journey_at_stops.empty?
first_vjas = vehicle.vehicle_journey_at_stops.first
t('vehicle_journeys.edit.title',
- :name => vehicle.published_journey_name,
+ :name => vehicle_name( vehicle),
:stop => first_vjas.stop_point.stop_area.name,
:time => vehicle_departure(vehicle))
end
diff --git a/app/maps/connection_link_map.rb b/app/maps/connection_link_map.rb
index dd642c47d..d26bba33b 100644
--- a/app/maps/connection_link_map.rb
+++ b/app/maps/connection_link_map.rb
@@ -18,6 +18,7 @@ class ConnectionLinkMap < ApplicationMap
page.assign "stop_areas_layer", kml_layer([connection_link.referential, connection_link, :stop_areas], :styleMap => StyleMap::StopAreasStyleMap.new.style_map)
page << map.add_layer(:stop_areas_layer)
+ page << map.add_layer( kml_layer([connection_link.referential, connection_link], :styleMap => StyleMap::ConnectionLinkStyleMap.new.style_map))
page << map.add_control( hover_control_display_name(:stop_areas_layer) )
#page << map.add_layer(kml_layer(connection_link, :styleMap => StyleMap::ConnectionLinkStyleMap.new( :style => connection_link_style).style_map))
#page << map.add_layer(kml_layer(polymorphic_path([referential, connection_link, :stop_areas], :format => :kml), :styleMap => StyleMap::StopAreasStyleMap.new.style_map))
diff --git a/app/maps/style_map/connection_link_style_map.rb b/app/maps/style_map/connection_link_style_map.rb
new file mode 100644
index 000000000..39a8c7fd8
--- /dev/null
+++ b/app/maps/style_map/connection_link_style_map.rb
@@ -0,0 +1,42 @@
+class StyleMap::ConnectionLinkStyleMap < StyleMap::GenericStyleMap
+ attr_accessor :style
+
+ def initialize(options = {})
+ @style = options[:style].present? ? default_style.merge(options[:style]) : default_style
+ end
+
+ def default_style
+ {
+ :fontColor => "black",
+ :fontSize => "11px",
+ :fontWeight => "bold",
+ :labelAlign => "ct",
+ :labelXOffset => 0,
+ :labelYOffset => -15,
+ :strokeColor => "#000000",
+ :strokeOpacity => 1,
+ :strokeWidth => 3,
+ :strokeLineCap => "round",
+ :strokeDashstyle => "solid",
+ :externalGraphic => "/assets/map/${positionType}.png",
+ :graphicWidth => 36,
+ :graphicHeight => 36,
+ :graphicOpacity => 1,
+ :graphicXOffset => -18,
+ :graphicYOffset => -18,
+ :display => true
+ }
+ end
+
+ def context
+ context = {
+ :positionType => :" function(feature) { if (feature.attributes.departure != undefined) { return 'departure'; } else { return 'arrival'; }} "
+ }
+ end
+
+ def style_map
+ OpenLayers::StyleMap.new(:default => OpenLayers::Style.new(style, { :context => context}))
+ end
+
+end
+
diff --git a/app/views/connection_links/show.kml.erb b/app/views/connection_links/show.kml.erb
new file mode 100644
index 000000000..fa355d7b5
--- /dev/null
+++ b/app/views/connection_links/show.kml.erb
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<kml xmlns="http://www.opengis.net/kml/2.2">
+ <Document>
+ <% if @connection_link.geometry %>
+ <Placemark id="route_<%= @connection_link.id %>" >
+ <name><%= @connection_link.name %></name>
+ <%= @connection_link.geometry.kml_representation.html_safe %>
+ </Placemark>
+ <Placemark id="<%= @connection_link.departure.id %>" >
+ <departure>true</departure>
+ <%= @connection_link.departure.geometry.kml_representation.html_safe %>
+ </Placemark>
+ <Placemark id="<%= @connection_link.arrival.id %>" >
+ <arrival>true</arrival>
+ <%= @connection_link.arrival.geometry.kml_representation.html_safe %>
+ </Placemark>
+ <% end %>
+ </Document>
+</kml>
+
diff --git a/app/views/lines/show.html.erb b/app/views/lines/show.html.erb
index 2f74ab4fa..6da0bf61e 100644
--- a/app/views/lines/show.html.erb
+++ b/app/views/lines/show.html.erb
@@ -59,6 +59,7 @@
</div>
</div>
+<p class="after_map" />
<h3 class="routes"><%= t('.itineraries') %></h3>
<div class="routes paginated_content">
diff --git a/app/views/routes/show.html.erb b/app/views/routes/show.html.erb
index e6fbcce3f..9980543c7 100644
--- a/app/views/routes/show.html.erb
+++ b/app/views/routes/show.html.erb
@@ -64,13 +64,24 @@
</div>
-<h3 class="route_stop_points"><%= t('.stop_points') %></h3>
-<div class="stop_points paginated_content">
+<p class="after_map" />
+ <h3 class="route_stop_points"><%= t('.stop_points') %>
+ <a class="stop_points">
+ <span class="switcher">+</span>
+ <span class="switcher" style="display: none;">-</span>
+ </a>
+ </h3>
+<div class="stop_points content" style="display: none;">
<%= render :partial => "stop_points/stop_point", :collection => @stop_points %>
</div>
-<h3 class="route_journey_patterns"><%= t('.journey_patterns') %></h3>
-<div class="journey_patterns">
+<h3 class="route_journey_patterns"><%= t('.journey_patterns') %>
+ <a class="journey_patterns">
+ <span class="switcher">+</span>
+ <span class="switcher" style="display: none;">-</span>
+ </a>
+</h3>
+<div class="journey_patterns content" style="display: none;">
<%= render :partial => "journey_patterns/journey_pattern", :collection => @route.journey_patterns %>
</div>
@@ -87,12 +98,6 @@
<li>
<%= link_to t('vehicle_journeys.actions.index'), [@referential, @line, @route, :vehicle_journeys], :class => "link" %>
</li>
- <li>
- <%= link_to t(".journey_patterns"), "#journey_patterns", :class => "select_parent" %>
- </li>
- <li>
- <%= link_to t(".stop_points"), "#stop_points", :class => "select_parent" %>
- </li>
</ul>
<% end %>
diff --git a/app/views/vehicle_journeys/index.html.erb b/app/views/vehicle_journeys/index.html.erb
index 98266e2c8..6f650892d 100644
--- a/app/views/vehicle_journeys/index.html.erb
+++ b/app/views/vehicle_journeys/index.html.erb
@@ -16,6 +16,9 @@
<div class="page_info">
<span class="search"> <%= t("will_paginate.page_entries_info.search") %></span> <%= page_entries_info @vehicle_journeys %>
</div>
+<div class="pagination">
+ <%= will_paginate @vehicle_journeys, :container => false %>
+</div>
<div class="vehicle_journeys paginated_content">
<table>
<thead>
@@ -54,6 +57,9 @@
</tbody>
</table>
</div>
+<div class="pagination">
+ <%= will_paginate @vehicle_journeys, :container => false %>
+</div>
<% content_for :sidebar do %>
<ul class="actions">
<li>
diff --git a/app/views/vehicle_journeys/show.html.erb b/app/views/vehicle_journeys/show.html.erb
index 83993e4d7..5a00430f6 100644
--- a/app/views/vehicle_journeys/show.html.erb
+++ b/app/views/vehicle_journeys/show.html.erb
@@ -52,8 +52,13 @@
</p>
</div>
</div>
-<h3><%= @vehicle_journey.human_attribute_name(:vehicle_journey_at_stop_ids) %></h3>
-<div class="vehicle_journey_at_stops">
+<h3><%= @vehicle_journey.human_attribute_name(:vehicle_journey_at_stop_ids) %>
+<a class="vehicle_journey_at_stops">
+ <span class="switcher">+</span>
+ <span class="switcher" style="display: none;">-</span>
+</a>
+</h3>
+<div class="vehicle_journey_at_stops content" style="display: none;">
<table border="0" >
<thead>
<tr>
@@ -74,8 +79,13 @@
</table>
</div>
-<h3><%= t('.time_tables') %></h3>
-<div class="vehicle_journey_time_tables">
+<h3><%= t('.time_tables') %>
+<a class="vehicle_journey_time_tables">
+ <span class="switcher">+</span>
+ <span class="switcher" style="display: none;">-</span>
+</a>
+</h3>
+<div class="vehicle_journey_time_tables content" style="display: none;">
<%= render :partial => "vehicle_journeys/time_table", :collection => @vehicle_journey.time_tables %>
</div>
<% content_for :sidebar do %>
@@ -83,16 +93,19 @@
<li><%= link_to t('vehicle_journeys.actions.edit'), edit_referential_line_route_vehicle_journey_path(@referential, @line, @route, @vehicle_journey), :class => "edit" %></li>
<li><%= link_to t('vehicle_journeys.actions.destroy'), referential_line_route_vehicle_journey_path(@referential, @line, @route, @vehicle_journey), :method => :delete, :confirm => t('vehicle_journeys.actions.destroy_confirm'), :class => "remove" %></li>
</ul>
- <h3><%= t('.translation_form') %></h3>
- <div id="compact_form" >
- <%= semantic_form_for [@referential, @line, @route, @vehicle_journey, VehicleTranslation.new] do |form| %>
- <%= form.inputs do %>
- <%= form.input :duration %>
- <%= form.input :count %>
- <% end %>
- <%= form.actions do %>
- <%= form.action :submit, :as => :button, :label => t('.validation') %>
+ <% unless @vehicle_journey.vehicle_journey_at_stops.empty? ||
+ @vehicle_journey.vehicle_journey_at_stops.any? { |vjas| vjas.departure_time.nil? } %>
+ <h3><%= t('.translation_form') %></h3>
+ <div id="compact_form" >
+ <%= semantic_form_for [@referential, @line, @route, @vehicle_journey, VehicleTranslation.new] do |form| %>
+ <%= form.inputs do %>
+ <%= form.input :duration %>
+ <%= form.input :count %>
+ <% end %>
+ <%= form.actions do %>
+ <%= form.action :submit, :as => :button, :label => t('.validation') %>
+ <% end %>
<% end %>
- <% end %>
</div>
+ <% end %>
<% end %>
diff --git a/db/schema.rb b/db/schema.rb
index 26e881fba..944588d55 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -176,16 +176,14 @@ ActiveRecord::Schema.define(:version => 20120620081755) do
t.integer "choice_code"
end
- add_index "facilities_features", ["facility_id"], :name => "idx_facility_id"
-
create_table "file_validation_log_messages", :force => true do |t|
t.integer "file_validation_id"
t.string "key"
t.string "arguments", :limit => 1000
t.integer "position"
t.string "severity"
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
end
add_index "file_validation_log_messages", ["file_validation_id"], :name => "index_file_validation_log_messages_on_file_validation_id"
@@ -195,8 +193,18 @@ ActiveRecord::Schema.define(:version => 20120620081755) do
t.string "options", :limit => 2000
t.string "file_name"
t.string "file_type"
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ create_table "geometry_columns", :id => false, :force => true do |t|
+ t.string "f_table_catalog", :limit => 256, :null => false
+ t.string "f_table_schema", :limit => 256, :null => false
+ t.string "f_table_name", :limit => 256, :null => false
+ t.string "f_geometry_column", :limit => 256, :null => false
+ t.integer "coord_dimension", :null => false
+ t.integer "srid", :null => false
+ t.string "type", :limit => 30, :null => false
end
create_table "group_of_lines", :force => true do |t|
@@ -211,13 +219,10 @@ ActiveRecord::Schema.define(:version => 20120620081755) do
add_index "group_of_lines", ["objectid"], :name => "group_of_lines_objectid_key", :unique => true
create_table "group_of_lines_lines", :id => false, :force => true do |t|
- t.integer "group_of_line_id", :limit => 8, :null => false
- t.integer "line_id", :limit => 8, :null => false
+ t.integer "group_of_line_id", :limit => 8
+ t.integer "line_id", :limit => 8
end
- add_index "group_of_lines_lines", ["group_of_line_id"], :name => "idx_grli_gr"
- add_index "group_of_lines_lines", ["line_id"], :name => "idx_grli_li"
-
create_table "import_log_messages", :force => true do |t|
t.integer "import_id"
t.string "key"
@@ -259,11 +264,10 @@ ActiveRecord::Schema.define(:version => 20120620081755) do
add_index "journey_patterns", ["objectid"], :name => "journey_patterns_objectid_key", :unique => true
create_table "journey_patterns_stop_points", :id => false, :force => true do |t|
- t.integer "journey_pattern_id", :limit => 8, :null => false
- t.integer "stop_point_id", :limit => 8, :null => false
+ t.integer "journey_pattern_id", :limit => 8
+ t.integer "stop_point_id", :limit => 8
end
- add_index "journey_patterns_stop_points", ["journey_pattern_id"], :name => "idx_jpsp_jpid"
add_index "journey_patterns_stop_points", ["journey_pattern_id"], :name => "index_journey_pattern_id_on_journey_patterns_stop_points"
create_table "lines", :force => true do |t|
@@ -326,8 +330,8 @@ ActiveRecord::Schema.define(:version => 20120620081755) do
t.datetime "updated_at"
t.string "prefix"
t.string "projection_type"
- t.string "bounding_box", :limit => nil
t.string "time_zone"
+ t.string "the_geom"
t.string "bounds"
end
@@ -353,8 +357,13 @@ ActiveRecord::Schema.define(:version => 20120620081755) do
t.integer "line_id", :limit => 8
end
- add_index "routing_constraints_lines", ["line_id"], :name => "idx_rcli_li"
- add_index "routing_constraints_lines", ["stop_area_id"], :name => "idx_rcli_st"
+ create_table "spatial_ref_sys", :id => false, :force => true do |t|
+ t.integer "srid", :null => false
+ t.string "auth_name", :limit => 256
+ t.integer "auth_srid"
+ t.string "srtext", :limit => 2048
+ t.string "proj4text", :limit => 2048
+ end
create_table "stop_areas", :force => true do |t|
t.integer "parent_id", :limit => 8
@@ -442,8 +451,8 @@ ActiveRecord::Schema.define(:version => 20120620081755) do
add_index "time_tables", ["objectid"], :name => "time_tables_objectid_key", :unique => true
create_table "time_tables_vehicle_journeys", :id => false, :force => true do |t|
- t.integer "time_table_id", :limit => 8, :null => false
- t.integer "vehicle_journey_id", :limit => 8, :null => false
+ t.integer "time_table_id", :limit => 8
+ t.integer "vehicle_journey_id", :limit => 8
end
add_index "time_tables_vehicle_journeys", ["time_table_id"], :name => "index_time_tables_vehicle_journeys_on_time_table_id"
@@ -477,12 +486,8 @@ ActiveRecord::Schema.define(:version => 20120620081755) do
t.time "waiting_time"
t.time "elapse_duration"
t.time "headway_frequency"
- t.integer "position", :limit => 8
- t.boolean "is_departure", :default => false
- t.boolean "is_arrival", :default => false
end
- add_index "vehicle_journey_at_stops", ["stop_point_id"], :name => "index_vehicle_journey_at_stops_on_stop_point_id"
add_index "vehicle_journey_at_stops", ["stop_point_id"], :name => "index_vehicle_journey_at_stops_on_stop_pointid"
add_index "vehicle_journey_at_stops", ["vehicle_journey_id"], :name => "index_vehicle_journey_at_stops_on_vehicle_journey_id"