diff options
25 files changed, 78 insertions, 60 deletions
| diff --git a/app/controllers/companies_controller.rb b/app/controllers/companies_controller.rb index 27f0f9235..3b5631a8f 100644 --- a/app/controllers/companies_controller.rb +++ b/app/controllers/companies_controller.rb @@ -3,6 +3,7 @@ class CompaniesController < ChouetteController    respond_to :html    respond_to :xml    respond_to :json +  respond_to :js, :only => :index    belongs_to :referential, :parent_class => Referential diff --git a/app/controllers/connection_links_controller.rb b/app/controllers/connection_links_controller.rb index 6f225af1f..3c7dd3ab6 100644 --- a/app/controllers/connection_links_controller.rb +++ b/app/controllers/connection_links_controller.rb @@ -8,6 +8,7 @@ class ConnectionLinksController < ChouetteController    respond_to :html, :xml, :json    respond_to :kml, :only => :show +  respond_to :js, :only => :index    def index          index! do |format| diff --git a/app/controllers/group_of_lines_controller.rb b/app/controllers/group_of_lines_controller.rb index a38b22c10..5bbda9b84 100644 --- a/app/controllers/group_of_lines_controller.rb +++ b/app/controllers/group_of_lines_controller.rb @@ -4,6 +4,7 @@ class GroupOfLinesController < ChouetteController    respond_to :xml    respond_to :json    respond_to :kml, :only => :show +  respond_to :js, :only => :index    belongs_to :referential diff --git a/app/controllers/networks_controller.rb b/app/controllers/networks_controller.rb index b911ab603..04d565812 100644 --- a/app/controllers/networks_controller.rb +++ b/app/controllers/networks_controller.rb @@ -4,6 +4,7 @@ class NetworksController < ChouetteController    respond_to :xml    respond_to :json    respond_to :kml, :only => :show +  respond_to :js, :only => :index    belongs_to :referential diff --git a/app/controllers/stop_areas_controller.rb b/app/controllers/stop_areas_controller.rb index 80723dc02..e18f89cab 100644 --- a/app/controllers/stop_areas_controller.rb +++ b/app/controllers/stop_areas_controller.rb @@ -9,6 +9,7 @@ class StopAreasController < ChouetteController    end    respond_to :html, :kml, :xml, :json +  respond_to :js, :only => :index    # def complete    #   @stop_areas = line.stop_areas diff --git a/app/controllers/time_tables_controller.rb b/app/controllers/time_tables_controller.rb index a18603ed9..586713c60 100644 --- a/app/controllers/time_tables_controller.rb +++ b/app/controllers/time_tables_controller.rb @@ -4,6 +4,7 @@ class TimeTablesController < ChouetteController    respond_to :html    respond_to :xml    respond_to :json +  respond_to :js, :only => :index    belongs_to :referential diff --git a/app/views/companies/_companies.erb b/app/views/companies/_companies.erb new file mode 100644 index 000000000..29871b836 --- /dev/null +++ b/app/views/companies/_companies.erb @@ -0,0 +1,9 @@ +<div class="page_info"> +  <span class="search"> <%= t("will_paginate.page_entries_info.search") %></span> <%= page_entries_info @companies %> +</div> +<div class="companies paginated_content"> +   <%= paginated_content(@companies) %> +</div> +<div class="pagination"> +  <%= will_paginate @companies, :container => false, renderer: BootstrapPagination::Rails %> +</div> diff --git a/app/views/companies/index.html.erb b/app/views/companies/index.html.erb index 48b190152..c28eaa8bc 100644 --- a/app/views/companies/index.html.erb +++ b/app/views/companies/index.html.erb @@ -1,6 +1,6 @@  <%= title_tag t('companies.index.title') %>  -<%= search_form_for @q, :url => referential_companies_path(@referential), :html => {:method => :get, class: "form-inline", :id => "search", role: "form"} do |f| %> +<%= search_form_for @q, :url => referential_companies_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 @companies %> -</div> -<div class="companies paginated_content"> -   <%= paginated_content(@companies) %> -</div> -<div class="pagination"> -  <%= will_paginate @companies, :container => false, renderer: BootstrapPagination::Rails %> -</div> +<div id="companies"><%= render 'companies' %></div>  <% content_for :sidebar do %>  <ul class="actions"> diff --git a/app/views/companies/index.js.erb b/app/views/companies/index.js.erb new file mode 100644 index 000000000..3afe2b9c5 --- /dev/null +++ b/app/views/companies/index.js.erb @@ -0,0 +1 @@ +$('#companies').html('<%= escape_javascript(render("companies")) %>');
\ No newline at end of file diff --git a/app/views/connection_links/_connection_links.erb b/app/views/connection_links/_connection_links.erb new file mode 100644 index 000000000..1f4704596 --- /dev/null +++ b/app/views/connection_links/_connection_links.erb @@ -0,0 +1,9 @@ +<div class="page_info"> +  <span class="search"> <%= t("will_paginate.page_entries_info.search") %></span> <%= page_entries_info @connection_links %> +</div> +<div class="connection_links paginated_content"> +  <%= paginated_content(@connection_links) %> +</div> +<div class="pagination"> +  <%= will_paginate @connection_links, :container => false, renderer: BootstrapPagination::Rails %> +</div> diff --git a/app/views/connection_links/index.html.erb b/app/views/connection_links/index.html.erb index a1e4ae5e4..151ce2d89 100644 --- a/app/views/connection_links/index.html.erb +++ b/app/views/connection_links/index.html.erb @@ -1,6 +1,6 @@  <%= title_tag t('connection_links.index.title') %>  -<%= search_form_for @q, :url => referential_connection_links_path(@referential), :html => {:method => :get, class: "form-inline", :id => "search", role: "form"} do |f| %> +<%= search_form_for @q, :url => referential_connection_links_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 @connection_links %> -</div> -<div class="connection_links paginated_content"> -  <%= paginated_content(@connection_links) %> -</div> -<div class="pagination"> -  <%= will_paginate @connection_links, :container => false, renderer: BootstrapPagination::Rails %> -</div> +<div id="connection_links"><%= render 'connection_links' %></div>  <% content_for :sidebar do %>  <ul class="actions"> diff --git a/app/views/connection_links/index.js.erb b/app/views/connection_links/index.js.erb new file mode 100644 index 000000000..c01f09b97 --- /dev/null +++ b/app/views/connection_links/index.js.erb @@ -0,0 +1 @@ +$('#connection_links').html('<%= escape_javascript(render("connection_links")) %>');
\ No newline at end of file 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 diff --git a/app/views/networks/_networks.erb b/app/views/networks/_networks.erb new file mode 100644 index 000000000..e395d4ebb --- /dev/null +++ b/app/views/networks/_networks.erb @@ -0,0 +1,9 @@ +<div class="page_info"> +  <span class="search"> <%= t("will_paginate.page_entries_info.search") %></span> <%= page_entries_info @networks %> +</div> +<div class="networks paginated_content"> +  <%= paginated_content(@networks) %> +</div> +<div class="pagination"> +  <%= will_paginate @networks, :container => false, renderer: BootstrapPagination::Rails %> +</div> diff --git a/app/views/networks/index.html.erb b/app/views/networks/index.html.erb index a477c179a..e093a258c 100644 --- a/app/views/networks/index.html.erb +++ b/app/views/networks/index.html.erb @@ -1,6 +1,6 @@  <%= title_tag t('networks.index.title') %>  -<%= search_form_for @q, :url => referential_networks_path(@referential), :html => {:method => :get, class: "form-inline", :id => "search", role: "form"} do |f| %> +<%= search_form_for @q, :url => referential_networks_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 @networks %> -</div> -<div class="networks paginated_content"> -  <%= paginated_content(@networks) %> -</div> -<div class="pagination"> -  <%= will_paginate @networks, :container => false, renderer: BootstrapPagination::Rails %> -</div> +<div id="networks"><%= render 'networks' %></div>  <% content_for :sidebar do %>  <ul class="actions"> diff --git a/app/views/networks/index.js.erb b/app/views/networks/index.js.erb new file mode 100644 index 000000000..43d9ce10c --- /dev/null +++ b/app/views/networks/index.js.erb @@ -0,0 +1 @@ +$('#networks').html('<%= escape_javascript(render("networks")) %>');
\ No newline at end of file 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 diff --git a/app/views/time_tables/_time_table.erb b/app/views/time_tables/_time_table.html.erb index 0679008fc..0679008fc 100644 --- a/app/views/time_tables/_time_table.erb +++ b/app/views/time_tables/_time_table.html.erb diff --git a/app/views/time_tables/_time_tables.html.erb b/app/views/time_tables/_time_tables.html.erb new file mode 100644 index 000000000..72fbd9384 --- /dev/null +++ b/app/views/time_tables/_time_tables.html.erb @@ -0,0 +1,9 @@ +<div class="page_info"> +  <span class="search"> <%= t("will_paginate.page_entries_info.search") %></span> <%= page_entries_info @time_tables %> +</div> +<div class="time_tables paginated_content"> +  <%= paginated_content(@time_tables) %> +</div> +<div class="pagination"> +  <%= will_paginate @time_tables, :container => false, renderer: BootstrapPagination::Rails %> +</div> diff --git a/app/views/time_tables/index.html.erb b/app/views/time_tables/index.html.erb index a5d170178..e9802b4bc 100644 --- a/app/views/time_tables/index.html.erb +++ b/app/views/time_tables/index.html.erb @@ -1,6 +1,6 @@  <%= title_tag t('time_tables.index.title') %>  -<%= search_form_for @q, :url => referential_time_tables_path(@referential), :html => {:method => :get, class: "form-inline", :id => "search", role: "form"} do |f| %> +<%= search_form_for @q, :url => referential_time_tables_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">    @@ -31,15 +31,7 @@  </div>  <% end %> -<div class="page_info"> -  <span class="search"> <%= t("will_paginate.page_entries_info.search") %></span> <%= page_entries_info @time_tables %> -</div> -<div class="time_tables paginated_content"> -  <%= paginated_content(@time_tables) %> -</div> -<div class="pagination"> -  <%= will_paginate @time_tables, :container => false, renderer: BootstrapPagination::Rails %> -</div> +<div id="time_tables"><%= render 'time_tables' %></div>  <% content_for :sidebar do %> diff --git a/app/views/time_tables/index.js.erb b/app/views/time_tables/index.js.erb new file mode 100644 index 000000000..3b37cde65 --- /dev/null +++ b/app/views/time_tables/index.js.erb @@ -0,0 +1 @@ +$('#time_tables').html('<%= escape_javascript(render("time_tables")) %>');
\ No newline at end of file | 
