diff --git a/public/css/style.less b/public/css/style.less index acf74e59b9..b4a0f13b44 100644 --- a/public/css/style.less +++ b/public/css/style.less @@ -405,7 +405,8 @@ footer.footer { .users-box{ display:inline-block; - margin:20px; + margin-right:20px; + margin-top: 20px; text-align:center; } diff --git a/public/src/ajaxify.js b/public/src/ajaxify.js index 448c17d363..a7db3bb87a 100644 --- a/public/src/ajaxify.js +++ b/public/src/ajaxify.js @@ -34,9 +34,11 @@ var ajaxify = {}; var tpl_url = templates.get_custom_map(url); - if (tpl_url == false) { + if (tpl_url == false && !templates[url]) { tpl_url = (url === '' || url === '/') ? 'home' : url.split('/')[0]; - } + } else if (templates[url]) { + tpl_url = url; + } if (templates[tpl_url]) { window.history.pushState({}, url, "/" + url); diff --git a/public/src/templates.js b/public/src/templates.js index a0ead8319a..2b9a9d17d0 100644 --- a/public/src/templates.js +++ b/public/src/templates.js @@ -68,7 +68,8 @@ var templates = {}; 'header', 'footer', 'register', 'home', 'topic','account', 'category', 'users', 'accountedit', 'login', 'reset', 'reset_code', 'account', 'confirm', - 'emails/reset', 'emails/reset_plaintext', 'emails/email_confirm', 'emails/email_confirm_plaintext' + 'emails/reset', 'emails/reset_plaintext', 'emails/email_confirm', 'emails/email_confirm_plaintext', + 'admin/index', 'admin/categories', 'admin/users', 'admin/topics', 'admin/settings', 'admin/themes', 'admin/twitter', 'admin/facebook', 'admin/gplus' ]); } @@ -168,15 +169,15 @@ function load_template(callback, custom_tpl) { jQuery.get(API_URL + url, function(data) { + var tpl = templates.get_custom_map(url); - if (tpl == false) { - tpl = url.split('/')[0]; + + if (tpl == false && !templates[url]) { + tpl = (url === '' || url === '/') ? 'home' : url.split('/')[0]; + } else if (templates[url]) { + tpl = url; } - - if (custom_tpl && custom_tpl != "undefined") - tpl = custom_tpl; - - + document.getElementById('content').innerHTML = templates[tpl].parse(JSON.parse(data)); if (callback) callback(); }); diff --git a/public/templates/admin/categories.tpl b/public/templates/admin/categories.tpl new file mode 100644 index 0000000000..d86bdbad17 --- /dev/null +++ b/public/templates/admin/categories.tpl @@ -0,0 +1,75 @@ + +