fix(front/file-uploader): remove unnecessary data-table-container usage

This commit is contained in:
Alice Gaudon 2022-03-05 09:08:14 +01:00
parent c2182dbbca
commit 53c7423115
1 changed files with 45 additions and 47 deletions

View File

@ -191,55 +191,53 @@
<Pagination pagination={$locals.pagination} routeName="file-uploader" contextSize={3}/>
<div class="data-table-container">
<table class="data-table file-upload-table">
<thead>
<table class="data-table file-upload-table">
<thead>
<tr>
<th>#</th>
<th class="table-col-grow">Name</th>
<th>Size</th>
<th>Expires in</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
{#each $locals.files as file}
<tr>
<th>#</th>
<th class="table-col-grow">Name</th>
<th>Size</th>
<th>Expires in</th>
<th>Actions</th>
<td>{file.id}</td>
<td class="table-col-grow-cell"><a href="{file.url}">
<pre>{file.real_name}</pre>
</a></td>
<td>{(file.size / (1024 * 1024)).toFixed(2)}MB</td>
<td>
{#if file.expires_at}
<time datetime="{file.expires_at}" title="{file.expires_at}">
{Time.humanizeTimeTo(new Date(file.expires_at))}
</time>
{:else}
Never
{/if}
</td>
<td class="actions">
{#if file.shouldBeDeleted}
Pending deletion
{:else}
<CopyableText content="{file.url}" buttonMode/>
<Form action={route('delete-file-frontend', file.slug)} button
submitIcon="trash" submitText="delete" submitClass="danger"
confirm="Are you sure you want to delete file {file.real_name}?"/>
{/if}
</td>
</tr>
</thead>
<tbody>
{#each $locals.files as file}
<tr>
<td>{file.id}</td>
<td class="table-col-grow-cell"><a href="{file.url}">
<pre>{file.real_name}</pre>
</a></td>
<td>{(file.size / (1024 * 1024)).toFixed(2)}MB</td>
<td>
{#if file.expires_at}
<time datetime="{file.expires_at}" title="{file.expires_at}">
{Time.humanizeTimeTo(new Date(file.expires_at))}
</time>
{:else}
Never
{/if}
</td>
<td class="actions">
{#if file.shouldBeDeleted}
Pending deletion
{:else}
<CopyableText content="{file.url}" buttonMode/>
<Form action={route('delete-file-frontend', file.slug)} button
submitIcon="trash" submitText="delete" submitClass="danger"
confirm="Are you sure you want to delete file {file.real_name}?"/>
{/if}
</td>
</tr>
{:else}
<tr>
<td colspan="5" class="center">You haven't uploaded any file yet.</td>
</tr>
{/each}
</tbody>
</table>
</div>
{:else}
<tr>
<td colspan="5" class="center">You haven't uploaded any file yet.</td>
</tr>
{/each}
</tbody>
</table>
<Pagination pagination={$locals.pagination} routeName="file-uploader" contextSize={3}/>
</section>