Added icon to edit

Added edit link to success notification
This commit is contained in:
2014-01-21 15:11:10 -05:00
parent 9c2149d52c
commit 0ef5199048
4 changed files with 31 additions and 19 deletions
+4 -1
View File
@@ -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");
}
+7 -3
View File
@@ -103,7 +103,7 @@ $(function() {
});
});
$(function () {
function addButtonIcons () {
var textToIcon = {
'Edit': 'edit',
'Filter': 'filter',
@@ -115,12 +115,16 @@ $(function () {
'Vehicle Mileage': 'car'
};
$.each(textToIcon, function(text, icon) {
$("a:contains('" + text + "')")
$("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
+2 -2
View File
@@ -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>
}
+5
View File
@@ -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">
$(function () {
$('a.btn.disabled').prop('disabled', true).removeAttr('href');
addButtonIcons();
});
</script>