photo upload bei runs geht jetzt (beim ergebnis eintragen)
All checks were successful
Build and push / Pulling repo on server (push) Successful in 3s

This commit is contained in:
2023-11-01 21:48:45 +01:00
parent e03d9ab449
commit 19622359f0
8 changed files with 208 additions and 40 deletions

View File

@ -22,7 +22,8 @@
<h2>Ergebnis
<?= $result_id?'Bearbeiten':'Eintragen'; ?>
</h2>
<form hx-post="/runs/validateresults" hx-encoding='multipart/form-data' hx-target="#response">
<form id="resulteditform" hx-post="/runs/validateresults" hx-encoding='multipart/form-data' hx-target="#response">
<div class="dropzone-previews"></div>
<input type="hidden" name="result_id" value="<?= $result_id; ?>">
<input type="hidden" name="run_id" value="<?= $run_id; ?>">
<div>
@ -88,7 +89,7 @@
</div>
<div>
<label for="uploads">Uploads</label>
<input type="file" accept="image/png, image/jpeg, image/gif" id="uploads" name="uploads">
<input type="file" accept="image/png, image/jpeg, image/gif" id="uploads" name="photos[]" multiple>
</div>
<div>
<label for="video-url">Video Url</label>
@ -103,7 +104,13 @@
<input class="form-check-input" type="checkbox" id="public" name="public" value="1" <?=$result['public']!='0' ?'checked':''; ?>>
</div>
<button type="submit" name="submit" value="true" class="btn btn-primary">Speichern</button>
<progress id='progress' value='0' max='100'></progress>
<div id="response"></div>
</form>
</div>
</div>
<script>
htmx.on('#resulteditform', 'htmx:xhr:progress', function(evt) {
htmx.find('#progress').setAttribute('value', evt.detail.loaded/evt.detail.total * 100)
});
</script>