@model WF.Sample.Models.DocumentHistoryModel
@if (Model != null && Model.Items != null && Model.Items.Count > 0)
{
    <h1>Document's Transition History</h1>
    <table class="table">
        <tbody>
            <tr class="table-header">
                <th>From</th>
                <th>To</th>
                <th>Command</th>
                <th>Executor</th>
                <th>TransitionTime</th>
                <th>Available for</th>
            </tr>
            @foreach (var item in Model.Items)
            {
                <tr>
                    <td>@Html.Label(item.InitialState)</td>
                    <td>@Html.Label(item.DestinationState)</td>
                    <td>@Html.Label(item.TriggerName)</td>
                    <td>@Html.Label(item?.IdentityId != null ? item.Employee?.Name??item.IdentityId : "")</td>
                    <td>
                        @if (item.TransitionTime.HasValue)
                        {
                            @Html.Raw(string.Format("{0}",
                            item.TransitionTime.Value.ToString("yyyy-MM-dd HH:mm:ss")))
                        }
                    </td>
                    <td>@Html.Label(item.AllowedTo)</td>
                </tr>
            }
        </tbody>
    </table>
}
