  <div class="corps">
    <div class="card">
      <div class="card-header">
        <h2>Ajouter un nouveau département</h2>
      </div>
      <div class="card-body">
        <form method="post" action="/department/save">
          <div class="form-group">
            <label for="nomDepartement">Nom du département</label>
            <input type="text" class="form-control form-control-sm" id="nomDepartement" name="nomDepartement" required>
            <% if (errors && errors.find(error => error.path === 'nomDepartement')) { %>
                <p class="text-danger"><%= errors.find(error => error.path === 'nomDepartement').msg %></p>
            <% } %>
          </div>
          <div class="form-group">
            <label for="description">Description </label>
            <textarea class="form-control form-control-sm" id="description" name="description" rows="3"></textarea>
            <% if (errors && errors.find(error => error.path === 'description')) { %>
                <p class="text-danger"><%= errors.find(error => error.path === 'description').msg %></p>
            <% } %>
          </div>
          <% if(req.session && req.session.admin && (req.session.admin.role == 'Admin' || req.session.admin.role == 'Super admin')) {%>
            <button type="submit" class="btn btn-primary">Ajouter</button>
          <% } %>
          <button type="reset" class="btn btn-light">Annuler</button>
        </form>
      </div>              
    </div>
  </div>

