From 2068cd41eff4a9ea9c96b3d4d619666aefc4f2c1 Mon Sep 17 00:00:00 2001 From: chiu Date: Mon, 16 Sep 2019 19:08:11 +0800 Subject: [PATCH 01/12] Update archive_files_controller.rb --- app/controllers/admin/archive_files_controller.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/controllers/admin/archive_files_controller.rb b/app/controllers/admin/archive_files_controller.rb index 623c8c8..121aeaf 100644 --- a/app/controllers/admin/archive_files_controller.rb +++ b/app/controllers/admin/archive_files_controller.rb @@ -3,14 +3,12 @@ class Admin::ArchiveFilesController < OrbitAdminController if ArchiveSortOrder.count == 0 ArchiveSortOrder.new('sort_order' => false).save end - if !params['order_asc'].nil? + if !(params['order_asc'].nil?) if params['order_asc'] == 'true' ArchiveSortOrder.first.update_attributes('sort_order' => true) elsif params['order_asc'] == 'false' ArchiveSortOrder.first.update_attributes('sort_order' => false) end - else - ArchiveSortOrder.first.update_attributes('sort_order' => false) end @choose = ArchiveSortOrder.first['sort_order'] @table_fields = [:status, :category, :title, :updated_at,:last_modified,"archive.downloaded_times"] From a03c5312127a7d8e5fa77fa1a6e0bf8e93417664 Mon Sep 17 00:00:00 2001 From: chiu Date: Mon, 16 Sep 2019 19:46:22 +0800 Subject: [PATCH 02/12] Update archive_files_controller.rb --- app/controllers/admin/archive_files_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/admin/archive_files_controller.rb b/app/controllers/admin/archive_files_controller.rb index 121aeaf..4a39d62 100644 --- a/app/controllers/admin/archive_files_controller.rb +++ b/app/controllers/admin/archive_files_controller.rb @@ -3,7 +3,7 @@ class Admin::ArchiveFilesController < OrbitAdminController if ArchiveSortOrder.count == 0 ArchiveSortOrder.new('sort_order' => false).save end - if !(params['order_asc'].nil?) + if !(params['order_asc'].nil?) if params['order_asc'] == 'true' ArchiveSortOrder.first.update_attributes('sort_order' => true) elsif params['order_asc'] == 'false' From cb85f736b9f7bb6c9fc905a5898261da21718340 Mon Sep 17 00:00:00 2001 From: chiu Date: Mon, 16 Sep 2019 19:54:44 +0800 Subject: [PATCH 03/12] Update _sort_order_choose.html.erb --- .../admin/archive_files/_sort_order_choose.html.erb | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/app/views/admin/archive_files/_sort_order_choose.html.erb b/app/views/admin/archive_files/_sort_order_choose.html.erb index 9c49971..c0c32d4 100644 --- a/app/views/admin/archive_files/_sort_order_choose.html.erb +++ b/app/views/admin/archive_files/_sort_order_choose.html.erb @@ -1,10 +1,18 @@ +
+ <%= t('archive.choose_order')+':' %> <% if @choose %> -<%= t('archive.yes') %> +<%= t('archive.yes') %> <% else %> -<%= t('archive.no') %> +<%= t('archive.no') %> <% end %>
\ No newline at end of file From fe3e9c25b1c9cb2291bf8fc903d2a8f243ce9747 Mon Sep 17 00:00:00 2001 From: chiu Date: Mon, 16 Sep 2019 19:56:49 +0800 Subject: [PATCH 04/12] Update _sort_order_choose.html.erb fix error --- app/views/admin/archive_files/_sort_order_choose.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/admin/archive_files/_sort_order_choose.html.erb b/app/views/admin/archive_files/_sort_order_choose.html.erb index c0c32d4..17c0e9c 100644 --- a/app/views/admin/archive_files/_sort_order_choose.html.erb +++ b/app/views/admin/archive_files/_sort_order_choose.html.erb @@ -1,6 +1,6 @@