diff --git a/Controllers/HomeController.cs b/Controllers/HomeController.cs index dad44ec..86d2f70 100644 --- a/Controllers/HomeController.cs +++ b/Controllers/HomeController.cs @@ -45,7 +45,8 @@ namespace CarCareTracker.Controllers UseDarkMode = bool.Parse(_config[nameof(UserConfig.UseDarkMode)]), UseMPG = bool.Parse(_config[nameof(UserConfig.UseMPG)]), UseDescending = bool.Parse(_config[nameof(UserConfig.UseDescending)]), - EnableAuth = bool.Parse(_config[nameof(UserConfig.EnableAuth)]) + EnableAuth = bool.Parse(_config[nameof(UserConfig.EnableAuth)]), + HideZero = bool.Parse(_config[nameof(UserConfig.HideZero)]) }; return PartialView("_Settings", userConfig); } diff --git a/Models/UserConfig.cs b/Models/UserConfig.cs index b3cd48c..2e80932 100644 --- a/Models/UserConfig.cs +++ b/Models/UserConfig.cs @@ -7,6 +7,7 @@ public bool UseMPG { get; set; } public bool UseDescending { get; set; } public bool EnableAuth { get; set; } + public bool HideZero { get; set; } public string UserNameHash { get; set; } public string UserPasswordHash { get; set;} } diff --git a/Views/Home/_Settings.cshtml b/Views/Home/_Settings.cshtml index ee79800..160d24a 100644 --- a/Views/Home/_Settings.cshtml +++ b/Views/Home/_Settings.cshtml @@ -24,6 +24,10 @@ +
+ + +
@@ -76,7 +80,8 @@ useDarkMode: $("#enableDarkMode").is(':checked'), enableCsvImports: $("#enableCsvImports").is(':checked'), useMPG: $("#useMPG").is(':checked'), - useDescending: $("#useDescending").is(':checked') + useDescending: $("#useDescending").is(':checked'), + hideZero: $("#hideZero").is(":checked") } $.post('/Home/WriteToSettings', { userConfig: userConfigObject}, function(data){ if (data) { diff --git a/Views/Vehicle/_CollisionRecordModal.cshtml b/Views/Vehicle/_CollisionRecordModal.cshtml index 2b66989..a61e3c8 100644 --- a/Views/Vehicle/_CollisionRecordModal.cshtml +++ b/Views/Vehicle/_CollisionRecordModal.cshtml @@ -30,14 +30,7 @@ @if (Model.Files.Any()) {
- - @foreach (UploadedFiles filesUploaded in Model.Files) - { - - } + @await Html.PartialAsync("_UploadedFiles", Model.Files)
diff --git a/Views/Vehicle/_CollisionRecords.cshtml b/Views/Vehicle/_CollisionRecords.cshtml index e122b5b..1071ea0 100644 --- a/Views/Vehicle/_CollisionRecords.cshtml +++ b/Views/Vehicle/_CollisionRecords.cshtml @@ -1,6 +1,7 @@ @inject IConfiguration Configuration @{ var enableCsvImports = bool.Parse(Configuration[nameof(UserConfig.EnableCsvImports)]); + var hideZero = bool.Parse(Configuration[nameof(UserConfig.HideZero)]); } @model List
@@ -48,7 +49,7 @@ @collisionRecord.Date.ToShortDateString() @collisionRecord.Mileage @collisionRecord.Description - @collisionRecord.Cost.ToString("C") + @((hideZero && collisionRecord.Cost == default) ? "---" : collisionRecord.Cost.ToString("C")) @collisionRecord.Notes } @@ -58,7 +59,7 @@
-