1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
  | 
<%= title_tag t('stop_areas.show.title', :stop_area => @stop_area.name ) %>
<div class="stop_area_show">
  <%= @map.to_html %>
  <div class="summary">
    <p>
      <label><%= @stop_area.human_attribute_name("name") %>: </label>
      <%= @stop_area.name %>
    </p>
    <p>
      <label><%= @stop_area.human_attribute_name("comment") %>: </label>
      <%= @stop_area.comment %>
    </p>
    <p>
      <label><%= @stop_area.human_attribute_name("nearest_topic_name") %>: </label>
      <%= @stop_area.nearest_topic_name %>
    </p>
    <p>
      <label><%= @stop_area.human_attribute_name("street_name") %>: </label>
      <%= @stop_area.street_name %>
    </p>
    <p>
      <label><%= @stop_area.human_attribute_name("country_code") %>: </label>
      <%= @stop_area.country_code %>
    </p>
    <p>
      <label><%= @stop_area.human_attribute_name("fare_code") %>: </label>
      <%= @stop_area.fare_code %>
    </p>
    <p>
      <label><%= @stop_area.human_attribute_name("registration_number") %>: </label>
      <%= @stop_area.registration_number %>
    </p>
    <p>
      <label><%= @stop_area.human_attribute_name("stop_area_type") %>: </label>
      <%= t("area_types.label.#{@stop_area.stop_area_type}") %>
    </p>
    <p> <label><%= t('stop_areas.show.geographic_data') %> </label></p>
    <% if @stop_area.projection_type == nil && @stop_area.long_lat_type == nil %>
	    <span class='geo_data'><%= t('stop_areas.show.no_geographic_data') %></span>
    <% else %>
	    <% if @stop_area.projection_type != nil %>
	    <p>
	      <span class='geo_data'><%= @stop_area.human_attribute_name("projection_type") %>: </span>
	      <%= @stop_area.projection_type %>
	    </p>
	    <p>
	      <span class='geo_data'><%= @stop_area.human_attribute_name("x") %>: </span>
	      <%= @stop_area.x %>
	    </p>
	    <p>
	      <span class='geo_data'><%= @stop_area.human_attribute_name("y") %>: </span>
	      <%= @stop_area.y %>
	    </p>
	    <% end %>
	    <% if @stop_area.long_lat_type != nil %>
	    <p>
	      <span class='geo_data'><%= @stop_area.human_attribute_name("long_lat_type") %>: </span>
	      <%= @stop_area.long_lat_type %>
	    </p>
	    <p>
	      <span class='geo_data'><%= @stop_area.human_attribute_name("longitude") %>: </span>
	      <%= @stop_area.longitude %>
	    </p>
	    <p>
	      <span class='geo_data'><%= @stop_area.human_attribute_name("latitude") %>: </span>
	      <%= @stop_area.latitude %>
	    </p>
	    <% end %>
    <% end %>
    <p>
      <label><%= @stop_area.human_attribute_name("objectid") %>: </label>
      <%= @stop_area.objectid %>
    </p>
    <p>
      <label><%= @stop_area.human_attribute_name("creation_time") %>: </label>
      <%= l(@stop_area.creation_time) %>
    </p>
    <p>
      <label><%= @stop_area.human_attribute_name("creator_id") %>: </label>
      <%= @stop_area.creator_id %>
    </p>    
  </div>
  
  <div class="genealogical">
    <% if @stop_area.parent.present? || @stop_area.children.present? %>
      <h3><%= t(".genealogical") %></h3>
    <% end %>
    <% if @stop_area.parent.present? %> 
    <div class="parent">
      <%= link_to([@referential, @stop_area.parent]) do %> 
        <%= image_tag "map/" + @stop_area.parent.stop_area_type + ".png"   %><span><%= @stop_area.parent.name %></span>        
      <% end %>
      <%= link_to image_tag("user_interface/ui/remove.png"), referential_stop_area_path(@referential, @stop_area.parent), :method => :delete, :confirm =>  t('stop_areas.actions.destroy_confirm'), :class => "remove" %>
    </div> 
    <div class="link"><%= image_tag "icons/link.png"%></div>
    <% else %>
    <div class="no_parent"> </div>
    <% end %>
    <% if @stop_area.parent.present? || @stop_area.children.present? %>
    <div class="target">
      <%= image_tag "map/" + @stop_area.stop_area_type + ".png"%><span><%= @stop_area.name %></span>
    </div> 
    <% end %>
    
    <% if @stop_area.children.present? %>
    <div class="link"><%= image_tag "icons/link.png"%></div>
    <div class="children">
      <% @stop_area.children.each do |child| %>
      <div class="child">
        <%= link_to([@referential, child]) do %> 
          <%= image_tag "map/" + child.stop_area_type + ".png"   %><span><%= child.name %></span>         
        <% end %>  
        <%= link_to image_tag("user_interface/ui/remove.png"), referential_stop_area_path(@referential, child), :method => :delete, :confirm =>  t('stop_areas.actions.destroy_confirm'), :class => "remove" %>
      </div>
      <% end %>
    </div> 
    <% end %>
  </div>
                         
</div>
                         
<% content_for :sidebar do %>
<ul class="actions">
  <li><%= link_to t('stop_areas.actions.edit'), edit_referential_stop_area_path(@referential, @stop_area), :class => "edit" %></li>
  <li><%= link_to  t('stop_areas.actions.destroy'), referential_stop_area_path(@referential, @stop_area), :method => :delete, :confirm =>  t('stop_areas.actions.destroy_confirm'), :class => "remove" %></li>
  <% if @stop_area.stop_area_type != 'itl' %>
    <li><%= link_to  t('stop_areas.actions.select_parent'), select_parent_referential_stop_area_path(@referential, @stop_area), :class => "select_parent" %></li>
  <% end %>
  <% if @stop_area.stop_area_type != 'boarding_position' && @stop_area.stop_area_type != 'quay' %>
    <li><%= link_to  t('stop_areas.actions.add_children'), add_children_referential_stop_area_path(@referential, @stop_area), :class => "add_children" %></li>
  <% end %>
  <br>
</ul>
<% end %>
  |