isntallation steps
This commit is contained in:
@ -22,13 +22,27 @@ namespace isn
|
||||
// GET: PackageVersion
|
||||
public async Task<IActionResult> Index(PackageVersionIndexViewModel model)
|
||||
{
|
||||
var applicationDbContext = _context.PackageVersions.Include(p => p.Package).Where(p => p.PackageId == model.PackageId);
|
||||
var applicationDbContext = _context.PackageVersions.Include(p => p.Package).Where(p => p.PackageId.StartsWith(model.PackageId));
|
||||
|
||||
model.Versions = await applicationDbContext.ToListAsync();
|
||||
|
||||
return View(model);
|
||||
}
|
||||
|
||||
[Authorize]
|
||||
public async Task<IActionResult> Mines(PackageVersionIndexViewModel model)
|
||||
{
|
||||
var userId = User.FindFirstValue(ClaimTypes.NameIdentifier);
|
||||
var applicationDbContext = _context.PackageVersions
|
||||
.Include(p => p.Package).Where(
|
||||
p => (string.IsNullOrEmpty(model.PackageId) || p.PackageId.StartsWith(model.PackageId))
|
||||
&& p.Package.OwnerId == userId);
|
||||
|
||||
model.Versions = await applicationDbContext.ToListAsync();
|
||||
|
||||
return View("Index", model);
|
||||
}
|
||||
|
||||
// GET: PackageVersion/Details/5
|
||||
public async Task<IActionResult> Details(string pkgid, string version)
|
||||
{
|
||||
|
@ -30,5 +30,10 @@ namespace isn.Data
|
||||
[JsonIgnore]
|
||||
public virtual Package Package { get; set; }
|
||||
|
||||
public string GetParmaLink()
|
||||
{
|
||||
return $"/package/{PackageId}/{FullString}/{PackageId}{FullString}.nupkg";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -10,24 +10,6 @@
|
||||
<h4>PackageVersion</h4>
|
||||
<hr />
|
||||
<dl class="dl-horizontal">
|
||||
<dt>
|
||||
@Html.DisplayNameFor(model => model.Major)
|
||||
</dt>
|
||||
<dd>
|
||||
@Html.DisplayFor(model => model.Major)
|
||||
</dd>
|
||||
<dt>
|
||||
@Html.DisplayNameFor(model => model.Minor)
|
||||
</dt>
|
||||
<dd>
|
||||
@Html.DisplayFor(model => model.Minor)
|
||||
</dd>
|
||||
<dt>
|
||||
@Html.DisplayNameFor(model => model.Patch)
|
||||
</dt>
|
||||
<dd>
|
||||
@Html.DisplayFor(model => model.Patch)
|
||||
</dd>
|
||||
<dt>
|
||||
@Html.DisplayNameFor(model => model.IsPrerelease)
|
||||
</dt>
|
||||
@ -35,14 +17,20 @@
|
||||
@Html.DisplayFor(model => model.IsPrerelease)
|
||||
</dd>
|
||||
<dt>
|
||||
@Html.DisplayNameFor(model => model.Package)
|
||||
@Html.DisplayNameFor(model => model.PackageId)
|
||||
</dt>
|
||||
<dd>
|
||||
@Html.DisplayFor(model => model.Package.Id)
|
||||
@Html.DisplayFor(model => model.PackageId)
|
||||
</dd>
|
||||
<dt>
|
||||
@Html.DisplayNameFor(model => model.FullString)
|
||||
</dt>
|
||||
<dd>
|
||||
<a href="@Model.GetParmaLink();" >@Html.DisplayFor(model => model.FullString)</a>
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div>
|
||||
@Html.ActionLink("Edit", "Edit", new { /* id = Model.PrimaryKey */ }) |
|
||||
@Html.ActionLink("Edit", "Edit", new { pkgid = Model.PackageId, version = Model.FullString }) |
|
||||
<a asp-action="Index">Back to List</a>
|
||||
</div>
|
||||
|
@ -24,20 +24,14 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.Versions[0].Major)
|
||||
@Html.DisplayNameFor(model => model.Versions[0].Package.Id)
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.Versions[0].Minor)
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.Versions[0].Patch)
|
||||
@Html.DisplayNameFor(model => model.Versions[0].FullString)
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.Versions[0].IsPrerelease)
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.Versions[0].Package)
|
||||
</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
@ -45,20 +39,17 @@
|
||||
@foreach (var item in Model.Versions) {
|
||||
<tr>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.Major)
|
||||
@Html.DisplayFor(modelItem => item.Package.Id)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.Minor)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.Patch)
|
||||
@Html.DisplayFor(modelItem => item.FullString)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.IsPrerelease)
|
||||
</td>
|
||||
<td>
|
||||
@Html.ActionLink("Details", "Details", new { pkgid = Model.PackageId, version = item.FullString }) |
|
||||
@Html.ActionLink("Delete", "Delete", new { pkgid = Model.PackageId, version = item.FullString })
|
||||
@Html.ActionLink("Details", "Details", new { pkgid = item.PackageId, version = item.FullString }) |
|
||||
@Html.ActionLink("Delete", "Delete", new { pkgid = item.PackageId, version = item.FullString })
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
|
@ -11,7 +11,7 @@
|
||||
<header>
|
||||
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3">
|
||||
<div class="container">
|
||||
<a class="navbar-brand" asp-area="" asp-controller="Home" asp-action="Index">mvc_ident</a>
|
||||
<a class="navbar-brand" asp-area="" asp-controller="PackageVersion" asp-action="Index">mvc_ident</a>
|
||||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target=".navbar-collapse" aria-controls="navbarSupportedContent"
|
||||
aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
|
@ -6,7 +6,10 @@
|
||||
@if (SignInManager.IsSignedIn(User))
|
||||
{
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" asp-area="Identity" asp-page="/Account/Manage/Index" title="Manage">Hello @User.Identity.Name!</a>
|
||||
<a class="nav-link text-dark" asp-area="Identity" asp-page="/Account/Manage/Index" title="Manage">Hello @User.Identity.Name!</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" asp-controller="ApiKeys" asp-action="Index" title="Api Keys">Your API keys</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<form class="form-inline" asp-area="Identity" asp-page="/Account/Logout" asp-route-returnUrl="@Url.Action("Index", "Home", new { area = "" })">
|
||||
|
Reference in New Issue
Block a user