afimb/chouette2

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

Summary

Maintainability
Test Coverage
<%= title_tag t('stop_areas.add_routing_lines.title', :stop_area => @stop_area.name ) %>

<%= semantic_form_for [@referential, @stop_area] do |form| %>
<div>
  <%= form.inputs do %>
    <%= form.input :routing_line_ids, :as => :text, :input_html => { :"data-pre" => ( @lines.map { |line| { :id => line.id.to_s, :name => "#{line.number} - #{line.name}" } } ).to_json }  %>
  <% end %>

   <%= form.actions do %>
     <%= form.action :submit, :as => :button %>
     <%= form.action :cancel, :as => :link %>
   <% end %>
</div>
<% end %>

<script>
    $(function() {
        $( "#stop_area_routing_line_ids" ).tokenInput('<%= referential_stop_area_stop_area_routing_lines_path(@referential, @stop_area, :format => :json) %>', {
       crossDomain: false,
       prePopulate: $('#stop_area_routing_line_id').data('pre'),
       minChars: 1,
       hintText: '<%= t('search_hint') %>',
       noResultsText: '<%= t('no_result_text') %>',
       searchingText: '<%= t('searching_term') %>'
    });
    });
</script>

<% content_for :sidebar do %>
<ul class="actions">
</ul>
<% end %>