Show draft/scheduled status banners for authenticated users
This commit is contained in:
@@ -1,4 +1,23 @@
|
||||
<div class="space-y-8">
|
||||
<a href={@base_path} class="text-sm text-primary hover:underline">← Back to posts</a>
|
||||
|
||||
<%= if @authenticated and @visibility == :draft do %>
|
||||
<div
|
||||
class="rounded-lg bg-amber-50 border border-amber-200 px-4 py-3 text-amber-800 text-sm font-medium"
|
||||
id="post-status-banner"
|
||||
>
|
||||
Draft — not published
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<%= if @authenticated and @visibility == :scheduled do %>
|
||||
<div
|
||||
class="rounded-lg bg-blue-50 border border-blue-200 px-4 py-3 text-blue-800 text-sm font-medium"
|
||||
id="post-status-banner"
|
||||
>
|
||||
This post is scheduled for {Calendar.strftime(@post.date, "%B %d, %Y")}
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<.post_show post={@post} base_path={@base_path} />
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user