aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Florisson2012-08-14 17:50:44 +0200
committerMarc Florisson2012-08-14 17:50:44 +0200
commitee04378e1ad1f4a280e6055751ece7642a7729af (patch)
tree0b4377f3f00e9e90f5772e05d2438317f71df2fc
parent14b075295d9dde393a5088df0c3d7a0dec239022 (diff)
downloadchouette-core-ee04378e1ad1f4a280e6055751ece7642a7729af.tar.bz2
hide vehicle translation form, if not having well defined times. Refs #106
-rw-r--r--app/views/vehicle_journeys/show.html.erb23
1 files changed, 13 insertions, 10 deletions
diff --git a/app/views/vehicle_journeys/show.html.erb b/app/views/vehicle_journeys/show.html.erb
index ab0cbc5b6..5a00430f6 100644
--- a/app/views/vehicle_journeys/show.html.erb
+++ b/app/views/vehicle_journeys/show.html.erb
@@ -93,16 +93,19 @@
<li><%= link_to t('vehicle_journeys.actions.edit'), edit_referential_line_route_vehicle_journey_path(@referential, @line, @route, @vehicle_journey), :class => "edit" %></li>
<li><%= link_to t('vehicle_journeys.actions.destroy'), referential_line_route_vehicle_journey_path(@referential, @line, @route, @vehicle_journey), :method => :delete, :confirm => t('vehicle_journeys.actions.destroy_confirm'), :class => "remove" %></li>
</ul>
- <h3><%= t('.translation_form') %></h3>
- <div id="compact_form" >
- <%= semantic_form_for [@referential, @line, @route, @vehicle_journey, VehicleTranslation.new] do |form| %>
- <%= form.inputs do %>
- <%= form.input :duration %>
- <%= form.input :count %>
- <% end %>
- <%= form.actions do %>
- <%= form.action :submit, :as => :button, :label => t('.validation') %>
+ <% unless @vehicle_journey.vehicle_journey_at_stops.empty? ||
+ @vehicle_journey.vehicle_journey_at_stops.any? { |vjas| vjas.departure_time.nil? } %>
+ <h3><%= t('.translation_form') %></h3>
+ <div id="compact_form" >
+ <%= semantic_form_for [@referential, @line, @route, @vehicle_journey, VehicleTranslation.new] do |form| %>
+ <%= form.inputs do %>
+ <%= form.input :duration %>
+ <%= form.input :count %>
+ <% end %>
+ <%= form.actions do %>
+ <%= form.action :submit, :as => :button, :label => t('.validation') %>
+ <% end %>
<% end %>
- <% end %>
</div>
+ <% end %>
<% end %>