diff --git a/Helper/ConfigHelper.cs b/Helper/ConfigHelper.cs index 5979cc3..f08d097 100644 --- a/Helper/ConfigHelper.cs +++ b/Helper/ConfigHelper.cs @@ -15,6 +15,7 @@ namespace CarCareTracker.Helper string GetServerLanguage(); bool GetServerEnableShopSupplies(); string GetServerPostgresConnection(); + string GetAllowedFileUploadExtensions(); public bool DeleteUserConfig(int userId); } public class ConfigHelper : IConfigHelper @@ -44,6 +45,14 @@ namespace CarCareTracker.Helper } return logoUrl; } + public string GetAllowedFileUploadExtensions() + { + var allowedFileExtensions = _config["LUBELOGGER_ALLOWED_FILE_EXTENSIONS"]; + if (string.IsNullOrWhiteSpace(allowedFileExtensions)){ + return ".png,.jpg,.jpeg,.pdf,.xls,.xlsx,.docx"; + } + return allowedFileExtensions; + } public bool AuthenticateRootUser(string username, string password) { var rootUsername = _config[nameof(UserConfig.UserNameHash)] ?? string.Empty; diff --git a/Views/Vehicle/_CollisionRecordModal.cshtml b/Views/Vehicle/_CollisionRecordModal.cshtml index 28247b0..cc39ba5 100644 --- a/Views/Vehicle/_CollisionRecordModal.cshtml +++ b/Views/Vehicle/_CollisionRecordModal.cshtml @@ -64,7 +64,7 @@
@await Html.PartialAsync("_UploadedFiles", Model.Files) - +
@translator.Translate(userLanguage,"Max File Size: 28.6MB")
} @@ -80,7 +80,7 @@ } - +
@translator.Translate(userLanguage,"Max File Size: 28.6MB") } diff --git a/Views/Vehicle/_GasModal.cshtml b/Views/Vehicle/_GasModal.cshtml index ba74cc0..687a814 100644 --- a/Views/Vehicle/_GasModal.cshtml +++ b/Views/Vehicle/_GasModal.cshtml @@ -103,14 +103,14 @@
@await Html.PartialAsync("_UploadedFiles", Model.GasRecord.Files) - +
@translator.Translate(userLanguage,"Max File Size: 28.6MB")
} else { - +
@translator.Translate(userLanguage,"Max File Size: 28.6MB") } diff --git a/Views/Vehicle/_NoteModal.cshtml b/Views/Vehicle/_NoteModal.cshtml index 2e84cb3..623bdc8 100644 --- a/Views/Vehicle/_NoteModal.cshtml +++ b/Views/Vehicle/_NoteModal.cshtml @@ -34,14 +34,14 @@
@await Html.PartialAsync("_UploadedFiles", Model.Files) - +
@translator.Translate(userLanguage, "Max File Size: 28.6MB")
} else { - +
@translator.Translate(userLanguage, "Max File Size: 28.6MB") } diff --git a/Views/Vehicle/_OdometerRecordModal.cshtml b/Views/Vehicle/_OdometerRecordModal.cshtml index 74355f1..74e701d 100644 --- a/Views/Vehicle/_OdometerRecordModal.cshtml +++ b/Views/Vehicle/_OdometerRecordModal.cshtml @@ -48,14 +48,14 @@
@await Html.PartialAsync("_UploadedFiles", Model.Files) - +
@translator.Translate(userLanguage,"Max File Size: 28.6MB")
} else { - +
@translator.Translate(userLanguage,"Max File Size: 28.6MB") } diff --git a/Views/Vehicle/_PlanRecordModal.cshtml b/Views/Vehicle/_PlanRecordModal.cshtml index ff84f38..99a91fa 100644 --- a/Views/Vehicle/_PlanRecordModal.cshtml +++ b/Views/Vehicle/_PlanRecordModal.cshtml @@ -65,14 +65,14 @@
@await Html.PartialAsync("_UploadedFiles", Model.Files) - +
@translator.Translate(userLanguage, "Max File Size: 28.6MB")
} else { - +
@translator.Translate(userLanguage, "Max File Size: 28.6MB") diff --git a/Views/Vehicle/_ServiceRecordModal.cshtml b/Views/Vehicle/_ServiceRecordModal.cshtml index ed34e38..401c4a7 100644 --- a/Views/Vehicle/_ServiceRecordModal.cshtml +++ b/Views/Vehicle/_ServiceRecordModal.cshtml @@ -64,7 +64,7 @@
@await Html.PartialAsync("_UploadedFiles", Model.Files) - +
@translator.Translate(userLanguage,"Max File Size: 28.6MB")
} @@ -80,7 +80,7 @@ } - +
@translator.Translate(userLanguage,"Max File Size: 28.6MB") } diff --git a/Views/Vehicle/_SupplyRecordModal.cshtml b/Views/Vehicle/_SupplyRecordModal.cshtml index 98387b2..2873cc7 100644 --- a/Views/Vehicle/_SupplyRecordModal.cshtml +++ b/Views/Vehicle/_SupplyRecordModal.cshtml @@ -67,14 +67,14 @@
@await Html.PartialAsync("_UploadedFiles", Model.Files) - +
@translator.Translate(userLanguage,"Max File Size: 28.6MB")
} else { - +
@translator.Translate(userLanguage,"Max File Size: 28.6MB") } diff --git a/Views/Vehicle/_TaxRecordModal.cshtml b/Views/Vehicle/_TaxRecordModal.cshtml index 56cec53..ae2296f 100644 --- a/Views/Vehicle/_TaxRecordModal.cshtml +++ b/Views/Vehicle/_TaxRecordModal.cshtml @@ -73,7 +73,7 @@
@await Html.PartialAsync("_UploadedFiles", Model.Files) - +
@translator.Translate(userLanguage,"Max File Size: 28.6MB")
} @@ -89,7 +89,7 @@ } - +
@translator.Translate(userLanguage,"Max File Size: 28.6MB") } diff --git a/Views/Vehicle/_UpgradeRecordModal.cshtml b/Views/Vehicle/_UpgradeRecordModal.cshtml index c978850..f0f111b 100644 --- a/Views/Vehicle/_UpgradeRecordModal.cshtml +++ b/Views/Vehicle/_UpgradeRecordModal.cshtml @@ -64,7 +64,7 @@
@await Html.PartialAsync("_UploadedFiles", Model.Files) - +
@translator.Translate(userLanguage,"Max File Size: 28.6MB")
} @@ -80,7 +80,7 @@ } - +
@translator.Translate(userLanguage,"Max File Size: 28.6MB") }