optimized forms

This commit is contained in:
the1mason 2024-09-27 02:52:25 +05:00
parent 81f3fc93e5
commit c40beff1e3
13 changed files with 29 additions and 13 deletions

View File

@ -15,7 +15,11 @@ public sealed class FileService(IFileMetaRepository metaRepository, IFileReposit
if (meta is null)
return false;
return await metaRepository.Delete(meta);
var result = await metaRepository.Delete(meta);
if (!result)
return result;
return await repository.Delete(meta.SourceLocation);
}
public async Task<Result<FileMeta, BusinessError>> AddFile(FileMeta meta, Func<Stream> streamProvider)

View File

@ -41,19 +41,31 @@
@foreach (var file in Model.Data)
{
<div style="display: flex">
<h3 class="no-margin" style="margin-right: 10px">
<a target="_blank" href="/static/@file.SourceLocation">@file.SourceLocation</a>
</h3>
<h3 class="no-margin">
<a class="pico-color-red" hx-delete="/files/@file.Id"
hx-swap="outerHTML"
hx-target="#file-list">
[ Delete ]
</a>
</h3>
<div class="grid">
<div style="display: flex; font-size: 16px">
<p class="no-margin" style="margin-right: 10px; font-weight: bold">
<a target="_blank" href="/static/@file.SourceLocation">@file.SourceLocation</a>
</p>
<p class="no-margin">
<a class="pico-color-red" hx-delete="/files/@file.Id"
hx-swap="outerHTML"
hx-target="#file-list">
[ Delete ]
</a>
</p>
</div>
<div>
<p class="no-margin">
<strong>Created:</strong> @file.CreatedAt.ToString("d");
</p>
</div>
<div>
<p class="no-margin">
<strong>Type:</strong> @file.MimeType;
</p>
</div>
</div>
<hr/>
}
</body>
<footer>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB