1
0
This repository has been archived on 2026-04-22. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
my-old-website/MyWebsite/MyWebsite/Areas/Admin/Views/Shared/LinkShortener.cshtml
T
Michael Gordeev 4c3b1bf5da Added link shortener
Fixed text selection
2020-06-20 12:13:11 +03:00

46 lines
1.1 KiB
Plaintext

@model List<ShortLinkModel>
@{
ViewData["Title"] = "Link shortener";
}
<header>
&#xE760; <a asp-action="Index" asp-controller="Admin" asp-area="">Back to main menu</a>
<h1>Link shortener</h1>
</header>
<article>
<div asp-validation-summary="All" class="text-danger"></div>
<h2>Create new link</h2>
<form method="post" asp-action="Create" enctype="multipart/form-data">
<label for="original-link">Original link</label>
<input id="original-link" name="url" type="url" />
<label for="link-id">Short link identifier (optional)</label>
<input id="link-id" name="id" type="text" />
<input type="submit" value="Create" />
</form>
<h2>Shortened links</h2>
<table>
<thead>
<tr>
<th>Original link</th>
<th>Short link</th>
</tr>
</thead>
<tbody>
@foreach (ShortLinkModel link in Model)
{
<tr>
<td>@link.Uri.OriginalString</td>
<td>//xfox111.net/@link.LinkId</td>
<td>
<a asp-action="Delete" asp-route-id="@link.LinkId">Delete</a>
</td>
</tr>
}
</tbody>
</table>
</article>