simple-images-upload/views/pages/upload.ejs

31 lines
824 B
Text
Raw Normal View History

2023-09-23 20:54:44 +02:00
<div class="box">
<form method="POST" enctype="multipart/form-data">
<h1>
Upload
</h1>
<div class="field">
<label for="image">Choisir une image</label>
<input
type="file"
accept="image/*"
class="custom-file-input"
id="image"
name="image"
2023-09-25 14:26:48 +02:00
>
2023-09-23 20:54:44 +02:00
</div>
<button type="submit" class="button is-primary">Uploader</button>
<% if ( page.upload ) { %>
<div class="grid gap-5 grid-cols-1 md:grid-cols-2">
<div class="image-preview">
2023-09-25 14:26:48 +02:00
<img src="<%= page.upload.smallFile %>" alt="Miniature">
2023-09-23 20:54:44 +02:00
</div>
<div>
2023-09-25 14:26:48 +02:00
<%- include('../partials/details', {file: page.upload, index: 0}) %>
2023-09-23 20:54:44 +02:00
</div>
</div>
<% } %>
</form>
</div>