'use strict'; module.exports.render = function (template) { if (template.match(/^admin/)) { return; } const locations = Object.keys(ajaxify.data.widgets); locations.forEach(function (location) { let area = $('#content [widget-area="' + location + '"],#content [data-widget-area="' + location + '"]').eq(0); const widgetsAtLocation = ajaxify.data.widgets[location] || []; if (area.length || !widgetsAtLocation.length) { return; } let html = ''; widgetsAtLocation.forEach(function (widget) { html += widget.html; }); if (!html) { return; } if (location === 'footer' && !$('#content [widget-area="footer"],#content [data-widget-area="footer"]').length) { $('#content').append($('
')); } else if (location === 'sidebar' && !$('#content [widget-area="sidebar"],#content [data-widget-area="sidebar"]').length) { if ($('[component="account/cover"]').length) { $('[component="account/cover"]').nextAll().wrapAll($('