Files
MileageTraker/Web/Views/CreateLog/RecentLogs.cshtml
T
poprhythm 9c2149d52c Add cancel button for edit log.
Disable edit button for past month
Format gas correctly
2014-01-21 11:30:17 -05:00

61 lines
1.2 KiB
Plaintext

@using MileageTraker.Web.Models
@using MileageTraker.Web.Utility
@model IEnumerable<Log>
@if (Model.Any())
{
<h5>Recent Logs for @ViewData["name"]</h5>
<table class="table">
<thead>
<tr>
<th>
Date
</th>
<th>
City
</th>
<th>
End ODO
</th>
<th>
Type
</th>
<th></th>
</tr>
</thead>
@foreach (var log in Model)
{
<tr>
<td>
@Html.Encode(log.Date.ToShortDateString())
</td>
<td>
@Html.Encode(log.CityName)
</td>
<td>
@Html.Encode(log.EndOdometer)
</td>
<td>
@Html.Encode(log.LogType.Enum.GetDisplayShortName())
</td>
<td>
@if (log.Date >= DomainRules.GetLogEntryCutoff())
{
@Html.ActionLink("Edit", "EditPast", new {id = log.LogId}, new {@class = "btn btn-mini"})
}
else
{
@Html.ActionLink("Edit", "EditPast", new {id = log.LogId}, new {@class = "btn btn-mini disabled", title="Previous Month" })
}
</td>
</tr>
}
</table>
}
else
{
<p>Mileage history not found for <strong>@ViewData["name"]</strong></p>
}
<script type="text/javascript">
$('a.btn.disabled').prop('disabled', true).removeAttr('href');
</script>