add roomId class to body

isekai-main
Barış Soner Uşaklı 2 years ago
parent 5f43605e4d
commit bc8dbc2084

@ -41,16 +41,20 @@ helpers.buildBodyClass = function (req, res, templateData = {}) {
p = validator.escape(String(p));
parts[index] = index ? `${parts[0]}-${p}` : `page-${p || 'home'}`;
});
if (templateData.template) {
parts.push(`template-${templateData.template.name.split('/').join('-')}`);
const { template } = templateData;
if (template) {
parts.push(`template-${template.name.split('/').join('-')}`);
}
if (templateData.template && templateData.template.topic) {
if (template && template.topic) {
parts.push(`page-topic-category-${templateData.category.cid}`);
parts.push(`page-topic-category-${slugify(templateData.category.name)}`);
}
if (template && template.chats && templateData.roomId) {
parts.push(`page-user-chats-${templateData.roomId}`);
}
if (Array.isArray(templateData.breadcrumbs)) {
templateData.breadcrumbs.forEach((crumb) => {
if (crumb && crumb.hasOwnProperty('cid')) {

Loading…
Cancel
Save