From 8f6bee5a8beb232f09710d405e3a5eba556653df Mon Sep 17 00:00:00 2001 From: bohung Date: Fri, 16 Oct 2020 14:44:08 +0800 Subject: [PATCH] Fix bug. --- app/controllers/admin/galleries_controller.rb | 2 +- app/views/admin/galleries/_albums.html.erb | 14 ++++++++++++++ app/views/admin/galleries/index.html.erb | 10 +++++++--- 3 files changed, 22 insertions(+), 4 deletions(-) create mode 100644 app/views/admin/galleries/_albums.html.erb diff --git a/app/controllers/admin/galleries_controller.rb b/app/controllers/admin/galleries_controller.rb index be9f663..f6a491d 100644 --- a/app/controllers/admin/galleries_controller.rb +++ b/app/controllers/admin/galleries_controller.rb @@ -324,7 +324,7 @@ class Admin::GalleriesController < OrbitAdminController @color_save = 'transparent' end if request.xhr? - render :partial => "album", :collection => @albums + render :partial => "albums" end end diff --git a/app/views/admin/galleries/_albums.html.erb b/app/views/admin/galleries/_albums.html.erb new file mode 100644 index 0000000..afb68e7 --- /dev/null +++ b/app/views/admin/galleries/_albums.html.erb @@ -0,0 +1,14 @@ +<%= render :partial => "album", :collection => @albums %> + \ No newline at end of file diff --git a/app/views/admin/galleries/index.html.erb b/app/views/admin/galleries/index.html.erb index 13d4e41..fd5da95 100644 --- a/app/views/admin/galleries/index.html.erb +++ b/app/views/admin/galleries/index.html.erb @@ -10,6 +10,9 @@ var page_no = 2 var catch_flag = true var max_page = <%= (@fiter_albums.length/@limit_count).ceil rescue 1 %> + if( max_page > 1){ + $("#edit-order-btn").hide(); + } $('.bottomnav').ready(function(){ function load_html_func(){ $('#load_html').text("<%= t('gallery.wait_time') %>") @@ -27,7 +30,8 @@ page_no++ catch_flag = true if (max_page < page_no){ - $('#load_html').hide() + $("#edit-order-btn").show(); + $('#load_html').hide(); } $('#load_html').text("<%= t('gallery.load_html') %>") }, @@ -61,7 +65,7 @@
@@ -75,5 +79,5 @@
<% else %> - <%= render :partial => "album", :collection => @albums %> + <%= render :partial => "albums" %> <% end %> \ No newline at end of file