Add editable pages
This commit is contained in:
51
slices/admin/templates/pages/index.html.slim
Normal file
51
slices/admin/templates/pages/index.html.slim
Normal file
@@ -0,0 +1,51 @@
|
||||
div class="mb-12 prose dark:prose-invert max-w-prose mx-auto text-gray-800 dark:text-gray-200"
|
||||
h1 Admin // Pages
|
||||
|
||||
div class="max-w-prose mx-auto" x-data="{ activeTab: 0 }"
|
||||
div class="mb-4"
|
||||
a href="/admin/pages/new" class="text-gray-200 cursor-pointer p-2 border-2 mr-2 rounded border-blue-400 bg-blue-400 text-blue-900" New page
|
||||
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="2" Actions
|
||||
tbody class="{ 'active': activeTab === 0 }" x-show.transition.in.opacity.duration.600="activeTab === 0"
|
||||
- published_pages.each do |page|
|
||||
tr id="post-#{page.slug}"
|
||||
td
|
||||
div
|
||||
= page.name
|
||||
a class="no-underline" href="/#{page.slug}"
|
||||
small class="text-gray-400 dark:text-gray-600" = page.slug
|
||||
td
|
||||
= page.published_at&.strftime("%d %b %Y")
|
||||
td
|
||||
a href="/admin/pages/#{page.slug}/edit" edit
|
||||
td
|
||||
button class="text-red-600" hx-delete="/admin/pages/#{page.slug}" hx-target="#post-#{page.slug}" delete
|
||||
td
|
||||
button hx-post="/admin/pages/#{page.slug}/archive" unpublish
|
||||
tbody class="{ 'active': activeTab === 1 }" x-show.transition.in.opacity.duration.600="activeTab === 1"
|
||||
- unpublished_pages.each do |page|
|
||||
tr id="post-#{page.slug}"
|
||||
td
|
||||
div
|
||||
= page.name
|
||||
a class="no-underline" href="/#{page.slug}"
|
||||
small class="text-gray-400 dark:text-gray-600" = page.slug
|
||||
td
|
||||
= page.published_at&.strftime("%d %b %Y")
|
||||
td
|
||||
a href="/admin/pages/#{page.slug}/edit" edit
|
||||
td
|
||||
button class="text-red-600" hx-delete="/admin/pages/#{page.slug}" hx-target="#post-#{page.slug}" delete
|
||||
td
|
||||
button hx-post="/admin/pages/#{page.slug}/publish" publish
|
||||
|
||||
div class="max-w-screen-md mx-auto border-t border-solid border-gray-200 dark:border-gray-600"
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user