Skip to content

Instantly share code, notes, and snippets.

@slmanju
Created January 5, 2018 17:54
Show Gist options
  • Select an option

  • Save slmanju/ba28d311c8ebcc5f88aa1ccc4b79f7f4 to your computer and use it in GitHub Desktop.

Select an option

Save slmanju/ba28d311c8ebcc5f88aa1ccc4b79f7f4 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<title>Employee List</title>
<link rel='stylesheet' href='/stylesheets/style.css' />
</head>
<body>
<div class="container">
<h3><a href="/employees/create">Create Employee</a></h3>
<h1>Employee List</h1>
<% if (employees.length > 0) { %>
<table>
<thead>
<tr>
<th>Username</th>
<th>Email</th>
</tr>
</thead>
<tbody>
<% for(var i = 0; i < employees.length; i++) { %>
<tr>
<td><a href="/employees/show/<%= employees[i]._id%>"><%= employees[i].username %></a></td>
<td><%= employees[i].email %></td>
</tr>
<% } %>
</tbody>
</table>
<% } else { %>
<div>No employees found.</div>
<% } %>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment