Files

46 lines
2.7 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<title>Upload a Static Image - Sanctuary Commander</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
<script src="{{ url_for('static', filename='upload_media.js') }}" defer></script>
</head>
<body>
<div class="container">
<h1 class="text-center">Upload a Static Image</h1>
<hr>
<a class="btn btn-secondary mb-3" href="{{ url_for('home.root_route') }}">Home</a>
<div class="alert alert-warning" role="note">
Do not leave this page, refresh, or close the browser until the upload is complete.
You will automatically return to the homepage when the image has been saved.
</div>
<p>Upload one image, up to 100MB ({{ max_image_size }} bytes).</p>
<noscript><div class="alert alert-danger">JavaScript must be enabled to upload images and show progress.</div></noscript>
<div id="uploadError" class="alert alert-danger" role="alert" hidden></div>
<form id="imageUploadForm" action="{{ url_for('upload_photo.get_page') }}" method="POST" enctype="multipart/form-data"
data-media-upload data-media-kind="image" data-limit-label="100MB"
data-max-size="{{ max_image_size }}" data-home-url="{{ url_for('home.root_route') }}">
<fieldset id="uploadFields">
<div class="mb-3">
<label class="form-label" for="imageName">Image Name</label>
<input class="form-control" type="text" id="imageName" name="name" maxlength="120" required>
</div>
<div class="mb-3">
<label class="form-label" for="imageFile">Image File</label>
<input class="form-control" type="file" id="imageFile" name="files[]"
accept=".jpg,.jpeg,.png,.webp,.bmp,.tif,.tiff,.gif" required>
</div>
<button class="btn btn-primary mb-3" type="submit">Upload Image</button>
</fieldset>
</form>
<div id="uploadProgress" class="progress mb-2" role="progressbar" aria-label="Image upload progress"
aria-valuemin="0" aria-valuemax="100" aria-valuenow="0">
<div id="uploadProgressBar" class="progress-bar" style="width: 0%">0%</div>
</div>
<p id="uploadStatus" role="status" aria-live="polite">Ready to upload.</p>
</div>
</body>
</html>