2025-05-03 08:51:33 +01:00

54 lines
2.3 KiB
HTML

<div class="block">
<h4 class="title is-4">Attachments</h4>
<div class="block">
<check if="isset( {{@attachments }})">
<check if="count({{@attachments}}) > 0">
<table class="table is-fullwidth is-narrow is-striped is-hoverable">
<thead>
<tr>
<th class="th-icon"></th>
<th>File Name</th>
<th>Uploaded By</th>
<th>Created At</th>
<th>Version</th>
</tr>
</thead>
<tbody>
<repeat group="{{ @attachments }}" value="{{ @attach }}">
<tr>
<td>
<span class="icon"><i class="fas fa-file"></i></span>
</td>
<td><a href="/attachment/{{@attach.id}}/download">{{ @attach.file_name }}</a></td>
<td>{{ @attach.username }}</td>
<td>{{ @attach.created_at }}</td>
<td>{{ @attach.version_number }}</td>
</tr>
</repeat>
</tbody>
</table>
<hr>
<div>
<repeat group="{{ @attachments }}" value="{{ @attach }}">
<img src="/attachment/{{@attach.id}}/view">
</repeat>
</div>
</check>
</check>
<div class="block">
<form action="/ticket/{{@PARAMS.id}}/attachments/upload" method="POST" enctype="multipart/form-data">
<div class="field has-addons">
<div class="control has-icons-left"><!-- is-expanded -->
<input class="input" type="file" name="attachment" required>
<span class="icon is-small is-left">
<i class="fas fa-file"></i>
</span>
</div>
<div class="control">
<button class="button" type="submit">Upload</button>
</div>
</div>
</form>
</div>
</div>
</div>