commit
25e9dca74e
@ -0,0 +1,10 @@
|
||||
[
|
||||
{
|
||||
"widget": "html",
|
||||
"data" : {
|
||||
"html": "<footer id=\"footer\" class=\"container footer\">\r\n\t<div class=\"copyright\">\r\n\t\tCopyright © 2014 <a target=\"_blank\" href=\"https://nodebb.org\">NodeBB Forums</a> | <a target=\"_blank\" href=\"//github.com/NodeBB/NodeBB/graphs/contributors\">Contributors</a>\r\n\t</div>\r\n</footer>",
|
||||
"title":"",
|
||||
"container":""
|
||||
}
|
||||
}
|
||||
]
|
@ -0,0 +1,10 @@
|
||||
# Welcome to your brand new NodeBB forum!
|
||||
|
||||
This is what a topic and post looks like. As an administator, you can edit the post\'s title and content.
|
||||
To customise your forum, go to the [Administrator Control Panel](../../admin). You can modify all aspects of your forum there, including installation of third-party plugins.
|
||||
|
||||
## Additional Resources
|
||||
|
||||
* [NodeBB Documentation](https://docs.nodebb.org)
|
||||
* [Community Support Forum](https://community.nodebb.org)
|
||||
* [Project repository](https://github.com/nodebb/nodebb)
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"no_tag_topics": "There are no topics with this tag.",
|
||||
"tags": "Tags",
|
||||
"enter_tags_here": "Enter tags here. Press enter after each tag.",
|
||||
"enter_tags_here": "Enter tags here. %1-%2 characters. Press enter after each tag.",
|
||||
"enter_tags_here_short": "Enter tags...",
|
||||
"no_tags": "There are no tags yet."
|
||||
}
|
File diff suppressed because one or more lines are too long
@ -0,0 +1,90 @@
|
||||
"use strict";
|
||||
|
||||
var async = require('async'),
|
||||
nconf = require('nconf'),
|
||||
fs = require('fs'),
|
||||
path = require('path'),
|
||||
meta = require('../meta'),
|
||||
plugins = require('../plugins'),
|
||||
utils = require('../../public/src/utils'),
|
||||
templatesController = {};
|
||||
|
||||
|
||||
var availableTemplatesCache = null;
|
||||
var configCache = null;
|
||||
|
||||
templatesController.getTemplatesListing = function(req, res, next) {
|
||||
async.parallel({
|
||||
availableTemplates: function(next) {
|
||||
getAvailableTemplates(next);
|
||||
},
|
||||
templatesConfig: function(next) {
|
||||
async.waterfall([
|
||||
function(next) {
|
||||
readConfigFile(next);
|
||||
},
|
||||
function(config, next) {
|
||||
config.custom_mapping['^/?$'] = meta.config.homePageRoute || 'home';
|
||||
|
||||
plugins.fireHook('filter:templates.get_config', config, next);
|
||||
}
|
||||
], next);
|
||||
},
|
||||
}, function(err, results) {
|
||||
if (err) {
|
||||
return next(err);
|
||||
}
|
||||
|
||||
res.json(results);
|
||||
});
|
||||
};
|
||||
|
||||
function readConfigFile(callback) {
|
||||
if (configCache) {
|
||||
return callback(null, configCache);
|
||||
}
|
||||
fs.readFile(path.join(nconf.get('views_dir'), 'config.json'), function(err, config) {
|
||||
if (err) {
|
||||
return callback(err);
|
||||
}
|
||||
try {
|
||||
config = JSON.parse(config.toString());
|
||||
} catch (err) {
|
||||
return callback(err);
|
||||
}
|
||||
configCache = config;
|
||||
callback(null, config);
|
||||
});
|
||||
}
|
||||
|
||||
function getAvailableTemplates(callback) {
|
||||
if (availableTemplatesCache) {
|
||||
return callback(null, availableTemplatesCache);
|
||||
}
|
||||
|
||||
async.parallel({
|
||||
views: function(next) {
|
||||
utils.walk(nconf.get('views_dir'), next);
|
||||
},
|
||||
extended: function(next) {
|
||||
plugins.fireHook('filter:templates.get_virtual', [], next);
|
||||
}
|
||||
}, function(err, results) {
|
||||
if (err) {
|
||||
return callback(err);
|
||||
}
|
||||
var availableTemplates = results.views.filter(function(value, index, self) {
|
||||
return value && self.indexOf(value) === index;
|
||||
}).map(function(el) {
|
||||
return el && el.replace(nconf.get('views_dir') + '/', '');
|
||||
});
|
||||
|
||||
availableTemplatesCache = availableTemplates.concat(results.extended);
|
||||
callback(null, availableTemplatesCache);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
module.exports = templatesController;
|
Loading…
Reference in New Issue