From 0c9781ac6c9927c4631826c2319c0c14436587d6 Mon Sep 17 00:00:00 2001 From: Michel Etienne Date: Tue, 13 Nov 2012 10:23:06 +0100 Subject: add created bloc for each show view --- app/assets/stylesheets/access_points.css.scss | 1 - app/views/access_links/show.html.erb | 9 +--- app/views/access_points/show.html.erb | 9 +--- app/views/companies/show.html.erb | 9 +--- app/views/connection_links/show.html.erb | 9 +--- app/views/group_of_lines/show.html.erb | 11 +--- app/views/journey_patterns/show.html.erb | 9 +--- app/views/lines/show.html.erb | 9 +--- app/views/networks/show.html.erb | 9 +--- app/views/routes/show.html.erb | 9 +--- app/views/stop_areas/_genealogical.html.erb | 66 +++++++++++++++++++++++ app/views/stop_areas/show.html.erb | 76 +-------------------------- app/views/vehicle_journeys/show.html.erb | 9 +--- 13 files changed, 78 insertions(+), 157 deletions(-) create mode 100644 app/views/stop_areas/_genealogical.html.erb (limited to 'app') diff --git a/app/assets/stylesheets/access_points.css.scss b/app/assets/stylesheets/access_points.css.scss index 7a27050fa..22dc3ac3d 100644 --- a/app/assets/stylesheets/access_points.css.scss +++ b/app/assets/stylesheets/access_points.css.scss @@ -46,7 +46,6 @@ } .summary{ - height: 400px; p label { font-weight: bold; diff --git a/app/views/access_links/show.html.erb b/app/views/access_links/show.html.erb index 27e2e9bbf..aa049899a 100644 --- a/app/views/access_links/show.html.erb +++ b/app/views/access_links/show.html.erb @@ -70,14 +70,6 @@ <%= @access_link.objectid %>

-

- - <%= l(@access_link.creation_time) %> -

-

- - <%= @access_link.creator_id %> -

@@ -87,4 +79,5 @@
  • <%= link_to t('access_links.actions.destroy'), referential_access_point_access_link_path(@referential, @access_link.access_point, @access_link), :method => :delete, :data => {:confirm => t('access_links.actions.destroy_confirm')}, :class => "remove" %>

  • + <%= creation_tag(@access_link) %> <% end %> diff --git a/app/views/access_points/show.html.erb b/app/views/access_points/show.html.erb index 97bd961d6..7b25d6b96 100644 --- a/app/views/access_points/show.html.erb +++ b/app/views/access_points/show.html.erb @@ -89,14 +89,6 @@ <%= @access_point.objectid %>

    -

    - - <%= l(@access_point.creation_time) %> -

    -

    - - <%= @access_point.creator_id %> -

    @@ -149,4 +141,5 @@
  • <%= link_to t('access_points.actions.destroy'), referential_stop_area_access_point_path(@referential, @stop_area, @access_point), :method => :delete, :data => {:confirm => t('access_points.actions.destroy_confirm')}, :class => "remove" %>

  • + <%= creation_tag(@access_point) %> <% end %> diff --git a/app/views/companies/show.html.erb b/app/views/companies/show.html.erb index fe819d360..844832ee1 100644 --- a/app/views/companies/show.html.erb +++ b/app/views/companies/show.html.erb @@ -43,14 +43,6 @@ <%= @company.objectid %>

    -

    - - <%= l(@company.creation_time) %> -

    -

    - - <%= @company.creator_id %> -

    @@ -60,4 +52,5 @@
  • <%= link_to t('companies.actions.destroy'), referential_company_path(@referential, @company), :method => :delete, :data => {:confirm => t('companies.actions.destroy_confirm')}, :class => "remove" %>

  • + <%= creation_tag(@company) %> <% end %> diff --git a/app/views/connection_links/show.html.erb b/app/views/connection_links/show.html.erb index 58c90cc41..a41112621 100644 --- a/app/views/connection_links/show.html.erb +++ b/app/views/connection_links/show.html.erb @@ -79,14 +79,6 @@ <%= @connection_link.objectid %>

    -

    - - <%= l(@connection_link.creation_time) %> -

    -

    - - <%= @connection_link.creator_id %> -

    @@ -97,4 +89,5 @@
  • <%= link_to t('connection_links.actions.select_areas'), select_areas_referential_connection_link_path(@referential, @connection_link), :class => "select_areas" %>

  • + <%= creation_tag(@connection_link) %> <% end %> diff --git a/app/views/group_of_lines/show.html.erb b/app/views/group_of_lines/show.html.erb index 60c4b7def..5e77bfe78 100644 --- a/app/views/group_of_lines/show.html.erb +++ b/app/views/group_of_lines/show.html.erb @@ -15,14 +15,6 @@ <%= @group_of_line.objectid %>

    -

    - - <%= l @group_of_line.creation_time %> -

    -

    - - <%= @group_of_line.creator_id %> -

    @@ -35,8 +27,6 @@

    - - <% content_for :sidebar do %> @@ -45,4 +35,5 @@
  • <%= link_to t('group_of_lines.actions.destroy'), referential_group_of_line_path(@referential, @group_of_line), :method => :delete, :data => {:confirm => t('group_of_lines.actions.destroy_confirm')} , :class => "remove" %>

  • + <%= creation_tag(@group_of_line) %> <% end %> diff --git a/app/views/journey_patterns/show.html.erb b/app/views/journey_patterns/show.html.erb index b9378abd5..eb8f40cc1 100644 --- a/app/views/journey_patterns/show.html.erb +++ b/app/views/journey_patterns/show.html.erb @@ -32,14 +32,6 @@ <%= @journey_pattern.objectid %>

    -

    - - <%= l @journey_pattern.creation_time %> -

    -

    - - <%= @journey_pattern.creator_id %> -

    @@ -56,5 +48,6 @@
  • <%= link_to t('journey_patterns.actions.destroy'), referential_line_route_journey_pattern_path(@referential, @line, @route, @journey_pattern), :method => :delete, :data => {:confirm => t('journey_patterns.actions.destroy_confirm')}, :class => "remove" %>
  • <%= link_to t('journey_patterns.journey_pattern.vehicle_journey_at_stops'), referential_line_route_vehicle_journeys_path(@referential, @line, @route, :q => {:journey_pattern_id_eq => @journey_pattern.id}), :class => "link" %>
  • + <%= creation_tag(@journey_pattern) %> <% end %> diff --git a/app/views/lines/show.html.erb b/app/views/lines/show.html.erb index 737d922a0..668eaebdc 100644 --- a/app/views/lines/show.html.erb +++ b/app/views/lines/show.html.erb @@ -48,14 +48,6 @@ <%= @line.objectid %>

    -

    - - <%= l(@line.creation_time) %> -

    -

    - - <%= @line.creator_id %> -

    @@ -81,4 +73,5 @@
  • <%= link_to t('routes.actions.new'), new_referential_line_route_path(@referential, @line), :class => "add" %>

  • + <%= creation_tag(@line) %> <% end %> diff --git a/app/views/networks/show.html.erb b/app/views/networks/show.html.erb index 8ed9c422f..273a04aed 100644 --- a/app/views/networks/show.html.erb +++ b/app/views/networks/show.html.erb @@ -37,14 +37,6 @@ <%= @network.objectid %>

    -

    - - <%= l @network.creation_time %> -

    -

    - - <%= @network.creator_id %> -

    @@ -54,4 +46,5 @@
  • <%= link_to t('networks.actions.destroy'), referential_network_path(@referential, @network), :method => :delete, :data => {:confirm => t('networks.actions.destroy_confirm')}, :class => "remove" %>

  • + <%= creation_tag(@network) %> <% end %> diff --git a/app/views/routes/show.html.erb b/app/views/routes/show.html.erb index 414d0474a..654e3975a 100644 --- a/app/views/routes/show.html.erb +++ b/app/views/routes/show.html.erb @@ -52,14 +52,6 @@ <%= @route.objectid %>

    -

    - - <%= l @route.creation_time %> -

    -

    - - <%= @route.creator_id %> -

    @@ -104,5 +96,6 @@ <% end %> + <%= creation_tag(@route) %> <% end %> diff --git a/app/views/stop_areas/_genealogical.html.erb b/app/views/stop_areas/_genealogical.html.erb new file mode 100644 index 000000000..3b935ce92 --- /dev/null +++ b/app/views/stop_areas/_genealogical.html.erb @@ -0,0 +1,66 @@ +

    <%= genealogical_title %>

    + + <% if @stop_area.parent.present? %> +
    + <%= link_to([@referential, @stop_area.parent]) do %> + <%= image_tag "map/" + @stop_area.parent.stop_area_type + ".png" %><%= @stop_area.parent.name %> + <% end %> +
    + + <% elsif @stop_area.routing_lines.present? %> +
    + <% @stop_area.routing_lines.each do |line| %> +
    + <%= link_to([@referential, line]) do %> + <%= line.name %> + <% end %> +
    + <% end %> +
    + + <% else %> +
     
    + <% end %> + +
    + <%= image_tag "map/" + @stop_area.stop_area_type + ".png"%><%= @stop_area.name %> +
    + + <% if @stop_area.children.present? %> + +
    + <% @stop_area.children.each do |child| %> +
    + <%= link_to([@referential, child]) do %> + <%= image_tag "map/" + child.stop_area_type + ".png" %><%= child.name %> + <% end %> +
    + <% end %> +
    + <% elsif @stop_area.routing_stops.present? %> + +
    + <% @stop_area.routing_stops.each do |stop| %> +
    + <%= link_to([@referential, stop]) do %> + <%= image_tag "map/" + stop.stop_area_type + ".png" %><%= stop.name %> + <% end %> +
    + <% end %> +
    + <% elsif @stop_area.routes.present? %> + +
    + <% @stop_area.routes.each do |route| %> +
    + <%= link_to([@referential, route.line ]) do %> + <%= route.line.number %> + <% end %> +   + <%= link_to([@referential, route.line , route]) do %> + <%= route.name %> + <% end %> +
    + <% end %> +
    + <% end %> diff --git a/app/views/stop_areas/show.html.erb b/app/views/stop_areas/show.html.erb index 44755d020..310761a03 100644 --- a/app/views/stop_areas/show.html.erb +++ b/app/views/stop_areas/show.html.erb @@ -74,85 +74,12 @@ <%= @stop_area.objectid %>

    -

    - - <%= l(@stop_area.creation_time) %> -

    -

    - - <%= @stop_area.creator_id %> -

    -

    <%= genealogical_title %>

    - - <% if @stop_area.parent.present? %> -
    - <%= link_to([@referential, @stop_area.parent]) do %> - <%= image_tag "map/" + @stop_area.parent.stop_area_type + ".png" %><%= @stop_area.parent.name %> - <% end %> -
    - - <% elsif @stop_area.routing_lines.present? %> -
    - <% @stop_area.routing_lines.each do |line| %> -
    - <%= link_to([@referential, line]) do %> - <%= line.name %> - <% end %> -
    - <% end %> -
    - - <% else %> -
     
    - <% end %> - -
    - <%= image_tag "map/" + @stop_area.stop_area_type + ".png"%><%= @stop_area.name %> -
    - - <% if @stop_area.children.present? %> - -
    - <% @stop_area.children.each do |child| %> -
    - <%= link_to([@referential, child]) do %> - <%= image_tag "map/" + child.stop_area_type + ".png" %><%= child.name %> - <% end %> -
    - <% end %> -
    - <% elsif @stop_area.routing_stops.present? %> - -
    - <% @stop_area.routing_stops.each do |stop| %> -
    - <%= link_to([@referential, stop]) do %> - <%= image_tag "map/" + stop.stop_area_type + ".png" %><%= stop.name %> - <% end %> -
    - <% end %> -
    - <% elsif @stop_area.routes.present? %> - -
    - <% @stop_area.routes.each do |route| %> -
    - <%= link_to([@referential, route.line ]) do %> - <%= route.line.number %> - <% end %> -   - <%= link_to([@referential, route.line , route]) do %> - <%= route.name %> - <% end %> -
    - <% end %> -
    - <% end %> + <%= render "stop_areas/genealogical" %>
    @@ -208,4 +135,5 @@ <% end %>
    + <%= creation_tag(@stop_area) %> <% end %> diff --git a/app/views/vehicle_journeys/show.html.erb b/app/views/vehicle_journeys/show.html.erb index 3ed6452ae..b6203c2bc 100644 --- a/app/views/vehicle_journeys/show.html.erb +++ b/app/views/vehicle_journeys/show.html.erb @@ -42,14 +42,6 @@ <%= @vehicle_journey.objectid %>

    -

    - - <%= l @vehicle_journey.creation_time %> -

    -

    - - <%= @vehicle_journey.creator_id %> -

    @@ -107,5 +99,6 @@ <% end %> <% end %> + <%= creation_tag(@vehicle_journey) %> <% end %> <% end %> -- cgit v1.2.3