Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added AJAX pagination to all other core engines that use pagination.

  • Loading branch information...
commit 5001a682f57e56b9b653aa3b62a8c0afe5062591 1 parent cac5b9f
@parndt parndt authored
View
7 authentication/app/controllers/admin/users_controller.rb
@@ -6,6 +6,13 @@ class Admin::UsersController < Admin::BaseController
layout 'admin'
+ def index
+ search_all_users if searching?
+ paginate_all_users
+
+ render :partial => 'users' if request.xhr?
+ end
+
def new
@user = User.new
@selected_plugin_names = []
View
4 authentication/app/views/admin/users/_users.html.erb
@@ -0,0 +1,4 @@
+<%= will_paginate @users %>
+<ul>
+ <%= render :partial => "user", :collection => @users %>
+</ul>
View
8 authentication/app/views/admin/users/index.html.erb
@@ -1,9 +1,7 @@
<div id='records'>
- <%= will_paginate @users %>
- <ul>
- <%= render :partial => "user", :collection => @users %>
- </ul>
- <%= will_paginate @users %>
+ <div class='pagination_container'>
+ <%= render :partial => 'users' %>
+ </div>
</div>
<div id='actions'>
<ul>
View
4 core/public/javascripts/refinery/admin.js
@@ -24,8 +24,9 @@ if(typeof(window.onpopstate) == "object"){
$.fn.slideTo = function(response) {
$(this).html(response);
$(this).applyMinimumHeightFromChildren();
- $('.pagination_frame').removeClass('frame_right').addClass('frame_center');
+ $(this).find('.pagination_frame').removeClass('frame_right').addClass('frame_center');
init_modal_dialogs();
+ return $(this);
}
$.fn.applyMinimumHeightFromChildren = function() {
@@ -37,6 +38,7 @@ $.fn.applyMinimumHeightFromChildren = function() {
});
});
$(this).css('min-height', child_heights);
+ return $(this);
}
init_ajaxy_pagination = function(){
View
13 core/public/stylesheets/refinery/refinery.css
@@ -410,11 +410,13 @@ header p {
.filter {
float: right;
}
-#records > ul, #records > #recent_activity > ul, #records > #recent_inquiries > ul, #records .pagination_container > ul {
+#records > ul, #records > #recent_activity > ul, #records > #recent_inquiries > ul,
+ #records .pagination_container > ul, #records .pagination_frame > ul {
margin-left: 0;
padding-left: 0;
}
-#records > ul li, #records > #recent_activity > ul li, #records > #recent_inquiries > ul li, #records .pagination_container > ul li {
+#records > ul li, #records > #recent_activity > ul li, #records > #recent_inquiries > ul li,
+ #records .pagination_container > ul li, #records .pagination_frame > ul {
list-style: none;
padding: 0px 5px;
vertical-align: top;
@@ -1420,7 +1422,7 @@ input.button.close_dialog:active, a.button.close_dialog:active, #content a.butto
float: left;
padding: 0px;
margin: 0px 12px 0px 0px;
- list-style: none;
+ list-style: none;
}
#switch_locale_picker a {
border-bottom: 0px none;
@@ -1439,7 +1441,7 @@ input.button.close_dialog:active, a.button.close_dialog:active, #content a.butto
.pagination_container {
position: relative;
overflow: hidden;
- min-height: 500px;
+ min-height: 600px;
}
.pagination_frame {
@@ -1454,6 +1456,9 @@ input.button.close_dialog:active, a.button.close_dialog:active, #content a.butto
-webkit-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
}
+.pagination_container > div.pagination_frame {
+ top: 40px;
+}
.pagination_frame.frame_left {
left: -1000px;
}
View
18 images/app/views/admin/images/_list_view.html.erb
@@ -1,8 +1,10 @@
-<% group_by_date(@images).each do |container| %>
- <% date_time = (image_group = container.last).first.created_at %>
- <% date = Date.parse(date_time.to_s) %>
- <h3><%= l(date, :format => :long ) %></h3>
- <ul class="<%= ['pagination_frame', pagination_css_class].compact.join(' ') %>">
- <%= render :partial => 'list_view_image', :collection => image_group %>
- </ul>
-<% end %>
+<div class="<%= ['clearfix', 'pagination_frame', pagination_css_class].compact.join(' ') %>">
+ <% group_by_date(@images).each do |container| %>
+ <% date_time = (image_group = container.last).first.created_at %>
+ <% date = Date.parse(date_time.to_s) %>
+ <h3><%= l(date, :format => :long ) %></h3>
+ <ul>
+ <%= render :partial => 'list_view_image', :collection => image_group %>
+ </ul>
+ <% end %>
+</div>
View
2  resources/app/controllers/admin/resources_controller.rb
@@ -43,6 +43,8 @@ def create
def index
search_all_resources if searching?
paginate_all_resources
+
+ render :partial => 'resources' if request.xhr?
end
def insert
View
10 resources/app/views/admin/resources/_resources.html.erb
@@ -0,0 +1,10 @@
+<%= will_paginate @resources %>
+<div class="<%= ['clearfix', 'pagination_frame', pagination_css_class].compact.join(' ') %>">
+ <% group_by_date(@resources).each do |container|
+ date = Date.parse((resource_group = container.last).first.created_at.to_s) %>
+ <h3><%= l(date, :format => :long ) %></h3>
+ <ul>
+ <%= render :partial => "resource", :collection => resource_group %>
+ </ul>
+ <% end %>
+</div>
View
12 resources/app/views/admin/resources/index.html.erb
@@ -3,15 +3,9 @@
<h2><%= t('results_for', :query => params[:search], :scope => 'shared.admin.search') %></h2>
<% end %>
<% if @resources.any? %>
- <%= will_paginate @resources %>
- <% group_by_date(@resources).each do |container|
- date = Date.parse((resource_group = container.last).first.created_at.to_s) %>
- <h3><%= l(date, :format => :long ) %></h3>
- <ul>
- <%= render :partial => "resource", :collection => resource_group %>
- </ul>
- <% end %>
- <%= will_paginate @resources %>
+ <div class='pagination_container'>
+ <%= render :partial => 'resources' %>
+ </div>
<% else %>
<p>
<% unless searching? %>
Please sign in to comment.
Something went wrong with that request. Please try again.