diff --git a/lib/app.js b/lib/app.js
index 6a5f7aa9..355901f9 100644
--- a/lib/app.js
+++ b/lib/app.js
@@ -128,7 +128,14 @@ module.exports.initialize = function(config) {
app.use(expValidator());
app.set('views', __dirname + '/../views');
- app.set('view engine', 'jade');
+
+ if (config.get("application").EJSViews){
+ app.set('view engine', 'ejs');
+ app.engine('ejs', require("ejs-mate"));
+ }
+ else {
+ app.set('view engine', 'jade');
+ }
app.use(function (req, res, next) {
diff --git a/lib/config.js b/lib/config.js
index 8d005b8f..d624663e 100644
--- a/lib/config.js
+++ b/lib/config.js
@@ -57,6 +57,7 @@ module.exports = (function() {
git: "git",
skipGitCheck: false,
loggingMode: 1,
+ EJSViews: false,
pedanticMarkdown: true,
staticWhitelist: "/\\.png$/i, /\\.jpg$/i, /\\.gif$/i"
},
diff --git a/package.json b/package.json
index e2aad03a..54139867 100644
--- a/package.json
+++ b/package.json
@@ -34,6 +34,7 @@
"gravatar": "^1.1.0",
"iconv": "*",
"jade": "*",
+ "ejs-mate": "*",
"js-yaml": "^3.1.0",
"lodash": "^2.4.1",
"marked": "^0.3.2",
diff --git a/views/404.ejs b/views/404.ejs
new file mode 100644
index 00000000..4f38e900
--- /dev/null
+++ b/views/404.ejs
@@ -0,0 +1,7 @@
+<% layout('layout') -%>
+
+
+
<%= title %>
+
The requested resource is not available
+
+
diff --git a/views/500.ejs b/views/500.ejs
new file mode 100644
index 00000000..e9116599
--- /dev/null
+++ b/views/500.ejs
@@ -0,0 +1,8 @@
+<% layout('layout') -%>
+
+
+
<%= title %>
+
<%= error %>
+
<%= message %>
+
+
diff --git a/views/compare.ejs b/views/compare.ejs
new file mode 100644
index 00000000..b166d136
--- /dev/null
+++ b/views/compare.ejs
@@ -0,0 +1,25 @@
+<% layout('layout') -%>
+
+
Compare two revisions of:
+ <%= page.title %>
+
+
+
+<%
+ lines.forEach(function(line){ -%>
+
+ | <%= line.ldln %> |
+ <%= line.rdln %> |
+ <%= line.text %> |
+
+<%
+ }); -%>
+
+
diff --git a/views/create.ejs b/views/create.ejs
new file mode 100644
index 00000000..cfca7617
--- /dev/null
+++ b/views/create.ejs
@@ -0,0 +1,100 @@
+<% layout('layout') -%>
+<% var str = "";
+if (hasFeature('markitup')){
+ str = str + '\
+ \n\
+ \n\
+ \n';
+}
+if (hasFeature('codemirror')){
+ str = str + '\
+ \n\
+ \n';
+}
+block('styles').append(str) %>
+
+
+<%
+ var errors = locals.errors;
+ if ((typeof(errors) != 'undefined' && Object.keys(errors).length > 0)){ %>
+
+
+ <% errors.forEach(function(v){ -%>
+ - <%= v.msg || v %>
+<% }) -%>
+
+
+<%
+ } -%>
+
Create a new page
+
+
+
+
+
+<% var str = "";
+if (hasFeature('markitup')){
+ str = str + '\
+ \n\
+ \n\
+ \n\
+ \n\
+ '
+}
+if (hasFeature('codemirror')){
+ str = str + '\
+ \n\
+ '
+}
+block('scripts').append(str) %>
diff --git a/views/edit.ejs b/views/edit.ejs
new file mode 100644
index 00000000..8aec9d0a
--- /dev/null
+++ b/views/edit.ejs
@@ -0,0 +1,129 @@
+<% layout('layout') -%>
+<% var style = "";
+if (hasFeature('markitup')){
+ style = style + '\
+ \n\
+ \n\
+ \n';
+}
+if (hasFeature('codemirror')){
+ style = style + '\
+ \n\
+ \n';
+}
+block('styles').append(style);
+
+var tools = '\
+ \n';
+
+block('tools').append(tools) -%>
+
+<%
+ var errors = locals.errors;
+ if (typeof(errors) != 'undefined' && Object.keys(errors).length > 0){ -%>
+
+
+ <% errors.forEach(function(v){ -%>
+ - <%= v.msg || v %>
+ <% }) -%>
+
+
+<%
+ }
+
+ var warning = locals.warning;
+ if (typeof(warning) != 'undefined'){ -%>
+
+ <%- warning %>
+
+<%
+ } -%>
+
Edit page
+
+
+
+
+<% var scripts = "";
+if (hasFeature('markitup')){
+ scripts = scripts + '\
+ \n\
+ \n\
+ \n\
+ \n\
+ \n';
+}
+
+if (hasFeature('codemirror')){
+ scripts = scripts + '\
+ \n\
+ \n';
+}
+
+block('scripts').append(scripts) -%>
diff --git a/views/history.ejs b/views/history.ejs
new file mode 100644
index 00000000..2a00e45c
--- /dev/null
+++ b/views/history.ejs
@@ -0,0 +1,40 @@
+<% layout('layout');
+
+var tools = '\
+ \n';
+
+block('tools').append(tools); %>
+
+
+
Revisions of:
+ <%= page.title %>
+
+
+
+
+
+
diff --git a/views/index.ejs b/views/index.ejs
new file mode 100644
index 00000000..3e18769c
--- /dev/null
+++ b/views/index.ejs
@@ -0,0 +1,4 @@
+<% layout('layout') -%>
+
+
Welcome to <%= title %>
+
diff --git a/views/layout.ejs b/views/layout.ejs
new file mode 100644
index 00000000..ea0ce4e9
--- /dev/null
+++ b/views/layout.ejs
@@ -0,0 +1,102 @@
+<% /*# TODO trouver comment require mixins/form.jade */ -%>
+
+
+
+
+
+
+ <%= title%>
+
+
+
+
+
+<%- block('styles').toString() -%>
+<%
+ if (hasCustomStyle()){ -%>
+
+<%
+ } -%>
+
+
+<% var term_ph = (typeof term == "undefined" ? "" : term) -%>
+
+
+
+
+
+<% if (isAnonymous()) { -%>
+ You're not
+ logged in
+<% }
+ else { -%>
+ <%= user.displayName %>
+
+
+
+<% } -%>
+
+
+
+
+
+
+<%- block('tools').toString() -%>
+
+
+
+
+<% if (hasSidebar()) { -%>
+
+<% }
+ else { -%>
+
+<% } -%>
+
+<%- body -%>
+
+
+<% if (hasFooter()) { -%>
+
+<% } -%>
+
+
+
+
+
+
+
+<%- block('scripts').toString() %>
+<%
+ if (hasCustomScript()) { -%>
+
+<%
+ } -%>
+
+
diff --git a/views/list.ejs b/views/list.ejs
new file mode 100644
index 00000000..a27aadfe
--- /dev/null
+++ b/views/list.ejs
@@ -0,0 +1,42 @@
+<% layout('layout') -%>
+
+
+
Document list – Most recent updates shown first
+
+<%
+ items.forEach(function(item){ -%>
+ -
+
+
+
+
+ <% if (!isAnonymous()) { -%>
+
+ <% }; %>
+
+ <% if (item.hashes) { -%>
+
+ <% }; %>
+
+
→ <%= item.page.lastCommitMessage %>
+
+
+<%
+ }); %>
+
+
+<%
+ pageNumbers.forEach(function(pageNumber){ -%>
+ -
+ <%= pageNumber %>
+
+<%
+ }); %>
+
+
diff --git a/views/login.ejs b/views/login.ejs
new file mode 100644
index 00000000..3bee610f
--- /dev/null
+++ b/views/login.ejs
@@ -0,0 +1,57 @@
+<% layout('layout'); -%>
+
+
Choose your authentication method
+<%
+if (auth.google.enabled){ -%>
+
Google login
+<%
+}
+
+if (auth.github.enabled){ -%>
+
Github login
+<%
+}
+
+if (auth.google.enabled || auth.github.enabled){ -%>
+
Cancel
+<%
+}
+
+var errors = locals.errors;
+if (typeof(errors) != 'undefined' && Object.keys(errors).length > 0){ %>
+
+
+<% errors.forEach(function(v){ -%>
+ - <%= v.msg || v %>
+<% }) -%>
+
+
+<%
+}
+
+if (auth.alone.enabled){ -%>
+
+
Authenticate locally
+
+
+<%
+} -%>
+
diff --git a/views/preview.ejs b/views/preview.ejs
new file mode 100644
index 00000000..5a4ba040
--- /dev/null
+++ b/views/preview.ejs
@@ -0,0 +1,3 @@
+
+ <%- content %>
+
diff --git a/views/search.ejs b/views/search.ejs
new file mode 100644
index 00000000..8589a39f
--- /dev/null
+++ b/views/search.ejs
@@ -0,0 +1,24 @@
+<% layout('layout') -%>
+
+
+<%
+ var warning = locals.warning;
+ if (typeof(warning) != 'undefined'){ %>
+
+ <%- warning %>
+
+<%
+ } -%>
+
Search results for <%= term %>
+
+<%
+ matches.forEach(function(match){ -%>
+ -
+
+ <%= match.line %>
+
+ - <%= match.text %>
+<%
+ }) -%>
+
+
diff --git a/views/show.ejs b/views/show.ejs
new file mode 100644
index 00000000..ab779146
--- /dev/null
+++ b/views/show.ejs
@@ -0,0 +1,68 @@
+<% layout('layout');
+
+var tools = '\
+ \n';
+
+if (!isAnonymous()){
+ tools = tools + '\
+ - \n\
+ \n\
+ \n\
+ \n\
+
\n';
+
+ if (canEdit){
+ tools = tools + '\
+ - \n\
+ \n\
+ \n\
+ \n\
+
\n';
+ }
+}
+
+tools = tools + '\
+ - \n\
+ \n\
+ \n\
+ \n\
+
\n\
+ - \n\
+ \n\
+ \n\
+ \n\
+
\n\
+
\n';
+
+block('tools').append(tools) -%>
+
+
+<%
+var notice = locals.notice;
+if (typeof(notice) != 'undefined') { %>
+
+ <%- notice %>
+
+<%
+}
+
+var warning = locals.warning;
+if (typeof(warning) != 'undefined'){ %>
+
+ <%- warning %>
+
+<%
+} -%>
+
+<%- content %>
+
+
+
diff --git a/views/syntax.ejs b/views/syntax.ejs
new file mode 100644
index 00000000..85db0b75
--- /dev/null
+++ b/views/syntax.ejs
@@ -0,0 +1,69 @@
+
+
+
+
Format Text
+
Headers
+
# This is an <h1> tag
+## This is an <h2> tag
+###### This is an <h6> tag
+
Text styles
+
*This text will be italic*
+_This will also be italic_
+**This text will be bold**
+__This will also be bold__
+*You **can** combine them*
+
+
+
Lists
+
Unordered
+
* Item 1
+* Item 2
+* Item 2a
+* Item 2b
+
Ordered
+
1. Item 1
+2. Item 2
+3. Item 3
+ * Item 3a
+ * Item 3b
+
+
+
Miscellaneous
+
Images
+

+Format: 
+
Links
+
|http://github.com - automatic!
+[GitHub](http://github.com)
+
Blockquotes
+
As Kanye West said:
+> We're living the future so
+> the present is our past.
+
+
+
+
Code Examples in Markdown
+
+
Syntax highlighting with GFM
+
```javascript
+function fancyAlert(arg) {
+ if(arg) {
+ $.facebox({div:'#foo'})
+ }
+}
+```
+
+
+
Or, indent your code 4 spaces
+
Here is a Python code example
+without syntax highlighting:
+def foo:
+if not bar:
+ return true
+
+
+
Inline code for comments
+
I think you should use an
+`<addr>` element here instead.
+
+
diff --git a/views/welcome.ejs b/views/welcome.ejs
new file mode 100644
index 00000000..b1da0c7b
--- /dev/null
+++ b/views/welcome.ejs
@@ -0,0 +1,8 @@
+<% layout('layout') -%>
+
+
+
Welcome to the wiki
+
This page doesn't (yet) exist. You should first login and then you'll be redirected to the editor so that you can create the front page.
+
Login and start adding content!
+
+