Permalink
View
4 examples/auth/views/head.ejs
@@ -13,10 +13,6 @@
.success {
color: green;
}
- footer {
- margin-top: 50px;
- color: gray;
- }
</style>
</head>
<body>
View
16 examples/ejs/index.js
@@ -31,24 +31,16 @@ app.set('view engine', 'html');
// Dummy users
var users = [
- { name: 'tobi', email: 'tobi@learnboost.com' }
- , { name: 'loki', email: 'loki@learnboost.com' }
- , { name: 'jane', email: 'jane@learnboost.com' }
+ { name: 'tobi', email: 'tobi@learnboost.com' },
+ { name: 'loki', email: 'loki@learnboost.com' },
+ { name: 'jane', email: 'jane@learnboost.com' }
];
app.get('/', function(req, res){
res.render('users', {
- users: users,
- title: "EJS example",
- header: "Some users"
- });
-});
-
-app.get('/next', function(req, res){
- res.render('emails', {
users: users,
title: "EJS example",
- header: "Some email address"
+ header: "Some users"
});
});
View
12 examples/ejs/views/emails.html
@@ -1,12 +0,0 @@
-<% include header/emails.html %>
-
-<h1>Emails</h1>
-<ul id="emails">
- <% users.forEach(function(user){ %>
- <li><%= user.email %> by <%= user.name %></li>
- <% }) %>
-</ul>
-
-<p><a href="/">back</a></p>
-
-<% include footer/all.html %>
View
2 examples/ejs/views/footer.html
@@ -0,0 +1,2 @@
+</body>
+</html>
View
7 examples/ejs/views/footer/all.html
@@ -1,7 +0,0 @@
- <footer>
- <p>
- <%= title %>
- </p>
- </footer>
-</body>
-</html>
View
20 examples/ejs/views/header.html
@@ -0,0 +1,20 @@
+<!DOCTYPE HTML>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <title> <%= title %> </title>
+ <style type="text/css">
+ body {
+ padding: 50px;
+ font: 13px Helvetica, Arial, sans-serif;
+ }
+ .header {
+ font-size: 4em;
+ }
+ footer {
+ margin-top: 50px;
+ color: gray;
+ }
+ </style>
+</head>
+<body>
View
20 examples/ejs/views/header/all.html
@@ -1,20 +0,0 @@
-<!DOCTYPE HTML>
-<html lang="en">
-<head>
- <meta charset="UTF-8">
- <title> <%= title %> </title>
- <style type="text/css">
- body {
- padding: 50px;
- font: 13px Helvetica, Arial, sans-serif;
- }
- .header {
- font-size: 4em;
- }
- footer {
- margin-top: 50px;
- color: gray;
- }
- </style>
-</head>
-<body>
View
3 examples/ejs/views/header/emails.html
@@ -1,3 +0,0 @@
-<% include all.html %>
-
-<h1 class="header">Some email address</h1>
View
3 examples/ejs/views/header/users.html
@@ -1,3 +0,0 @@
-<% include all.html %>
-
-<h1 class="header">Some users</h1>
View
8 examples/ejs/views/users.html
@@ -1,12 +1,10 @@
-<% include header/users.html %>
+<% include header.html %>
<h1>Users</h1>
<ul id="users">
<% users.forEach(function(user){ %>
- <li><%= user.name %> <%= user.email %></li>
+ <li><%= user.name %> &lt;<%= user.email %>&gt;</li>
<% }) %>
</ul>
-<p><a href="/next">next</a></p>
-
-<% include footer/all.html %>
+<% include footer.html %>
View
6 test/acceptance/ejs.js
@@ -10,9 +10,9 @@ describe('ejs', function(){
.end(function(err, res){
res.should.have.status(200);
res.should.have.header('Content-Type', 'text/html; charset=utf-8');
- res.text.should.include('<li>tobi tobi@learnboost.com</li>');
- res.text.should.include('<li>loki loki@learnboost.com</li>');
- res.text.should.include('<li>jane jane@learnboost.com</li>');
+ res.text.should.include('<li>tobi &lt;tobi@learnboost.com&gt;</li>');
+ res.text.should.include('<li>loki &lt;loki@learnboost.com&gt;</li>');
+ res.text.should.include('<li>jane &lt;jane@learnboost.com&gt;</li>');
done();
});
})

0 comments on commit d653d23

Please sign in to comment.