Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Add draft mode indication to pages admin.

Matthew Kennedyc4960fd57fc8
diff --git a/backend/app/views/spree/admin/cms_pages/index.html.erb b/backend/app/views/spree/admin/cms_pages/index.html.erb
index e670cb8905..7be69d84bf 100644
--- a/backend/app/views/spree/admin/cms_pages/index.html.erb
+++ b/backend/app/views/spree/admin/cms_pages/index.html.erb
@@ -11,6 +11,7 @@
<table class="table" id="pagesTable">
<thead>
<th scope="col"><%= Spree.t(:title) %></th>
+ <th scope="col"><%= Spree.t(:draft_mode) %></th>
<th scope="col"><%= Spree.t('admin.pages.page_type') %></th>
<th scope="col"><%= Spree.t('store') %></th>
<th scope="col"><%= Spree.t('language') %></th>
@@ -22,6 +23,9 @@
<td>
<%= page.title %>
</td>
+ <td>
+ <%= active_badge(page.draft_mode?) %>
+ </td>
<td>
<%= humanize_cms_page_type(page) %>
</td>
diff --git a/core/app/models/spree/cms_page.rb b/core/app/models/spree/cms_page.rb
index f17c65f765..21885e1e1b 100644
--- a/core/app/models/spree/cms_page.rb
+++ b/core/app/models/spree/cms_page.rb
@@ -40,6 +40,10 @@ module Spree
visible
end
+ def draft_mode?
+ !visible
+ end
+
private
def handle_slug