Lazy load images on photo admin page
This commit is contained in:
@@ -14,9 +14,9 @@ div class="mb-4 max-w-prose mx-auto prose dark:prose-invert"
|
|||||||
- photos.each_with_index do |photo, idx|
|
- photos.each_with_index do |photo, idx|
|
||||||
- next if photo.match(/small/)
|
- next if photo.match(/small/)
|
||||||
div class="rounded max-w-xs" x-data="" id="photo-#{idx}"
|
div class="rounded max-w-xs" x-data="" id="photo-#{idx}"
|
||||||
img class="rounded object-cover hover:opacity-80 h-48 w-48 mb-2" src="/#{photo.gsub("public/", "")}"
|
img loading="lazy" class="rounded object-cover hover:opacity-80 h-48 w-48 mb-2" src="/#{photo.gsub("public/", "")}"
|
||||||
div class="grid grid-cols-2 gap-2"
|
div class="grid grid-cols-2 gap-2"
|
||||||
button class="hover:text-blue-400 p-1 bg-blue-100 rounded text-blue-600 no-underline" @click="$clipboard('#{Hanami.app.settings.micropub_site_url}/#{photo.gsub("public/", "")}')" Copy URL
|
button class="hover:text-blue-400 p-1 bg-blue-100 rounded text-blue-600 no-underline" @click="$clipboard('#{Hanami.app.settings.micropub_site_url}/#{photo.gsub("public/", "")}')" Copy URL
|
||||||
button class="hover:text-blue-400 p-1 bg-blue-100 rounded text-blue-600 no-underline" @click="$clipboard('})')" Copy .md
|
button class="hover:text-blue-400 p-1 bg-blue-100 rounded text-blue-600 no-underline" @click="$clipboard('})')" Copy .md
|
||||||
div class="grid grid-cols-1"
|
div class="grid grid-cols-1"
|
||||||
button class="text-red-600 p-1 bg-red-50 rounded hover:text-red-400 mt-2" hx-delete="/admin/media/#{photo}" hx-target="#photo-#{idx}" Delete
|
button class="text-red-600 p-1 bg-red-50 rounded hover:text-red-400 mt-2" hx-delete="/admin/media/#{photo}" hx-target="#photo-#{idx}" Delete
|
||||||
|
Reference in New Issue
Block a user