temporary templateMapping fix for admin side; will come back to this after merging this branch

This commit is contained in:
psychobunny
2014-03-06 16:00:17 -05:00
parent 8c8055fbae
commit 55a7838725
2 changed files with 23 additions and 5 deletions

View File

@@ -127,23 +127,33 @@ var ajaxify = {};
$('#footer, #content').removeClass('hide').addClass('ajaxifying');
};
/*
* this is complete hax and needs to be looked at. (fixing this is out of scope for what I'm currently refactoring)
* -- psychobunny
*/
ajaxify.getTemplateMapping = function(url) {
var tpl_url = templates.get_custom_map(url.split('?')[0]);
if (tpl_url == false && !templates[url]) {
// todo: regex
if (url === '' || url === '/') {
tpl_url = 'home';
} else if (url === 'admin' || url === 'admin/') {
tpl_url = 'admin/index';
} else {
tpl_url = url.split('/')[0].split('?')[0];
tpl_url = url.split('/');
if (tpl_url[0] === 'admin') {
tpl_url = tpl_url[0] + '/' + tpl_url[1];
} else {
tpl_url = tpl_url[0].split('?')[0];
}
}
} else if (templates[url]) {
tpl_url = url;
}
console.log(tpl_url);
return tpl_url;
}