From 59029a0ef096d767da7610ebb4d86493d756ead0 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Tue, 23 Jul 2013 16:43:02 -0400 Subject: [PATCH] minor tweaks to theme engine --- .gitignore | 1 + public/images/themes/default.png | Bin 0 -> 3559 bytes public/src/forum/admin/themes.js | 7 +++++-- public/templates/header.tpl | 2 +- src/meta.js | 2 ++ src/webserver.js | 5 ++++- 6 files changed, 13 insertions(+), 4 deletions(-) create mode 100644 public/images/themes/default.png 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 0000000000000000000000000000000000000000..2b2e6a05e741ca51457181c90c5bb9c8565a4d99 GIT binary patch literal 3559 zcmZ`+c|6o>7oT!VMdC)53~njeqEWdT86^f~XS#M%hAzo6G?jG! zeRrwGY-5`l@1s7wpHH9negF9Vp7T4;dCvJh&vVZCo%7Vx7rTVo**zN5R(9!P4M7+~`H8W`#Fj`030c;fIP znotE;;=a1S`RaIjcwp}NLUepEXkU!84DNT|J2FTEBh#B90;0eO+Thw1OaI}85&Q6j zwb70V&#oI0PjqUW+p~noQD~ukbH4~VD?YvQr?6N;ZwM^bPw<)$+F#~ih>U`PlVAc= z-|X7e7nD}?ap@T`%I5J2HO%XjW3C`LEY46jUJn+ z*sqdzY|kdu@}49N$eUdoJY}6qmyUk)NSCwKoImChI=0p8MBnjp6Mk#1hKmqm*~TkL z>3vk&z#lupy=*Gh4ilE2&5>P~P4N{Olk_OnFj&fd{+Rot7|`8WQk; zbTn^3jBM&|rh*xlPtHBZma4`xc?LZxpM`K@L-{7gKFB!n&#OPD!c=1rDRlS>IP4!G7;x`N#lUf5!F|^sFDY4V zUQd4>62Mj#_b+JI%qW;J(=U*pZM7FSeO(B9Y2z;(S8#AUjh}$gu8^?7sCI~8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S=Mb2Cr2=i-GiKMqj zUc=7Jf&#{02se9aS=Uziu84|Nb7#8S(+5JJ%J};k99MO1JPgH``L=1`olQyy&eh31 z8+n{4Ar<<{t-on^DG>$ef<>?;Wjl{TT26sD*>oYK_)UKcYUu<+^--+!;x1`!0V-F6 z+f}<@+(3bM0WXIrxA8wuNF&_AJS?%mMq=_On*g9+Q)BISanJ;;1UF-CcF9oml<|Ze zs0>N|@)ByeLjhlx{z~G1g4%xo9(qej$BYM2{(ii}F0i7+sxBPf=SAPaR(RbKQSrM) zJPA328l+J79Mb=<7UGBQVnpaat;GLmA%5sCK%ekq3-LpD@qc@f+YI36P#*14wsd9t W*`~ed{uR)XK@4<_uN7T&dh~CMr5n)z literal 0 HcmV?d00001 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' + + liEl.innerHTML = '' + '
' + '
' + ' ' + '' + '
' + '

' + themes[x].name + '

' + - '

' + themes[x].description + '

' + + '

' + + themes[x].description + + (themes[x].url ? ' (Homepage)' : '') + + '

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