Skip to content

Commit

Permalink
Improved admin menu preview
Browse files Browse the repository at this point in the history
  • Loading branch information
matt4446 committed Mar 22, 2012
1 parent 76b122e commit d8029b6
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 8 deletions.
7 changes: 6 additions & 1 deletion Controllers/ServiceController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,12 @@ public ServiceController(
public ActionResult Index()
{
var viewModel = new ViewModel.AdminIndexViewModel();
viewModel.Items = this.Services.ContentManager.Query<Orchard.Projections.Models.QueryPart>().List().ToList();
var queries = this.Services.ContentManager.Query<Orchard.Projections.Models.QueryPart>()
.List()
.ToList();

viewModel.Items = queries.Where(e => e.Layouts.Any(layout => layout.Category.IndexOf("JSON", StringComparison.InvariantCultureIgnoreCase) >= 0))
.ToList();

return View(viewModel);
}
Expand Down
33 changes: 26 additions & 7 deletions Views/Service/index.cshtml
Original file line number Diff line number Diff line change
@@ -1,8 +1,27 @@
@model JsonProjection.ViewModel.AdminIndexViewModel
<h2>Feeds</h2>
<ul>
@foreach (var item in Model.Items)
{
<li>@Html.ActionLink(item.Name, "Preview", "Service", new { Id = item.Id }, null)</li>
}
</ul>


<table class="items">
<thead>
<tr>
<th colspan="3">
Json Feeds
</th>
</tr>
<tr>
<th>Name</th>
<th>Preview</th>
<th>Feed Source</th>
</tr>
</thead>
<tbody>
@foreach (var item in Model.Items)
{
<tr>
<td>@item.Name</td>
<td>@Html.ActionLink("Preview", "Preview", "Service", new { Id = item.Id }, new { Class = "button" })</td>
<td>@Html.ActionLink("Source", "Feed", "Service", new { Id = item.Id }, new { Class = "button" }) </td>
</tr>
}
</tbody>
</table>

0 comments on commit d8029b6

Please sign in to comment.