| <!DOCTYPE html> |
| <html lang="en"> |
| <head> |
| <meta charset="UTF-8"> |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| <title>{{.title}}</title> |
| <link rel="preconnect" href="https://fonts.googleapis.com"> |
| <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> |
| <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet"> |
| <link href="/static/css/style.css" rel="stylesheet"> |
| </head> |
| <body> |
| <nav class="navbar"> |
| <div class="container"> |
| <a href="/" class="logo"> |
| <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> |
| <path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/> |
| <polyline points="14 2 14 8 20 8"/> |
| <line x1="16" y1="13" x2="8" y2="13"/> |
| <line x1="16" y1="17" x2="8" y2="17"/> |
| <polyline points="10 9 9 9 8 9"/> |
| </svg> |
| Patbin |
| </a> |
| <div class="nav-links"> |
| <button class="theme-toggle" onclick="toggleTheme()" title="Toggle theme"> |
| <svg class="sun" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"> |
| <circle cx="12" cy="12" r="5"/> |
| <line x1="12" y1="1" x2="12" y2="3"/> |
| <line x1="12" y1="21" x2="12" y2="23"/> |
| <line x1="4.22" y1="4.22" x2="5.64" y2="5.64"/> |
| <line x1="18.36" y1="18.36" x2="19.78" y2="19.78"/> |
| <line x1="1" y1="12" x2="3" y2="12"/> |
| <line x1="21" y1="12" x2="23" y2="12"/> |
| <line x1="4.22" y1="19.78" x2="5.64" y2="18.36"/> |
| <line x1="18.36" y1="5.64" x2="19.78" y2="4.22"/> |
| </svg> |
| <svg class="moon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"> |
| <path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"/> |
| </svg> |
| </button> |
| <a href="/" class="btn btn-primary"> |
| <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"> |
| <path d="M12 5v14M5 12h14"/> |
| </svg> |
| New Paste |
| </a> |
| <a href="#" id="logout-btn" class="btn btn-secondary">Logout</a> |
| </div> |
| </div> |
| </nav> |
|
|
| <main class="page"> |
| <div class="container"> |
| <div class="page-header"> |
| <h1 class="page-title">Dashboard</h1> |
| <p class="page-subtitle">Welcome back, {{.username}}</p> |
| </div> |
|
|
| <div class="stats-grid"> |
| <div class="stat-card"> |
| <div class="stat-value">{{.totalCount}}</div> |
| <div class="stat-label">Total Pastes</div> |
| </div> |
| <div class="stat-card"> |
| <div class="stat-value">{{.publicCount}}</div> |
| <div class="stat-label">Public</div> |
| </div> |
| <div class="stat-card"> |
| <div class="stat-value">{{.privateCount}}</div> |
| <div class="stat-label">Private</div> |
| </div> |
| </div> |
|
|
| <div class="card"> |
| <div class="card-header"> |
| <h2 class="card-title">Your Pastes</h2> |
| <a href="/" class="btn btn-primary btn-sm"> |
| <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"> |
| <path d="M12 5v14M5 12h14"/> |
| </svg> |
| New |
| </a> |
| </div> |
|
|
| {{if .pastes}} |
| <div class="paste-list"> |
| {{range .pastes}} |
| <a href="/{{.ID}}" class="paste-item"> |
| <div class="paste-icon"> |
| <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"> |
| <polyline points="16 18 22 12 16 6"/> |
| <polyline points="8 6 2 12 8 18"/> |
| </svg> |
| </div> |
| <div class="paste-info"> |
| <div class="paste-name">{{if .Title}}{{.Title}}{{else}}Untitled{{end}}</div> |
| <div class="paste-details"> |
| {{if .IsPublic}} |
| <span class="paste-badge public">Public</span> |
| {{else}} |
| <span class="paste-badge private">Private</span> |
| {{end}} |
| <span>{{if .Language}}{{.Language}}{{else}}plain{{end}}</span> |
| <span>{{.Views}} views</span> |
| <span>{{formatTime .CreatedAt}}</span> |
| </div> |
| </div> |
| </a> |
| {{end}} |
| </div> |
| {{else}} |
| <div class="text-center text-muted" style="padding: 3rem 1rem;"> |
| <svg width="48" height="48" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" style="margin: 0 auto 1rem; opacity: 0.5;"> |
| <path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/> |
| <polyline points="14 2 14 8 20 8"/> |
| </svg> |
| <p>No pastes yet</p> |
| <a href="/" class="btn btn-primary mt-3">Create your first paste</a> |
| </div> |
| {{end}} |
| </div> |
| </div> |
| </main> |
|
|
| <script src="/static/js/app.js"></script> |
| </body> |
| </html> |
|
|