update cdn

This commit is contained in:
Jonathan committed 2025-10-11 13:08:07 +07:00
1 parent 3857f0bdc0
commit eb4f9ad157
27 files changed
+165 -78

No files matched your search

+36
View File
@@ -0,0 +1,36 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>pix.cdn — demo</title>
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}" />
</head>
<body>
<header class="topbar">
<a href="{{ url_for('gallery') }}" class="brand">pix.cdn</a>
<nav>
{% if session.get('uid') %}
<a href="{{ url_for('upload') }}">Upload</a>
<a href="{{ url_for('logout') }}">Logout</a>
{% else %}
<a href="{{ url_for('login') }}">Login</a>
<a href="{{ url_for('register') }}">Register</a>
{% endif %}
</nav>
</header>
{% with msgs = get_flashed_messages() %}
{% if msgs %}
<div class="flash">
{% for m in msgs %}<div>{{ m }}</div>{% endfor %}
</div>
{% endif %}
{% endwith %}
<main class="container">
{% block content %}{% endblock %}
</main>
<footer class="foot">© pix.cdn</footer>
</body>
</html>
+20
View File
@@ -0,0 +1,20 @@
{% extends "base.html" %}
{% block content %}
<h2>Gallery</h2>
{% if not posts %}
<p>No posts yet. <a href="{{ url_for('upload') }}">Upload one</a>.</p>
{% endif %}
<div class="grid">
{% for p in posts %}
<a class="card" href="{{ url_for('view_post', pid=p.id) }}">
<img src="{{ url_for('cdn_serve', filename=p.filename) }}" alt="thumb" />
<div class="meta">
<div class="title">{{ p.title }}</div>
<div class="sub">{{ p.username }} · {{ p.created_at }}</div>
</div>
</a>
{% endfor %}
</div>
{% endblock %}
+11
View File
@@ -0,0 +1,11 @@
{% extends "base.html" %}
{% block content %}
<h2>Login</h2>
<form method="post">
<label>Username</label>
<input name="username" required />
<label>Password</label>
<input name="password" type="password" required />
<button type="submit">Login</button>
</form>
{% endblock %}
@@ -0,0 +1,12 @@
{% extends "base.html" %}
{% block content %}
<h2>Register</h2>
<form method="post">
<label>Username</label>
<input name="username" required />
<label>Password</label>
<input name="password" type="password" required />
<button type="submit">Create account</button>
</form>
<p class="hint">New users default to role <code>user</code>.</p>
{% endblock %}
+13
View File
@@ -0,0 +1,13 @@
{% extends "base.html" %}
{% block content %}
<h2>Upload image</h2>
<form method="post" enctype="multipart/form-data">
<label>Title</label>
<input name="title" placeholder="My picture" />
<label>Image file (png/jpg/jpeg/bmp)</label>
<input type="file" name="image" accept=".png,.jpg,.jpeg,.bmp" required />
<label>Notes (optional, saved with metadata)</label>
<textarea name="notes" rows="4" placeholder="CDN descriptors, tags, etc."></textarea>
<button type="submit">Upload</button>
</form>
{% endblock %}
@@ -0,0 +1,14 @@
{% extends "base.html" %}
{% block content %}
<article class="post">
<h2>{{ post.title }}</h2>
<img class="full" src="{{ url_for('cdn_serve', filename=post.filename) }}" alt="" />
<details class="desc">
<summary>Delivery details</summary>
<p>Static CDN reference: <code>/i/{{ post.filename }}</code></p>
<p>Uploaded at: <code>{{ post.created_at }}</code></p>
</details>
<template id="internal-meta" hidden>{{ metadata_snippet or '' }}</template>
</article>
{% endblock %}