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) if (meta is null)
return false; 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) public async Task<Result<FileMeta, BusinessError>> AddFile(FileMeta meta, Func<Stream> streamProvider)

View File

@ -41,19 +41,31 @@
@foreach (var file in Model.Data) @foreach (var file in Model.Data)
{ {
<div style="display: flex"> <div class="grid">
<h3 class="no-margin" style="margin-right: 10px"> <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> <a target="_blank" href="/static/@file.SourceLocation">@file.SourceLocation</a>
</h3> </p>
<h3 class="no-margin"> <p class="no-margin">
<a class="pico-color-red" hx-delete="/files/@file.Id" <a class="pico-color-red" hx-delete="/files/@file.Id"
hx-swap="outerHTML" hx-swap="outerHTML"
hx-target="#file-list"> hx-target="#file-list">
[ Delete ] [ Delete ]
</a> </a>
</h3> </p>
</div> </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> </body>
<footer> <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