diff options
| -rw-r--r-- | app/assets/stylesheets/time_tables.css.scss | 113 | ||||
| -rw-r--r-- | app/controllers/time_tables_controller.rb | 23 | ||||
| -rw-r--r-- | app/views/time_tables/_date.erb | 3 | ||||
| -rw-r--r-- | app/views/time_tables/_form.erb | 42 | ||||
| -rw-r--r-- | app/views/time_tables/_form_date.erb | 5 | ||||
| -rw-r--r-- | app/views/time_tables/_form_period.erb | 6 | ||||
| -rw-r--r-- | app/views/time_tables/_period.erb | 3 | ||||
| -rw-r--r-- | app/views/time_tables/_time_table.erb | 9 | ||||
| -rw-r--r-- | app/views/time_tables/edit.html.erb | 3 | ||||
| -rw-r--r-- | app/views/time_tables/index.html.erb | 23 | ||||
| -rw-r--r-- | app/views/time_tables/new.html.erb | 3 | ||||
| -rw-r--r-- | app/views/time_tables/show.html.erb | 68 | ||||
| -rw-r--r-- | config/initializers/ui_datepicker-rails3.rb | 1 | ||||
| -rw-r--r-- | config/locales/time_tables.yml | 94 | ||||
| -rw-r--r-- | doc/functional/dataspaces.textile | 21 | ||||
| -rw-r--r-- | doc/functional/introduction.textile | 5 | ||||
| -rw-r--r-- | doc/functional/timetables.textile | 39 | 
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éfinition + +p. un espace de données est le lieu de stockage d'un ensemble de données de transport connectées entre elles. + +h3. Attributs + +- Nom := nom de l'espace de données  +- Code := code de l'espace de données +- Préfixe Neptune := préfixe utilisé par défaut pour la génération des identifiants Neptune +- Projection géographique := référentiel de projection des coordonnées cartographiques en complément du WGS84 + +h3. Implémentation + +p. L'espace de données est concrétisé dans la base de données par un schéma au sens SQL portant le nom definit par l'attribut code,  +les attributs sont enregistré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éfinition + +p. Un calendrier d'application est un ensemble de dates et de périodes calendaires  + +h3. Attributs + +- Commentaire := Description du calendrier +- Version :=  +- Jours d'application := jours de la semaine effectivement applicables dans le cas où des périodes sont définies dans le calendrier +- Périodes d'application := périodes calendaires durant lesquelles le calendrier est applicable +- Dates d'application :=  +dates spécifiques pour lesquelles le calendrier est applicable; +ces dates peuvent être ajoutées dans ou en dehors des périodes calendaires. +Un calendrier peut n'avoir que des dates calendaires, auquel cas les jours d'applications n'ont pas de signification + +Données de gestion :  + +- Identifiant Neptune :=  +clé unique pérenne identifiant le réseau pour les échanges Neptune +cet identifiant est composé de 3 parties : préfixe:type:id_technique +* préfixe : clé identifiant un producteur de données unique +* type = Timetable : clé identifiant le type d'objet (valeur imposée) +* id_technique : valeur identifiant un seul object d'un type donné pour un même producteur +ce champ obligatoire est automatiquement généré s'il n'est pas renseigné  +il est possible aussi de ne renseigner que le préfixe auquel cas la valeur sera complétée automatiquement. +=: +- Date de création := date à laquelle l'objet a été créé ou modifié pour la dernière fois +- Version := version de l'objet (auto incrémenté à chaque modification) +- Créé par := compte utilisateur ayant procédé à la derni&egarve;re modification + +h3. Implémentation + +p. TODO + | 
