diff options
| author | Marc Florisson | 2014-05-23 15:27:47 +0200 |
|---|---|---|
| committer | Michel Etienne | 2014-06-24 08:18:25 +0200 |
| commit | ac4a70b85680a59cc2298f542ac429e2504edddf (patch) | |
| tree | e9e762910471401f2a36b6d267f2cb715987df7f | |
| parent | 6658941452598e01439c5e1f391fe8d5de5b6513 (diff) | |
| download | chouette-core-ac4a70b85680a59cc2298f542ac429e2504edddf.tar.bz2 | |
clean useless code, after adding stop_points in route#edit, next
| -rw-r--r-- | app/views/stop_points/_stop_point_draggable.html.erb | 18 | ||||
| -rw-r--r-- | app/views/stop_points/index.html.erb | 74 | ||||
| -rw-r--r-- | app/views/stop_points/new.html.erb | 39 |
3 files changed, 0 insertions, 131 deletions
diff --git a/app/views/stop_points/_stop_point_draggable.html.erb b/app/views/stop_points/_stop_point_draggable.html.erb deleted file mode 100644 index eea0e065a..000000000 --- a/app/views/stop_points/_stop_point_draggable.html.erb +++ /dev/null @@ -1,18 +0,0 @@ -<%= div_for(stop_point) do %> - <div class="handle" alt="<%= t('stop_points.index.move') %>" title="<%= t('stop_points.index.move') %>" ><%= image_tag "icons/move.png" %></div> - <span class="position"> - <%= stop_point.position + 1 %> - </span> - <%= stop_point.stop_area.name %> - <div class="info"> - <%= t('.lines') %> <% stop_point.stop_area.lines.reject { |l| l.id==@line.id}.each do |line| %> - <span class="line"><%= line.number %></span> - <% end %> - - <%= stop_point.stop_area.human_attribute_name('country_code') %> <%= stop_point.stop_area.country_code %> - <div class="actions"> - <%= link_to t("stop_points.actions.show"), referential_stop_area_path(@referential, stop_point.stop_area), :class => "link" %> | - <%= link_to t("actions.destroy"), referential_line_route_stop_point_path(@referential, @line, @route, stop_point), :method => :delete, :data => {:confirm => t('stop_points.actions.destroy_confirm')}, :class => "remove" %> - </div> - </div> -<% end %> - diff --git a/app/views/stop_points/index.html.erb b/app/views/stop_points/index.html.erb deleted file mode 100644 index 0204ea67a..000000000 --- a/app/views/stop_points/index.html.erb +++ /dev/null @@ -1,74 +0,0 @@ -<%= title_tag t('stop_points.index.title', :route => @route.name ) %> - -<div class="stop_points_index"> - <div class="summary"> - <p> - <label><%= @route.class.model_name.human %>: </label> - <%= link_to @route.name, [@referential, @line, @route] %> - </p> - <p> - <label><%= @route.human_attribute_name(:line) %>: </label> - <%= link_to line_formatted_name( @line), [@referential, @line] %> - </p> - </div> - - <h3><%= t('stop_points.index.subtitle')%></h3> - <% if @route.stop_points.empty? %> - <p><%= t('.no_stop_point') %></p> - <% end %> - - <div id="sortable_stop_points"> - <%= render :partial => "stop_point_draggable", :collection => @route.stop_points, :as => :stop_point %> - </div> - <%= semantic_form_for( Chouette::StopPoint.new, - :url => sort_referential_line_route_stop_points_path( @referential, @line, @route), - :html => {:class => "formtastic stop_points_form"}) do |form| %> - <% @stop_points.each do |sp| %> - <input type="hidden" id="<%= "pos_#{sp.position}" %>" name="stop_point[]" value="<%= sp.id %>" /> - <% end %> - <%= form.actions do %> - <% if !@stop_points.empty? %> - <%= form.action :submit, :as => :button, :label => t('.reorder_button') %> - <%= form.action :cancel, :as => :link , :url => referential_line_route_stop_points_path(@referential, @line, @route) %> - <% end %> - <% end %> - <% end %> -</div> -<% content_for :sidebar do %> -<ul class="actions"> - <li><%= link_to t('stop_points.actions.new'), new_referential_line_route_stop_point_path(@referential, @line, @route), :class => "add" %> - </li> -</ul> -<% end %> -<script> -// Sorting the list - - $(document).ready(function(){ - $('#sortable_stop_points').sortable({ - axis: 'y', - dropOnEmpty: false, - handle: '.handle', - cursor: 'crosshair', - items: '.stop_point', - opacity: 0.4, - scroll: true, - update: function(){ - $('.stop_points_form input[name="stop_point[]"]').map(function(index,element){ - var stop_point_id =$('#sortable_stop_points .stop_point')[index].id.replace("stop_point_",""); - var before = $( element).attr("value"); - $( element).attr("value",stop_point_id); - var after = $( element).attr("value"); - console.log( "pos: "+index+", before: "+before+", after:"+after); - }); - // $.ajax({ - // type: 'post', - // data: $('#sortable_stop_points').sortable('serialize'), - // dataType: 'script', - // complete: function(request){ - // $('#sortable_stop_points').effect('highlight'); - // }, - // url: "<%= sort_referential_line_route_stop_points_path( @referential, @line, @route)%>"}) - } - }); - }); -</script> diff --git a/app/views/stop_points/new.html.erb b/app/views/stop_points/new.html.erb deleted file mode 100644 index ee2495ee0..000000000 --- a/app/views/stop_points/new.html.erb +++ /dev/null @@ -1,39 +0,0 @@ -<%= title_tag t('.title', :route => @route.name) %> - -<ul> - <% @route.stop_areas.last(3).each do |stop_area| %> - <li><%= stop_area.parent.name %></li> - <% end %> -</ul> -<%= semantic_form_for [@referential, @line, @route, @stop_point] do |form| %> -<div> - <%= form.inputs do %> - <%= form.input :stop_area_id, :label => t('.select_area'),:input_html => { :"data-pre" => [].to_json } %> - <% end %> - - <%= form.actions do %> - <%= form.action :submit, :as => :button %> - <%= form.action :cancel, :as => :link %> - <% end %> -</div> -<% end %> - -<script> - $(function() { - $( "#stop_point_stop_area_id" ).tokenInput('<%= referential_stop_point_areas_path(@referential, :format => :json) %>', { - crossDomain: false, - prePopulate: $('#stop_area_id').data('pre'), - tokenLimit: 1, - minChars: 3, - hintText: '<%= t('search_hint') %>', - noResultsText: '<%= t('no_result_text') %>', - searchingText: '<%= t('searching_term') %>' - }); - }); -</script> - -<% content_for :sidebar do %> -<ul class="actions"> -</ul> -<% end %> - |
