Files
adamantium/slices/admin/templates/photos/index.html.slim

22 lines
1.5 KiB
Plaintext

div class="mb-12 prose dark:prose-invert max-w-prose mx-auto text-gray-800 dark:text-gray-200"
h1 Admin // Media
div class="mb-4 max-w-prose mx-auto prose dark:prose-invert"
form id='media_form' hx-headers='{"authorization": "Bearer #{Hanami.app.settings.shortcut_key}"}' hx-encoding='multipart/form-data' hx-post='/micropub/media'
fieldset class="mb-6"
input type='file' name='file'
fieldset
button class="hover:text-blue-400 p-2 bg-blue-100 rounded text-blue-600 mr-4 no-underline" Upload
- photos_buckets.each do |year, photos|
- next unless photos.count > 0
h2 = year
div class="grid grid-cols-3 gap-4"
- photos.each_with_index do |photo, idx|
- next if photo.match(/small/)
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/", "")}"
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 .md
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