From 9ef9eda41c8fe189537ccfcd2608acbc0b9e6cb8 Mon Sep 17 00:00:00 2001 From: Daniel Nitsikopoulos Date: Sun, 7 May 2023 20:53:20 +1000 Subject: [PATCH] Fix reverse cron ordering --- slices/admin/templates/photos/index.html.slim | 2 +- slices/admin/views/photos/index.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/slices/admin/templates/photos/index.html.slim b/slices/admin/templates/photos/index.html.slim index 0ddfb9c..72026d6 100644 --- a/slices/admin/templates/photos/index.html.slim +++ b/slices/admin/templates/photos/index.html.slim @@ -2,7 +2,7 @@ div class="mb-12 prose dark:prose-invert max-w-prose mx-auto text-gray-800 dark: h1 Admin // Media div class="mb-4 max-w-prose mx-auto prose dark:prose-invert" - - photos_buckets.reverse.each do |year, photos| + - photos_buckets.each do |year, photos| - next unless photos.count > 0 h2 = Date.parse(year).strftime("%m %b %Y") div class="grid grid-cols-3 gap-4" diff --git a/slices/admin/views/photos/index.rb b/slices/admin/views/photos/index.rb index 2cd7c0f..c12eb5e 100644 --- a/slices/admin/views/photos/index.rb +++ b/slices/admin/views/photos/index.rb @@ -6,7 +6,7 @@ module Admin MEDIA_DIR = "public/media/".freeze expose :photos_buckets do - Dir["#{MEDIA_DIR}*"].each_with_object({}) do |root, memo| + Dir["#{MEDIA_DIR}*"].reverse.each_with_object({}) do |root, memo| memo[root.gsub(MEDIA_DIR, "")] = Dir["#{root}/**"] end end