Node.js based forum software built for the modern web
minor tweaks to theme engine
Julian Lam59029a0ef096
diff --git a/.gitignore b/.gitignoreindex 7ae63a58f6..93d4ccda41 100644--- a/.gitignore+++ b/.gitignore@@ -8,5 +8,6 @@ sftp-config.jsonconfig.jsonpublic/config.jsonpublic/css/*.css+public/themes/**.sublime-project*.sublime-workspacediff --git a/public/images/themes/default.png b/public/images/themes/default.pngnew file mode 100644index 0000000000..2b2e6a05e7Binary files /dev/null and b/public/images/themes/default.png differdiff --git a/public/src/forum/admin/themes.js b/public/src/forum/admin/themes.jsindex 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.tplindex 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.jsindex 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.jsindex 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'+ }});};