Skip to content

Node.js based forum software built for the modern web

minor tweaks to theme engine

Julian Lam59029a0ef096
diff --git a/.gitignore b/.gitignore
index 7ae63a58f6..93d4ccda41 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,5 +8,6 @@ sftp-config.json
config.json
public/config.json
public/css/*.css
+public/themes/*
*.sublime-project
*.sublime-workspace
diff --git a/public/images/themes/default.png b/public/images/themes/default.png
new file mode 100644
index 0000000000..2b2e6a05e7
Binary files /dev/null and b/public/images/themes/default.png differ
diff --git a/public/src/forum/admin/themes.js b/public/src/forum/admin/themes.js
index 54d0140be2..66b04a9de2 100644
--- a/public/src/forum/admin/themes.js
+++ b/public/src/forum/admin/themes.js
@@ -89,14 +89,17 @@ var nodebb_admin = (function(nodebb_admin) {
for(var x=0,numThemes=themes.length;x<numThemes;x++) {
liEl.setAttribute('data-theme', themes[x].id);
liEl.setAttribute('data-css', themes[x].src);
- liEl.innerHTML = '<img src="' + themes[x].thumbnail + '" />' +
+ liEl.innerHTML = '<img src="' + themes[x].screenshot + '" />' +
'<div>' +
'<div class="pull-right">' +
'<button class="btn btn-primary" data-action="use">Use</button> ' +
'<button class="btn" data-action="preview">Preview</button>' +
'</div>' +
'<h4>' + themes[x].name + '</h4>' +
- '<p>' + themes[x].description + '</p>' +
+ '<p>' +
+ themes[x].description +
+ (themes[x].url ? ' (<a href="' + themes[x].url + '">Homepage</a>)' : '') +
+ '</p>' +
'</div>' +
'<div class="clear">';
themeFrag.appendChild(liEl.cloneNode(true));
diff --git a/public/templates/header.tpl b/public/templates/header.tpl
index 896c009e74..2215f0b742 100644
--- a/public/templates/header.tpl
+++ b/public/templates/header.tpl
@@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="title" CONTENT="NodeBB">
<meta name="keywords" content="" />
- <meta name="description" content="" />
+ <meta name="description" content="{meta.description}" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<link href="{cssSrc}" rel="stylesheet" media="screen">
diff --git a/src/meta.js b/src/meta.js
index c0e868569b..130edb312e 100644
--- a/src/meta.js
+++ b/src/meta.js
@@ -61,6 +61,8 @@ var utils = require('./../public/src/utils.js'),
fs.readFile(themeConfPath, function(err, conf) {
conf = JSON.parse(conf);
conf.src = global.nconf.get('url') + 'themes/' + themeDir + '/' + conf.src;
+ if (conf.screenshot) conf.screenshot = global.nconf.get('url') + 'themes/' + themeDir + '/' + conf.screenshot;
+ else conf.screenshot = global.nconf.get('url') + 'images/themes/default.png';
themeArr.push(conf);
next();
});
diff --git a/src/webserver.js b/src/webserver.js
index 3c692a5812..3065d71b99 100644
--- a/src/webserver.js
+++ b/src/webserver.js
@@ -31,7 +31,10 @@ var express = require('express'),
cssSrc: global.config['theme:src'] || global.nconf.get('relative_path') + '/vendor/bootstrap/css/bootstrap.min.css',
title: global.config['title'] || 'NodeBB',
csrf:res.locals.csrf_token,
- relative_path: global.nconf.get('relative_path')
+ relative_path: global.nconf.get('relative_path'),
+ meta: {
+ description: 'test'
+ }
});
};