From e6959a82f2dac47c41e9ef77d3392cd0ee526f54 Mon Sep 17 00:00:00 2001
From: MarcEricMartel <74071476+MarcEricMartel@users.noreply.github.com>
Date: Mon, 12 Sep 2022 15:21:11 -0700
Subject: [PATCH] Cleanup.
---
.../GrossesMitaines/Models/RequestViewModel.cs | 10 +++++++---
.../GrossesMitaines/Views/Home/Index.cshtml | 17 ++++++++++-------
.../Shared/Components/EnVedette/Default.cshtml | 6 +++---
3 files changed, 20 insertions(+), 13 deletions(-)
diff --git a/GrossesMitaines/GrossesMitaines/Models/RequestViewModel.cs b/GrossesMitaines/GrossesMitaines/Models/RequestViewModel.cs
index c431dcf..615fca6 100644
--- a/GrossesMitaines/GrossesMitaines/Models/RequestViewModel.cs
+++ b/GrossesMitaines/GrossesMitaines/Models/RequestViewModel.cs
@@ -9,9 +9,13 @@ namespace GrossesMitaines.Models
{
public class RequestViewModel
{
+ [Display(Prompt ="NOM COMPLET")]
public string Name { get; set; }
+ [Display(Prompt = "COURRIEL")]
public string Email { get; set; }
+ [Display(Prompt = "TÉLÉPHONE")]
public string Phone { get; set; }
+ [Display(Prompt = "VOS COMMENTAIRES")]
public string Message { get; set; }
}
@@ -24,12 +28,12 @@ namespace GrossesMitaines.Models
.MinimumLength(2).WithMessage("Votre nom doit être de 2 lettres minimum");
RuleFor(x => x.Email)
- .NotEmpty().WithMessage("Un Email est requis")
- .Matches("^[\\w-\\.]+@([\\w-]+\\.)+[\\w-]{2,4}$").WithMessage("Format non valide!");
+ .NotEmpty().WithMessage("Une adresse courriel est requise")
+ .EmailAddress().WithMessage("Format non valide!");
RuleFor(x => x.Phone)
.NotEmpty().WithMessage("Vous devez entrer votre téléphone")
- .Matches("^[0-9][0-9][0-9]-[0-9][0-9][0-9]-[0-9][0-9][0-9][0-9]$").WithMessage("Téléphone non valide!");
+ .Matches("^\\s*(?:\\+?(\\d{1}))?[-. (]*(\\d{3})[-. )]*(\\d{3})[-. ]*(\\d{4})$").WithMessage("Téléphone non valide!");
}
}
}
diff --git a/GrossesMitaines/GrossesMitaines/Views/Home/Index.cshtml b/GrossesMitaines/GrossesMitaines/Views/Home/Index.cshtml
index 3a2fb71..2424a4b 100644
--- a/GrossesMitaines/GrossesMitaines/Views/Home/Index.cshtml
+++ b/GrossesMitaines/GrossesMitaines/Views/Home/Index.cshtml
@@ -21,37 +21,40 @@
+
+
+