@model PackageDetailViewModel
@{
    ViewData["Title"] = "Details";
}

<h2>Details</h2>

<div>
    <h4>PackageVersion</h4>
    <hr />
    <dl class="dl-horizontal">
        <dt>
            @Html.DisplayNameFor(model => model.latest.IsPrerelease)
        </dt>
        <dd>
            @Html.DisplayFor(model => model.latest.IsPrerelease)
        </dd>
        <dt>
            @Html.DisplayNameFor(model => model.latest.PackageId)
        </dt>
        <dd>
            @Html.DisplayFor(model => model.latest.PackageId)
        </dd>
        <dt>
            @Html.DisplayNameFor(model => model.latest.FullString)
        </dt>
        <dd>
            <a href="@Constants.ApiVersionPrefix@Model.latest.NugetLink" >@Html.DisplayFor(model => model.latest.FullString)</a>
            <a href="@Constants.ApiVersionPrefix@Model.latest.NuspecLink" >nuspec</a>
            <i class="extinfo">(version count : @Model.totalHits)</i>
        </dd>
    </dl>
    
    <h4>Integration</h4>
    <hr />
    <div class="shadowbox">
        <button class="far fa-copy" style="float:right" onclick="navigator.clipboard.writeText($('#code').text());this.innerText='copied'" >copy</button>
        <pre><code id="code" >&lt;PackageReference Include="@Model.pkgid" Version="@Model.latest.FullString" /&gt;</code></pre> 
    </div>
    <div>
    @Html.ActionLink("Edit", "Edit", new { pkgid = Model.pkgid, version = Model.latest.FullString })  |
                @Html.ActionLink("Delete", "Delete", new { pkgid = Model.pkgid, version= Model.latest.FullString }) |
    <a asp-action="Index">Back to List</a>
    </div>
</div>
