Skip to content

Instantly share code, notes, and snippets.

@tusmester
Created February 8, 2018 13:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tusmester/fae3fa8414fa1bfa1fa71c7fe672fb7e to your computer and use it in GitHub Desktop.
Save tusmester/fae3fa8414fa1bfa1fa71c7fe672fb7e to your computer and use it in GitHub Desktop.
#sn #mvc #view #index #dashboard
@{
ViewBag.Title = "Dashboard";
}
@using SenseNet.ContentRepository.Storage.Security
@using SenseNet.Portal.Helpers
@model SnWebApplication.Models.DashboardViewModel
<h2>@ViewBag.Title</h2>
<h3>@ViewBag.Message</h3>
<div class="row">
<div class="col-md-4">
@Html.MvcActionLink("New task", "Create", "Dashboard")
</div>
</div>
<div class="row">
<div class="col-md-4">
<h3>My tasks</h3>
<table>
<thead><tr><th>To do</th><th>Due date</th><th></th></tr></thead>
<tbody>
@foreach (var task in this.Model.MyTasks)
{
<tr>
<td>@task.DisplayName</td>
<td>@task.DueDate</td>
<td>
@if (task.Task?.Security.HasPermission(PermissionType.Delete) ?? false)
{
@Html.RouteLink("Delete", "Default", new RouteValueDictionary
{
{"controller", "Dashboard"},
{"action", "Delete"},
{"Id", @task.Id}
})
}
</td>
</tr>
}
</tbody>
</table>
</div>
<div class="col-md-4">
<h3>More tasks</h3>
<table>
<thead><tr><th>To do</th><th>Due date</th><th>Assigned to</th><th></th></tr></thead>
<tbody>
@foreach (var task in this.Model.OthersTasks)
{
<tr><td>@task.DisplayName</td><td>@task.DueDate</td><td>@task.AssignedToText</td>
<td>
@if (task.Task?.Security.HasPermission(PermissionType.Delete) ?? false)
{
@Html.RouteLink("Delete", "Default", new RouteValueDictionary
{
{"controller", "Dashboard"},
{"action", "Delete"},
{"Id", @task.Id}
})
}
</td>
</tr>
}
</tbody>
</table>
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment