Skip to content
Myr

Merge branch 'flash-example'

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Tj Holowaychuk · committed by Tj Holowaychuk · parents 344218f, b4e7557 · Browse files · 5 files+88 added−10 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

5 files+88 added−10 removed

  • other:+88 added−10 removed

5 files+88 added−10 removed

added:examples/flash/views/partials/messages.ejs+12 added
1<% if (hasMessages) { %>2 <div id="messages">3 <% for (var type in types) { %>4 <h2><%= type %> messages</h2>5 <ul id="<%= type %>">6 <% types[type].forEach(function(msg){ %>7 <li><%= msg %></li>8 <% }) %>9 </ul>10 <% } %>11 </div>12<% } %>
added:examples/flash/views/index.ejs+2 added
1<h1>Flash Message Example</h1>2<%- messages %>
added:examples/flash/views/layout.ejs+5 added
1<html>2 <body>3 <%- body %>4 </body>5</html>
added:examples/flash/app.js+57 added
modified:lib/express/view.js+12 added-10 removed
207 unmodified lines
208 options.locals = options.locals || {};209 options.locals.__filename = options.filename = path;210211 // Dynamic helper support212 if (options.dynamicHelpers !== false) {212 var keys = Object.keys(dynamicHelpers);213 for (var i = 0, len = keys.length; i < len; ++i) {214 var key = keys[i],215 val = dynamicHelpers[key];216 if (typeof val === 'function') {217 helpers[key] = val.call(218 this.app, 219 this.req, 220 this, 221 this.req.params.path);213 var keys = Object.keys(dynamicHelpers);214 for (var i = 0, len = keys.length; i < len; ++i) {215 var key = keys[i],216 val = dynamicHelpers[key];217 if (typeof val === 'function') {218 helpers[key] = val.call(219 this.app, 220 this.req, 221 this, 222 this.req.params.path);223 }224 }225 }226227 // Always expose partial() as a local
46 unmodified lines