aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichel Etienne2012-09-05 18:51:16 +0200
committerMichel Etienne2012-09-05 18:51:16 +0200
commit9d5b817bb9053b25cd5d3914ff95e1a592fc62e9 (patch)
tree7661d5852e028aca7b585783183befe8dfef1f79
parente524f087ae7fe7543bffbdf281ed9e07c00b9418 (diff)
downloadchouette-core-9d5b817bb9053b25cd5d3914ff95e1a592fc62e9.tar.bz2
block journey_pattern and vehicle_journey link when less than 2 stop_points are defined on route
-rw-r--r--Gemfile.lock3
-rw-r--r--app/views/journey_patterns/show.html.erb4
-rw-r--r--app/views/routes/show.html.erb8
3 files changed, 13 insertions, 2 deletions
diff --git a/Gemfile.lock b/Gemfile.lock
index e8929de66..5af91e2b9 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -1,6 +1,6 @@
GIT
remote: git://chouette.dryade.priv/ninoxe
- revision: 55d3c3c3f8dde90dc1b30224cefbe679a4ee9786
+ revision: ddc6b0f9adfb2df8aa2b521d6a749c229977383c
specs:
ninoxe (0.0.8)
GeoRuby
@@ -195,7 +195,6 @@ GEM
jruby-rack (1.1.9)
jruby-rack-worker (0.4-java)
jruby-rack (>= 1.1.1)
- json (1.7.5)
json (1.7.5-java)
json_pure (1.7.5)
launchy (2.1.0)
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 %>