Skip to content

Commit

Permalink
examples: replace jade with ejs in route-separation
Browse files Browse the repository at this point in the history
closes #3241
  • Loading branch information
notrab authored and dougwilson committed Mar 17, 2017
1 parent 1b6ad08 commit 245fa89
Show file tree
Hide file tree
Showing 14 changed files with 79 additions and 48 deletions.
2 changes: 1 addition & 1 deletion examples/route-separation/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module.exports = app;

// Config

app.set('view engine', 'jade');
app.set('view engine', 'ejs');
app.set('views', path.join(__dirname, 'views'));

/* istanbul ignore next */
Expand Down
2 changes: 2 additions & 0 deletions examples/route-separation/views/footer.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
</body>
</html>
8 changes: 8 additions & 0 deletions examples/route-separation/views/header.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title><%= title %></title>
<link rel="stylesheet" href="/style.css">
</head>
<body>
10 changes: 10 additions & 0 deletions examples/route-separation/views/index.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<% include header %>

<h1><%= title %></h1>

<ul>
<li>Visit the <a href="/users">users</a> page.</li>
<li>Visit the <a href="/users">posts</a> page.</li>
</ul>

<% include footer %>
6 changes: 0 additions & 6 deletions examples/route-separation/views/index.jade

This file was deleted.

6 changes: 0 additions & 6 deletions examples/route-separation/views/layout.jade

This file was deleted.

12 changes: 12 additions & 0 deletions examples/route-separation/views/posts/index.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<% include ../header %>

<h1>Posts</h1>

<dl id="posts">
<% posts.forEach(function(post) { %>
<dt><%= post.title %></dt>
<dd><%= post.body %></dd>
<% }) %>
</dl>

<% include ../footer %>
8 changes: 0 additions & 8 deletions examples/route-separation/views/posts/index.jade

This file was deleted.

23 changes: 23 additions & 0 deletions examples/route-separation/views/users/edit.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<% include ../header %>

<h1>Editing <%= user.name %></h1>

<div id="user">
<form action="?_method=put", method="post">
<p>
Name:
<input type="text" value="<%= user.name %>" name="user[name]" />
</p>

<p>
Email:
<input type="email" value="<%= user.email %>" name="user[email]" />
</p>

<p>
<input type="submit" value="Save" />
</p>
</form>
</div>

<% include ../footer %>
12 changes: 0 additions & 12 deletions examples/route-separation/views/users/edit.jade

This file was deleted.

14 changes: 14 additions & 0 deletions examples/route-separation/views/users/index.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<% include ../header %>

<h1><%= title %></h1>

<div id="users">
<% users.forEach(function(user, index) { %>
<li>
<a href="/user/<%= index %>"><%= user.name %></a>
<a href="/user/<%= index %>/edit">edit</a>
</li>
<% }) %>
</div>

<% include ../footer %>
9 changes: 0 additions & 9 deletions examples/route-separation/views/users/index.jade

This file was deleted.

9 changes: 9 additions & 0 deletions examples/route-separation/views/users/view.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<% include ../header %>

<h1><%= user.name %></h1>

<div id="user">
<p>Email: <%= user.email %></p>
</div>

<% include ../footer %>
6 changes: 0 additions & 6 deletions examples/route-separation/views/users/view.jade

This file was deleted.

0 comments on commit 245fa89

Please sign in to comment.