Add cancel button for edit log.

Disable edit button for past month
Format gas correctly
This commit is contained in:
2014-01-21 11:30:17 -05:00
parent 1feda1b520
commit 9c2149d52c
7 changed files with 65 additions and 8 deletions
+2 -1
View File
@@ -15,7 +15,8 @@
@Html.Partial("_ValidationSummary")
@Html.EditorForModel()
<div class="form-actions">
<input type="submit" value="Submit" class="btn btn-primary" />
<input type="submit" value="Submit" class="btn btn-primary" />
@Html.ActionLink("Cancel", "Index", new {}, new { @class = "btn" })
</div>
</fieldset>
}
+13 -3
View File
@@ -36,10 +36,17 @@
@Html.Encode(log.EndOdometer)
</td>
<td>
@Html.Encode(log.LogType.Enum.GetDisplayName())
@Html.Encode(log.LogType.Enum.GetDisplayShortName())
</td>
<td>
@Html.ActionLink("Edit", "EditPast", new { id = log.LogId }, new { @class = "btn btn-mini" })
@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>
}
@@ -48,4 +55,7 @@
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>