diff --git a/lib/theme.js b/lib/theme.js index 71cadab..2dace70 100644 --- a/lib/theme.js +++ b/lib/theme.js @@ -4,27 +4,62 @@ const Theme = module.exports; Theme.defineWidgetAreas = async function (areas) { + const locations = ['header', 'sidebar', 'footer']; + const templates = [ + 'categories.tpl', 'category.tpl', 'topic.tpl', 'users.tpl', + 'unread.tpl', 'recent.tpl', 'popular.tpl', 'top.tpl', 'tags.tpl', 'tag.tpl', + 'login.tpl', 'register.tpl', + ]; + function capitalizeFirst(str) { + return str.charAt(0).toUpperCase() + str.slice(1); + } + templates.forEach((template) => { + locations.forEach((location) => { + areas.push({ + name: `${capitalizeFirst(template.split('.')[0])} ${capitalizeFirst(location)}`, + template: template, + location: location, + }); + }); + }); + areas = areas.concat([ { - name: 'MOTD', - template: 'home.tpl', - location: 'motd', - }, - { - name: 'Homepage Footer', - template: 'home.tpl', - location: 'footer', - }, - { - name: 'Category Sidebar', - template: 'category.tpl', - location: 'sidebar', - }, - { - name: 'Topic Footer', + name: 'Main post header', template: 'topic.tpl', - location: 'footer', + location: 'mainpost-header', + }, + { + name: 'Main post footer', + template: 'topic.tpl', + location: 'mainpost-footer', + }, + { + name: 'Sidebar Footer', + template: 'global', + location: 'sidebar-footer', + }, + { + name: 'Brand Header', + template: 'global', + location: 'brand-header', + }, + { + name: 'About me (before)', + template: 'account/profile.tpl', + location: 'profile-aboutme-before', + }, + { + name: 'About me (after)', + template: 'account/profile.tpl', + location: 'profile-aboutme-after', + }, + { + name: 'Chat Header', + template: 'chats.tpl', + location: 'header', }, ]); + return areas; };