← back to Wallco Ai
admin-card: add created date+time chip to elements + return created_at from elements/items API (cactus-curator convention)
d3abf43424779148745dade2fffa2bce3d1033d5 · 2026-05-27 14:59:01 -0700 · Steve
Files touched
M public/admin/elements.htmlM server.js
Diff
commit d3abf43424779148745dade2fffa2bce3d1033d5
Author: Steve <steve@designerwallcoverings.com>
Date: Wed May 27 14:59:01 2026 -0700
admin-card: add created date+time chip to elements + return created_at from elements/items API (cactus-curator convention)
---
public/admin/elements.html | 11 +++++++++++
server.js | 2 +-
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/public/admin/elements.html b/public/admin/elements.html
index 425e60e..149bddf 100644
--- a/public/admin/elements.html
+++ b/public/admin/elements.html
@@ -137,6 +137,11 @@
}
.card-use-btn:hover { background:var(--ink); color:#fff; border-color:var(--ink); }
+ .card-when {
+ color:var(--faint); font-size:10.5px;
+ font-variant-numeric:tabular-nums;
+ }
+
.card-tier {
position:absolute; top:8px; right:8px;
font:700 8.5px var(--sans); letter-spacing:.16em; text-transform:uppercase;
@@ -245,6 +250,11 @@
<script>
(function(){
+ function fmtDate(iso){
+ if(!iso) return '—';
+ const d = new Date(iso); if(isNaN(d)) return '—';
+ return d.toLocaleString(undefined, { year:'numeric', month:'short', day:'numeric', hour:'numeric', minute:'2-digit' });
+ }
const PER = 200;
const state = {
items: [],
@@ -382,6 +392,7 @@
<span class="card-id">#${item.id}</span>
<button class="card-use-btn" data-id="${item.id}">+ Use</button>
</div>
+ <div class="card-when" title="created ${item.created_at || ''}">🕓 ${fmtDate(item.created_at)}</div>
</div>
</div>`;
}).join('');
diff --git a/server.js b/server.js
index 504a540..5a0e00f 100644
--- a/server.js
+++ b/server.js
@@ -1637,7 +1637,7 @@ app.get('/api/admin/elements/items', (req, res) => {
// no edges/ghost/settlement/bleed flag. Returns both baked + not-yet-baked.
const rawJson = psqlQuery(
"SELECT COALESCE(json_agg(t),'[]'::json) FROM (" +
- "SELECT id, category, dominant_hex, element_motif_path, element_ref_path " +
+ "SELECT id, category, dominant_hex, element_motif_path, element_ref_path, created_at " +
"FROM all_designs " +
"WHERE is_published = TRUE " +
"AND (user_removed IS NULL OR user_removed = FALSE) " +
← b36a8ee cactus prompt: all-new-specs rewrite vs graphic-designer age
·
back to Wallco Ai
·
admin-card: add created date+time chip to inspirations (cact d20cf0a →