<div class="row mt-5">
    <div class="col-md-6 m-auto">
      <div class="cbg_light card_normal f_normal card card-body">
        <h1 class="c_dark t_normal text-center mb-3">Register</h1>

        <% if(typeof errors != 'undefined') { %>
          <% errors.forEach(function(error) { %>
              <div class="alert alert-warning alert-dismissible fade show" role="alert">
                  <%= error.msg %>
                  <button type="button" class="btn close" data-bs-dismiss="alert" aria-label="Close";">&times</button>
                </div> 
          <% }); %>
        <% } %>

        <form action="/users/register" method="POST">
          <div class="c_dark lead form-group">
            <label for="name">Name : </label>
            <input
              type="name"
              id="name"
              name="name"
              class="form-control"
              placeholder="Enter Name"
              value="<%= typeof name != 'undefined' ? name : '' %>"
            />
          </div>
          <div class="c_dark lead form-group">
            <label for="email">Email : </label>
            <input
              type="email"
              id="email"
              name="email"
              class="form-control"
              placeholder="Enter Email"
              value="<%= typeof email != 'undefined' ? email : '' %>"
            />
          </div>
          <div class="c_dark lead form-group">
            <label for="password">Password : </label>
            <input
              type="password"
              id="password"
              name="password"
              class="form-control"
              placeholder="Create Password"
              value="<%= typeof password != 'undefined' ? password : '' %>"
            />
          </div>
          <div class="c_dark lead form-group">
            <label for="password2">Confirm Password : </label>
            <input
              type="password"
              id="password2"
              name="password2"
              class="form-control"
              placeholder="Confirm Password"
              value="<%= typeof password2 != 'undefined' ? password2 : '' %>"
            />
          </div>
          <button type="submit" class="c_dark b_new btn btn-block">
            Register
          </button>
        </form>
        <p class="c_dark mt-3">Have An Account? <a href="/users/login">Login</a></p>
      </div>
    </div>
  </div>
