refact
parent
7da74b0dfb
commit
504f431937
@ -0,0 +1,15 @@
|
|||||||
|
using isnd.Data;
|
||||||
|
|
||||||
|
namespace isnd.ViewModels
|
||||||
|
{
|
||||||
|
public class PackageDetailViewModel
|
||||||
|
{
|
||||||
|
public PackageVersion latest { get; set; }
|
||||||
|
|
||||||
|
public string pkgid { get; set; }
|
||||||
|
public int totalHits { get; set; }
|
||||||
|
public PackageVersion[] data { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -1,11 +1,12 @@
|
|||||||
using isn.Data;
|
using isnd.Data;
|
||||||
|
|
||||||
namespace isnd.ViewModels
|
namespace isnd.ViewModels
|
||||||
{
|
{
|
||||||
public class PackageIndexViewModel
|
public class PackageIndexViewModel
|
||||||
{
|
{
|
||||||
|
public bool Prerelease { get; set; }
|
||||||
public Package[] data {get; set;}
|
public Package[] data {get; set;}
|
||||||
public string Query { get; set; }
|
public string query { get; set; }
|
||||||
public int totalHits { get; internal set; }
|
public int totalHits { get; internal set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -0,0 +1,37 @@
|
|||||||
|
@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="@Model.latest.NugetLink" >@Html.DisplayFor(model => model.latest.FullString)</a>
|
||||||
|
<a href="@Model.latest.NuspecLink" >nuspec</a>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
@Html.ActionLink("Edit", "Edit", new { pkgid = Model.pkgid, version = Model.latest.FullString }) |
|
||||||
|
<a asp-action="Index">Back to List</a>
|
||||||
|
</div>
|
@ -0,0 +1,53 @@
|
|||||||
|
@model PackageIndexViewModel
|
||||||
|
|
||||||
|
@{
|
||||||
|
ViewData["Title"] = "Index";
|
||||||
|
}
|
||||||
|
|
||||||
|
<h2>Index</h2>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<form method="get">
|
||||||
|
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label asp-for="query" class="control-label"></label>
|
||||||
|
<input asp-for="query" class="form-control" />
|
||||||
|
<label asp-for="totalHits" class="control-label"></label>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<input type="submit" value="Find" class="btn btn-default" />
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<table class="table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>
|
||||||
|
@Html.DisplayNameFor(model => model.data[0].Id)
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
@Html.DisplayNameFor(model => model.data[0].Description)
|
||||||
|
</th>
|
||||||
|
<th></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
@foreach (var item in Model.data) {
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
@Html.DisplayFor(modelItem => item.Id)
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
@Html.DisplayFor(modelItem => item.Description)
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
@Html.ActionLink("Details", "Details", new { pkgid = item.Id }) |
|
||||||
|
@Html.ActionLink("Delete", "Delete", new { pkgid = item.Id })
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
@ -1,3 +1,3 @@
|
|||||||
@using isn.Data
|
@using isnd.Data
|
||||||
@using isn.ViewModels
|
@using isnd.ViewModels
|
||||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
||||||
|
Loading…
Reference in New Issue