openvibers/openvibe.community Commits

Forum: a board's style tag reads Classic or Feed, as the page and the settings name them (it said "Forum" on every classic forum) (#97)

OP OpenVibers committed 27 days ago · 71b6fa06fa · 2 files, +2 −2

Changes

ddiff --git a/server/render/board.js b/server/render/board.js
iindex 4b98918..ce3e574 100644
---- a/server/render/board.js
++++ b/server/render/board.js
@@@ -15,7 +15,7 @@ const { markdownToText } = require('./markdown');
const { timeTag, fmtDate, num, avatarUrl, authorHtml, wearName } = require('./pages');
const f = require('./forum');
--const STYLE_LABELS = { forum: 'Forum', feed: 'Feed' };
++const STYLE_LABELS = { forum: 'Classic', feed: 'Feed' }; // the two styles, as the Forum page and the settings name them
const monthYear = (iso) => { const d = iso ? new Date(iso) : null; return d && !Number.isNaN(d.getTime()) ? d.toLocaleDateString('en-US', { month: 'short', year: 'numeric', timeZone: 'UTC' }) : null; };
const crumbs = (items) => `<nav class="crumbs" aria-label="Breadcrumb">${items.map(([label, href], i) => (i === items.length - 1 ? `<span aria-current="page">${esc(label)}</span>` : `<a href="${esc(href)}">${esc(label)}</a>`)).join(' › ')}</nav>`;
const trail = (space) => [['Home', '/'], ['Forum', '/s'], ...(space.group ? [[space.group.name, `/s#g-${space.group.slug}`]] : []), ...(space.parent ? [[space.parent.name, `/s/${space.parent.slug}`]] : [])];
ddiff --git a/test/forum-style.test.js b/test/forum-style.test.js
iindex 9331ff6..b1d321f 100644
---- a/test/forum-style.test.js
++++ b/test/forum-style.test.js
@@@ -56,7 +56,7 @@ const { boot, check, done } = require('./helpers/app');
assert.strictEqual(general.thread_count, 1); assert.strictEqual(general.post_count, 2);
assert.strictEqual(general.last_post.thread.title, 'Welcome thread'); assert.strictEqual(general.last_post.author.username, 'sam');
const html = (await call('/s')).text;
-- assert.ok(html.includes('id="g-openvibe"') && html.includes('id="g-community"') && html.includes('Off-topic') && html.includes('badge-style">Forum') && html.includes('badge-style">Feed'));
++ assert.ok(html.includes('id="g-openvibe"') && html.includes('id="g-community"') && html.includes('Off-topic') && html.includes('badge-style">Classic') && html.includes('badge-style">Feed'));
});
await check('ratings: one per person per post, toggle, replace, not your own; totals on the author panel', async () => {