aboutsummaryrefslogtreecommitdiffstats
path: root/app/views
diff options
context:
space:
mode:
authorMichel Etienne2012-05-14 16:37:49 +0200
committerMichel Etienne2012-05-14 16:37:49 +0200
commit79c40eb3b3e4552bf37c3bd14bf15f4370c2120a (patch)
treedaf675cc27a8916a6c12796f7be75720b0818a2a /app/views
parent7d9eae12af5fbc0e25d7425a8ab5e6e07d7d853f (diff)
downloadchouette-core-79c40eb3b3e4552bf37c3bd14bf15f4370c2120a.tar.bz2
add date and period on timetables and missing fields on connectionlinks
Diffstat (limited to 'app/views')
-rw-r--r--app/views/companies/_form.erb2
-rw-r--r--app/views/companies/show.html.erb4
-rw-r--r--app/views/connection_links/_form.erb11
-rw-r--r--app/views/connection_links/show.html.erb41
-rw-r--r--app/views/lines/_form.erb2
-rw-r--r--app/views/lines/show.html.erb4
-rw-r--r--app/views/networks/_form.erb6
-rw-r--r--app/views/networks/show.html.erb6
-rw-r--r--app/views/stop_areas/_form.html.erb10
-rw-r--r--app/views/stop_areas/show.html.erb4
-rw-r--r--app/views/time_table_dates/_form.html.erb2
-rw-r--r--app/views/time_table_periods/_form.html.erb12
-rw-r--r--app/views/time_table_periods/new.html.erb4
-rw-r--r--app/views/time_tables/_date.erb3
-rw-r--r--app/views/time_tables/_date_fields.erb8
-rw-r--r--app/views/time_tables/_dates.html.erb8
-rw-r--r--app/views/time_tables/_form.erb12
-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/_period_fields.erb9
-rw-r--r--app/views/time_tables/_periods.html.erb10
-rw-r--r--app/views/time_tables/show.html.erb10
22 files changed, 110 insertions, 67 deletions
diff --git a/app/views/companies/_form.erb b/app/views/companies/_form.erb
index bea95b0b4..63cb2661b 100644
--- a/app/views/companies/_form.erb
+++ b/app/views/companies/_form.erb
@@ -8,7 +8,7 @@
<%= form.input :phone, :as => :phone %>
<%= form.input :fax, :as => :phone %>
<%= form.input :email, :as => :email %>
- <%= form.input :registration_number %>
+ <%= form.input :registrationnumber %>
<% if @company.new_record? %>
<%= form.input :objectid %>
<% else %>
diff --git a/app/views/companies/show.html.erb b/app/views/companies/show.html.erb
index 16d104969..8703bbc49 100644
--- a/app/views/companies/show.html.erb
+++ b/app/views/companies/show.html.erb
@@ -36,7 +36,7 @@
<%= @company.email %>
</p>
<p>
- <label><%= Chouette::Company.human_attribute_name("registration_number") %>: </label>
+ <label><%= Chouette::Company.human_attribute_name("registrationnumber") %>: </label>
<%= @company.registration_number %>
</p>
<p>
@@ -45,7 +45,7 @@
</p>
<p>
<label><%= @company.human_attribute_name("creation_time") %>: </label>
- <%= @company.creation_time %>
+ <%= l(@company.creation_time) %>
</p>
<p>
<label><%= @company.human_attribute_name("creator_id") %>: </label>
diff --git a/app/views/connection_links/_form.erb b/app/views/connection_links/_form.erb
index 31777c253..31c3e3bde 100644
--- a/app/views/connection_links/_form.erb
+++ b/app/views/connection_links/_form.erb
@@ -3,7 +3,16 @@
<%= form.inputs do %>
<%= form.input :name %>
<%= form.input :connection_link_type, :as => :select, :collection => Chouette::ConnectionLink.connection_link_types, :include_blank => false, :member_label => Proc.new { |type| t("connection_link_types.label.#{type}") } %>
- <%= form.input :comment %>
+ <%= form.input :comment %>
+ <%= form.input :link_distance %>
+ <%= form.input :defaultduration, :as => :time ,:include_seconds => true , :label => @connection_link.human_attribute_name("default_duration")%>
+ <%= form.input :frequenttravellerduration, :as => :time ,:include_seconds => true , :label => @connection_link.human_attribute_name("frequent_traveller_duration")%>
+ <%= form.input :occasionaltravellerduration, :as => :time ,:include_seconds => true , :label => @connection_link.human_attribute_name("occasional_traveller_duration")%>
+ <%= form.input :mobilityrestrictedtravellerduration, :as => :time ,:include_seconds => true , :label => @connection_link.human_attribute_name("mobility_restricted_traveller_duration")%>
+ <%= form.input :mobility_restricted_suitability,:as => :boolean %>
+ <%= form.input :stairs_availability,:as => :boolean %>
+ <%= form.input :lift_availability,:as => :boolean %>
+
<% if @connection_link.new_record? %>
<%= form.input :objectid %>
<% else %>
diff --git a/app/views/connection_links/show.html.erb b/app/views/connection_links/show.html.erb
index da8ca5702..273d9102e 100644
--- a/app/views/connection_links/show.html.erb
+++ b/app/views/connection_links/show.html.erb
@@ -33,12 +33,51 @@
<%= @connection_link.comment %>
</p>
<p>
+ <label><%= @connection_link.human_attribute_name("link_distance") %>: </label>
+ <%= @connection_link.link_distance %>
+ </p>
+ <p>
+ <label><%= @connection_link.human_attribute_name("default_duration") %>: </label>
+ <% if (@connection_link.default_duration.present?) %>
+ <%= @connection_link.default_duration.strftime('%Hh %Mm %Ss') %>
+ <% end %>
+ </p>
+ <p>
+ <label><%= @connection_link.human_attribute_name("frequent_traveller_duration") %>: </label>
+ <% if (@connection_link.frequent_traveller_duration.present?) %>
+ <%= @connection_link.frequent_traveller_duration.strftime('%Hh %Mm %Ss') %>
+ <% end %>
+ </p>
+ <p>
+ <label><%= @connection_link.human_attribute_name("occasional_traveller_duration") %>: </label>
+ <% if (@connection_link.occasional_traveller_duration.present?) %>
+ <%= @connection_link.occasional_traveller_duration.strftime('%Hh %Mm %Ss') %>
+ <% end %>
+ </p>
+ <p>
+ <label><%= @connection_link.human_attribute_name("mobility_restricted_traveller_duration") %>: </label>
+ <% if (@connection_link.mobility_restricted_traveller_duration.present?) %>
+ <%= @connection_link.mobility_restricted_traveller_duration.strftime('%Hh %Mm %Ss') %>
+ <% end %>
+ </p>
+ <p>
+ <label><%= @connection_link.human_attribute_name("mobility_restricted_suitability") %>: </label>
+ <%= @connection_link.mobility_restricted_suitability %>
+ </p>
+ <p>
+ <label><%= @connection_link.human_attribute_name("stairs_availability") %>: </label>
+ <%= @connection_link.stairs_availability %>
+ </p>
+ <p>
+ <label><%= @connection_link.human_attribute_name("lift_availability") %>: </label>
+ <%= @connection_link.lift_availability %>
+ </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 %>
+ <%= l(@connection_link.creation_time) %>
</p>
<p>
<label><%= @connection_link.human_attribute_name("creator_id") %>: </label>
diff --git a/app/views/lines/_form.erb b/app/views/lines/_form.erb
index ed0e4f9a2..1a7107e7e 100644
--- a/app/views/lines/_form.erb
+++ b/app/views/lines/_form.erb
@@ -5,7 +5,7 @@
<%= form.input :company, :as => :select, :collection => Chouette::Company.all, :include_blank => false%>
<%= form.input :name %>
<%= form.input :published_name %>
- <%= form.input :registration_number %>
+ <%= form.input :registrationnumber %>
<%= form.input :number %>
<%= form.input :transport_mode, :as => :select, :collection => Chouette::Line.transport_modes, :include_blank => false, :member_label => Proc.new { |mode| t("transport_modes.label.#{mode}") } %>
<%= form.input :comment %>
diff --git a/app/views/lines/show.html.erb b/app/views/lines/show.html.erb
index e5a2d5d7f..4e7217384 100644
--- a/app/views/lines/show.html.erb
+++ b/app/views/lines/show.html.erb
@@ -21,7 +21,7 @@
<%= @line.publishedname %>
</p>
<p>
- <label><%= @line.human_attribute_name("registration_number") %>: </label>
+ <label><%= @line.human_attribute_name("registrationnumber") %>: </label>
<%= @line.registration_number %>
</p>
<p>
@@ -42,7 +42,7 @@
</p>
<p>
<label><%= @line.human_attribute_name("creation_time") %>: </label>
- <%= @line.creation_time %>
+ <%= l(@line.creation_time) %>
</p>
<p>
<label><%= @line.human_attribute_name("creator_id") %>: </label>
diff --git a/app/views/networks/_form.erb b/app/views/networks/_form.erb
index 4b5b7e509..e1d802dac 100644
--- a/app/views/networks/_form.erb
+++ b/app/views/networks/_form.erb
@@ -3,10 +3,10 @@
<%= form.input :name %>
<%= form.input :registrationnumber %>
<%= form.input :comment %>
- <%= form.input :versiondate, :as => :date %>
+ <%= form.input :version_date, :as => :date %>
<%= form.input :description %>
- <%= form.input :sourcename %>
- <%= form.input :sourceidentifier %>
+ <%= form.input :source_name %>
+ <%= form.input :source_identifier %>
<% if @network.new_record? %>
<%= form.input :objectid %>
<% else %>
diff --git a/app/views/networks/show.html.erb b/app/views/networks/show.html.erb
index 6822cf41e..594c670b2 100644
--- a/app/views/networks/show.html.erb
+++ b/app/views/networks/show.html.erb
@@ -8,7 +8,7 @@
<%= @network.name %>
</p>
<p>
- <label><%= Chouette::Network.human_attribute_name("registration_number") %>: </label>
+ <label><%= Chouette::Network.human_attribute_name("registrationnumber") %>: </label>
<%= @network.registrationnumber %>
</p>
<p>
@@ -17,7 +17,7 @@
</p>
<p>
<label><%= Chouette::Network.human_attribute_name("version_date") %>: </label>
- <%= @network.version_date %>
+ <%= l(@network.version_date) %>
</p>
<p>
<label><%= Chouette::Network.human_attribute_name("description") %>: </label>
@@ -37,7 +37,7 @@
</p>
<p>
<label><%= @network.human_attribute_name("creation_time") %>: </label>
- <%= @network.creation_time %>
+ <%= l(@network.creation_time) %>
</p>
<p>
<label><%= @network.human_attribute_name("creator_id") %>: </label>
diff --git a/app/views/stop_areas/_form.html.erb b/app/views/stop_areas/_form.html.erb
index fab7c1510..ffdd9faa1 100644
--- a/app/views/stop_areas/_form.html.erb
+++ b/app/views/stop_areas/_form.html.erb
@@ -6,12 +6,16 @@
<%= form.input :street_name %>
<%= form.input :country_code %>
<%= form.input :fare_code %>
- <%= form.input :registration_number %>
- <%= form.input :stop_area_type, :as => :select, :collection => Chouette::StopArea.stop_area_types, :include_blank => false, :member_label => Proc.new { |stop_area_type| t("area_types.label.#{stop_area_type}") } %>
+ <%= form.input :registrationnumber %>
<% if @stop_area.new_record? %>
+ <%= form.input :stop_area_type, :as => :select, :collection => Chouette::StopArea.stop_area_types, :include_blank => false, :member_label => Proc.new { |stop_area_type| t("area_types.label.#{stop_area_type}") } %>
<%= form.input :objectid %>
<% else %>
<li>
+ <label><%= @stop_area.human_attribute_name("stop_area_type") %>: </label>
+ <%= @stop_area.stop_area_type %>
+ </li>
+ <li>
<label><%= @stop_area.human_attribute_name("objectid") %>: </label>
<%= @stop_area.objectid %>
</li>
@@ -25,6 +29,6 @@
<%= form.buttons do %>
<%= form.commit_button %>
- ou <%= link_to "revenir", [@referential, @stop_area] %>
+ ou <%= link_to t('cancel'), [@referential, @stop_area] %>
<% end %>
<% end %>
diff --git a/app/views/stop_areas/show.html.erb b/app/views/stop_areas/show.html.erb
index f558d7c9b..f4f7a9064 100644
--- a/app/views/stop_areas/show.html.erb
+++ b/app/views/stop_areas/show.html.erb
@@ -28,7 +28,7 @@
<%= @stop_area.fare_code %>
</p>
<p>
- <label><%= @stop_area.human_attribute_name("registration_number") %>: </label>
+ <label><%= @stop_area.human_attribute_name("registrationnumber") %>: </label>
<%= @stop_area.registration_number %>
</p>
<p>
@@ -74,7 +74,7 @@
</p>
<p>
<label><%= @stop_area.human_attribute_name("creation_time") %>: </label>
- <%= @stop_area.creation_time %>
+ <%= l(@stop_area.creation_time) %>
</p>
<p>
<label><%= @stop_area.human_attribute_name("creator_id") %>: </label>
diff --git a/app/views/time_table_dates/_form.html.erb b/app/views/time_table_dates/_form.html.erb
index 8e0461ef5..c0218eb64 100644
--- a/app/views/time_table_dates/_form.html.erb
+++ b/app/views/time_table_dates/_form.html.erb
@@ -1,6 +1,6 @@
<%= semantic_form_for [@referential, @time_table, @time_table_date] do |form| %>
<%= form.inputs do %>
- <%= form.input :date, :as => :date, :label => @time_table.human_attribute_name("date") %>
+ <%= form.input :date, :as => :date, :label => @time_table_date.human_attribute_name("date") %>
<% end %>
<%= form.buttons do %>
<%= form.commit_button %>
diff --git a/app/views/time_table_periods/_form.html.erb b/app/views/time_table_periods/_form.html.erb
new file mode 100644
index 000000000..8369e9701
--- /dev/null
+++ b/app/views/time_table_periods/_form.html.erb
@@ -0,0 +1,12 @@
+<%= semantic_form_for [@referential, @time_table, @time_table_period] do |form| %>
+ <%= form.inputs do %>
+ <%= form.input :periodstart, :as => :date, :label => @time_table_period.human_attribute_name("period_start") %>
+ <%= form.input :periodend, :as => :date, :label => @time_table_period.human_attribute_name("period_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_table_periods/new.html.erb b/app/views/time_table_periods/new.html.erb
new file mode 100644
index 000000000..5088637a1
--- /dev/null
+++ b/app/views/time_table_periods/new.html.erb
@@ -0,0 +1,4 @@
+<%= title_tag t('time_table_periods.new.title') %>
+
+<%= render "form" %>
+
diff --git a/app/views/time_tables/_date.erb b/app/views/time_tables/_date.erb
deleted file mode 100644
index 7ea217be9..000000000
--- a/app/views/time_tables/_date.erb
+++ /dev/null
@@ -1,3 +0,0 @@
-<div>
-<span class='date'><%= date.date %></span>
-</div> \ No newline at end of file
diff --git a/app/views/time_tables/_date_fields.erb b/app/views/time_tables/_date_fields.erb
deleted file mode 100644
index 7ec895b44..000000000
--- a/app/views/time_tables/_date_fields.erb
+++ /dev/null
@@ -1,8 +0,0 @@
-<div class='nested-fields'>
- <%= f.inputs :class => 'dates' do %>
- <%= f.input :date, :as => :date , :label => @time_table.human_attribute_name("date")%>
- <%= f.input :time_table_id, :as => :hidden %>
- <%= f.input :position, :as => :hidden %>
- <%= link_to_remove_association t('actions.destroy'), f %>
- <% end %>
-</div> \ No newline at end of file
diff --git a/app/views/time_tables/_dates.html.erb b/app/views/time_tables/_dates.html.erb
index 3aa021536..47ae01710 100644
--- a/app/views/time_tables/_dates.html.erb
+++ b/app/views/time_tables/_dates.html.erb
@@ -1,7 +1,11 @@
-<p>:;,:;,</p>
<ul class='dates'>
<% @time_table.dates.each do |tmd| %>
- <li class="<%= (tmd.position%2==0) ? 'odd' : 'even' %>"><%= tmd.date %></li>
+ <li class="<%= (tmd.position%2==0) ? 'odd' : 'even' %>"><%= l tmd.date %>
+ <div class="actions">
+ <%= link_to t("actions.destroy"), referential_time_table_time_table_date_path(@referential, @time_table,tmd), :method => :delete, :confirm => t('time_tables.actions.destroy_date_confirm'), :class => "remove" %>
+ </div>
+
+ </li>
<% end %>
</ul>
diff --git a/app/views/time_tables/_form.erb b/app/views/time_tables/_form.erb
index 203342cad..59cc30947 100644
--- a/app/views/time_tables/_form.erb
+++ b/app/views/time_tables/_form.erb
@@ -33,16 +33,4 @@
<h3 class="dates"><%= t('.dates') %></h3>
<%= render "dates" %>
-<% content_for :sidebar do %>
-<ul class="actions">
- <% unless @time_table.new_record? %>
- <li><%= link_to t('time_tables.edit.add_date'), new_referential_time_table_time_table_date_path(@referential, @time_table) %></li>
- <% end %>
-<!--
- <li><%= link_to_add_association t('time_tables.edit.add_period'), form, :periods %></li>
- <li><%= link_to_add_association t('time_tables.edit.add_date'), form, :dates %></li>
--->
- <br>
-</ul>
-<% end %>
diff --git a/app/views/time_tables/_form_period.erb b/app/views/time_tables/_form_period.erb
deleted file mode 100644
index 110bad1eb..000000000
--- a/app/views/time_tables/_form_period.erb
+++ /dev/null
@@ -1,6 +0,0 @@
-<%= 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
deleted file mode 100644
index 0be52145d..000000000
--- a/app/views/time_tables/_period.erb
+++ /dev/null
@@ -1,3 +0,0 @@
-<div>
-<span class='period'><%= period.period_start %> - <%= period.period_end %></span>
-</div>
diff --git a/app/views/time_tables/_period_fields.erb b/app/views/time_tables/_period_fields.erb
deleted file mode 100644
index 76bb506f9..000000000
--- a/app/views/time_tables/_period_fields.erb
+++ /dev/null
@@ -1,9 +0,0 @@
-<div class='nested-fields'>
- <%= f.inputs :class => 'periods' do %>
- <%= f.input :period_start, :as => :date , :label => @time_table.human_attribute_name("period_start")%>
- <%= f.input :period_end, :as => :date , :label => @time_table.human_attribute_name("period_end")%>
- <%= f.input :time_table_id, :as => :hidden %>
- <%= f.input :position, :as => :hidden %>
- <%= link_to_remove_association t('actions.destroy'), f %>
- <% end %>
-</div>
diff --git a/app/views/time_tables/_periods.html.erb b/app/views/time_tables/_periods.html.erb
new file mode 100644
index 000000000..9f3974735
--- /dev/null
+++ b/app/views/time_tables/_periods.html.erb
@@ -0,0 +1,10 @@
+ <ul class='periods'>
+ <% @time_table.periods.each do |tmp| %>
+ <li class='period'><%= t('time_tables.show.from')%> <%= l tmp.period_start %> <%= t('time_tables.show.to')%> <%= l tmp.period_end %>
+ <div class="actions">
+ <%= link_to t("actions.destroy"), referential_time_table_time_table_period_path(@referential, @time_table,tmp), :method => :delete, :confirm => t('time_tables.actions.destroy_period_confirm'), :class => "remove" %>
+ </div>
+ </li>
+ <% end %>
+ </ul>
+
diff --git a/app/views/time_tables/show.html.erb b/app/views/time_tables/show.html.erb
index 0e6a6c6e7..0ddd49338 100644
--- a/app/views/time_tables/show.html.erb
+++ b/app/views/time_tables/show.html.erb
@@ -52,23 +52,25 @@
</p>
<p>
<label><%= @time_table.human_attribute_name("creation_time") %>: </label>
- <%= @time_table.creation_time %>
+ <%= l @time_table.creation_time %>
</p>
<p>
<label><%= @time_table.human_attribute_name("creator_id") %>: </label>
<%= @time_table.creator_id %>
</p>
</div>
-
<h3 class="dates"><%= t('.dates') %></h3>
<%= render "dates" %>
+ <h3 class="periods"><%= t('.periods') %></h3>
+ <%= render "periods" %>
</div>
<% content_for :sidebar do %>
<ul class="actions">
- <li><%= link_to t('time_tables.edit.add_date'), new_referential_time_table_time_table_date_path(@referential, @time_table), :class => 'add' %></li>
<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>
+ <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>
+ <li><%= link_to t('time_tables.show.add_date'), new_referential_time_table_time_table_date_path(@referential, @time_table), :class => 'add' %></li>
+ <li><%= link_to t('time_tables.show.add_period'), new_referential_time_table_time_table_period_path(@referential, @time_table), :class => 'add' %></li>
<br>
</ul>
<% end %>