BuildFeed/BuildFeed/Areas/admin/Views/meta/index.cshtml
2016-08-19 22:10:55 +01:00

82 lines
1.9 KiB
Plaintext

@using BuildFeed.Model
@model BuildFeed.Areas.admin.Models.ViewModel.MetaListing
@{
ViewBag.Title = "Metadata | BuildFeed";
}
<h2>Manage metadata</h2>
<ul>
<li>@Html.ActionLink("Manage users", "index")</li>
<li>@Html.ActionLink("Return to admin panel", "index", "base")</li>
</ul>
<h3>Current items</h3>
<table class="table table-striped table-bordered table-admin">
<thead>
<tr>
<th>Name</th>
<th style="width: 50px"></th>
</tr>
</thead>
<tbody>
@foreach (IGrouping<MetaType, MetaItemModel> group in Model.CurrentItems)
{
<tr>
<td colspan="3">
<h4>@group.Key</h4>
</td>
</tr>
foreach (MetaItemModel item in group)
{
<tr>
<td>@item.Id.Value</td>
<td>
@Html.ActionLink("Edit", "edit", new
{
type = item.Id.Type,
value = item.Id.Value
}, new
{
@class = "button",
style = "width:50px"
})</td>
</tr>
}
}
</tbody>
</table>
<h3>Add new metadata</h3>
<table class="table table-striped table-bordered table-admin">
<thead>
<tr>
<th>Name</th>
<th style="width: 50px"></th>
</tr>
</thead>
<tbody>
@foreach (IGrouping<MetaType, MetaItemModel> group in Model.NewItems)
{
<tr>
<td colspan="3">
<h4>@group.Key</h4>
</td>
</tr>
foreach (MetaItemModel item in group)
{
<tr>
<td>@item.Id.Value</td>
<td>
@Html.ActionLink("Create", "create", new
{
type = item.Id.Type,
value = item.Id.Value
}, new
{
@class = "button",
style = "width:50px"
})</td>
</tr>
}
}
</tbody>
</table>