From 0b88ebad20968af30f180ebc3ce2a14826db5110 Mon Sep 17 00:00:00 2001 From: ivancheahhh Date: Wed, 3 Jan 2024 14:57:49 -0700 Subject: [PATCH] disable csv imports by default. --- Views/Vehicle/Index.cshtml | 4 +--- Views/Vehicle/_Gas.cshtml | 27 ++++++++++++++++++--------- appsettings.json | 3 ++- 3 files changed, 21 insertions(+), 13 deletions(-) diff --git a/Views/Vehicle/Index.cshtml b/Views/Vehicle/Index.cshtml index bfb756a..1f13356 100644 --- a/Views/Vehicle/Index.cshtml +++ b/Views/Vehicle/Index.cshtml @@ -14,9 +14,7 @@

@($"{Model.Year} {Model.Make} {Model.Model}(License # {Model.LicensePlate})")

-
- -
+

diff --git a/Views/Vehicle/_Gas.cshtml b/Views/Vehicle/_Gas.cshtml index cf0b922..e27af1e 100644 --- a/Views/Vehicle/_Gas.cshtml +++ b/Views/Vehicle/_Gas.cshtml @@ -1,4 +1,8 @@ -@model List +@inject IConfiguration Configuration +@{ + var enableCsvImports = bool.Parse(Configuration["EnableCsvImports"]); +} +@model List
@@ -12,15 +16,20 @@ @($"Total Fuel Consumed: {Model.Sum(x=>x.Gallons)}") @($"Total Cost: {Model.Sum(x => x.Cost).ToString("C")}")
-
+ @if (enableCsvImports) + { +
+ + + +
+ } else { - - -
+ }
diff --git a/appsettings.json b/appsettings.json index 2aa9e16..528a826 100644 --- a/appsettings.json +++ b/appsettings.json @@ -6,5 +6,6 @@ } }, "AllowedHosts": "*", - "DarkMode": true + "DarkMode": true, + "EnableCsvImports": false }