minor tweaks to theme engine

v1.18.x
Julian Lam 12 years ago
parent bf6a38904a
commit 59029a0ef0

1
.gitignore vendored

@ -8,5 +8,6 @@ sftp-config.json
config.json
public/config.json
public/css/*.css
public/themes/*
*.sublime-project
*.sublime-workspace

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

@ -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));

@ -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">

@ -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();
});

@ -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'
}
});
};

Loading…
Cancel
Save