hn-dotnet/Apps/Website/Views/Shared/_LinkItem.cshtml
2020-12-22 10:47:22 +01:00

26 lines
947 B
Plaintext

@model HN.Application.LinkDto
<article class="link">
<h2>
<a class="link_title" href="@Model.Url" rel="nofollow">@Model.Url</a>
</h2>
<ul class="link__actions">
<li><a asp-action="Show" asp-controller="Links" asp-route-id="@Model.Id">🔍 view</a></li>
<li>posted at @Model.CreatedAt.ToLocalTime() by <strong>@Model.CreatedByName</strong></li>
<li>
<strong>@Model.UpVotes</strong> 👍 / <strong>@Model.DownVotes</strong> 👎
</li>
@if (User.Identity.IsAuthenticated)
{
<li>
<form class="votable" asp-controller="Links" asp-action="Vote" asp-route-id="@Model.Id" asp-route-url="@Model.Url"
method="post">
<input type="hidden" name="redirectTo" value="@Context.Request.Path" />
vote&nbsp;<input type="submit" name="type" value="up" />&nbsp;or&nbsp;<input type="submit" name="type"
value="down" />
</form>
</li>
}
</ul>
</article>