diff --git a/app/controllers/admin/property_hires_controller.rb b/app/controllers/admin/property_hires_controller.rb index 8b2f6c7..41ebbf3 100644 --- a/app/controllers/admin/property_hires_controller.rb +++ b/app/controllers/admin/property_hires_controller.rb @@ -11,6 +11,9 @@ class Admin::PropertyHiresController < OrbitAdminController .with_tags(filters("tag")) @properties = search_data(@properties,[:title]).page(params[:page]).per(10) + if request.xhr? + render :partial => "index" + end end def fields_display_order uid = params[:id].split("-").last diff --git a/app/views/admin/property_hires/_index.html.erb b/app/views/admin/property_hires/_index.html.erb new file mode 100644 index 0000000..7aac958 --- /dev/null +++ b/app/views/admin/property_hires/_index.html.erb @@ -0,0 +1,46 @@ + + + + <% @table_fields.each do |f| %> + <%= thead(f) %> + <% end %> + + + + <% @properties.each do |property| %> + + + + + + + <% end %> + +
+ <% if can_edit_or_delete?(property) %> + <%= property.title %> + + <% else %> + <%= property.title %> + <% end %> + + <%= property.category.title rescue nil %> + + <%= property.get_location_name %> + + <% if property.can_be_hired %> + Yes + <% else %> + No + <% end %> +
+
+ <%= content_tag(:div, paginate(@properties), class: "pagination pagination-centered") %> +
\ No newline at end of file diff --git a/app/views/admin/property_hires/index.html.erb b/app/views/admin/property_hires/index.html.erb index 7aac958..65d2e2b 100644 --- a/app/views/admin/property_hires/index.html.erb +++ b/app/views/admin/property_hires/index.html.erb @@ -1,46 +1,4 @@ - - - - <% @table_fields.each do |f| %> - <%= thead(f) %> - <% end %> - - - - <% @properties.each do |property| %> - - - - - - - <% end %> - -
- <% if can_edit_or_delete?(property) %> - <%= property.title %> - - <% else %> - <%= property.title %> - <% end %> - - <%= property.category.title rescue nil %> - - <%= property.get_location_name %> - - <% if property.can_be_hired %> - Yes - <% else %> - No - <% end %> -
-
- <%= content_tag(:div, paginate(@properties), class: "pagination pagination-centered") %> -
\ No newline at end of file +<%= render_filter @filter_fields, "index_table" %> + + <%= render 'index'%> + \ No newline at end of file