52 lines
3.2 KiB
HTML
52 lines
3.2 KiB
HTML
{% extends "base.html" %}
|
|
{% block title %}Files — {{ settings.APP_NAME }}{% endblock %}
|
|
{% block content %}
|
|
<div class="page" style="max-width:760px">
|
|
<h1 class="greeting">My files</h1>
|
|
<p class="muted">Upload pictures here from your computer — they instantly appear in the <strong>GIMP</strong> (and video/audio) apps, under the shared <code>/media</code> folder, in your own <code>{{ user.username }}/</code> subfolder.</p>
|
|
|
|
{% if ok %}<div class="form-success" style="background:#e8f7ec;color:#1aae39;border:1px solid #b8e6c7;padding:10px 12px;border-radius:8px">✅ Uploaded. It's now in GIMP under <code>{{ user.username }}/…</code></div>{% endif %}
|
|
{% if error %}<div class="form-error">{{ error }}</div>{% endif %}
|
|
|
|
<div class="admin-panel">
|
|
<div class="linkout-card stack">
|
|
<h2 class="section-title">Upload a picture</h2>
|
|
<form method="post" action="/files/upload" enctype="multipart/form-data">
|
|
<div class="form-field">
|
|
<input class="text-input" type="file" name="file" accept="image/*,.pdf,.txt,.md" required>
|
|
</div>
|
|
<button class="button button-primary width-full" type="submit">Upload</button>
|
|
</form>
|
|
<p class="faint margin-top" style="font: var(--type-caption)">
|
|
On your computer (e.g. <code>.27</code>) uploads go to the lab's shared folder on <code>.13</code>, which GIMP opens at <code>/media/{{ user.username }}/</code>.
|
|
</p>
|
|
</div>
|
|
|
|
<section class="stack">
|
|
<h2 class="section-title">Uploaded ({{ files|length }})</h2>
|
|
{% if files %}
|
|
<ul class="file-list">
|
|
{% for f in files %}
|
|
<li style="display:flex;align-items:center;gap:12px">
|
|
{% if f.img %}
|
|
<img src="/files/raw/{{ f.name }}" alt="{{ f.name }}" style="width:56px;height:56px;object-fit:cover;border-radius:8px;border:1px solid var(--hairline,#e6e6e6)">
|
|
{% else %}
|
|
<span style="width:56px;height:56px;display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--hairline,#e6e6e6);border-radius:8px;color:#999;font-size:11px">file</span>
|
|
{% endif %}
|
|
<span title="{{ f.name }}" style="flex:1;min-width:0;white-space:normal;word-break:break-all;overflow:visible;font:var(--type-body-sm);color:var(--ink)">{{ f.name }}</span>
|
|
<span class="faint" style="flex:none">{{ (f.size/1024)|round(1) }} KB</span>
|
|
<a class="button button-utility" href="/files/raw/{{ f.name }}" target="_blank" title="View {{ f.name }}" style="width:32px;height:32px;display:inline-flex;align-items:center;justify-content:center;padding:0;font-size:15px">👁</a>
|
|
<a class="button button-utility" href="/files/dl/{{ f.name }}" title="Download {{ f.name }}" style="width:32px;height:32px;display:inline-flex;align-items:center;justify-content:center;padding:0;font-size:17px">↓</a>
|
|
</li>
|
|
{% endfor %}
|
|
</ul>
|
|
<p class="faint margin-top" style="font: var(--type-caption)">
|
|
To open one in GIMP: go to <code>gimp.lab.audasmedia.com.au</code> → <strong>File → Open</strong> → <code>/media/{{ user.username }}/…</code>.
|
|
</p>
|
|
{% else %}
|
|
<p class="faint">Nothing uploaded yet.</p>
|
|
{% endif %}
|
|
</section>
|
|
</div>
|
|
</div>
|
|
{% endblock %} |