aboutsummaryrefslogtreecommitdiffstats
path: root/app/views/group_of_lines
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/group_of_lines
parent4ff26e0096f122dc74b45b427137eb631da3fd06 (diff)
downloadchouette-core-32df4c7578d30d5a413f3da8d66d525d7e80e4f3.tar.bz2
search results : refresh form with ajax
Diffstat (limited to 'app/views/group_of_lines')
-rw-r--r--app/views/group_of_lines/_group_of_lines.erb9
-rw-r--r--app/views/group_of_lines/index.html.erb12
-rw-r--r--app/views/group_of_lines/index.js.erb1
3 files changed, 12 insertions, 10 deletions
diff --git a/app/views/group_of_lines/_group_of_lines.erb b/app/views/group_of_lines/_group_of_lines.erb
new file mode 100644
index 000000000..4d2d06159
--- /dev/null
+++ b/app/views/group_of_lines/_group_of_lines.erb
@@ -0,0 +1,9 @@
+<div class="page_info">
+ <span class="search"> <%= t("will_paginate.page_entries_info.search") %></span> <%= page_entries_info @group_of_lines %>
+</div>
+<div class="group_of_lines paginated_content">
+ <%= paginated_content(@group_of_lines) %>
+</div>
+<div class="pagination">
+ <%= will_paginate @group_of_lines, :container => false, renderer: BootstrapPagination::Rails %>
+</div>
diff --git a/app/views/group_of_lines/index.html.erb b/app/views/group_of_lines/index.html.erb
index 38010f82e..2257096bd 100644
--- a/app/views/group_of_lines/index.html.erb
+++ b/app/views/group_of_lines/index.html.erb
@@ -1,6 +1,6 @@
<%= title_tag t('group_of_lines.index.title') %>
-<%= search_form_for @q, :url => referential_group_of_lines_path(@referential), :html => {:method => :get, class: "form-inline", :id => "search", role: "form"} do |f| %>
+<%= search_form_for @q, :url => referential_group_of_lines_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-12">
@@ -16,15 +16,7 @@
</div>
<% end %>
-<div class="page_info">
- <span class="search"> <%= t("will_paginate.page_entries_info.search") %></span> <%= page_entries_info @group_of_lines %>
-</div>
-<div class="group_of_lines paginated_content">
- <%= paginated_content(@group_of_lines) %>
-</div>
-<div class="pagination">
- <%= will_paginate @group_of_lines, :container => false, renderer: BootstrapPagination::Rails %>
-</div>
+<div id="group_of_lines"><%= render 'group_of_lines' %></div>
<% content_for :sidebar do %>
<ul class="actions">
diff --git a/app/views/group_of_lines/index.js.erb b/app/views/group_of_lines/index.js.erb
new file mode 100644
index 000000000..fe3e96b5e
--- /dev/null
+++ b/app/views/group_of_lines/index.js.erb
@@ -0,0 +1 @@
+$('#group_of_lines').html('<%= escape_javascript(render("group_of_lines")) %>'); \ No newline at end of file