Skip to content

Commit b989e84

Browse files
author
Martii
committed
Modify /about page a bit
* Add hardcoded bookmarks * Add Mission header with tba * Add Getting Started header * Show node version for admins only
1 parent 14e5adf commit b989e84

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

controllers/document.js

+16
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
'use strict';
22

3+
var pkg = require('../package.json');
4+
35
var fs = require('fs');
46
var async = require('async');
57
var renderMd = require('../libs/markdown').renderMd;
@@ -97,10 +99,24 @@ exports.view = function (aReq, aRes, aNext) {
9799
});
98100
}
99101
else {
102+
var then = null;
103+
100104
// Page metadata
101105
pageMetadata(options, ['About', 'About']);
102106

103107
options.isAbout = true;
108+
109+
options.process = {};
110+
if (options.isAdmin) {
111+
options.process.version = process.version;
112+
}
113+
114+
then = new Date(Date.now() - parseInt(process.uptime() * 1000, 10));
115+
options.lastRestart = then.toLocaleString();
116+
117+
options.pkg = {};
118+
options.pkg.name = pkg.name;
119+
options.pkg.version = pkg.version;
104120
}
105121

106122
//---

views/pages/documentPage.html

+5-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,11 @@ <h2 class="page-heading">
1616
</h2>
1717
<div class="panel panel-default">
1818
<div class="panel-body">
19-
<h3>Welcome</h3>
20-
<p>Welcome to OpenUserJS.org <em>(OUJS)</em>!</p>
19+
<h3><a name="welcome"></a>Welcome<a class="anchor" href="#welcome"><em class="fa fa-link"></em></a></h3>
20+
<p>Welcome to {{#pkg.name}}{{pkg.name}} <em>(OUJS)</em>{{#pkg.version}} v{{pkg.version}}{{/pkg.version}}{{/pkg.name}}{{#process.version}} using Node {{process.version}}{{/process.version}}{{#lastRestart}} last restarted on {{lastRestart}}{{/lastRestart}}.</p>
21+
<h3><a name="mission"></a>Mission<a class="anchor" href="#mission"><em class="fa fa-link"></em></a></h3>
22+
<em>(To be announced)</em>
23+
<h3><a name="getting-started"></a>Getting Started<a class="anchor" href="#getting-started"><em class="fa fa-link"></em></a></h3>
2124
<p>For getting started with Userscripts please check out the <a href="/about/Userscript-Beginners-HOWTO">Userscript Beginners HOWTO</a>.</p>
2225
</div>
2326
</div>

0 commit comments

Comments
 (0)