diff --git a/public/src/app.js b/public/src/app.js index 836748641f..f7734ab588 100644 --- a/public/src/app.js +++ b/public/src/app.js @@ -15,6 +15,9 @@ var socket, url: RELATIVE_PATH + '/api/config', success: function (data) { config = data; + + exposeConfigToTemplates(); + if(socket) { socket.disconnect(); setTimeout(function() { @@ -591,13 +594,17 @@ var socket, }); createHeaderTooltips(); - - templates.setGlobal('relative_path', RELATIVE_PATH); - templates.setGlobal('usePagination', config.usePagination); - templates.setGlobal('topicsPerPage', config.topicsPerPage); - templates.setGlobal('postsPerPage', config.postsPerPage); }); + function exposeConfigToTemplates() { + $(document).ready(function() { + templates.setGlobal('relative_path', RELATIVE_PATH); + for(var key in config) { + templates.setGlobal('config.' + key, config[key]); + } + }); + } + function createHeaderTooltips() { $('#header-menu li i[title]').each(function() { $(this).parents('a').tooltip({ diff --git a/public/templates/category.tpl b/public/templates/category.tpl index 440cf48a09..48971a5265 100644 --- a/public/templates/category.tpl +++ b/public/templates/category.tpl @@ -86,14 +86,14 @@ - +
- + diff --git a/public/templates/topic.tpl b/public/templates/topic.tpl index c6eeaeb2df..4666bc639e 100644 --- a/public/templates/topic.tpl +++ b/public/templates/topic.tpl @@ -214,14 +214,14 @@ - + - +