72 lines
3.6 KiB
Plaintext
72 lines
3.6 KiB
Plaintext
div class="mb-12 prose dark:prose-invert max-w-prose mx-auto text-gray-800 dark:text-gray-200"
|
|
h1 Admin // Bookmarks
|
|
|
|
div class="max-w-prose mx-auto" x-data="{ activeTab: 0 }"
|
|
- if running_jobs
|
|
div class="text-center bg-blue-100 mb-4 p-2 rounded" Job already queued
|
|
- else
|
|
button class="block rounded bg-blue-100 hover:bg-blue-200 text-blue-600 mb-4 p-2 hover:cursor-pointer" hx-post="/admin/bookmarks/clean" Check for dead links
|
|
div class="flex"
|
|
a href="#" class="text-gray-200 cursor-pointer p-2 border-2 mr-2 rounded border-blue-400" :class="{ 'bg-blue-400 text-blue-900': activeTab === 0 }" @click="activeTab = 0" class="tab-control" Published
|
|
a href="#" class="text-gray-200 cursor-pointer p-2 border-2 rounded border-blue-400" :class="{ 'bg-blue-400 text-blue-900': activeTab === 1 }" @click="activeTab = 1" class="tab-control" Un published
|
|
table class="prose dark:prose-invert table-auto prose-a:text-blue-600 prose-a:no-underline"
|
|
thead
|
|
th Details
|
|
th Date
|
|
th colspan="4" Actions
|
|
tbody class="{ 'active': activeTab === 0 }" x-show.transition.in.opacity.duration.600="activeTab === 0"
|
|
- published_bookmarks.each do |bookmark|
|
|
tr id="bookmark-#{bookmark.id}"
|
|
td
|
|
div
|
|
a href="/admin/posts/#{bookmark.id}"
|
|
= bookmark.name
|
|
a class="no-underline" href=bookmark.url
|
|
small class="text-gray-400 dark:text-gray-600" = bookmark.url
|
|
div
|
|
- if bookmark.cached_content
|
|
a href="/bookmark/#{bookmark.slug}" View cached version
|
|
span —
|
|
button hx-post="/admin/bookmarks/cache/#{bookmark.id}" Re-cache
|
|
- else
|
|
button hx-post="/admin/bookmarks/cache/#{bookmark.id}" No cached content, cache now?
|
|
td
|
|
= bookmark.published_at&.strftime("%d %b %Y")
|
|
td
|
|
button class="text-red-600" hx-delete="/admin/bookmarks/#{bookmark.id}" hx-target="#bookmark-#{bookmark.id}" delete
|
|
td
|
|
button hx-post="/admin/bookmarks/#{bookmark.id}/archive" archive
|
|
td
|
|
- if bookmark.is_read
|
|
button hx-post="/admin/bookmarks/#{bookmark.id}/mark_unread" mark unread
|
|
- else
|
|
button hx-post="/admin/bookmarks/#{bookmark.id}/mark_read" mark read
|
|
td
|
|
a href="obsidian://new?zettelkasten&file=Personal%2F01%20Blog%2F01.03%20Bookmarks%2F#{bookmark.name}&content=#{bookmark.url}" Blog about this
|
|
tbody class="{ 'active': activeTab === 1 }" x-show.transition.in.opacity.duration.600="activeTab === 1"
|
|
- unpublished_bookmarks.each do |bookmark|
|
|
tr id="bookmark-#{bookmark.id}"
|
|
td
|
|
div
|
|
= bookmark.name
|
|
a class="no-underline" href=bookmark.url
|
|
small class="text-gray-400 dark:text-gray-600" = bookmark.url
|
|
div
|
|
- if bookmark.cached_content
|
|
a href="/bookmark/#{bookmark.slug}" View cached version
|
|
span —
|
|
button hx-post="/admin/bookmarks/cache/#{bookmark.id}" Re-cache
|
|
- else
|
|
button hx-post="/admin/bookmarks/cache/#{bookmark.id}" No cached content, cache now?
|
|
td
|
|
= bookmark.published_at&.strftime("%d %b %Y")
|
|
td
|
|
button class="text-red-600" hx-delete="/admin/bookmarks/#{bookmark.id}" hx-target="#bookmark-#{bookmark.id}" delete
|
|
td
|
|
button hx-post="/admin/bookmarks/#{bookmark.id}/publish" publish
|
|
|
|
div class="max-w-screen-md mx-auto border-t border-solid border-gray-200 dark:border-gray-600"
|
|
|
|
|
|
|