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)
Changes
@@@ -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 themconst 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}`]] : [])];@@@ -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 () => {
@@ -15,7 +15,7 @@ const { markdownToText } = require('./markdown');
@@ -15,7 +15,7 @@ const { markdownToText } = require('./markdown');
const { timeTag, fmtDate, num, avatarUrl, authorHtml, wearName } = require('./pages');
const { timeTag, fmtDate, num, avatarUrl, authorHtml, wearName } = require('./pages');
const f = require('./forum');
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 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 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}`]] : [])];
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}`]] : [])];
@@ -56,7 +56,7 @@ const { boot, check, done } = require('./helpers/app');
@@ -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.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');
assert.strictEqual(general.last_post.thread.title, 'Welcome thread'); assert.strictEqual(general.last_post.author.username, 'sam');
const html = (await call('/s')).text;
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 () => {
await check('ratings: one per person per post, toggle, replace, not your own; totals on the author panel', async () => {