From 8f5f07882fbb61241f5aa3d0b750f195d64252c9 Mon Sep 17 00:00:00 2001 From: BenSanex Date: Thu, 7 Feb 2019 20:27:26 -0600 Subject: [PATCH 1/2] Custom validation message for Crowdfund form primary currency --- BTCPayServer/Models/AppViewModels/UpdateCrowdfundViewModel.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BTCPayServer/Models/AppViewModels/UpdateCrowdfundViewModel.cs b/BTCPayServer/Models/AppViewModels/UpdateCrowdfundViewModel.cs index 18260dee7..9886ab548 100644 --- a/BTCPayServer/Models/AppViewModels/UpdateCrowdfundViewModel.cs +++ b/BTCPayServer/Models/AppViewModels/UpdateCrowdfundViewModel.cs @@ -39,7 +39,7 @@ namespace BTCPayServer.Models.AppViewModels public DateTime? StartDate { get; set; } public DateTime? EndDate { get; set; } - [Required] + [Required(ErrorMessage="The primary currency is required")] [MaxLength(5)] [Display(Name = "The primary currency used for targets and stats. (e.g. BTC, LTC, USD, etc.)")] public string TargetCurrency { get; set; } = "BTC"; From 2b7006a14cee49761d3923a97411c04a8cdc1b52 Mon Sep 17 00:00:00 2001 From: BenSanex Date: Mon, 11 Feb 2019 21:53:45 -0600 Subject: [PATCH 2/2] add asterisk, revert primary currency error message, remove the --- BTCPayServer/Models/AppViewModels/UpdateCrowdfundViewModel.cs | 4 ++-- BTCPayServer/Views/Apps/UpdateCrowdfund.cshtml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/BTCPayServer/Models/AppViewModels/UpdateCrowdfundViewModel.cs b/BTCPayServer/Models/AppViewModels/UpdateCrowdfundViewModel.cs index 9886ab548..aacd98df5 100644 --- a/BTCPayServer/Models/AppViewModels/UpdateCrowdfundViewModel.cs +++ b/BTCPayServer/Models/AppViewModels/UpdateCrowdfundViewModel.cs @@ -39,9 +39,9 @@ namespace BTCPayServer.Models.AppViewModels public DateTime? StartDate { get; set; } public DateTime? EndDate { get; set; } - [Required(ErrorMessage="The primary currency is required")] + [Required] [MaxLength(5)] - [Display(Name = "The primary currency used for targets and stats. (e.g. BTC, LTC, USD, etc.)")] + [Display(Name = "Primary currency used for targets and stats. (e.g. BTC, LTC, USD, etc.)")] public string TargetCurrency { get; set; } = "BTC"; [Display(Name = "Set a Target amount ")] diff --git a/BTCPayServer/Views/Apps/UpdateCrowdfund.cshtml b/BTCPayServer/Views/Apps/UpdateCrowdfund.cshtml index 1af73a633..40bc4f1af 100644 --- a/BTCPayServer/Views/Apps/UpdateCrowdfund.cshtml +++ b/BTCPayServer/Views/Apps/UpdateCrowdfund.cshtml @@ -57,7 +57,7 @@
- + *