askrobots / dbbasic-admin
Public
An admin interface that builds itself from the dbbasic modules you install; its pages follow file paths, like CGI.
edit.html · 14.1 KB · 299 lines
| 1 | <!DOCTYPE html> |
| 2 | <html lang="en"> |
| 3 | <head> |
| 4 | <meta charset="UTF-8"> |
| 5 | <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| 6 | <title>Edit Post - DBBASIC Studio</title> |
| 7 | <link rel="stylesheet" href="../../../static/css/admin.css"> |
| 8 | </head> |
| 9 | <body> |
| 10 | <div class="studio-container"> |
| 11 | <!-- Top Bar --> |
| 12 | <header class="studio-header"> |
| 13 | <div class="logo"> |
| 14 | <span class="logo-icon">⚡</span> |
| 15 | <span class="logo-text">DBBASIC Studio</span> |
| 16 | </div> |
| 17 | <div class="header-actions"> |
| 18 | <span class="project-name">myblog/</span> |
| 19 | <button class="btn-icon" title="Deploy">🚀</button> |
| 20 | <button class="btn-icon" title="Settings">⚙️</button> |
| 21 | </div> |
| 22 | </header> |
| 23 | |
| 24 | <!-- Main Layout --> |
| 25 | <div class="studio-layout"> |
| 26 | <!-- Sidebar Navigation --> |
| 27 | <nav class="sidebar"> |
| 28 | <a href="../../../index.html" class="nav-item"> |
| 29 | <span class="nav-icon">📊</span> |
| 30 | <span class="nav-label">Dashboard</span> |
| 31 | </a> |
| 32 | <a href="../database.html" class="nav-item"> |
| 33 | <span class="nav-icon">🗄️</span> |
| 34 | <span class="nav-label">Database</span> |
| 35 | </a> |
| 36 | <a href="list.html" class="nav-item active"> |
| 37 | <span class="nav-icon">📝</span> |
| 38 | <span class="nav-label">Posts</span> |
| 39 | </a> |
| 40 | <a href="../users/list.html" class="nav-item"> |
| 41 | <span class="nav-icon">👥</span> |
| 42 | <span class="nav-label">Users</span> |
| 43 | </a> |
| 44 | <div class="nav-divider"></div> |
| 45 | <a href="../jobs.html" class="nav-item"> |
| 46 | <span class="nav-icon">⏰</span> |
| 47 | <span class="nav-label">Jobs</span> |
| 48 | </a> |
| 49 | <a href="../logs.html" class="nav-item"> |
| 50 | <span class="nav-icon">📋</span> |
| 51 | <span class="nav-label">Logs</span> |
| 52 | </a> |
| 53 | <a href="../deploy.html" class="nav-item"> |
| 54 | <span class="nav-icon">🚀</span> |
| 55 | <span class="nav-label">Deploy</span> |
| 56 | </a> |
| 57 | </nav> |
| 58 | |
| 59 | <!-- Main Content Area --> |
| 60 | <main class="main-content"> |
| 61 | <div class="content-header"> |
| 62 | <div> |
| 63 | <h1>Edit Post</h1> |
| 64 | <div class="breadcrumb">Home / Posts / Edit</div> |
| 65 | </div> |
| 66 | <div class="header-actions"> |
| 67 | <button class="btn-secondary">Preview</button> |
| 68 | <button class="btn-primary">Save</button> |
| 69 | </div> |
| 70 | </div> |
| 71 | |
| 72 | <!-- Edit Form --> |
| 73 | <div class="editor-layout"> |
| 74 | <div class="editor-main"> |
| 75 | <div class="card"> |
| 76 | <div class="form-group"> |
| 77 | <label for="title">Title</label> |
| 78 | <input type="text" id="title" class="form-input" value="Getting Started with DBBASIC" placeholder="Post title..."> |
| 79 | </div> |
| 80 | |
| 81 | <div class="form-group"> |
| 82 | <label for="slug">Slug</label> |
| 83 | <input type="text" id="slug" class="form-input" value="getting-started-with-dbbasic" placeholder="post-slug"> |
| 84 | <div class="form-hint">URL: /blog/getting-started-with-dbbasic</div> |
| 85 | </div> |
| 86 | |
| 87 | <div class="form-group"> |
| 88 | <label for="body">Content</label> |
| 89 | <div class="editor-toolbar"> |
| 90 | <button class="toolbar-btn" title="Bold">B</button> |
| 91 | <button class="toolbar-btn" title="Italic">I</button> |
| 92 | <button class="toolbar-btn" title="Link">🔗</button> |
| 93 | <button class="toolbar-btn" title="Image">🖼️</button> |
| 94 | <button class="toolbar-btn" title="Code">{'<>'}</button> |
| 95 | <div class="toolbar-divider"></div> |
| 96 | <button class="toolbar-btn" title="Preview">👁️</button> |
| 97 | <button class="toolbar-btn" title="Fullscreen">⛶</button> |
| 98 | </div> |
| 99 | <textarea id="body" class="form-textarea editor-textarea" rows="20">## Welcome to DBBASIC |
| 100 | |
| 101 | DBBASIC is a web framework that embraces Unix philosophy. Instead of complex abstractions, it uses: |
| 102 | |
| 103 | - **TSV files** for data (grep-able, git-friendly) |
| 104 | - **Unix primitives** (files, processes, pipes) |
| 105 | - **Python** for logic (readable, powerful) |
| 106 | |
| 107 | ### Why TSV Files? |
| 108 | |
| 109 | ```python |
| 110 | # Reading data is simple |
| 111 | posts = tsv.query("posts", where={"published": True}) |
| 112 | |
| 113 | # No ORM complexity |
| 114 | # No migrations |
| 115 | # Just files |
| 116 | ``` |
| 117 | |
| 118 | ### Getting Started |
| 119 | |
| 120 | 1. Install: `pip install dbbasic` |
| 121 | 2. Create project: `dbbasic new myblog` |
| 122 | 3. Run: `dbbasic serve` |
| 123 | |
| 124 | That's it! Your blog is running. |
| 125 | |
| 126 | ### What Makes It Different? |
| 127 | |
| 128 | - **No database server** - TSV files are the database |
| 129 | - **No Redis** - Unix pipes for IPC |
| 130 | - **No Docker** - Just systemd |
| 131 | - **$5/month hosting** - One VPS, many apps |
| 132 | |
| 133 | Ready to build something simple?</textarea> |
| 134 | </div> |
| 135 | </div> |
| 136 | |
| 137 | <!-- Markdown Preview --> |
| 138 | <div class="card preview-card"> |
| 139 | <div class="preview-header"> |
| 140 | <h3>Preview</h3> |
| 141 | <span class="preview-toggle">Live preview enabled</span> |
| 142 | </div> |
| 143 | <div class="preview-content markdown-content"> |
| 144 | <h2>Welcome to DBBASIC</h2> |
| 145 | <p>DBBASIC is a web framework that embraces Unix philosophy. Instead of complex abstractions, it uses:</p> |
| 146 | <ul> |
| 147 | <li><strong>TSV files</strong> for data (grep-able, git-friendly)</li> |
| 148 | <li><strong>Unix primitives</strong> (files, processes, pipes)</li> |
| 149 | <li><strong>Python</strong> for logic (readable, powerful)</li> |
| 150 | </ul> |
| 151 | <h3>Why TSV Files?</h3> |
| 152 | <pre><code class="language-python"># Reading data is simple |
| 153 | posts = tsv.query("posts", where={"published": True}) |
| 154 | |
| 155 | # No ORM complexity |
| 156 | # No migrations |
| 157 | # Just files</code></pre> |
| 158 | <h3>Getting Started</h3> |
| 159 | <ol> |
| 160 | <li>Install: <code>pip install dbbasic</code></li> |
| 161 | <li>Create project: <code>dbbasic new myblog</code></li> |
| 162 | <li>Run: <code>dbbasic serve</code></li> |
| 163 | </ol> |
| 164 | <p>That's it! Your blog is running.</p> |
| 165 | </div> |
| 166 | </div> |
| 167 | </div> |
| 168 | |
| 169 | <!-- Sidebar Meta --> |
| 170 | <aside class="editor-sidebar"> |
| 171 | <!-- Publish Settings --> |
| 172 | <div class="card sidebar-card"> |
| 173 | <h3>Publish</h3> |
| 174 | <div class="form-group"> |
| 175 | <label for="status">Status</label> |
| 176 | <select id="status" class="form-select"> |
| 177 | <option value="published" selected>Published</option> |
| 178 | <option value="draft">Draft</option> |
| 179 | <option value="scheduled">Scheduled</option> |
| 180 | </select> |
| 181 | </div> |
| 182 | <div class="form-group"> |
| 183 | <label for="published_at">Published At</label> |
| 184 | <input type="datetime-local" id="published_at" class="form-input" value="2025-01-15T10:30"> |
| 185 | </div> |
| 186 | <div class="card-actions"> |
| 187 | <button class="btn-danger-outline">Delete</button> |
| 188 | <button class="btn-primary">Update</button> |
| 189 | </div> |
| 190 | </div> |
| 191 | |
| 192 | <!-- Category & Tags --> |
| 193 | <div class="card sidebar-card"> |
| 194 | <h3>Category</h3> |
| 195 | <div class="form-group"> |
| 196 | <select class="form-select"> |
| 197 | <option value="">Select category...</option> |
| 198 | <option value="tutorials" selected>Tutorials</option> |
| 199 | <option value="news">News</option> |
| 200 | <option value="guides">Guides</option> |
| 201 | </select> |
| 202 | </div> |
| 203 | |
| 204 | <h3>Tags</h3> |
| 205 | <div class="tag-list"> |
| 206 | <span class="tag">python <button>×</button></span> |
| 207 | <span class="tag">web-development <button>×</button></span> |
| 208 | <span class="tag">unix <button>×</button></span> |
| 209 | </div> |
| 210 | <input type="text" class="form-input" placeholder="Add tag..."> |
| 211 | </div> |
| 212 | |
| 213 | <!-- Featured Image --> |
| 214 | <div class="card sidebar-card"> |
| 215 | <h3>Featured Image</h3> |
| 216 | <div class="image-upload"> |
| 217 | <div class="image-preview"> |
| 218 | <img src="https://placehold.co/300x200?text=Featured+Image" alt="Featured"> |
| 219 | </div> |
| 220 | <button class="btn-secondary-small">Change Image</button> |
| 221 | <button class="btn-danger-outline-small">Remove</button> |
| 222 | </div> |
| 223 | </div> |
| 224 | |
| 225 | <!-- SEO --> |
| 226 | <div class="card sidebar-card"> |
| 227 | <h3>SEO</h3> |
| 228 | <div class="form-group"> |
| 229 | <label for="meta_title">Meta Title</label> |
| 230 | <input type="text" id="meta_title" class="form-input" value="Getting Started with DBBASIC"> |
| 231 | <div class="char-count">45 / 60 characters</div> |
| 232 | </div> |
| 233 | <div class="form-group"> |
| 234 | <label for="meta_description">Meta Description</label> |
| 235 | <textarea id="meta_description" class="form-textarea" rows="3">Learn how to build web apps with DBBASIC, the Unix-native web framework.</textarea> |
| 236 | <div class="char-count">78 / 160 characters</div> |
| 237 | </div> |
| 238 | </div> |
| 239 | |
| 240 | <!-- Stats --> |
| 241 | <div class="card sidebar-card"> |
| 242 | <h3>Stats</h3> |
| 243 | <div class="stats-list"> |
| 244 | <div class="stat-row"> |
| 245 | <span class="stat-label">Views</span> |
| 246 | <span class="stat-value">1,234</span> |
| 247 | </div> |
| 248 | <div class="stat-row"> |
| 249 | <span class="stat-label">Comments</span> |
| 250 | <span class="stat-value">23</span> |
| 251 | </div> |
| 252 | <div class="stat-row"> |
| 253 | <span class="stat-label">Word Count</span> |
| 254 | <span class="stat-value">342</span> |
| 255 | </div> |
| 256 | <div class="stat-row"> |
| 257 | <span class="stat-label">Reading Time</span> |
| 258 | <span class="stat-value">2 min</span> |
| 259 | </div> |
| 260 | </div> |
| 261 | </div> |
| 262 | </aside> |
| 263 | </div> |
| 264 | </main> |
| 265 | |
| 266 | <!-- AI Assistant Sidebar --> |
| 267 | <aside class="ai-assistant"> |
| 268 | <div class="ai-header"> |
| 269 | <span class="ai-icon">🤖</span> |
| 270 | <span class="ai-title">AI Assistant</span> |
| 271 | <button class="ai-toggle">−</button> |
| 272 | </div> |
| 273 | |
| 274 | <div class="ai-content"> |
| 275 | <div class="ai-messages"> |
| 276 | <div class="ai-message ai-message-assistant"> |
| 277 | <div class="message-content"> |
| 278 | I can help you write, edit, or enhance this post. What would you like to do? |
| 279 | </div> |
| 280 | </div> |
| 281 | </div> |
| 282 | |
| 283 | <div class="ai-suggestions"> |
| 284 | <div class="suggestion-title">Try asking:</div> |
| 285 | <button class="suggestion-btn">"Make it more concise"</button> |
| 286 | <button class="suggestion-btn">"Add code examples"</button> |
| 287 | <button class="suggestion-btn">"Generate SEO meta"</button> |
| 288 | </div> |
| 289 | |
| 290 | <div class="ai-input"> |
| 291 | <textarea placeholder="Ask AI to edit this post..." rows="3"></textarea> |
| 292 | <button class="btn-primary">Send</button> |
| 293 | </div> |
| 294 | </div> |
| 295 | </aside> |
| 296 | </div> |
| 297 | </div> |
| 298 | </body> |
| 299 | </html> |