afimb/chouette2

View on GitHub
app/views/stop_areas/show.html.erb

Summary

Maintainability
Test Coverage
<%= title_tag t('stop_areas.show.title', stop_area: @stop_area.name, stop_area_type: t("area_types.label.#{@stop_area.stop_area_type}") ) %>

<div class="stop_area_show">
  <% if show_map? %>
    <%= @map.to_html %>
  <% end %>  
  <div class="summary">
    <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("zip_code") %>: </label>
      <%= @stop_area.zip_code %>
    </p>
    <p>
      <label><%= @stop_area.human_attribute_name("city_name") %>: </label>
      <%= @stop_area.city_name %>
    </p>
    <p>
      <label><%= @stop_area.human_attribute_name("fare_code") %>: </label>
      <%= @stop_area.fare_code %>
    </p>
    <p>
      <label><%= @stop_area.human_attribute_name("time_zone") %>: </label>
      <%= @stop_area.time_zone %>
    </p>
    <p>
      <label><%= @stop_area.human_attribute_name("url") %>: </label>
      <%= @stop_area.url %>
    </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}") %>
      <i class="fa fa-info-circle" data-toggle="tooltip" data-placement="right" title="<%= t('.not_editable') %>"></i>
    </p>
    <% if !manage_itl %>
        <p>
          <label><%= @stop_area.human_attribute_name("mobility_restricted_suitability") %>: </label>
          <% if (!@stop_area.mobility_restricted_suitability.nil?) %>
            <%= t((@stop_area.mobility_restricted_suitability == true).to_s) %>
          <% else %>
             <%=t("unknown") %>
          <% end %>
        </p>
        <p>
          <label><%= @stop_area.human_attribute_name("stairs_availability") %>: </label>
          <% if (!@stop_area.stairs_availability.nil?) %>
             <%= t((@stop_area.stairs_availability == true).to_s) %>
          <% else %>
             <%=t("unknown") %>
          <% end %>
        </p>
        <p>
          <label><%= @stop_area.human_attribute_name("lift_availability") %>: </label>
          <% if (!@stop_area.lift_availability.nil?) %>
             <%= t((@stop_area.lift_availability == true).to_s) %>
          <% else %>
             <%=t("unknown") %>
          <% end %>
        </p>
        <p> <label><%= t('stop_areas.show.geographic_data') %> </label></p>
        <% if @stop_area.long_lat_type == nil %>
            <span class='geo_data'><%= t('stop_areas.show.no_geographic_data') %></span>
        <% else %>
            <% if !@stop_area.projection.nil? %>
            <p>
              <span class='geo_data'><%= @stop_area.human_attribute_name("projection") %>: </span>
              <%= @referential.projection_type_label %>
            </p>
            <p>
              <span class='geo_data'><%= @stop_area.human_attribute_name("projection_x") %>: </span>
              <%= @stop_area.projection_x %>
            </p>
            <p>
              <span class='geo_data'><%= @stop_area.human_attribute_name("projection_y") %>: </span>
              <%= @stop_area.projection_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 %>
    <% end %>
  </div>
</div>
<p class="after_map" />

<div class="genealogical clearfix">
  <%= render "stop_areas/genealogical" %>
</div>
                         
<% if manage_access_points %>
<div>
    <h3><%= t('.access_points') %></h3>
    
    <div class="access_points paginated_content">
      <%= paginated_content @access_points, "access_points/access_point" %>
    </div>
</div>
<% end %>
                         
<% content_for :sidebar do %>
    <table>
    <tr><td>    
    <ul class="actions">
      <li><%= link_to t('stop_areas.actions.new'), new_referential_stop_area_path(@referential), :class => "add" %></li>
      <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, :data => {:confirm =>  t('stop_areas.actions.destroy_confirm')}, :class => "remove" %></li>
    </ul>
    </td></tr>
  <% if manage_itl %>
    <tr><td>    
    <h4><%= t(".itl_managment") %></h4>
    <ul class="actions">
        <li><%= link_to t('stop_areas.actions.add_routing_lines'), add_routing_lines_referential_stop_area_path(@referential, @stop_area), :class => "add_routing_lines" %></li>
        <li><%= link_to t('stop_areas.actions.add_routing_stops'), add_routing_stops_referential_stop_area_path(@referential, @stop_area), :class => "add_routing_stops" %></li>
    </ul>
    </td></tr>
  <% else %>
    <tr><td>    
    <h4><%= t(".stop_managment") %></h4>
    <ul class="actions">
       <li><%= link_to t('stop_areas.actions.select_parent'), select_parent_referential_stop_area_path(@referential, @stop_area), :class => "parent" %></li>
       <% if @stop_area.parent == nil %>
         <li><%= link_to t('stop_areas.actions.clone_as_parent'), new_referential_stop_area_stop_area_copy_path(@referential, @stop_area, :hierarchy => "parent"), :class => "clone" %></li>
       <% end %>
       <% if manage_children %>
          <li><%= link_to t('stop_areas.actions.add_children'), add_children_referential_stop_area_path(@referential, @stop_area), :class => "children" %></li>
          <li><%= link_to t('stop_areas.actions.clone_as_child'), new_referential_stop_area_stop_area_copy_path(@referential, @stop_area, :hierarchy => "child"), :class => "clone" %></li>
       <% end %>
    </ul>
    </td></tr>
    
    <% if manage_access_points %>
    <tr><td>    
    <h4><%= t(".access_managment") %></h4>
    <ul class="actions">
        <li><%= link_to t('access_points.actions.new'), new_referential_stop_area_access_point_path(@referential,@stop_area), :class => "add" %></li>
        <li><%= link_to t('stop_areas.actions.manage_access_links'), access_links_referential_stop_area_path(@referential,@stop_area), :class => "access_link" %></li>
    </ul>
    </td></tr>
    <% end %>
    
  <% end %>
    </table>
  <br>
  <%= creation_tag(@stop_area) %>
<% end %>