Add ResultsAdmin, delete action

This commit is contained in:
2016-05-20 22:47:28 -04:00
parent cff6a0d96f
commit 790e2494e3
6 changed files with 182 additions and 1 deletions
+22
View File
@@ -0,0 +1,22 @@
@model LeafWeb.Web.ViewModels.ResultsAdmin.LeafInputViewModel
@{
ViewBag.Title = "Delete LeafInput";
}
<h1>@ViewBag.Title</h1>
<div class="center-content label label-warning">Are you sure you wish to delete this LeafInput?</div>
<div class="center-content well">
@Html.DisplayForModel()
@using (Html.BeginForm("Delete", "ResultsAdmin", FormMethod.Post, new { @class = "form-horizontal" }))
{
<div class="form-actions">
<input type="submit" value="Delete" class="btn btn-warning" />
@Html.ActionLink("Cancel", "Details", new { id = Model.LeafInputId }, new { @class = "btn" })
</div>
}
</div>
+28
View File
@@ -0,0 +1,28 @@
@model IEnumerable<LeafWeb.Web.ViewModels.Results.ResultStatusViewModel>
@{
ViewBag.Title = "Results Administration";
var grid = new WebGrid(Model, rowsPerPage: 45);
}
<h1>@ViewBag.Title</h1>
@grid.GetHtml(columns:
grid.Columns(
grid.Column("LeafInputIdentifier", "Identifier"),
grid.Column("LeafInputSiteId", "Site Id"),
grid.Column("LeafInputName", "Submitted By"),
grid.Column("CurrentStatus", "Status"),
grid.Column("Chart", "Chart", item =>
item.HasLeafChart
? Html.ActionLink("Chart", "Index", "Chart", new { leafInputId = item.LeafInputId }, new { })
: Html.Raw("")),
grid.Column("Total Results: " + Model.Count(), format:
@<div class="btn-group" role="group">
@Html.ActionLink("Edit", "Edit", new { id = item.LeafInputId }, new { @class = "btn btn-default btn-xs", role = "button" })
@Html.ActionLink("Details", "Details", new { id = item.LeafInputId }, new { @class = "btn btn-default btn-xs", role = "button" })
@Html.ActionLink("Delete", "Delete", new { id = item.LeafInputId }, new { @class = "btn btn-default btn-xs", role="button" })
</div>)
),
htmlAttributes: new { @class = "table table-striped table-bordered table-hover table-condensed" }
)