aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/assets/stylesheets/time_tables.css.scss113
-rw-r--r--app/controllers/time_tables_controller.rb23
-rw-r--r--app/views/time_tables/_date.erb3
-rw-r--r--app/views/time_tables/_form.erb42
-rw-r--r--app/views/time_tables/_form_date.erb5
-rw-r--r--app/views/time_tables/_form_period.erb6
-rw-r--r--app/views/time_tables/_period.erb3
-rw-r--r--app/views/time_tables/_time_table.erb9
-rw-r--r--app/views/time_tables/edit.html.erb3
-rw-r--r--app/views/time_tables/index.html.erb23
-rw-r--r--app/views/time_tables/new.html.erb3
-rw-r--r--app/views/time_tables/show.html.erb68
-rw-r--r--config/initializers/ui_datepicker-rails3.rb1
-rw-r--r--config/locales/time_tables.yml94
-rw-r--r--doc/functional/dataspaces.textile21
-rw-r--r--doc/functional/introduction.textile5
-rw-r--r--doc/functional/timetables.textile39
17 files changed, 461 insertions, 0 deletions
diff --git a/app/assets/stylesheets/time_tables.css.scss b/app/assets/stylesheets/time_tables.css.scss
new file mode 100644
index 000000000..e6fb6cec3
--- /dev/null
+++ b/app/assets/stylesheets/time_tables.css.scss
@@ -0,0 +1,113 @@
+// 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/
+@mixin div_for_object {
+ margin-bottom: 20px;
+
+ .color {
+ width: 64px;
+ height: 64px;
+ float: left;
+ margin-right: 10px;
+ }
+
+ img {
+ float: left;
+ margin-right: 10px;
+ }
+
+ img.preview {
+ width: 90px;
+ height: 70px;
+ }
+
+ a {
+ display:block;
+ text-decoration: underline;
+ margin: 5px 0px 0px 0px;
+ }
+
+ .info {
+ font-size: 10px;
+ color: #777;
+ font-weight: normal;
+ line-height: 14px;
+ margin-top: 5px;
+
+ a {
+ display:inline;
+ color: #777;
+ }
+
+ .actions {
+ margin-top: 14px;
+ a {
+ color: #666;
+ padding-left: 12px;
+ }
+
+ a.edit {
+ background: url(image-path('user_interface/ui/edit-small.png')) no-repeat 0% 50%;
+ }
+ a.remove {
+ background: url(image-path('user_interface/ui/remove-small.png')) no-repeat 0% 50%;
+ }
+ }
+
+ p {
+ margin:0;
+ }
+ }
+}
+
+@mixin content_to_clear {
+ content: " ";
+ display: block;
+ height: 0;
+ clear: both;
+ visibility: hidden;
+}
+
+@mixin after_div_for_object {
+ @include content_to_clear;
+}
+
+#workspace.time_tables.index
+{
+ .time_table:after {
+ @include after_div_for_object;
+ }
+
+ .time_tables {
+ margin-top: 20px;
+ }
+
+ .time_tables:after {
+ @include content_to_clear;
+ }
+
+ .time_table {
+ @include div_for_object;
+
+ /* to create multi-column index */
+ width: 350px;
+ float: left;
+ padding-right: 10px;
+
+ }
+}
+
+
+#workspace .order {
+ float: right;
+ padding: 15px 0;
+ font-size: 0.8em;
+
+ a { text-decoration: underline; }
+
+ a.current {
+ font-weight: bold;
+ text-decoration: none;
+ }
+}
+
diff --git a/app/controllers/time_tables_controller.rb b/app/controllers/time_tables_controller.rb
new file mode 100644
index 000000000..dbecde0eb
--- /dev/null
+++ b/app/controllers/time_tables_controller.rb
@@ -0,0 +1,23 @@
+class TimeTablesController < ChouetteController
+ defaults :resource_class => Chouette::TimeTable
+ respond_to :html
+ respond_to :xml
+ respond_to :json
+
+ belongs_to :referential
+
+ protected
+
+ def collection
+ @q = referential.time_tables.search(params[:q])
+ @time_tables ||= @q.result(:distinct => true).order(:comment).paginate(:page => params[:page], :per_page => 10)
+ end
+
+ def resource_url(time_table = nil)
+ referential_time_table_path(referential, time_table || resource)
+ end
+
+ def collection_url
+ referential_time_tables_path(referential)
+ end
+end
diff --git a/app/views/time_tables/_date.erb b/app/views/time_tables/_date.erb
new file mode 100644
index 000000000..4430efd33
--- /dev/null
+++ b/app/views/time_tables/_date.erb
@@ -0,0 +1,3 @@
+<%= div_for(date) do %>
+ <%= date.date %>
+<% end %>
diff --git a/app/views/time_tables/_form.erb b/app/views/time_tables/_form.erb
new file mode 100644
index 000000000..1d78ad84e
--- /dev/null
+++ b/app/views/time_tables/_form.erb
@@ -0,0 +1,42 @@
+<%= semantic_form_for [@referential, @time_table] do |form| %>
+ <%= form.inputs do %>
+ <%= form.input :comment %>
+ <%= form.input :version %>
+ <%= form.input :monday, :as => :boolean %>
+ <%= form.input :tuesday, :as => :boolean %>
+ <%= form.input :wednesday, :as => :boolean %>
+ <%= form.input :thursday, :as => :boolean %>
+ <%= form.input :friday, :as => :boolean %>
+ <%= form.input :saturday, :as => :boolean %>
+ <%= form.input :sunday, :as => :boolean %>
+
+ <% if @time_table.new_record? %>
+ <%= form.input :objectid %>
+ <% else %>
+ <li>
+ <label><%= @time_table.human_attribute_name("objectid") %>: </label>
+ <%= @time_table.objectid %>
+ </li>
+ <% end %>
+ <% end %>
+ <!--
+ <% if not @time_table.new_record? %>
+ <label><%= @time_table.human_attribute_name("periods") %>: </label>
+ <%= form.inputs :for => :periods do |period_form| %>
+ <%= period_form.input :period_start, :as => :date ,:label => @time_table.human_attribute_name("period_start")%>
+ <%= period_form.input :period_end, :as => :date ,:label => @time_table.human_attribute_name("period_end")%>
+ <% end %>
+ <label><%= @time_table.human_attribute_name("dates") %>: </label>
+ <%= form.inputs :for => :dates do |date_form| %>
+ <%= date_form.input :date, :as => :date %>
+ <% end %>
+
+ <% end%>
+ -->
+
+ <%= form.buttons do %>
+ <%= form.commit_button %>
+ <li><%= t('or') %></li>
+ <li><%= link_to t('cancel'), :back %></li>
+ <% end %>
+<% end %>
diff --git a/app/views/time_tables/_form_date.erb b/app/views/time_tables/_form_date.erb
new file mode 100644
index 000000000..2b841c377
--- /dev/null
+++ b/app/views/time_tables/_form_date.erb
@@ -0,0 +1,5 @@
+<%= semantic_form_for [@referential, @time_table_date] do |form| %>
+ <%= form.inputs do %>
+ <%= form.input :date , :as => :date%>
+ <% end %>
+<% end %>
diff --git a/app/views/time_tables/_form_period.erb b/app/views/time_tables/_form_period.erb
new file mode 100644
index 000000000..110bad1eb
--- /dev/null
+++ b/app/views/time_tables/_form_period.erb
@@ -0,0 +1,6 @@
+<%= semantic_form_for [@referential, @time_table_period] do |form| %>
+ <%= form.inputs do %>
+ <%= form.input :period_start, :as => :date %>
+ <%= form.input :period_end, :as => :date %>
+ <% end %>
+<% end %>
diff --git a/app/views/time_tables/_period.erb b/app/views/time_tables/_period.erb
new file mode 100644
index 000000000..a8be8c73a
--- /dev/null
+++ b/app/views/time_tables/_period.erb
@@ -0,0 +1,3 @@
+<%= div_for(period) do %>
+ <%= period.period_start %> - <%= period.period_end %>
+<% end %>
diff --git a/app/views/time_tables/_time_table.erb b/app/views/time_tables/_time_table.erb
new file mode 100644
index 000000000..ea2d69be4
--- /dev/null
+++ b/app/views/time_tables/_time_table.erb
@@ -0,0 +1,9 @@
+<%= div_for(time_table) do %>
+ <%= link_to time_table.comment, [@referential, time_table] %>
+ <div class="info">
+ <div class="actions">
+ <%= link_to t("actions.edit"), edit_referential_time_table_path(@referential, time_table), :class => "edit" %> |
+ <%= link_to t("actions.destroy"), referential_time_table_path(@referential, time_table), :method => :delete, :confirm => t('time_tables.actions.destroy_confirm'), :class => "remove" %>
+ </div>
+ </div>
+<% end %>
diff --git a/app/views/time_tables/edit.html.erb b/app/views/time_tables/edit.html.erb
new file mode 100644
index 000000000..d80974841
--- /dev/null
+++ b/app/views/time_tables/edit.html.erb
@@ -0,0 +1,3 @@
+<%= title_tag t('time_tables.edit.title', :time_table => @time_table.comment) %>
+
+<%= render "form" %>
diff --git a/app/views/time_tables/index.html.erb b/app/views/time_tables/index.html.erb
new file mode 100644
index 000000000..90225446a
--- /dev/null
+++ b/app/views/time_tables/index.html.erb
@@ -0,0 +1,23 @@
+<%= title_tag t('time_tables.index.title') %>
+
+<%= search_form_for @q, :url => referential_time_tables_path(@referential), :html => {:method => :get} do |f| %>
+ <%= f.label :comment_cont, "#{t('.comment')} :" %>
+ <%= f.text_field :comment_cont %>
+
+ <%= f.submit t('actions.search') %> <%= t("or") %>
+ <%= link_to t("cancel"), referential_time_tables_path(@referential) %>
+<% end %>
+
+<%= will_paginate @time_tables %>
+<div class="time_tables paginated_content">
+ <%= render :partial => "time_table", :collection => @time_tables %>
+</div>
+<%= will_paginate @time_tables %>
+
+
+<% content_for :sidebar do %>
+<ul class="actions">
+ <li><%= link_to t('time_tables.actions.new'), new_referential_time_table_path(@referential), :class => "add" %></li>
+ <br>
+</ul>
+<% end %>
diff --git a/app/views/time_tables/new.html.erb b/app/views/time_tables/new.html.erb
new file mode 100644
index 000000000..90b9876e2
--- /dev/null
+++ b/app/views/time_tables/new.html.erb
@@ -0,0 +1,3 @@
+<%= title_tag t('time_tables.new.title') %>
+
+<%= render "form" %>
diff --git a/app/views/time_tables/show.html.erb b/app/views/time_tables/show.html.erb
new file mode 100644
index 000000000..a03c9e570
--- /dev/null
+++ b/app/views/time_tables/show.html.erb
@@ -0,0 +1,68 @@
+<%= title_tag t('time_tables.show.title', :time_table => @time_table.comment )%>
+
+<div class="time_table_show">
+
+ <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>
+ <p>
+ <label><%= @time_table.human_attribute_name("objectid") %>: </label>
+ <%= @time_table.objectid %>
+ </p>
+ <p>
+ <label><%= @time_table.human_attribute_name("monday") %>: </label>
+ <%= @time_table.monday %>
+ </p>
+ <p>
+ <label><%= @time_table.human_attribute_name("tuesday") %>: </label>
+ <%= @time_table.tuesday %>
+ </p>
+ <p>
+ <label><%= @time_table.human_attribute_name("wednesday") %>: </label>
+ <%= @time_table.wednesday %>
+ </p>
+ <p>
+ <label><%= @time_table.human_attribute_name("thursday") %>: </label>
+ <%= @time_table.thursday %>
+ </p>
+ <p>
+ <label><%= @time_table.human_attribute_name("friday") %>: </label>
+ <%= @time_table.friday %>
+ </p>
+ <p>
+ <label><%= @time_table.human_attribute_name("saturday") %>: </label>
+ <%= @time_table.saturday %>
+ </p>
+ <p>
+ <label><%= @time_table.human_attribute_name("sunday") %>: </label>
+ <%= @time_table.sunday %>
+ </p>
+ </div>
+ <div>
+ <p>
+ <label><%= @time_table.human_attribute_name("periods") %>: </label>
+ </p>
+ <%= render :partial => "period", :collection => @time_table.periods %>
+ </div>
+ <div>
+ <p>
+ <label><%= @time_table.human_attribute_name("dates") %>: </label>
+ </p>
+ <%= render :partial => "date", :collection => @time_table.dates %>
+ </div>
+
+</div>
+
+<% content_for :sidebar do %>
+<ul class="actions">
+ <li><%= link_to t('time_tables.actions.edit'), edit_referential_time_table_path(@referential, @time_table), :class => "edit" %></li>
+ <li><%= link_to t('time_tables.actions.destroy'), referential_time_table_path(@referential, @time_table), :method => :delete, :confirm => t('time_tables.actions.destroy_confirm'), :class => "remove" %></li>
+ <br>
+</ul>
+<% end %>
diff --git a/config/initializers/ui_datepicker-rails3.rb b/config/initializers/ui_datepicker-rails3.rb
new file mode 100644
index 000000000..7c53bb46a
--- /dev/null
+++ b/config/initializers/ui_datepicker-rails3.rb
@@ -0,0 +1 @@
+UiDatePickerRails3.activate :formtastic \ No newline at end of file
diff --git a/config/locales/time_tables.yml b/config/locales/time_tables.yml
new file mode 100644
index 000000000..f0333e4f0
--- /dev/null
+++ b/config/locales/time_tables.yml
@@ -0,0 +1,94 @@
+en:
+ time_tables:
+ time_table:
+ actions:
+ new: Add a new timetable
+ edit: Edit this timetable
+ destroy: Remove this timetable
+ destroy_confirm: Are you sure you want destroy this timetable?
+ new:
+ title: Add a new timetable
+ edit:
+ title: Update timetable %{time_table}
+ show:
+ title: Timetable %{time_table}
+ index:
+ title: Timetables
+ comment: Comment
+ selection: Selection
+ selection_all: All
+ activerecord:
+ models:
+ time_table: Timetable
+ attributes:
+ time_table:
+ comment: Comment
+ version: Version
+ monday: Monday
+ tuesday: Tuesday
+ wednesday: Wednesday
+ thursday: Thursday
+ friday: Friday
+ saturday: Saturday
+ sunday: Sunday
+ objectid: Neptune identifier
+ object_version: Version
+ creation_time: Created on
+ creator_id: Created by
+ dates: Application dates
+ periods: Application periods
+ period_start: From
+ period_end: to
+ formtastic:
+ hints:
+ time_table:
+ objectid: "[prefix]:Timetable:[unique_key] : prefix contains only alphanumerical or underscore characters, unique_key accepts also minus character"
+
+fr:
+ time_tables:
+ time_table:
+ actions:
+ new: Ajouter un calendrier
+ edit: Modifier ce calendrier
+ destroy: Supprimer ce calendrier
+ destroy_confirm: Etes vous sûr de détruire ce calendrier ?
+ new:
+ title: Ajouter un calendrier
+ edit:
+ title: "Modifier le calendrier %{time_table}"
+ show:
+ title: Calendrier %{time_table}
+ index:
+ comment: Commentaire
+ title: calendriers
+ selection: Sélection
+ selection_all: Tous
+ activerecord:
+ models:
+ time_table: Calendrier
+ attributes:
+ time_table:
+ comment: Commentaire
+ version: Version
+ monday: Lundi
+ tuesday: Mardi
+ wednesday: Mercredi
+ thursday: Jeudi
+ friday: Vendredi
+ saturday: Samedi
+ sunday: Dimanche
+ object_id: Identifiant Neptune
+ object_version: Version
+ creation_time: Créé le
+ creator_id: Créé par
+ dates: "Dates d'application"
+ periods: "Périodes d'application"
+ period_start: Du
+ period_end: au
+
+ formtastic:
+ hints:
+ time_table:
+ objectid: "[prefixe]:Timetable:[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/doc/functional/dataspaces.textile b/doc/functional/dataspaces.textile
new file mode 100644
index 000000000..536ea4173
--- /dev/null
+++ b/doc/functional/dataspaces.textile
@@ -0,0 +1,21 @@
+---
+layout: default
+title: Espaces de donnees
+---
+
+h3. D&eacute;finition
+
+p. un espace de donn&eacute;es est le lieu de stockage d'un ensemble de donn&eacute;es de transport connect&eacute;es entre elles.
+
+h3. Attributs
+
+- Nom := nom de l'espace de donn&eacute;es
+- Code := code de l'espace de donn&eacute;es
+- Pr&eacute;fixe Neptune := pr&eacute;fixe utilis&eacute; par d&eacute;faut pour la g&eacute;n&eacute;ration des identifiants Neptune
+- Projection g&eacute;ographique := r&eacute;f&eacute;rentiel de projection des coordonn&eacute;es cartographiques en compl&eacute;ment du WGS84
+
+h3. Impl&eacute;mentation
+
+p. L'espace de donn&eacute;es est concr&eacute;tis&eacute; dans la base de donn&eacute;es par un sch&eacute;ma au sens SQL portant le nom definit par l'attribut code,
+les attributs sont enregistr&eacute;s dans la table REFERENTIALS du schema PUBLIC
+
diff --git a/doc/functional/introduction.textile b/doc/functional/introduction.textile
new file mode 100644
index 000000000..54725242b
--- /dev/null
+++ b/doc/functional/introduction.textile
@@ -0,0 +1,5 @@
+---
+layout: default
+title: Introduction
+---
+
diff --git a/doc/functional/timetables.textile b/doc/functional/timetables.textile
new file mode 100644
index 000000000..bff532980
--- /dev/null
+++ b/doc/functional/timetables.textile
@@ -0,0 +1,39 @@
+---
+layout: default
+title: Calendriers d'application
+---
+
+h3. D&eacute;finition
+
+p. Un calendrier d'application est un ensemble de dates et de p&eacute;riodes calendaires
+
+h3. Attributs
+
+- Commentaire := Description du calendrier
+- Version :=
+- Jours d'application := jours de la semaine effectivement applicables dans le cas o&ugrave; des p&eacute;riodes sont d&eacute;finies dans le calendrier
+- P&eacute;riodes d'application := p&eacute;riodes calendaires durant lesquelles le calendrier est applicable
+- Dates d'application :=
+dates spécifiques pour lesquelles le calendrier est applicable;
+ces dates peuvent &ecirc;tre ajout&eacute;es dans ou en dehors des p&eacute;riodes calendaires.
+Un calendrier peut n'avoir que des dates calendaires, auquel cas les jours d'applications n'ont pas de signification
+
+Donn&eacute;es de gestion :
+
+- Identifiant Neptune :=
+cl&eacute; unique p&eacute;renne identifiant le r&eacute;seau 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 = Timetable : 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è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&egarve;re modification
+
+h3. Impl&eacute;mentation
+
+p. TODO
+