73 lines
3.0 KiB
HTML
73 lines
3.0 KiB
HTML
<!DOCTYPE html>
|
|||
|
|
<html lang="en">
|
||
|
|
<head>
|
||
|
|
<meta charset="UTF-8">
|
||
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||
|
|
<title>Clipboard — Yggdrasil</title>
|
||
|
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||
|
|
<link href="https://fonts.googleapis.com/css2?family=VT323&display=swap" rel="stylesheet">
|
||
|
|
<link rel="stylesheet" href="{{ url_for('static', filename='retro.css') }}">
|
||
|
|
</head>
|
||
|
|
<body>
|
||
|
|
<nav>
|
||
|
|
<a href="{{ url_for('home') }}">Home</a>
|
||
|
|
<a href="{{ url_for('sensors_page') }}">Sensors</a>
|
||
|
|
<a href="{{ url_for('notes_page') }}">Notes</a>
|
||
|
|
<a href="{{ url_for('clipboard_page') }}">Clipboard</a>
|
||
|
|
<a href="{{ url_for('notifications_page') }}">Notifications{% if unread_notifications %} <span class="nav-badge">{{ unread_notifications }}</span>{% endif %}</a>
|
||
|
|
<a href="{{ url_for('api_docs') }}">API</a>
|
||
|
|
<a href="{{ url_for('logout') }}">Log out</a>
|
||
|
|
<img class="nav-logo" src="{{ url_for('static', filename='yggdrasil-logo.png') }}" alt="Yggdrasil logo">
|
||
|
|
</nav>
|
||
|
|
<h1>Clipboard</h1>
|
||
|
|
|
||
|
|
<div class="panel">
|
||
|
|
<h2>Upload file</h2>
|
||
|
|
<p class="hint">
|
||
|
|
Max single file: {{ max_file | filesize }}. Total quota:
|
||
|
|
{{ max_total | filesize }} — used: {{ total_used | filesize }},
|
||
|
|
free: {{ remaining | filesize }}.
|
||
|
|
</p>
|
||
|
|
<form method="post" action="{{ url_for('clipboard_upload') }}" enctype="multipart/form-data">
|
||
|
|
<label for="file-upload">File:</label>
|
||
|
|
<input type="file" id="file-upload" name="file" required>
|
||
|
|
<button type="submit">[ Upload ]</button>
|
||
|
|
</form>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
{% with messages = get_flashed_messages(with_categories=true) %}
|
||
|
|
{% if messages %}
|
||
|
|
<ul class="flash-messages">
|
||
|
|
{% for category, message in messages %}
|
||
|
|
<li class="flash flash-{{ category }}">{{ message }}</li>
|
||
|
|
{% endfor %}
|
||
|
|
</ul>
|
||
|
|
{% endif %}
|
||
|
|
{% endwith %}
|
||
|
|
|
||
|
|
{% if not files %}
|
||
|
|
<p class="hint">No files yet. Upload your first file above.</p>
|
||
|
|
{% else %}
|
||
|
|
<ul class="clipboard-list">
|
||
|
|
{% for file in files %}
|
||
|
|
<li class="clipboard-item" id="clipboard-{{ file.id }}">
|
||
|
|
<div class="clipboard-main">
|
||
|
|
<a href="{{ url_for('clipboard_download', file_id=file.id) }}"
|
||
|
|
download="{{ file.original_name }}"
|
||
|
|
title="{{ file.original_name }}">{{ file.original_name }}</a>
|
||
|
|
<span class="clipboard-meta">{{ file.size | filesize }} · {{ file.created_at.strftime("%Y-%m-%d %H:%M") }}</span>
|
||
|
|
</div>
|
||
|
|
<form method="post" action="{{ url_for('clipboard_delete', file_id=file.id) }}" class="clipboard-delete-form">
|
||
|
|
<button type="submit" title="Delete {{ file.original_name }}">[x]</button>
|
||
|
|
</form>
|
||
|
|
</li>
|
||
|
|
{% endfor %}
|
||
|
|
</ul>
|
||
|
|
{% endif %}
|
||
|
|
|
||
|
|
<footer class="statusbar">
|
||
|
|
<span>{{ user.username }}@yggdrasil:~/clipboard$</span>
|
||
|
|
</footer>
|
||
|
|
</body>
|
||
|
|
</html>
|