aboutsummaryrefslogtreecommitdiffstats
path: root/app/views
diff options
context:
space:
mode:
authorMichel Etienne2012-09-05 18:51:16 +0200
committerMichel Etienne2012-09-05 18:51:16 +0200
commit9d5b817bb9053b25cd5d3914ff95e1a592fc62e9 (patch)
tree7661d5852e028aca7b585783183befe8dfef1f79 /app/views
parente524f087ae7fe7543bffbdf281ed9e07c00b9418 (diff)
downloadchouette-core-9d5b817bb9053b25cd5d3914ff95e1a592fc62e9.tar.bz2
block journey_pattern and vehicle_journey link when less than 2 stop_points are defined on route
Diffstat (limited to 'app/views')
-rw-r--r--app/views/journey_patterns/show.html.erb4
-rw-r--r--app/views/routes/show.html.erb8
2 files changed, 12 insertions, 0 deletions
diff --git a/app/views/journey_patterns/show.html.erb b/app/views/journey_patterns/show.html.erb
index 507a71cca..149f9df6a 100644
--- a/app/views/journey_patterns/show.html.erb
+++ b/app/views/journey_patterns/show.html.erb
@@ -5,6 +5,10 @@
<div class="summary">
<p>
+ <label><%= @route.human_attribute_name(:line) %>: </label>
+ <%= link_to line_formatted_name( @line), [@referential, @line] %>
+ </p>
+ <p>
<label><%= @journey_pattern.human_attribute_name(:route) %>: </label>
<%= link_to @route.name, [@referential, @line, @route] %>
</p>
diff --git a/app/views/routes/show.html.erb b/app/views/routes/show.html.erb
index 970ab7981..f65761fc6 100644
--- a/app/views/routes/show.html.erb
+++ b/app/views/routes/show.html.erb
@@ -65,6 +65,7 @@
</div>
<p class="after_map" />
+<% if @route.stop_points.size > 0 %>
<h3 class="route_stop_points">
<a class="stop_points"><%= t('.stop_points') %>
<%= image_tag("icons/plus.png" , :class => "switcher") %>
@@ -74,7 +75,9 @@
<div class="stop_points_detail" style="display: none;">
<%= render :partial => "stop_points_detail" %>
</div>
+<% end %>
+<% if @route.stop_points.size >= 2 %>
<h3 class="route_journey_patterns">
<a class="journey_patterns"><%= t('.journey_patterns') %>
<%= image_tag("icons/plus.png" , :class => "switcher") %>
@@ -84,6 +87,7 @@
<div class="journey_patterns content" style="display: none;">
<%= render :partial => "journey_patterns/journey_pattern", :collection => @route.journey_patterns %>
</div>
+<% end %>
<% content_for :sidebar do %>
<ul class="actions">
@@ -92,12 +96,16 @@
<li>
<%= link_to t('stop_points.actions.sort'), [@referential, @line, @route, :stop_points], :class => "edit" %>
</li>
+<% if @route.stop_points.size >= 2 %>
<li>
<%= link_to t('journey_patterns.actions.new'), new_referential_line_route_journey_pattern_path(@referential, @line, @route), :class => "add" %>
</li>
+<% if @route.journey_patterns.size > 0 %>
<li>
<%= link_to t('vehicle_journeys.actions.index'), [@referential, @line, @route, :vehicle_journeys], :class => "link" %>
</li>
+<% end %>
+<% end %>
</ul>
<% end %>