aboutsummaryrefslogtreecommitdiffstats
path: root/app/views/stop_areas
diff options
context:
space:
mode:
authorMichel Etienne2014-08-28 11:44:07 +0200
committerMichel Etienne2014-08-28 11:44:07 +0200
commit32df4c7578d30d5a413f3da8d66d525d7e80e4f3 (patch)
tree553a1206d1c21301b83c5c9fad085d35c6beee12 /app/views/stop_areas
parent4ff26e0096f122dc74b45b427137eb631da3fd06 (diff)
downloadchouette-core-32df4c7578d30d5a413f3da8d66d525d7e80e4f3.tar.bz2
search results : refresh form with ajax
Diffstat (limited to 'app/views/stop_areas')
-rw-r--r--app/views/stop_areas/_stop_areas.html.erb9
-rw-r--r--app/views/stop_areas/index.html.erb12
-rw-r--r--app/views/stop_areas/index.js.erb1
3 files changed, 12 insertions, 10 deletions
diff --git a/app/views/stop_areas/_stop_areas.html.erb b/app/views/stop_areas/_stop_areas.html.erb
new file mode 100644
index 000000000..38423aedf
--- /dev/null
+++ b/app/views/stop_areas/_stop_areas.html.erb
@@ -0,0 +1,9 @@
+<div class="page_info">
+ <span class="search"> <%= t("will_paginate.page_entries_info.search") %></span> <%= page_entries_info @stop_areas %>
+</div>
+<div class="stop_areas paginated_content">
+ <%= paginated_content(@stop_areas) %>
+</div>
+<div class="pagination">
+ <%= will_paginate @stop_areas, :container => false, renderer: BootstrapPagination::Rails %>
+</div>
diff --git a/app/views/stop_areas/index.html.erb b/app/views/stop_areas/index.html.erb
index a186a33ac..3398b8ab7 100644
--- a/app/views/stop_areas/index.html.erb
+++ b/app/views/stop_areas/index.html.erb
@@ -4,7 +4,7 @@
<%= @country_codes.to_json %>
</div>
-<%= search_form_for @q, :url => referential_stop_areas_path(@referential), :html => {:method => :get, class: "form-inline", :id => "search", role: "form"} do |f| %>
+<%= search_form_for @q, :url => referential_stop_areas_path(@referential), remote: true, :html => {:method => :get, class: "form-inline", :id => "search", role: "form"} do |f| %>
<div class="panel panel-default">
<div class="panel-heading">
<div class="input-group col-md-9">
@@ -27,15 +27,7 @@
</div>
<% end %>
-<div class="page_info">
- <span class="search"> <%= t("will_paginate.page_entries_info.search") %></span> <%= page_entries_info @stop_areas %>
-</div>
-<div class="stop_areas paginated_content">
- <%= paginated_content(@stop_areas) %>
-</div>
-<div class="pagination">
- <%= will_paginate @stop_areas, :container => false, renderer: BootstrapPagination::Rails %>
-</div>
+<div id="stop_areas"><%= render 'stop_areas' %></div>
<% content_for :sidebar do %>
<ul class="actions">
diff --git a/app/views/stop_areas/index.js.erb b/app/views/stop_areas/index.js.erb
new file mode 100644
index 000000000..1621823cc
--- /dev/null
+++ b/app/views/stop_areas/index.js.erb
@@ -0,0 +1 @@
+$('#stop_areas').html('<%= escape_javascript(render("stop_areas")) %>'); \ No newline at end of file