clipboard
This commit is contained in:
@@ -0,0 +1,72 @@
|
||||
<!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>
|
||||
@@ -13,6 +13,7 @@
|
||||
<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>
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
<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>
|
||||
@@ -27,9 +28,10 @@
|
||||
<li><a href="{{ url_for('notes_page') }}"><span class="mc-key">2</span>Notes — title, text and checklists</a></li>
|
||||
<li><a href="{{ url_for('notifications_page') }}"><span class="mc-key">3</span>Notifications{% if unread_notifications %} ({{ unread_notifications }} new){% endif %}</a></li>
|
||||
<li><a href="{{ url_for('api_docs') }}"><span class="mc-key">4</span>API — documentation</a></li>
|
||||
<li><a href="{{ url_for('clipboard_page') }}"><span class="mc-key">5</span>Clipboard — upload and share files</a></li>
|
||||
<li><a href="{{ url_for('logout') }}"><span class="mc-key">0</span>Log out</a></li>
|
||||
</ul>
|
||||
<p class="hint">Tip: press <b>1</b>, <b>2</b>, <b>3</b>, <b>4</b> or <b>0</b> to navigate.</p>
|
||||
<p class="hint">Tip: press <b>1</b>, <b>2</b>, <b>3</b>, <b>4</b>, <b>5</b> or <b>0</b> to navigate.</p>
|
||||
</div>
|
||||
<img class="logo" src="{{ url_for('static', filename='yggdrasil-logo.png') }}" alt="Yggdrasil logo">
|
||||
<footer class="statusbar">
|
||||
@@ -47,6 +49,7 @@
|
||||
'2': "{{ url_for('notes_page') }}",
|
||||
'3': "{{ url_for('notifications_page') }}",
|
||||
'4': "{{ url_for('api_docs') }}",
|
||||
'5': "{{ url_for('clipboard_page') }}",
|
||||
'0': "{{ url_for('logout') }}"
|
||||
};
|
||||
if (targets[e.key]) window.location.href = targets[e.key];
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
<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>
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
<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>
|
||||
@@ -43,6 +44,9 @@
|
||||
<span>{{ notification.created_at.strftime("%Y-%m-%d %H:%M") }}</span>
|
||||
</span>
|
||||
</a>
|
||||
<form method="post" action="{{ url_for('notification_delete', notification_id=notification.id) }}" class="notification-delete-form">
|
||||
<button type="submit" title="Delete notification">[x]</button>
|
||||
</form>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
<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>
|
||||
|
||||
Reference in New Issue
Block a user