diff --git a/Web/Controllers/CreateLogController.cs b/Web/Controllers/CreateLogController.cs index 01191a5..49791fc 100644 --- a/Web/Controllers/CreateLogController.cs +++ b/Web/Controllers/CreateLogController.cs @@ -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 " + model.Date.ToShortDateString() + @" in Vehicle Id " + model.VehicleId + @" ending in " + model.EndOdometer + @" - miles on the odometer."; + miles on the odometer. " + + @"Edit"; return RedirectToAction("Index"); } diff --git a/Web/Scripts/Shared/Site.js b/Web/Scripts/Shared/Site.js index ebcc5d2..bfb5632 100644 --- a/Web/Scripts/Shared/Site.js +++ b/Web/Scripts/Shared/Site.js @@ -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(' '); - }); + }); - $(".navbar-inverse a[title='Manage']") + $(".navbar-inverse a[title='Manage']:not(:has(i))") .prepend(' '); +} + +$(function () { + addButtonIcons(); }); // Convert MVC3 WebGrid paging to Bootstrap diff --git a/Web/Views/CreateLog/EditPast.cshtml b/Web/Views/CreateLog/EditPast.cshtml index fc09bbc..ec5a6be 100644 --- a/Web/Views/CreateLog/EditPast.cshtml +++ b/Web/Views/CreateLog/EditPast.cshtml @@ -15,8 +15,8 @@ @Html.Partial("_ValidationSummary") @Html.EditorForModel()
Mileage history not found for @ViewData["name"]
} \ No newline at end of file