diff --git a/app/controllers/admin/web_resources_controller.rb b/app/controllers/admin/web_resources_controller.rb index d3af595..0503333 100644 --- a/app/controllers/admin/web_resources_controller.rb +++ b/app/controllers/admin/web_resources_controller.rb @@ -8,11 +8,14 @@ class Admin::WebResourcesController < OrbitAdminController @filter_fields = filter_fields(@categories, @tags) @table_fields = [:status, :category, :title] - @links = WebLink.order_by(sort).with_categories(filters("category")).with_tags(filters("tag")).with_status(filters("status")).page(params[:page]).per(10) + @links = WebLink.order_by(sort) + .with_categories(filters("category")) + .with_tags(filters("tag")) + .with_status(filters("status")) - if request.xhr? - render :partial => "index" - end + @links = search_data(@links,[:title]).page(params[:page]).per(10) + + render :partial => "index" if request.xhr? end def new diff --git a/app/views/admin/web_resources/index.html.erb b/app/views/admin/web_resources/index.html.erb index 31d9a3b..80f6fa7 100644 --- a/app/views/admin/web_resources/index.html.erb +++ b/app/views/admin/web_resources/index.html.erb @@ -1,81 +1,4 @@ -<% content_for :right_nav do %> - -
- <% @filter_fields.keys.each do |field| %> -
-
- <% @filter_fields[field].each do |val| %> - <%= link_to t(val[:title]), "#", :onclick => "filter.addFilter('filters[#{field}][]=#{val[:id]}')", :class => "btn btn-small #{is_filter_active?(field, val[:id])}" %> - <% end %> -
- -
- <% end %> -
-<% end %> - - +<%= render_filter @filter_fields, "index_table" %> +
<%= render 'index'%> - - -<%= render 'layouts/delete_modal', delete_options: @delete_options %> - - \ No newline at end of file +
\ No newline at end of file