Added icon to edit
Added edit link to success notification
This commit is contained in:
@@ -109,6 +109,8 @@ namespace MileageTraker.Web.Controllers
|
||||
.First(pt => pt.PurposeTypeId == model.Purpose.Selected);
|
||||
|
||||
DataService.AddLog(log);
|
||||
var editLink = Url.Action("EditPast", "CreateLog", new {id = log.LogId});
|
||||
|
||||
TempData["StatusMessage-Type"] = "alert-success";
|
||||
TempData["StatusMessage"] =
|
||||
@"You've successfully created an entry
|
||||
@@ -117,7 +119,8 @@ namespace MileageTraker.Web.Controllers
|
||||
on <strong>" + model.Date.ToShortDateString() + @"</strong>
|
||||
in Vehicle Id <strong>" + model.VehicleId + @"</strong>
|
||||
ending in <strong>" + model.EndOdometer + @"</strong>
|
||||
miles on the odometer.";
|
||||
miles on the odometer. " +
|
||||
@"<a href='" + editLink + @"' class='btn btn-mini btn-success'>Edit</a>";
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
|
||||
|
||||
+19
-15
@@ -103,24 +103,28 @@ $(function() {
|
||||
});
|
||||
});
|
||||
|
||||
$(function () {
|
||||
var textToIcon = {
|
||||
'Edit': 'edit',
|
||||
'Filter': 'filter',
|
||||
'Details' : 'zoom-in',
|
||||
'Delete': 'trash',
|
||||
'Add': 'plus',
|
||||
'Export': 'download',
|
||||
'Driver Mileage': 'user',
|
||||
'Vehicle Mileage': 'car'
|
||||
};
|
||||
$.each(textToIcon, function(text, icon) {
|
||||
$("a:contains('" + text + "')")
|
||||
function addButtonIcons () {
|
||||
var textToIcon = {
|
||||
'Edit': 'edit',
|
||||
'Filter': 'filter',
|
||||
'Details' : 'zoom-in',
|
||||
'Delete': 'trash',
|
||||
'Add': 'plus',
|
||||
'Export': 'download',
|
||||
'Driver Mileage': 'user',
|
||||
'Vehicle Mileage': 'car'
|
||||
};
|
||||
$.each(textToIcon, function(text, icon) {
|
||||
$("a:contains('" + text + "'):not(:has(i))")
|
||||
.prepend('<i class="icon-' + icon + '" /> ');
|
||||
});
|
||||
});
|
||||
|
||||
$(".navbar-inverse a[title='Manage']")
|
||||
$(".navbar-inverse a[title='Manage']:not(:has(i))")
|
||||
.prepend('<i class="icon-user icon-white" /> ');
|
||||
}
|
||||
|
||||
$(function () {
|
||||
addButtonIcons();
|
||||
});
|
||||
|
||||
// Convert MVC3 WebGrid paging to Bootstrap
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
@Html.Partial("_ValidationSummary")
|
||||
@Html.EditorForModel()
|
||||
<div class="form-actions">
|
||||
<input type="submit" value="Submit" class="btn btn-primary" />
|
||||
@Html.ActionLink("Cancel", "Index", new {}, new { @class = "btn" })
|
||||
<input type="submit" value="Update" class="btn btn-primary" />
|
||||
@Html.ActionLink("Cancel", "Index", new {}, new { @class = "btn btn-mini" })
|
||||
</div>
|
||||
</fieldset>
|
||||
}
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
@Html.Encode(log.LogType.Enum.GetDisplayShortName())
|
||||
</td>
|
||||
<td>
|
||||
<div class='btn-group'>
|
||||
@if (log.Date >= DomainRules.GetLogEntryCutoff())
|
||||
{
|
||||
@Html.ActionLink("Edit", "EditPast", new {id = log.LogId}, new {@class = "btn btn-mini"})
|
||||
@@ -47,6 +48,7 @@
|
||||
{
|
||||
@Html.ActionLink("Edit", "EditPast", new {id = log.LogId}, new {@class = "btn btn-mini disabled", title="Previous Month" })
|
||||
}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
@@ -57,5 +59,8 @@ else
|
||||
<p>Mileage history not found for <strong>@ViewData["name"]</strong></p>
|
||||
}
|
||||
<script type="text/javascript">
|
||||
$('a.btn.disabled').prop('disabled', true).removeAttr('href');
|
||||
$(function () {
|
||||
$('a.btn.disabled').prop('disabled', true).removeAttr('href');
|
||||
addButtonIcons();
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user