diff options
| author | Bruno Perles | 2015-12-07 15:40:07 +0100 | 
|---|---|---|
| committer | Bruno Perles | 2015-12-16 10:02:41 +0100 | 
| commit | 39dccecdda931e73959ff7f5cdb96980aab512aa (patch) | |
| tree | 676cf6feb524deeb28536a8b4332c73e2cdd6a8f /app | |
| parent | e2602ff09070e8d752a3c3ddf90ea1d26487af27 (diff) | |
| download | chouette-core-39dccecdda931e73959ff7f5cdb96980aab512aa.tar.bz2 | |
Add control to journey_pattern_secion
Diffstat (limited to 'app')
| -rw-r--r-- | app/assets/stylesheets/main/journey_patterns.scss | 8 | ||||
| -rw-r--r-- | app/controllers/route_sections_selectors_controller.rb | 5 | ||||
| -rw-r--r-- | app/views/journey_patterns/show.html.erb | 7 | ||||
| -rw-r--r-- | app/views/route_sections/index.html.erb | 2 | 
4 files changed, 17 insertions, 5 deletions
| diff --git a/app/assets/stylesheets/main/journey_patterns.scss b/app/assets/stylesheets/main/journey_patterns.scss index 07ed52b9e..51547b05d 100644 --- a/app/assets/stylesheets/main/journey_patterns.scss +++ b/app/assets/stylesheets/main/journey_patterns.scss @@ -49,7 +49,7 @@              padding-left: 4px;          }      } -     -}         - - +} +#middle #sidebar a.control-shape { +  color: orange; +} diff --git a/app/controllers/route_sections_selectors_controller.rb b/app/controllers/route_sections_selectors_controller.rb index 05a399ae8..b5b5ebd48 100644 --- a/app/controllers/route_sections_selectors_controller.rb +++ b/app/controllers/route_sections_selectors_controller.rb @@ -18,6 +18,11 @@ class RouteSectionsSelectorsController < ChouetteController      @map = RouteSectionSelectorMap.new(resource).with_helpers(self)    end +  def update +    update! +    parent.control_route_sections +  end +    def selection      parent diff --git a/app/views/journey_patterns/show.html.erb b/app/views/journey_patterns/show.html.erb index 3a2b18ea1..6bd6022f7 100644 --- a/app/views/journey_patterns/show.html.erb +++ b/app/views/journey_patterns/show.html.erb @@ -35,7 +35,12 @@    <li><%= link_to t('journey_patterns.actions.new'), new_referential_line_route_journey_pattern_path(@referential, @line, @route), :class => "add" %></li>    <li><%= link_to t('journey_patterns.actions.edit'), edit_referential_line_route_journey_pattern_path(@referential, @line, @route, @journey_pattern), :class => "edit" %></li>    <li><%= 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" %></li> -  <li><%= link_to t('journey_patterns.actions.edit_route_sections'), edit_referential_line_route_journey_pattern_route_sections_selector_path(@referential, @line, @route, @journey_pattern), class: 'edit' %></li> +  <li> +    <%= link_to edit_referential_line_route_journey_pattern_route_sections_selector_path(@referential, @line, @route, @journey_pattern), class: "edit#{' control-shape' if @journey_pattern.control?}" do %> +      <%= t('journey_patterns.actions.edit_route_sections') %> +      <% if @journey_pattern.control? %><i class="fa fa-exclamation-triangle"></i><% end %> +    <% end %> +  </li>    <li><%= 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 => "clock" %></li>  </ul>    <%= creation_tag(@journey_pattern) %> diff --git a/app/views/route_sections/index.html.erb b/app/views/route_sections/index.html.erb index 5d7bef989..763ea360e 100644 --- a/app/views/route_sections/index.html.erb +++ b/app/views/route_sections/index.html.erb @@ -30,6 +30,7 @@        <th><%= Chouette::RouteSection.human_attribute_name :arrival %></th>        <th class="distance"><%= Chouette::RouteSection.human_attribute_name :distance %></th>        <th class="points"><%= Chouette::RouteSection.human_attribute_name :points %></th> +      <th class="points"><%= Chouette::RouteSection.human_attribute_name :quantity %></th>        <th class="actions"></th>      </tr>    </thead> @@ -40,6 +41,7 @@        <td><%= route_section.arrival.name %> <%= link_to content_tag(:i, "", class: "fa fa-external-link"), referential_stop_area_path(@referential, route_section.arrival) %></td>        <td class="distance"><%= route_section.distance.to_i if route_section.distance %></td>        <td class="points"><%= route_section.via_count if route_section.via_count > 0 %></td> +      <td class="journey_patterns"><%= route_section.journey_pattern_sections.count(:journey_pattern_id, distinct: true) %></td>        <td class="actions">          <%= link_to t('.actions.show'), referential_route_section_path(@referential, route_section), class: "view" %>          <%= link_to t('.actions.edit'), edit_referential_route_section_path(@referential, route_section), class: "edit" %> | 
