1
0
Fork 0
mirror of https://github.com/miawinter98/just-short-it.git synced 2024-09-20 01:39:00 +00:00
just-short-it/Pages/Urls.cshtml

86 lines
3.6 KiB
Plaintext
Raw Normal View History

2023-04-15 13:40:46 +00:00
@page
@model JustShortIt.Pages.UrlsModel
@{
ViewData["Title"] = "Urls";
}
2023-04-15 13:40:46 +00:00
<div class="columns is-centered is-multiline my-6 px-4">
@if (!string.IsNullOrEmpty(Model.Message)) {
<div class="column is-half-desktop is-two-thirds-tablet is-full-mobile notification is-info">
<button class="delete" onclick="this.parentElement.remove()"></button>
@Html.Raw(Model.Message)
</div>
}
<div class="column is-full has-text-centered">
<h1 class="title is-2">Urls Administration</h1>
</div>
2023-04-19 14:42:24 +00:00
<div class="column is-half-desktop is-two-thirds-tablet is-full-mobile">
<form class="mb-6" method="post" asp-page="Urls" asp-page-handler="Inspect">
<h2 class="title is-3">Inspect URL</h2>
2023-04-15 13:40:46 +00:00
2023-04-19 14:42:24 +00:00
<div class="field has-addons">
<div class="control">
<label class="button is-static">ID</label>
</div>
<div class="control is-expanded">
<input required type="text" class="input" name="Inspect_Id" autocomplete="off" />
2023-04-19 14:42:24 +00:00
</div>
<div class="control">
<button class="button is-primary" type="submit">Inspect</button>
</div>
</div>
<div class="field">
<span class="help is-danger">@ModelState["Inspect_Id"]?.Errors.FirstOrDefault()?.ErrorMessage</span>
</div>
</form>
<form method="post">
<h2 class="title is-3">New URL</h2>
2023-04-15 13:40:46 +00:00
2023-04-19 14:42:24 +00:00
<div class="field">
<label class="label" asp-for="Model!.Id">ID</label>
<div class="control">
<input required class="input" type="text" asp-for="Model!.Id" autocomplete="off" />
2023-04-19 14:42:24 +00:00
</div>
<span class="help is-danger" asp-validation-for="Model!.Id"></span>
2023-04-15 13:40:46 +00:00
</div>
2023-04-19 14:42:24 +00:00
<div class="field">
<label class="label" asp-for="Model!.Target">Target</label>
<div class="control">
<input required class="input" type="url" asp-for="Model!.Target" autocomplete="off" />
2023-04-19 14:42:24 +00:00
</div>
<span class="help is-danger" asp-validation-for="Model!.Target"></span>
2023-04-15 13:40:46 +00:00
</div>
2023-04-19 14:42:24 +00:00
<div class="field">
<label class="label" asp-for="Model!.ExpirationDate">Expiration</label>
<div class="control">
<div class="select">
@Html.DropDownListFor(m => m.Model!.ExpirationDate, new List<SelectListItem> {
new("1 Day", DateTime.UtcNow.AddDays(1).ToBinary().ToString()),
new("1 Week", DateTime.UtcNow.AddDays(7).ToBinary().ToString()),
new("4 Weeks", DateTime.UtcNow.AddDays(4 * 7).ToBinary().ToString()),
new("1 Year", DateTime.UtcNow.AddYears(1).ToBinary().ToString()),
new("Never", DateTime.UtcNow.AddYears(1000).ToBinary().ToString())
}, "Select Expiration")
</div>
2023-04-15 13:40:46 +00:00
</div>
2023-04-19 14:42:24 +00:00
<span class="help is-danger" asp-validation-for="Model!.ExpirationDate"></span>
2023-04-15 13:40:46 +00:00
</div>
2023-04-19 14:42:24 +00:00
<div class="has-text-danger" asp-validation-summary="ModelOnly"></div>
2023-04-15 13:40:46 +00:00
2023-04-19 14:42:24 +00:00
<div class="field is-grouped is-grouped-right">
<div class="control">
<button class="button is-primary" type="submit">Create</button>
</div>
2023-04-15 13:40:46 +00:00
</div>
2023-04-19 14:42:24 +00:00
</form>
</div>
2023-04-15 13:40:46 +00:00
</div>