Files
warpbox-dev/backend/templates/pages/home.html
Daniel Legt 9a3cb90b17
All checks were successful
Build and Publish Docker Image / deploy (push) Successful in 1m8s
feat(accounts): implement user accounts, sessions, and dashboards
Introduce Stage 4 features to support multi-user accounts, cookie-based web sessions, and personal dashboards.

Changes include:
- Adding `/register` to bootstrap the first admin account and `/login`/`/logout` for session management.
- Creating a personal dashboard (`/app`) to display owned boxes, storage usage, and upload history.
- Implementing admin user management (`/admin/users`) for generating invite links and managing user states.
- Updating the bbolt database schema to store users, sessions, invites, and collections.
- Adding `golang.org/x/crypto` for password hashing and introducing unit tests for account handlers.
2026-05-30 15:42:35 +03:00

100 lines
3.9 KiB
HTML

{{define "home.html"}}{{template "base" .}}{{end}}
{{define "content"}}
<section class="upload-view" aria-labelledby="upload-title">
<div class="hero-copy">
<h1 id="upload-title">Send a file. Get a link.</h1>
<p>Anonymous, self-hosted transfers. No account required.</p>
</div>
<form class="upload-panel card" id="upload-form" action="/api/v1/upload" method="post" enctype="multipart/form-data">
<div class="card-content">
<label class="drop-zone" for="file-input">
<span class="drop-icon" aria-hidden="true">
<svg viewBox="0 0 24 24" role="img" focusable="false" aria-hidden="true"><path d="M12 16V4m0 0 4 4m-4-4-4 4M5 20h14" /></svg>
</span>
<span class="drop-title">Drop files to upload</span>
<span class="drop-copy">or click to browse</span>
<span class="drop-meta">{{if .Data.IsAdmin}}Admin upload: no file size limit{{else}}Max file size: {{.Data.MaxUploadSize}}{{end}} · Links expire in 7 days</span>
<input id="file-input" name="file" type="file" multiple>
</label>
<details class="advanced-options">
<summary>
<svg viewBox="0 0 24 24" role="img" focusable="false" aria-hidden="true"><path d="m6 9 6 6 6-6" /></svg>
Advanced options
</summary>
<div class="option-grid">
{{if .CurrentUser}}
<label>
<span>Collection</span>
<select name="collection_id">
<option value="">Unsorted</option>
{{range .Data.Collections}}<option value="{{.ID}}">{{.Name}}</option>{{end}}
</select>
</label>
{{end}}
<label>
<span>Expires in</span>
<select name="max_days">
<option value="7">7 days</option>
<option value="1">1 day</option>
<option value="30">30 days</option>
</select>
</label>
<label>
<span>Max downloads</span>
<input type="number" name="max_downloads" min="1" placeholder="Unlimited">
</label>
<label>
<span>Password</span>
<input type="password" name="password" autocomplete="new-password" placeholder="Optional">
</label>
<label class="checkbox-field">
<input type="checkbox" name="obfuscate_metadata">
<span>Hide file names/count until unlocked</span>
</label>
</div>
</details>
<div class="upload-progress" id="upload-progress" hidden>
<div class="progress-row">
<span>Uploading</span>
<span id="upload-status">Preparing...</span>
</div>
<div class="progress"><span id="total-progress-bar"></span></div>
</div>
<div class="result-list upload-queue" id="upload-queue" hidden></div>
<div class="form-footer">
<p id="file-summary">Choose one or more files to begin.</p>
<button class="button button-primary" type="submit">Upload files</button>
</div>
</div>
</form>
<section class="upload-result card" id="upload-result" hidden aria-live="polite">
<div class="card-content">
<div class="result-header">
<div>
<div class="result-title">
<svg viewBox="0 0 24 24" role="img" focusable="false" aria-hidden="true"><path d="M20 6 9 17l-5-5" /></svg>
<span>Upload complete</span>
</div>
<p id="result-meta"></p>
</div>
<div class="result-actions">
<button class="button button-outline" type="button" id="copy-url">Copy URL</button>
<a class="button button-primary" id="open-box" href="/">Open box</a>
</div>
</div>
<div class="result-list" id="result-list"></div>
<p class="manage-link" id="manage-link" hidden>
<span>Keep this private:</span>
<a href="/" target="_blank" rel="noopener noreferrer">Manage or delete this upload</a>
</p>
</div>
</section>
</section>
{{end}}