From 73f8054ae5ddc1954899537d2f797c909da4401f Mon Sep 17 00:00:00 2001 From: Atiwit Pattanapukdee <65160394@go.buu.ac.th> Date: Wed, 19 Mar 2025 00:00:30 +0700 Subject: [PATCH] Project Round 7 --- public/css/login.css | 18 ++++++++++++++++++ public/css/regis.css | 18 ++++++++++++++++++ views/login.ejs | 16 +++++++++++++++- views/register.ejs | 13 +++++++++++++ 4 files changed, 64 insertions(+), 1 deletion(-) diff --git a/public/css/login.css b/public/css/login.css index cf9bc64..2f75301 100644 --- a/public/css/login.css +++ b/public/css/login.css @@ -93,3 +93,21 @@ a { a:hover { text-decoration: underline; } + +.alert { + padding: 10px 15px; + margin: 10px 0; + border-radius: 5px; + font-size: 16px; + } + + .alert-success { + background-color: #28a745; + color: white; + } + + .alert-danger { + background-color: #dc3545; + color: white; + } + \ No newline at end of file diff --git a/public/css/regis.css b/public/css/regis.css index b3d0237..77990da 100644 --- a/public/css/regis.css +++ b/public/css/regis.css @@ -112,3 +112,21 @@ a { a:hover { text-decoration: underline; } + +.alert { + padding: 10px 15px; + margin: 10px 0; + border-radius: 5px; + font-size: 16px; + } + + .alert-success { + background-color: #28a745; + color: white; + } + + .alert-danger { + background-color: #dc3545; + color: white; + } + \ No newline at end of file diff --git a/views/login.ejs b/views/login.ejs index eaed4a7..9c2b7f3 100644 --- a/views/login.ejs +++ b/views/login.ejs @@ -13,7 +13,19 @@ <% if (message) { %> <div class="error-message"><%= message %></div> <% } %> - + <!-- แสดงข้อความแจ้งเตือน --> + <% if (messages.success) { %> + <div class="alert alert-success"> + <%= messages.success %> + </div> + <% } %> + + <% if (messages.error) { %> + <div class="alert alert-danger"> + <%= messages.error %> + </div> + <% } %> + <form action="/login" method="POST"> <div class="input-group"> <label for="email">Email</label> @@ -27,6 +39,8 @@ </form> <p>Don't have an account? <a href="/register">Register here</a></p> + + </div> </body> </html> diff --git a/views/register.ejs b/views/register.ejs index e564e22..6fbf891 100644 --- a/views/register.ejs +++ b/views/register.ejs @@ -14,6 +14,19 @@ <div class="error-message"><%= message %></div> <% } %> + <!-- แสดงข้อความแจ้งเตือน --> + <% if (messages.success) { %> + <div class="alert alert-success"> + <%= messages.success %> + </div> + <% } %> + + <% if (messages.error) { %> + <div class="alert alert-danger"> + <%= messages.error %> + </div> + <% } %> + <form action="/register" method="POST"> <div class="input-group"> <label for="name">Name</label> -- GitLab