Add cancel button for edit log.
Disable edit button for past month Format gas correctly
This commit is contained in:
@@ -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>
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
Reference in New Issue
Block a user