This commit is contained in:
+14
-11
@@ -1,9 +1,10 @@
|
||||
<%- include('../partials/head', { title: 'Categories' }) %>
|
||||
<%- include('../partials/adminNav', { currentPath: '/admin/categories' }) %>
|
||||
<%- include('../partials/adminTopBar') %>
|
||||
|
||||
<div class="pl-56 min-h-screen">
|
||||
<div class="lg:pl-56 pt-14 lg:pt-0 min-h-screen">
|
||||
<%- include('../partials/adminBanner') %>
|
||||
<div class="max-w-2xl mx-auto px-8 py-8">
|
||||
<div class="max-w-2xl mx-auto px-4 sm:px-8 py-6 sm:py-8">
|
||||
<div class="mb-8">
|
||||
<h1 class="text-xl font-semibold text-white">Categories</h1>
|
||||
<p class="text-sm text-gray-500 mt-0.5">Organize your models into groups</p>
|
||||
@@ -18,12 +19,12 @@
|
||||
<!-- New category form -->
|
||||
<form method="POST" action="/admin/categories" class="bg-surface-900 border border-gray-800 rounded-2xl p-6 mb-6">
|
||||
<h2 class="text-sm font-semibold text-white mb-4">New Category</h2>
|
||||
<div class="flex gap-3">
|
||||
<div class="flex flex-col sm:flex-row gap-3">
|
||||
<input name="name" type="text" required placeholder="Category name"
|
||||
class="flex-1 bg-surface-800 border border-gray-700 rounded-lg px-3.5 py-2.5 text-sm text-white placeholder-gray-600 focus:outline-none focus:border-accent transition-colors" />
|
||||
<input name="description" type="text" placeholder="Description (optional)"
|
||||
class="flex-1 bg-surface-800 border border-gray-700 rounded-lg px-3.5 py-2.5 text-sm text-white placeholder-gray-600 focus:outline-none focus:border-accent transition-colors" />
|
||||
<button type="submit" class="btn-accent text-white rounded-lg px-5 py-2 text-sm font-medium transition-all shrink-0">
|
||||
<button type="submit" class="btn-accent text-white rounded-lg px-5 py-2.5 sm:py-2 text-sm font-medium transition-all sm:shrink-0">
|
||||
Add
|
||||
</button>
|
||||
</div>
|
||||
@@ -47,25 +48,27 @@
|
||||
<span class="text-xs text-gray-600 shrink-0"><%= cat.model_count %> model<%= cat.model_count !== 1 ? 's' : '' %></span>
|
||||
|
||||
<!-- Inline edit form (hidden by default) -->
|
||||
<form method="POST" action="/admin/categories/<%= cat.id %>/edit" class="hidden edit-form gap-2 items-center">
|
||||
<form method="POST" action="/admin/categories/<%= cat.id %>/edit" class="hidden edit-form flex-col sm:flex-row gap-2 items-start sm:items-center w-full sm:w-auto">
|
||||
<input name="name" value="<%= cat.name %>" type="text" required
|
||||
class="bg-surface-700 border border-gray-600 rounded-lg px-3 py-1.5 text-sm text-white focus:outline-none focus:border-accent w-40 transition-colors" />
|
||||
class="bg-surface-700 border border-gray-600 rounded-lg px-3 py-1.5 text-sm text-white focus:outline-none focus:border-accent w-full sm:w-40 transition-colors" />
|
||||
<input name="description" value="<%= cat.description || '' %>" type="text" placeholder="Description"
|
||||
class="bg-surface-700 border border-gray-600 rounded-lg px-3 py-1.5 text-sm text-white placeholder-gray-600 focus:outline-none focus:border-accent w-44 transition-colors" />
|
||||
<button type="submit" class="text-xs btn-accent text-white rounded-lg px-3 py-1.5">Save</button>
|
||||
<button type="button" class="text-xs text-gray-500 hover:text-white cancel-edit">Cancel</button>
|
||||
class="bg-surface-700 border border-gray-600 rounded-lg px-3 py-1.5 text-sm text-white placeholder-gray-600 focus:outline-none focus:border-accent w-full sm:w-44 transition-colors" />
|
||||
<div class="flex gap-2">
|
||||
<button type="submit" class="text-xs btn-accent text-white rounded-lg px-3 py-1.5">Save</button>
|
||||
<button type="button" class="text-xs text-gray-500 hover:text-white cancel-edit">Cancel</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<!-- Action buttons -->
|
||||
<div class="flex items-center gap-1 action-buttons">
|
||||
<button type="button" class="edit-btn p-1.5 rounded-lg text-gray-500 hover:text-white hover:bg-surface-700 transition-colors" title="Rename">
|
||||
<button type="button" class="edit-btn p-2 rounded-lg text-gray-500 hover:text-white hover:bg-surface-700 transition-colors" title="Rename">
|
||||
<svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="1.75">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L10.582 16.07a4.5 4.5 0 01-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 011.13-1.897l8.932-8.931z" />
|
||||
</svg>
|
||||
</button>
|
||||
<form method="POST" action="/admin/categories/<%= cat.id %>/delete"
|
||||
onsubmit="return confirm('Delete «<%= cat.name %>»? Models in this category will become uncategorized.')">
|
||||
<button type="submit" class="p-1.5 rounded-lg text-gray-500 hover:text-red-400 hover:bg-red-500/10 transition-colors" title="Delete">
|
||||
<button type="submit" class="p-2 rounded-lg text-gray-500 hover:text-red-400 hover:bg-red-500/10 transition-colors" title="Delete">
|
||||
<svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="1.75">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0" />
|
||||
</svg>
|
||||
|
||||
+12
-10
@@ -1,12 +1,13 @@
|
||||
<%- include('../partials/head', { title: 'Models' }) %>
|
||||
<%- include('../partials/adminNav', { currentPath: '/admin' }) %>
|
||||
<%- include('../partials/adminTopBar') %>
|
||||
|
||||
<div class="pl-56 min-h-screen">
|
||||
<div class="lg:pl-56 pt-14 lg:pt-0 min-h-screen">
|
||||
<%- include('../partials/adminBanner') %>
|
||||
<div class="max-w-7xl mx-auto px-8 py-8">
|
||||
<div class="max-w-7xl mx-auto px-4 sm:px-8 py-6 sm:py-8">
|
||||
|
||||
<!-- Page header -->
|
||||
<div class="flex items-center justify-between mb-8">
|
||||
<div class="flex items-center justify-between mb-6 sm:mb-8">
|
||||
<div>
|
||||
<h1 class="text-xl font-semibold text-white">Models</h1>
|
||||
<p class="text-sm text-gray-500 mt-0.5"><%= totalCount %> total · <%= publicCount %> public</p>
|
||||
@@ -15,16 +16,17 @@
|
||||
<svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M12 4.5v15m7.5-7.5h-15" />
|
||||
</svg>
|
||||
Upload Model
|
||||
<span class="hidden sm:inline">Upload Model</span>
|
||||
<span class="sm:hidden">Upload</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<!-- Filters -->
|
||||
<form method="GET" action="/admin" class="flex flex-wrap gap-3 mb-6">
|
||||
<form method="GET" action="/admin" class="flex flex-wrap gap-2 sm:gap-3 mb-5 sm:mb-6">
|
||||
<input
|
||||
name="search" value="<%= filters.search || '' %>"
|
||||
placeholder="Search models…"
|
||||
class="bg-surface-900 border border-gray-800 rounded-lg px-3.5 py-2 text-sm text-white placeholder-gray-600 focus:outline-none focus:border-accent w-64 transition-colors"
|
||||
class="bg-surface-900 border border-gray-800 rounded-lg px-3.5 py-2 text-sm text-white placeholder-gray-600 focus:outline-none focus:border-accent w-full sm:w-64 transition-colors"
|
||||
/>
|
||||
<select name="category_id" class="bg-surface-900 border border-gray-800 rounded-lg px-3 py-2 text-sm text-gray-300 focus:outline-none focus:border-accent transition-colors">
|
||||
<option value="">All categories</option>
|
||||
@@ -104,7 +106,7 @@
|
||||
<button
|
||||
type="button"
|
||||
title="Copy share link"
|
||||
class="copy-link-btn p-1.5 rounded-lg text-gray-500 hover:text-white hover:bg-surface-700 transition-colors"
|
||||
class="copy-link-btn p-2 rounded-lg text-gray-500 hover:text-white hover:bg-surface-700 transition-colors"
|
||||
data-url="<%= baseUrl %>/view/<%= model.slug %>"
|
||||
>
|
||||
<svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="1.75">
|
||||
@@ -113,7 +115,7 @@
|
||||
</button>
|
||||
<!-- View -->
|
||||
<a href="/view/<%= model.slug %>" target="_blank" title="View model"
|
||||
class="p-1.5 rounded-lg text-gray-500 hover:text-white hover:bg-surface-700 transition-colors">
|
||||
class="p-2 rounded-lg text-gray-500 hover:text-white hover:bg-surface-700 transition-colors">
|
||||
<svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="1.75">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M2.036 12.322a1.012 1.012 0 010-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.641 0-8.574-3.007-9.964-7.178z" />
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" />
|
||||
@@ -121,7 +123,7 @@
|
||||
</a>
|
||||
<!-- Edit -->
|
||||
<a href="/admin/models/<%= model.id %>/edit" title="Edit model"
|
||||
class="p-1.5 rounded-lg text-gray-500 hover:text-white hover:bg-surface-700 transition-colors">
|
||||
class="p-2 rounded-lg text-gray-500 hover:text-white hover:bg-surface-700 transition-colors">
|
||||
<svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="1.75">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L10.582 16.07a4.5 4.5 0 01-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 011.13-1.897l8.932-8.931zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0115.75 21H5.25A2.25 2.25 0 013 18.75V8.25A2.25 2.25 0 015.25 6H10" />
|
||||
</svg>
|
||||
@@ -129,7 +131,7 @@
|
||||
<!-- Delete -->
|
||||
<form method="POST" action="/admin/models/<%= model.id %>/delete" class="inline" onsubmit="return confirm('Delete «<%= model.name %>»? This cannot be undone.')">
|
||||
<button type="submit" title="Delete model"
|
||||
class="p-1.5 rounded-lg text-gray-500 hover:text-red-400 hover:bg-red-500/10 transition-colors">
|
||||
class="p-2 rounded-lg text-gray-500 hover:text-red-400 hover:bg-red-500/10 transition-colors">
|
||||
<svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="1.75">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0" />
|
||||
</svg>
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
<%- include('../partials/head', { title: 'Edit Model' }) %>
|
||||
<%- include('../partials/adminNav', { currentPath: '/admin' }) %>
|
||||
<%- include('../partials/adminTopBar') %>
|
||||
|
||||
<div class="pl-56 min-h-screen">
|
||||
<div class="lg:pl-56 pt-14 lg:pt-0 min-h-screen">
|
||||
<%- include('../partials/adminBanner') %>
|
||||
<div class="max-w-2xl mx-auto px-8 py-8">
|
||||
<div class="max-w-2xl mx-auto px-4 sm:px-8 py-6 sm:py-8">
|
||||
<div class="flex items-center gap-3 mb-8">
|
||||
<a href="/admin" class="text-gray-500 hover:text-white transition-colors">
|
||||
<svg class="w-5 h-5" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="1.75">
|
||||
@@ -33,7 +34,7 @@
|
||||
class="w-full bg-surface-800 border border-gray-700 rounded-lg px-3.5 py-2.5 text-sm text-white placeholder-gray-600 focus:outline-none focus:border-accent transition-colors resize-none"
|
||||
><%= model.description || '' %></textarea>
|
||||
</div>
|
||||
<div class="grid grid-cols-2 gap-4">
|
||||
<div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
|
||||
<div>
|
||||
<label class="block text-xs font-medium text-gray-400 mb-1.5">Category</label>
|
||||
<select name="category_id"
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
<%- include('../partials/head', { title: 'Settings' }) %>
|
||||
<%- include('../partials/adminNav', { currentPath: '/admin/settings' }) %>
|
||||
<%- include('../partials/adminTopBar') %>
|
||||
|
||||
<div class="pl-56 min-h-screen">
|
||||
<div class="lg:pl-56 pt-14 lg:pt-0 min-h-screen">
|
||||
<%- include('../partials/adminBanner') %>
|
||||
<div class="max-w-2xl mx-auto px-8 py-8">
|
||||
<div class="max-w-2xl mx-auto px-4 sm:px-8 py-6 sm:py-8">
|
||||
<div class="mb-8">
|
||||
<h1 class="text-xl font-semibold text-white">Settings</h1>
|
||||
<p class="text-sm text-gray-500 mt-0.5">Branding, appearance, and app configuration</p>
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
<%- include('../partials/head', { title: 'Upload Model' }) %>
|
||||
<%- include('../partials/adminNav', { currentPath: '/admin/upload' }) %>
|
||||
<%- include('../partials/adminTopBar') %>
|
||||
|
||||
<div class="pl-56 min-h-screen">
|
||||
<div class="lg:pl-56 pt-14 lg:pt-0 min-h-screen">
|
||||
<%- include('../partials/adminBanner') %>
|
||||
<div class="max-w-2xl mx-auto px-8 py-8">
|
||||
<div class="max-w-2xl mx-auto px-4 sm:px-8 py-6 sm:py-8">
|
||||
<div class="mb-8">
|
||||
<h1 class="text-xl font-semibold text-white">Upload Model</h1>
|
||||
<p class="text-sm text-gray-500 mt-0.5">Supported formats: STEP, STP, STL</p>
|
||||
@@ -52,7 +53,7 @@
|
||||
></textarea>
|
||||
</div>
|
||||
|
||||
<div class="grid grid-cols-2 gap-4">
|
||||
<div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
|
||||
<div>
|
||||
<label class="block text-xs font-medium text-gray-400 mb-1.5" for="category_id">Category</label>
|
||||
<select id="category_id" name="category_id"
|
||||
|
||||
Reference in New Issue
Block a user