Add a prompt explaining the situation as well as documentation

This commit is contained in:
Calvin Montgomery 2016-08-23 21:50:18 -07:00
parent 578d3fbb23
commit 5a81ab7ce7
10 changed files with 184 additions and 2 deletions

View file

@ -36,6 +36,9 @@ function getBaseUrl(res) {
* Renders and serves a pug template
*/
function sendPug(res, view, locals) {
if (!locals) {
locals = {};
}
locals.loggedIn = locals.loggedIn || !!res.user;
locals.loginName = locals.loginName || res.user ? res.user.name : false;
locals.superadmin = locals.superadmin || res.user ? res.user.global_rank >= 255 : false;

View file

@ -0,0 +1,7 @@
import { sendPug } from '../pug';
export default function initialize(app) {
app.get('/google_drive_userscript', (req, res) => {
return sendPug(res, 'google_drive_userscript')
});
}

View file

@ -177,6 +177,7 @@ module.exports = {
require('./account').init(app);
require('./acp').init(app);
require('../google2vtt').attach(app);
require('./routes/google_drive_userscript')(app);
app.use(serveStatic(path.join(__dirname, '..', '..', 'www'), {
maxAge: webConfig.getCacheTTL()
}));