aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Gemfile1
-rw-r--r--Gemfile.lock7
-rw-r--r--app/assets/stylesheets/connection_links.css.scss40
-rw-r--r--app/controllers/connection_links_controller.rb27
-rw-r--r--app/models/referential.rb4
-rw-r--r--app/views/connection_links/_connection_link.erb12
-rw-r--r--app/views/connection_links/_form.erb26
-rw-r--r--app/views/connection_links/edit.html.erb3
-rw-r--r--app/views/connection_links/index.html.erb22
-rw-r--r--app/views/connection_links/new.html.erb3
-rw-r--r--app/views/connection_links/show.html.erb47
-rw-r--r--app/views/help/companies.textile2
-rw-r--r--app/views/help/connection_links.textile46
-rw-r--r--app/views/help/index.textile9
-rw-r--r--app/views/help/normalisation.textile2
-rw-r--r--app/views/help/routes.textile38
-rw-r--r--app/views/help/toc.textile6
-rw-r--r--app/views/layouts/application.html.erb1
-rw-r--r--config/locales/connection_link_types.yml13
-rw-r--r--config/locales/connection_links.yml94
-rw-r--r--config/locales/directions.yml8
-rw-r--r--config/locales/lines.yml4
-rw-r--r--config/routes.rb2
-rw-r--r--db/migrate/20120426141032_create_chouette_connection_link.rb28
-rw-r--r--db/schema.rb25
-rw-r--r--spec/requests/connection_links_spec.rb60
-rw-r--r--spec/requests/time_tables_spec.rb50
-rw-r--r--spec/views/connection_links/edit.html.erb_spec.rb24
-rw-r--r--spec/views/connection_links/index.html.erb_spec.rb21
-rw-r--r--spec/views/connection_links/new.html.erb_spec.rb17
-rw-r--r--spec/views/connection_links/show.html.erb_spec.rb30
-rw-r--r--spec/views/time_tables/edit.html.erb_spec.rb23
-rw-r--r--spec/views/time_tables/index.html.erb_spec.rb21
-rw-r--r--spec/views/time_tables/new.html.erb_spec.rb17
-rw-r--r--spec/views/time_tables/show.html.erb_spec.rb24
35 files changed, 739 insertions, 18 deletions
diff --git a/Gemfile b/Gemfile
index 1ed841ed4..464c09285 100644
--- a/Gemfile
+++ b/Gemfile
@@ -26,6 +26,7 @@ gem 'inherited_resources'
gem 'will_paginate', '~> 3.0'
gem 'ransack'
gem 'squeel'
+gem 'RedCloth'
gem "acts_as_tree", :git => "git://github.com/dryade/acts_as_tree.git"
gem 'apartment', :git => 'git://github.com/dryade/apartment.git'
diff --git a/Gemfile.lock b/Gemfile.lock
index c22b08942..2e0505b07 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -1,6 +1,6 @@
GIT
remote: git://chouette.dryade.priv/ninoxe
- revision: 8b4136d1c06cc03c22443cae4408b5b173dca9b5
+ revision: d2bc7fde85bb5faf8830883a026ef0183f964eaa
specs:
ninoxe (0.0.8)
GeoRuby
@@ -51,6 +51,8 @@ GEM
remote: http://rubygems.org/
specs:
GeoRuby (1.3.4)
+ RedCloth (4.2.9)
+ RedCloth (4.2.9-java)
SyslogLogger (1.4.0)
hoe (>= 1.2.0)
actionmailer (3.1.3)
@@ -261,7 +263,7 @@ GEM
shoulda-context (1.0.0)
shoulda-matchers (1.0.0)
spoon (0.0.1)
- sprockets (2.0.3)
+ sprockets (2.0.4)
hike (~> 1.2)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
@@ -296,6 +298,7 @@ PLATFORMS
ruby
DEPENDENCIES
+ RedCloth
SyslogLogger
activerecord-jdbcpostgresql-adapter!
activerecord-jdbcsqlite3-adapter
diff --git a/app/assets/stylesheets/connection_links.css.scss b/app/assets/stylesheets/connection_links.css.scss
new file mode 100644
index 000000000..e3aedc918
--- /dev/null
+++ b/app/assets/stylesheets/connection_links.css.scss
@@ -0,0 +1,40 @@
+// Place all the styles related to the lines controller here.
+// They will automatically be included in application.css.
+// You can use Sass (SCSS) here: http://sass-lang.com/
+@import "common";
+
+#workspace.connection_links.index
+{
+ .connection_link:after {
+ @include after_div_for_object;
+ }
+
+ .connection_links {
+ margin-top: 20px;
+ }
+
+ .connection_links:after {
+ @include content_to_clear;
+ }
+
+ .connection_link {
+ @include div_for_object;
+
+ /* to create multi-column index */
+ width: 350px;
+ float: left;
+ padding-right: 10px;
+ }
+}
+
+
+#workspace.connection_links.show
+{
+
+ .summary p label {
+ font-weight: bold;
+ }
+}
+
+
+
diff --git a/app/controllers/connection_links_controller.rb b/app/controllers/connection_links_controller.rb
new file mode 100644
index 000000000..327fb7989
--- /dev/null
+++ b/app/controllers/connection_links_controller.rb
@@ -0,0 +1,27 @@
+class ConnectionLinksController < ChouetteController
+ defaults :resource_class => Chouette::ConnectionLink
+
+ belongs_to :referential do
+ #belongs_to :departure, :parent_class => Chouette::StopArea, :optional => false
+ #belongs_to :arrival, :parent_class => Chouette::StopArea, :optional => false
+ end
+
+ respond_to :html, :xml, :json
+
+
+ protected
+
+ def collection
+ @q = referential.connection_links.search(params[:q])
+ @connection_links ||= @q.result(:distinct => true).order(:name).paginate(:page => params[:page], :per_page => 10)
+ end
+
+ def resource_url(connection_link = nil)
+ referential_connection_link_path(referential, connection_link || resource)
+ end
+
+ def collection_url
+ referential_connection_links_path(referential)
+ end
+
+end
diff --git a/app/models/referential.rb b/app/models/referential.rb
index a05e3f065..c78c81a75 100644
--- a/app/models/referential.rb
+++ b/app/models/referential.rb
@@ -24,6 +24,10 @@ class Referential < ActiveRecord::Base
def time_tables
Chouette::TimeTable.scoped
end
+
+ def connection_links
+ Chouette::ConnectionLink.scoped
+ end
def switch
raise "Referential not created" if new_record?
diff --git a/app/views/connection_links/_connection_link.erb b/app/views/connection_links/_connection_link.erb
new file mode 100644
index 000000000..116adafb6
--- /dev/null
+++ b/app/views/connection_links/_connection_link.erb
@@ -0,0 +1,12 @@
+<%= div_for(connection_link) do %>
+ <%= link_to truncate(connection_link.name, :length => 30), [@referential, connection_link], :title => "Correspondance #{connection_link.name}" %>
+ <div class="info">
+ <%= connection_link.human_attribute_name('departure') %> <%= link_to_if connection_link.departure, connection_link.departure.name, referential_stop_area_path(@referential, connection_link.departure), :title => "#{connection_link.human_attribute_name('departure')} #{connection_link.departure.name}" %> -
+ <%= connection_link.human_attribute_name('arrival') %> <%= link_to_if( connection_link.arrival, connection_link.arrival.name, referential_stop_area_path(@referential, connection_link.arrival), :title => "#{connection_link.human_attribute_name('arrival')} #{connection_link.arrival.name}" ) %>
+
+ <div class="actions">
+ <%= link_to t("actions.edit"), edit_referential_connection_link_path(@referential, connection_link), :class => "edit" %> |
+ <%= link_to t("actions.destroy"), referential_connection_link_path(@referential, connection_link), :method => :delete, :confirm => t('connection_links.actions.destroy_confirm'), :class => "remove" %>
+ </div>
+ </div>
+<% end %>
diff --git a/app/views/connection_links/_form.erb b/app/views/connection_links/_form.erb
new file mode 100644
index 000000000..16174ec9a
--- /dev/null
+++ b/app/views/connection_links/_form.erb
@@ -0,0 +1,26 @@
+<!-- <%= @connection_link.errors.inspect %> -->
+<%= semantic_form_for [@referential, @connection_link] do |form| %>
+ <%= form.inputs do %>
+ <!--
+ <%= form.input :departure, :as => :select, :collection => Chouette::Network.all, :include_blank => false %>
+ <%= form.input :arrival, :as => :select, :collection => Chouette::Company.all, :include_blank => false%>
+ -->
+ <%= form.input :name %>
+ <%= form.input :connection_link_type, :as => :select, :collection => Chouette::ConnectionLink.connection_link_types, :include_blank => false, :member_label => Proc.new { |mode| t("connection_link_types.label.#{mode}") } %>
+ <%= form.input :comment %>
+ <% if @connection_link.new_record? %>
+ <%= form.input :objectid %>
+ <% else %>
+ <li>
+ <label><%= @connection_link.human_attribute_name("objectid") %>: </label>
+ <%= @connection_link.objectid %>
+ </li>
+ <% end %>
+ <% end %>
+
+ <%= form.buttons do %>
+ <%= form.commit_button true %>
+ <li><%= t('or') %></li>
+ <li><%= link_to t('cancel'), :back %></li>
+ <% end %>
+<% end %>
diff --git a/app/views/connection_links/edit.html.erb b/app/views/connection_links/edit.html.erb
new file mode 100644
index 000000000..77200420b
--- /dev/null
+++ b/app/views/connection_links/edit.html.erb
@@ -0,0 +1,3 @@
+<%= title_tag t('connection_links.edit.title', :connection_link => @connection_link.name ) %>
+
+<%= render "form" %>
diff --git a/app/views/connection_links/index.html.erb b/app/views/connection_links/index.html.erb
new file mode 100644
index 000000000..fdbd28021
--- /dev/null
+++ b/app/views/connection_links/index.html.erb
@@ -0,0 +1,22 @@
+<%= title_tag t('connection_links.index.title') %>
+
+<%= search_form_for @q, :url => referential_connection_links_path(@referential), :html => {:method => :get} do |f| %>
+ <%= f.label :name_cont, "#{t('.name')} :" %>
+ <%= f.text_field :name_cont %>
+
+ <%= f.submit t('actions.search') %> <%= t("or") %>
+ <%= link_to t("cancel"), referential_connection_links_path(@referential) %>
+<% end %>
+
+<%= will_paginate @connection_links %>
+<div class="connection_links paginated_content">
+ <%= render :partial => "connection_link", :collection => @connection_links %>
+</div>
+<%= will_paginate @connection_links %>
+
+<% content_for :sidebar do %>
+<ul class="actions">
+ <li><%= link_to t('connection_links.actions.new'), new_referential_connection_link_path(@referential), :class => "add" %></li>
+</ul>
+
+<% end %>
diff --git a/app/views/connection_links/new.html.erb b/app/views/connection_links/new.html.erb
new file mode 100644
index 000000000..bd098adc0
--- /dev/null
+++ b/app/views/connection_links/new.html.erb
@@ -0,0 +1,3 @@
+<%= title_tag t('connection_links.new.title') %>
+
+<%= render "form" %>
diff --git a/app/views/connection_links/show.html.erb b/app/views/connection_links/show.html.erb
new file mode 100644
index 000000000..cd564ce9b
--- /dev/null
+++ b/app/views/connection_links/show.html.erb
@@ -0,0 +1,47 @@
+<%= title_tag t('connection_links.show.title', :connection_link => @connection_link.name ) %>
+
+<div class="connection_link_show">
+
+ <div class="summary">
+ <p>
+ <label><%= @connection_link.human_attribute_name(:departure) %>: </label>
+ <%= link_to @connection_link.departure.name, [@referential, @connection_link.departure] %>
+ </p>
+ <p>
+ <label><%= @connection_link.human_attribute_name(:arrival) %>: </label>
+ <%= link_to @connection_link.arrival.name, [@referential, @connection_link.arrival] %>
+ </p>
+ <p>
+ <label><%= @connection_link.human_attribute_name("name") %>: </label>
+ <%= @connection_link.name %>
+ </p>
+ <p>
+ <label><%= @connection_link.human_attribute_name("link_type") %>: </label>
+ <%= t("connection_link_types.label.#{@connection_link.link_type}") %>
+ </p>
+ <p>
+ <label><%= @connection_link.human_attribute_name("comment") %>: </label>
+ <%= @connection_link.comment %>
+ </p>
+ <p>
+ <label><%= @connection_link.human_attribute_name("objectid") %>: </label>
+ <%= @connection_link.objectid %>
+ </p>
+ <p>
+ <label><%= @connection_link.human_attribute_name("creation_time") %>: </label>
+ <%= @connection_link.creation_time %>
+ </p>
+ <p>
+ <label><%= @connection_link.human_attribute_name("creator_id") %>: </label>
+ <%= @connection_link.creator_id %>
+ </p>
+ </div>
+</div>
+
+<% content_for :sidebar do %>
+<ul class="actions">
+ <li><%= link_to t('connection_links.actions.edit'), edit_referential_connection_link_path(@referential, @connection_link), :class => "edit" %></li>
+ <li><%= link_to t('connection_links.actions.destroy'), referential_connection_link_path(@referential, @connection_link), :method => :delete, :confirm => t('connection_links.actions.destroy_confirm'), :class => "remove" %></li>
+ <br>
+</ul>
+<% end %>
diff --git a/app/views/help/companies.textile b/app/views/help/companies.textile
index c1db6f4d3..0b89d9796 100644
--- a/app/views/help/companies.textile
+++ b/app/views/help/companies.textile
@@ -9,7 +9,7 @@ Dans la r&eacute;alit&eacute;, le transporteur est l'entit&eacute; en charge de
Ce principe se retrouve dans ce logiciel.
* Il s'agit de l'exploitant de la ligne; chaque ligne est rattach&eacute;e &agrave; un seul transporteur, un transporteur pouvant &eacute;videmment g&eacute;rer plusieurs lignes.
-* Chaque transporteur dispose d'un identifiant fonctionnel (&laquo; num&eacute;ro d'enregistrement &raquo;) qui est utilis&eacute; dans les &eacute;changes XML pour identifier le transporteur et le mettre &agrave; jour. Cet identifiant est unique pour toute la base CHOUETTE, quel que soit le r&eacute;seau ; il est donc important que le gestionnaire de la base CHOUETTE le renseigne d'une mani&egrave;re bien d&eacute;finie et p&eacute;renne.
+* Chaque transporteur dispose d'un identifiant fonctionnel (&laquo; num&eacute;ro d'enregistrement &raquo;) qui est utilis&eacute; dans les &eacute;changes XML pour identifier le transporteur et le mettre &agrave; jour. Cet identifiant est unique pour toute la base CHOUETTE, quel que soit le r&eacute;seau ; il est donc important que le gestionnaire de la base CHOUETTE le renseigne d'une mani&egrave;re bien d&eacute;finie et p&eacute;renne.
h3. Attributs
diff --git a/app/views/help/connection_links.textile b/app/views/help/connection_links.textile
new file mode 100644
index 000000000..4969db77d
--- /dev/null
+++ b/app/views/help/connection_links.textile
@@ -0,0 +1,46 @@
+---
+layout: default
+title: Correspondances
+---
+
+h3. D&eacute;finition
+
+Une correspondance ou un changement est, dans un voyage en transports en commun, une &eacute;tape n&eacute;cessitant de changer de ligne. Le changement peut se faire soit au sein du m&ecirc;me r&eacute;seau, soit de mani&egrave;re intermodale, c'est-&agrave;-dire en changeant &eacute;galement de mode de transport.
+La correspondance permet d'&eacute;tablir une liaison entre un arr&ecirc;t physique (ou une zone d'arr&ecirc;t de type &laquo; arr&ecirc;t commercial &raquo; ou de type &laquo; p&ocirc;le d'&eacute;change &raquo;) et un autre arr&ecirc;t physique (ou une autre zone d'arr&ecirc;t de type &laquo; arr&ecirc;t commercial &raquo; ou de type &laquo; p&ocirc;le d'&eacute;change &raquo;).
+Cette liaison d&eacute;finit aussi une dur&eacute;e de parcours entre les arr&ecirc;ts (ou zones) reli&eacute;s.
+
+h3. Attributs
+
+- Nom := nom de la correspondances
+- Commentaire := zone de texte libre
+- Distance := distance en m&egrave;tres
+- Type := liste de choix parmi &laquo; A&eacute;rien &raquo;, &laquo; Souterrain&raquo; ou mixte &laquo; A&eacute;rien et souterrain &raquo;
+- D&eacute;part := arr&ecirc;t de d&eacute;part de la correspondance
+- Arriv&eacute;e := arr&ecirc;t d'arriv&eacute;e de la correspondance
+- Dur&eacute;e moyenne := champ de type horaire hh:mm
+- Dur&eacute;e pour un voyageur &agrave; mobilit&eacute; r&eacute;duite := champ de type horaire hh:mm
+- Dur&eacute;e pour un voyageur occasionnel := champ de type horaire hh:mm
+- Dur&eacute;e pour un habitu&eacute; := champ de type horaire hh:mm
+- Ascenseur := indicateur (Oui ou Non)
+- Acc&egrave;s pour personne &agrave; mobilit&eacute; r&eacute;duite := indicateur (Oui ou Non)
+- Escalator disponible := indicateur (Oui ou Non)
+
+p(attr_data). Donn&eacute;es de gestion :
+
+- Identifiant Neptune :=
+cl&eacute; unique p&eacute;renne identifiant la correspondance pour les &eacute;changes Neptune
+cet identifiant est compos&eacute; de 3 parties : pr&eacute;fixe:type:id_technique
+* pr&eacute;fixe : cl&eacute; identifiant un producteur de donn&eacute;es unique
+* type = ConnectionLink : cl&eacute; identifiant le type d'objet (valeur impos&eacute;e)
+* id_technique : valeur identifiant un seul object d'un type donn&eacute; pour un m&ecirc;me producteur
+ce champ obligatoire est automatiquement g&eacute;n&eacute;r&eacute; s'il n'est pas renseign&eacute;
+il est possible aussi de ne renseigner que le pr&eacute;fixe auquel cas la valeur sera compl&eacute;t&eacute;e automatiquement.
+=:
+- Date de cr&eacute;ation := date &agrave; laquelle l'objet a &eacute;t&eacute; cr&eacute;&eacute; ou modifi&eacute; pour la derni&egrave;re fois
+- Version := version de l'objet (auto incr&eacute;ment&eacute; &agrave; chaque modification)
+- Cr&eacute;&eacute; par := compte utilisateur ayant proc&eacute;d&eacute; &agrave; la derni&egrave;re modification
+
+h3. Impl&eacute;mentation
+
+p. TODO
+
diff --git a/app/views/help/index.textile b/app/views/help/index.textile
index c3b5ee2bd..73c0f04c1 100644
--- a/app/views/help/index.textile
+++ b/app/views/help/index.textile
@@ -3,7 +3,7 @@ layout: default
title: Présentation
---
-Chouette v2 : it&eacute;ration 4 du 16/04/2012
+Chouette v2 : it&eacute;ration 5 du 07/05/2012
Cette it&eacute;ration pr&eacute;sente les formulaires de :
@@ -12,16 +12,19 @@ Cette it&eacute;ration pr&eacute;sente les formulaires de :
* lignes
* arr&ecirc;ts
* calendriers d'application
+* correspondances
+* s&eacute;quences d'arr&ecirc;ts
l'avancement actuel permet de :
* cr&eacute;er, modifier et supprimer les objets
* consulter les cartes
+* d&eacute;placer un arr&ecirc;t depuis la carte
+* associer les arr&ecirc;ts &agrave; leurs parents
les action suivantes ne sont pas encore disponible :
-* d&eacute;placer un arr&ecirc;t depuis la carte
* afficher le fond G&eacute;oportail
* ajouter ou supprimer des dates et des p&eacute;riodes aux calendriers
-* associer les arr&ecirc;ts &agrave; leurs parents
* associer une ITL &agrave; une ligne
+
diff --git a/app/views/help/normalisation.textile b/app/views/help/normalisation.textile
index 2790d5320..6d7793eb4 100644
--- a/app/views/help/normalisation.textile
+++ b/app/views/help/normalisation.textile
@@ -21,7 +21,7 @@ Ces sp&eacute;cifications d'&eacute;change couvrent l'information VP et TC, th&e
* un mod&egrave;le de donn&eacute;es orient&eacute; objets d&eacute;crit en UML, reprenant pour ce qui concerne les transports publics, le mod&egrave;le conceptuel de donn&eacute;es Transmodel V4.0, normalis&eacute; au niveau europ&eacute;en ;
* un format d'&eacute;change XML sp&eacute;cifi&eacute; sous forme de sch&eacute;mas XSD.
-Les sp&eacute;cifications TRIDENT ont &eacute;t&eacute; impl&eacute;ment&eacute;es dans plusieurs pays europ&eacute;ens, et en France ont &eacute;t&eacute; mises en &oelig;uvre par la RATP pour son syst&egrave;me d'information sur les situations perturb&eacute;es SIPRE, et &eacute;galement pour les &eacute;changes d'information au niveau francilien en cours entre les syst&egrave;mes de la RATP et du STIF, pour ce qui concerne l'information th&eacute;orique.
+Les sp&eacute;cifications TRIDENT ont &eacute;t&eacute; impl&eacute;ment&eacute;es dans plusieurs pays europ&eacute;ens, et en France ont &eacute;t&eacute; mises en &&oelig;lig;uvre par la RATP pour son syst&egrave;me d'information sur les situations perturb&eacute;es SIPRE, et &eacute;galement pour les &eacute;changes d'information au niveau francilien en cours entre les syst&egrave;mes de la RATP et du STIF, pour ce qui concerne l'information th&eacute;orique.
Le travail du groupe GT7 a abouti &agrave; des sp&eacute;cifications de profil d'&eacute;change TRIDENT / Chouette en 2006, qui ont servi de r&eacute;f&eacute;rence pour impl&eacute;menter le logiciel CHOUETTE et sont utilis&eacute;es depuis lors par plusieurs projets de SIM en France.
diff --git a/app/views/help/routes.textile b/app/views/help/routes.textile
new file mode 100644
index 000000000..f02946b41
--- /dev/null
+++ b/app/views/help/routes.textile
@@ -0,0 +1,38 @@
+---
+layout: default
+title: Séquence d'arrêts
+---
+
+h3. D&eacute;finition
+
+La s&eacute;quence d'arr&ecirc;ts est une s&eacute;lection ordonn&eacute;e de r&eacute;f&eacute;rences aux points d'arr&ecirc;t (exemple: itin&eacute;raires aller et retour d'une ligne). Une s&eacute;quence d'arr&ecirc;ts est sp&eacute;cifique &agrave; une ligne; les s&eacute;quences d'arr&ecirc;ts peuvent r&eacute;f&eacute;rencer des arr&ecirc;ts communs.
+
+h3. Attributs
+
+- Nom := nom de la s&eacute;quence d'arr&ecirc;ts
+- Nom public := nom public pour les voyageurs
+- Commentaire := zone de texte libre sur le r&eacute;seau
+- Direction := orientation principale (points cardinaux, circulaire ou aller/retour)
+- Indoce := num&eacute;ro de la s&eacute;quence d'arr&ecirc;ts
+- Sens := aller ou retour
+- Itin&eacute;raire associ&eacute; en sens oppos&eacute; := r&eacute;f&eacute;rence de l'itin&eacute;raire de sens oppos&eacute; associ&eacute;
+
+p(attr_data). Donn&eacute;es de gestion :
+
+- Identifiant Neptune :=
+cl&eacute; unique p&eacute;renne identifiant la s&eacute;quence d'arr&ecirc;ts pour les &eacute;changes Neptune
+cet identifiant est compos&eacute; de 3 parties : pr&eacute;fixe:type:id_technique
+* pr&eacute;fixe : cl&eacute; identifiant un producteur de donn&eacute;es unique
+* type = Route : cl&eacute; identifiant le type d'objet (valeur impos&eacute;e)
+* id_technique : valeur identifiant un seul object d'un type donn&eacute; pour un m&ecirc;me producteur
+ce champ obligatoire est automatiquement g&eacute;n&eacute;r&eacute; s'il n'est pas renseign&eacute;
+il est possible aussi de ne renseigner que le pr&eacute;fixe auquel cas la valeur sera compl&eacute;t&eacute;e automatiquement.
+=:
+- Date de cr&eacute;ation := date &agrave; laquelle l'objet a &eacute;t&eacute; cr&eacute;&eacute; ou modifi&eacute; pour la derni&egrave;re fois
+- Version := version de l'objet (auto incr&eacute;ment&eacute; &agrave; chaque modification)
+- Cr&eacute;&eacute; par := compte utilisateur ayant proc&eacute;d&eacute; &agrave; la derni&egrave;re modification
+
+h3. Impl&eacute;mentation
+
+p. TODO
+
diff --git a/app/views/help/toc.textile b/app/views/help/toc.textile
index f4f6998f8..e3ed1ba6f 100644
--- a/app/views/help/toc.textile
+++ b/app/views/help/toc.textile
@@ -1,6 +1,6 @@
---
layout: default
-title: sommaire
+title: Sommaire
---
h3. Sommaire
@@ -11,10 +11,10 @@ h3. Sommaire
# "R&eacute;seaux":networks
# "Transporteurs":companies
# "Lignes":lines
-## S&eacute;quences d'arr&ecirc;ts
+## "S&eacute;quences d'arr&ecirc;ts":routes
## Horaires
# "Arr&ecirc;ts":stop_areas
-## Correspondances
+## "Correspondances":connection_links
## Acc&egrave;s
## Liaisons Arr&ecirc;t-Acc&egrave;s
# "Calendriers d'application":timetables
diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb
index 9c48ff00b..d757c92d4 100644
--- a/app/views/layouts/application.html.erb
+++ b/app/views/layouts/application.html.erb
@@ -41,6 +41,7 @@
<li><%= tab_link_to Chouette::Company, referential_companies_path(@referential) %></li>
<li><%= tab_link_to Chouette::Line, referential_lines_path(@referential) %></li>
<li><%= tab_link_to Chouette::StopArea, referential_stop_areas_path(@referential) %></li>
+ <li><%= tab_link_to Chouette::ConnectionLink, referential_connection_links_path(@referential) %></li>
<li><%= tab_link_to Chouette::TimeTable, referential_time_tables_path(@referential) %></li>
<% end %>
</ul>
diff --git a/config/locales/connection_link_types.yml b/config/locales/connection_link_types.yml
new file mode 100644
index 000000000..f896e1883
--- /dev/null
+++ b/config/locales/connection_link_types.yml
@@ -0,0 +1,13 @@
+en:
+ connection_link_types:
+ label:
+ Underground: Underground
+ Mixed: Mixed
+ Overground: Overground
+
+fr:
+ connection_link_types:
+ label:
+ Underground: Souterrain
+ Mixed: Mixte
+ Overground: Aérien
diff --git a/config/locales/connection_links.yml b/config/locales/connection_links.yml
new file mode 100644
index 000000000..5eb2bbacf
--- /dev/null
+++ b/config/locales/connection_links.yml
@@ -0,0 +1,94 @@
+en:
+ connection_links:
+ actions:
+ new: Add a new connection link
+ edit: Edit this connection link
+ destroy: Remove this liconnection linkne
+ destroy_confirm: Are you sure you want destroy this connection link?
+ new:
+ title: Add a new connection link
+ edit:
+ title: Update connection link %{connection_link}
+ show:
+ title: Connection link %{connection_link}
+ index:
+ title: Connection_ links
+ name: Name
+ departure: Start of link
+ arrival: End of link
+ selection: Selection
+ selection_all: All
+ activerecord:
+ models:
+ connection_link: Connection link
+ attributes:
+ connection_link:
+ departure: Start of link
+ arrival: End of link
+ name: Name
+ comment: Comment
+ linkdistance: Distance
+ connection_link_type: Type
+ defaultduration: Average duration
+ frequenttravellerduration: Regular passenger duration
+ occasionaltravellerduration: Occasional passenger duration
+ mobilityrestrictedtravellerduration: Mobility reduced passenger duration
+ mobilityrestrictedsuitability: Mobility reduced passenger suitable
+ stairsavailability: Escalator
+ liftavailability: Lift
+ objectid: Neptune identifier
+ object_version: Version
+ creation_time: Created on
+ creator_id: Created by
+ formtastic:
+ hints:
+ connection_link:
+ objectid: "[prefix]:ConnectionLink:[unique_key] : prefix contains only alphanumerical or underscore characters, unique_key accepts also minus character"
+
+fr:
+ connection_links:
+ actions:
+ new: Ajouter une correspondance
+ edit: Modifier cette correspondance
+ destroy: Supprimer cette correspondance
+ destroy_confirm: Etes vous sûr de détruire cette correspondance ?
+ new:
+ title: Ajouter une correspondance
+ edit:
+ title: Modifier la correspondance %{connection_link}
+ show:
+ title: Correspondance %{connection_link}
+ index:
+ name: Nom ou indice
+ title: Correspondances
+ departure: Arrêt de départ
+ arrival: "Arrêt d'arrivée"
+ selection: Sélection
+ selection_all: Tous
+ activerecord:
+ models:
+ connection_link: Correspondance
+ attributes:
+ connection_link:
+ departure: Arrêt de départ
+ arrival: "Arrêt d'arrivée"
+ name: Nom
+ comment: Commentaire
+ linkdistance: Distance
+ connection_link_type: Type
+ defaultduration: Durée moyenne
+ frequenttravellerduration: Durée pour un habitué
+ occasionaltravellerduration: Durée pour un voyageur occasionnel
+ mobilityrestrictedtravellerduration: Durée pour un voyageur à mobilité réduite
+ mobilityrestrictedsuitability: Accès pour personne à mobilité réduite
+ stairsavailability: Escalator
+ liftavailability: Ascenseur
+ objectid: Identifiant Neptune
+ object_version: Version
+ creation_time: Créé le
+ creator_id: Créé par
+ formtastic:
+ hints:
+ connection_link:
+ objectid: "[prefixe]:ConnectionLink:[clé_unique] caractères autorisés : alphanumériques et 'souligné' pour le préfixe, la clé unique accepte en plus le 'moins'"
+
diff --git a/config/locales/directions.yml b/config/locales/directions.yml
index 82b87673a..8e59b0b84 100644
--- a/config/locales/directions.yml
+++ b/config/locales/directions.yml
@@ -3,8 +3,8 @@ en:
label:
straight_forward: straight forward
backward: backward
- clockwise: clockwise
- anti_clockwise: anticlockwise
+ clock_wise: clockwise
+ counter_clock_wise: counterclockwise
north: north
north_west: north west
west: west
@@ -18,8 +18,8 @@ fr:
label:
straight_forward: aller
backward: retour
- clockwise: sens horaire
- anti_clockwise: sens anti horaire
+ clock_wise: sens horaire
+ counter_clock_wise: sens anti horaire
north: nord
north_west: nord ouest
west: ouest
diff --git a/config/locales/lines.yml b/config/locales/lines.yml
index 490a7b630..a2ba7df95 100644
--- a/config/locales/lines.yml
+++ b/config/locales/lines.yml
@@ -28,7 +28,7 @@ en:
name: Name
published_name: Published name
number: Number
- transport_mode_name: Transport mode
+ transport_mode: Transport mode
comment: Comments
objectid: Neptune identifier
object_version: Version
@@ -70,7 +70,7 @@ fr:
name: Nom
published_name: Nom public
number: Indice
- transport_mode_name: Mode de transport
+ transport_mode: Mode de transport
comment: Commentaire
objectid: Identifiant Neptune
object_version: Version
diff --git a/config/routes.rb b/config/routes.rb
index 4aaedc87b..1cf771edb 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -20,7 +20,7 @@ ChouetteIhm::Application.routes.draw do
resources :routes
end
- resources :companies, :stop_areas, :time_tables
+ resources :companies, :stop_areas, :time_tables, :connection_links
end
match '/help/(*slug)' => 'help#show'
diff --git a/db/migrate/20120426141032_create_chouette_connection_link.rb b/db/migrate/20120426141032_create_chouette_connection_link.rb
new file mode 100644
index 000000000..185c49af2
--- /dev/null
+++ b/db/migrate/20120426141032_create_chouette_connection_link.rb
@@ -0,0 +1,28 @@
+class CreateChouetteConnectionLink < ActiveRecord::Migration
+ def up
+ create_table "connectionlink", :force => true do |t|
+ t.integer "departureid", :limit => 8
+ t.integer "arrivalid", :limit => 8
+ t.string "objectid", :null => false
+ t.integer "objectversion"
+ t.datetime "creationtime"
+ t.string "creatorid"
+ t.string "name"
+ t.string "comment"
+ t.decimal "linkdistance", :precision => 19, :scale => 2
+ t.string "linktype"
+ t.time "defaultduration"
+ t.time "frequenttravellerduration"
+ t.time "occasionaltravellerduration"
+ t.time "mobilityrestrictedtravellerduration"
+ t.boolean "mobilityrestrictedsuitability"
+ t.boolean "stairsavailability"
+ t.boolean "liftavailability"
+ t.integer "intuserneeds"
+ end
+ add_index "connectionlink", ["objectid"], :name => "connectionlink_objectid_key", :unique => true
+ end
+
+ def down
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 07dc4922d..7666b10bf 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -10,7 +10,7 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20120425125542) do
+ActiveRecord::Schema.define(:version => 20120426141032) do
create_table "company", :force => true do |t|
t.string "objectid"
@@ -31,6 +31,29 @@ ActiveRecord::Schema.define(:version => 20120425125542) do
add_index "company", ["objectid"], :name => "company_objectid_key", :unique => true
add_index "company", ["registrationnumber"], :name => "company_registrationnumber_key", :unique => true
+ create_table "connectionlink", :force => true do |t|
+ t.integer "departureid", :limit => 8
+ t.integer "arrivalid", :limit => 8
+ t.string "objectid", :null => false
+ t.integer "objectversion"
+ t.datetime "creationtime"
+ t.string "creatorid"
+ t.string "name"
+ t.string "comment"
+ t.decimal "linkdistance", :precision => 19, :scale => 2
+ t.string "linktype"
+ t.time "defaultduration"
+ t.time "frequenttravellerduration"
+ t.time "occasionaltravellerduration"
+ t.time "mobilityrestrictedtravellerduration"
+ t.boolean "mobilityrestrictedsuitability"
+ t.boolean "stairsavailability"
+ t.boolean "liftavailability"
+ t.integer "intuserneeds"
+ end
+
+ add_index "connectionlink", ["objectid"], :name => "connectionlink_objectid_key", :unique => true
+
create_table "line", :force => true do |t|
t.integer "ptnetworkid", :limit => 8
t.integer "companyid", :limit => 8
diff --git a/spec/requests/connection_links_spec.rb b/spec/requests/connection_links_spec.rb
new file mode 100644
index 000000000..c40e81970
--- /dev/null
+++ b/spec/requests/connection_links_spec.rb
@@ -0,0 +1,60 @@
+# -*- coding: utf-8 -*-
+require 'spec_helper'
+
+describe "ConnectionLinks" do
+ login_user
+
+ let!(:referential) { create(:referential).switch }
+ let!(:connection_links) { referential; Array.new(2) { create(:connection_link) } }
+ subject { connection_links.first }
+
+ describe "list" do
+ it "display connection_links" do
+ visit referential_connection_links_path(referential)
+ page.should have_content(connection_links.first.name)
+ page.should have_content(connection_links.last.name)
+ end
+
+ end
+
+ describe "show" do
+ it "display connection_link" do
+ visit referential_connection_links_path(referential)
+ click_link "#{connection_links.first.name}"
+ page.should have_content(connection_links.first.name)
+ end
+
+ it "display map" do
+ pending ": map not yet implemented"
+# subject.stub(:stop_areas).and_return(Array.new(2) { Factory(:stop_area) })
+# visit referential_connection_links_path(referential)
+# click_link "#{connection_links.first.name}"
+# page.should have_selector("#map", :class => 'connection_link')
+ end
+
+ end
+
+ describe "new" do
+ pending ": TODO see how to affect departure and arrival"
+# it "creates connection_link and return to show" do
+# visit referential_connection_links_path(referential)
+# click_link "Ajouter une correspondance"
+# fill_in "Nom", :with => "ConnectionLink 1"
+# fill_in "Identifiant Neptune", :with => "test:Timetable:1"
+# click_button("Créer Correspondance")
+# page.should have_content("ConnectionLink 1")
+# end
+ end
+
+ describe "edit and return to show" do
+ pending ": TODO see how to affect departure and arrival"
+# it "edit connection_link" do
+# visit referential_connection_link_path(referential, subject)
+# click_link "Modifier cette correspondance"
+# fill_in "Nom", :with => "ConnectionLink Modified"
+# click_button("Modifier Correspondance")
+# page.should have_content("ConnectionLink Modified")
+# end
+ end
+
+end
diff --git a/spec/requests/time_tables_spec.rb b/spec/requests/time_tables_spec.rb
new file mode 100644
index 000000000..720370ead
--- /dev/null
+++ b/spec/requests/time_tables_spec.rb
@@ -0,0 +1,50 @@
+# -*- coding: utf-8 -*-
+require 'spec_helper'
+
+describe "TimeTables" do
+ login_user
+
+ let!(:referential) { create(:referential).switch }
+ let!(:time_tables) { referential; Array.new(2) { create(:time_table) } }
+ subject { time_tables.first }
+
+ describe "list" do
+ it "display time_tables" do
+ visit referential_time_tables_path(referential)
+ page.should have_content(time_tables.first.comment)
+ page.should have_content(time_tables.last.comment)
+ end
+
+ end
+
+ describe "show" do
+ it "display time_table" do
+ visit referential_time_tables_path(referential)
+ click_link "#{time_tables.first.comment}"
+ page.should have_content(time_tables.first.comment)
+ end
+
+ end
+
+ describe "new" do
+ it "creates time_table and return to show" do
+ visit referential_time_tables_path(referential)
+ click_link "Ajouter un calendrier"
+ fill_in "Description", :with => "TimeTable 1"
+ fill_in "Identifiant Neptune", :with => "test:Timetable:1"
+ click_button("Créer Calendrier")
+ page.should have_content("TimeTable 1")
+ end
+ end
+
+ describe "edit and return to show" do
+ it "edit time_table" do
+ visit referential_time_table_path(referential, subject)
+ click_link "Modifier ce calendrier"
+ fill_in "Description", :with => "TimeTable Modified"
+ click_button("Modifier Calendrier")
+ page.should have_content("TimeTable Modified")
+ end
+ end
+
+end
diff --git a/spec/views/connection_links/edit.html.erb_spec.rb b/spec/views/connection_links/edit.html.erb_spec.rb
new file mode 100644
index 000000000..331529ff8
--- /dev/null
+++ b/spec/views/connection_links/edit.html.erb_spec.rb
@@ -0,0 +1,24 @@
+require 'spec_helper'
+
+describe "/connection_links/edit" do
+ let!(:referential) { assign(:referential, create(:referential)) }
+ let!(:connection_link) { assign(:connection_link, create(:connection_link)) }
+ let!(:connection_links) { Array.new(2) { create(:connection_link) } }
+
+ describe "test" do
+ it "should render h2 with the connection_link name" do
+ render
+ rendered.should have_selector("h2", :text => Regexp.new(connection_link.name))
+ end
+ end
+
+ describe "form" do
+ it "should render input for name" do
+ render
+ rendered.should have_selector("form") do
+ with_tag "input[type=text][name='connection_link[name]'][value=?]", connection_link.name
+ end
+ end
+ end
+
+end
diff --git a/spec/views/connection_links/index.html.erb_spec.rb b/spec/views/connection_links/index.html.erb_spec.rb
new file mode 100644
index 000000000..9732c16c5
--- /dev/null
+++ b/spec/views/connection_links/index.html.erb_spec.rb
@@ -0,0 +1,21 @@
+require 'spec_helper'
+
+describe "/connection_links/index" do
+
+ let!(:referential) { assign( :referential, create(:referential) ) }
+ let!(:connection_links) { assign :connection_links, Array.new(2) { create(:connection_link) }.paginate }
+ let!(:search) { assign :q, Ransack::Search.new(Chouette::ConnectionLink) }
+
+ it "should render a show link for each group" do
+ render
+ connection_links.each do |connection_link|
+ rendered.should have_selector(".connection_link a[href='#{view.referential_connection_link_path(referential, connection_link)}']", :text => connection_link.name)
+ end
+ end
+
+ it "should render a link to create a new group" do
+ render
+ view.content_for(:sidebar).should have_selector(".actions a[href='#{new_referential_connection_link_path(referential)}']")
+ end
+
+end
diff --git a/spec/views/connection_links/new.html.erb_spec.rb b/spec/views/connection_links/new.html.erb_spec.rb
new file mode 100644
index 000000000..1e9ee570d
--- /dev/null
+++ b/spec/views/connection_links/new.html.erb_spec.rb
@@ -0,0 +1,17 @@
+require 'spec_helper'
+
+describe "/connection_links/new" do
+ let!(:referential) { assign(:referential, create(:referential)) }
+ let!(:connection_link) { assign(:connection_link, build(:connection_link)) }
+
+ describe "form" do
+
+ it "should render input for name" do
+ render
+ rendered.should have_selector("form") do
+ with_selector "input[type=text][name=?]", connection_link.name
+ end
+ end
+
+ end
+end
diff --git a/spec/views/connection_links/show.html.erb_spec.rb b/spec/views/connection_links/show.html.erb_spec.rb
new file mode 100644
index 000000000..bc8d075cf
--- /dev/null
+++ b/spec/views/connection_links/show.html.erb_spec.rb
@@ -0,0 +1,30 @@
+require 'spec_helper'
+
+describe "/connection_links/show" do
+
+ let!(:referential) { assign(:referential, create(:referential)) }
+ let!(:connection_link) { assign(:connection_link, create(:connection_link)) }
+
+ it "should render h2 with the connection_link name" do
+ render
+ rendered.should have_selector("h2", :text => Regexp.new(connection_link.name))
+ end
+
+ it "should display a map with class 'connection_link'" do
+ pending ": map not yet implemented"
+ # render
+ # rendered.should have_selector("#map", :class => 'connection_link')
+ end
+
+ it "should render a link to edit the connection_link" do
+ render
+ view.content_for(:sidebar).should have_selector(".actions a[href='#{view.edit_referential_connection_link_path(referential, connection_link)}']")
+ end
+
+ it "should render a link to remove the connection_link" do
+ render
+ view.content_for(:sidebar).should have_selector(".actions a[href='#{view.referential_connection_link_path(referential, connection_link)}'][class='remove']")
+ end
+
+end
+
diff --git a/spec/views/time_tables/edit.html.erb_spec.rb b/spec/views/time_tables/edit.html.erb_spec.rb
new file mode 100644
index 000000000..6baf741fc
--- /dev/null
+++ b/spec/views/time_tables/edit.html.erb_spec.rb
@@ -0,0 +1,23 @@
+require 'spec_helper'
+
+describe "/time_tables/edit" do
+ let!(:referential) { assign(:referential, create(:referential)) }
+ let!(:time_table) { assign(:time_table, create(:time_table) ) }
+
+ describe "test" do
+ it "should render h2 with the group comment" do
+ render
+ rendered.should have_selector("h2", :text => Regexp.new(time_table.comment))
+ end
+ end
+
+ describe "form" do
+ it "should render input for comment" do
+ render
+ rendered.should have_selector("form") do
+ with_tag "input[type=text][comment='time_table[comment]'][value=?]", time_table.comment
+ end
+ end
+
+ end
+end
diff --git a/spec/views/time_tables/index.html.erb_spec.rb b/spec/views/time_tables/index.html.erb_spec.rb
new file mode 100644
index 000000000..7d56ad982
--- /dev/null
+++ b/spec/views/time_tables/index.html.erb_spec.rb
@@ -0,0 +1,21 @@
+require 'spec_helper'
+
+describe "/time_tables/index" do
+
+ let!(:referential) { assign :referential, create(:referential) }
+ let!(:time_tables) { assign :time_tables, Array.new(2){ create(:time_table) }.paginate }
+ let!(:search) { assign :q, Ransack::Search.new(Chouette::TimeTable) }
+
+ it "should render a show link for each group" do
+ render
+ time_tables.each do |time_table|
+ rendered.should have_selector(".time_table a[href='#{view.referential_time_table_path(referential, time_table)}']", :text => time_table.comment)
+ end
+ end
+
+ it "should render a link to create a new group" do
+ render
+ view.content_for(:sidebar).should have_selector(".actions a[href='#{new_referential_time_table_path(referential)}']")
+ end
+
+end
diff --git a/spec/views/time_tables/new.html.erb_spec.rb b/spec/views/time_tables/new.html.erb_spec.rb
new file mode 100644
index 000000000..dd7a35b3b
--- /dev/null
+++ b/spec/views/time_tables/new.html.erb_spec.rb
@@ -0,0 +1,17 @@
+require 'spec_helper'
+
+describe "/time_tables/new" do
+ let!(:referential) { assign(:referential, create(:referential)) }
+ let!(:time_table) { assign(:time_table, build(:time_table)) }
+
+ describe "form" do
+
+ it "should render input for comment" do
+ render
+ rendered.should have_selector("form") do
+ with_selector "input[type=text][comment=?]", time_table.comment
+ end
+ end
+
+ end
+end
diff --git a/spec/views/time_tables/show.html.erb_spec.rb b/spec/views/time_tables/show.html.erb_spec.rb
new file mode 100644
index 000000000..056919b2b
--- /dev/null
+++ b/spec/views/time_tables/show.html.erb_spec.rb
@@ -0,0 +1,24 @@
+require 'spec_helper'
+
+describe "/time_tables/show" do
+
+ let!(:referential) { assign(:referential, create(:referential)) }
+ let!(:time_table) { assign(:time_table, create(:time_table)) }
+
+ it "should render h2 with the time_table comment" do
+ render
+ rendered.should have_selector("h2", :text => Regexp.new(time_table.comment))
+ end
+
+ it "should render a link to edit the time_table" do
+ render
+ view.content_for(:sidebar).should have_selector(".actions a[href='#{view.edit_referential_time_table_path(referential, time_table)}']")
+ end
+
+ it "should render a link to remove the time_table" do
+ render
+ view.content_for(:sidebar).should have_selector(".actions a[href='#{view.referential_time_table_path(referential, time_table)}'][class='remove']")
+ end
+
+end
+