openvibers/openvibe.chat Commits
Room settings link an attached Community space at /forum (#376)
Changes
@@@ -87,7 +87,7 @@ module.exports = {// openvibe.chat, the site (server/web/): global chat, messages and settings, served by Chat itself.web: {baseUrl: strip(process.env.CHAT_WEB_URL || (isProduction ? 'https://openvibe.chat' : 'http://localhost:4400')),-- // Where a room's Community attachments link (a space is <communityUrl>/s/<slug>).++ // Where a room's Community attachments link (a space is <communityUrl>/forum/<slug>).communityUrl: strip(process.env.OV_COMMUNITY_URL || 'https://openvibe.community'),},// Pictures in rooms and channels (server/rooms/pictures.js): uploaded to OpenVibe.Pics as the person (their own@@@ -1010,7 +1010,7 @@ ${hookList.length < roomHooks.MAX_PER_ROOM ? `<form class="oc-form" method="post<label>Each alert <select name="queue_kind"><option value="">posts a message</option><option value="research">posts and asks Vibe to look into it (research, runs on your allowance)</option><option value="code">posts and queues a code task for a worker</option><option value="other">posts and queues a task for a worker</option></select></label><p><button type="submit">Make a hook</button></p></form>` : ''}</details>` : '';const communityUrl = config.web.communityUrl;-- const attachList = can.manage ? `<section class="oc-set"><h2>Attached to</h2>${attachments.length ? `<ul class="oc-members">${attachments.map((a) => `<li><a href="${esc(a.service === 'community' ? `${communityUrl}/s/${encodeURIComponent(a.resource)}` : '#')}">${esc(a.title || a.resource)}</a> <span class="oc-muted">${esc(a.service === 'community' ? 'OpenVibe.Community space' : a.service)}</span><form class="oc-inline" method="post" action="/r/${esc(room.slug)}/attachments/${encodeURIComponent(a.service)}/${encodeURIComponent(a.resource)}/detach"><button type="submit" class="oc-link">Detach</button></form></li>`).join('')}</ul>` : '<p class="oc-muted oc-set-note">Not attached anywhere. A Community space you own can attach this room from the space\'s page.</p>'}</section>` : '';++ const attachList = can.manage ? `<section class="oc-set"><h2>Attached to</h2>${attachments.length ? `<ul class="oc-members">${attachments.map((a) => `<li><a href="${esc(a.service === 'community' ? `${communityUrl}/forum/${encodeURIComponent(a.resource)}` : '#')}">${esc(a.title || a.resource)}</a> <span class="oc-muted">${esc(a.service === 'community' ? 'OpenVibe.Community space' : a.service)}</span><form class="oc-inline" method="post" action="/r/${esc(room.slug)}/attachments/${encodeURIComponent(a.service)}/${encodeURIComponent(a.resource)}/detach"><button type="submit" class="oc-link">Detach</button></form></li>`).join('')}</ul>` : '<p class="oc-muted oc-set-note">Not attached anywhere. A Community space you own can attach this room from the space\'s page.</p>'}</section>` : '';await page(req, res, 200, {actor, title: `${room.name}: settings`, path: `/r/${room.slug}/settings`, active: 'rooms', robots: 'noindex, nofollow', footer: 'compact', script: true, page: { view: 'settings' },body: `${ui.head({ title: 'Room settings', sub: esc(room.name), back: { href: `/r/${room.slug}`, label: 'Back to the room' } })}${saved}${error}@@@ -311,9 +311,9 @@ t('the site: kinds on the rooms page, the call panel, roles and attachments in sassert.match(r.text, /· seen <time/, 'moderators see when people were last here');await api('POST', '/tea-talk/attachments', own, { service: 'community', resource: 'general', title: 'General <b>' });r = await page('/r/tea-talk/settings', own);-- assert.match(r.text, /<a href="https:\/\/openvibe\.community\/s\/general">General <b><\/a>/);++ assert.match(r.text, /<a href="https:\/\/openvibe\.community\/forum\/general">General <b><\/a>/);assert.match(r.text, /action="\/r\/tea-talk\/attachments\/community\/general\/detach"/);-- assert.ok(!(await page('/r/tea-talk', own)).text.includes('openvibe.community/s/general'), 'the room page itself makes no claim about the space');++ assert.ok(!(await page('/r/tea-talk', own)).text.includes('openvibe.community/forum/general'), 'the room page itself makes no claim about the space');r = await page('/r/openvibe-news', out);assert.match(r.text, /Announcements from OpenVibe staff/);
@@ -87,7 +87,7 @@ module.exports = {
@@ -87,7 +87,7 @@ module.exports = {
// openvibe.chat, the site (server/web/): global chat, messages and settings, served by Chat itself.
// openvibe.chat, the site (server/web/): global chat, messages and settings, served by Chat itself.
web: {
web: {
baseUrl: strip(process.env.CHAT_WEB_URL || (isProduction ? 'https://openvibe.chat' : 'http://localhost:4400')),
baseUrl: strip(process.env.CHAT_WEB_URL || (isProduction ? 'https://openvibe.chat' : 'http://localhost:4400')),
- // Where a room's Community attachments link (a space is <communityUrl>/s/<slug>).
+ // Where a room's Community attachments link (a space is <communityUrl>/forum/<slug>).
communityUrl: strip(process.env.OV_COMMUNITY_URL || 'https://openvibe.community'),
communityUrl: strip(process.env.OV_COMMUNITY_URL || 'https://openvibe.community'),
},
},
// Pictures in rooms and channels (server/rooms/pictures.js): uploaded to OpenVibe.Pics as the person (their own
// Pictures in rooms and channels (server/rooms/pictures.js): uploaded to OpenVibe.Pics as the person (their own
@@ -1010,7 +1010,7 @@ ${hookList.length < roomHooks.MAX_PER_ROOM ? `<form class="oc-form" method="post
@@ -1010,7 +1010,7 @@ ${hookList.length < roomHooks.MAX_PER_ROOM ? `<form class="oc-form" method="post
<label>Each alert <select name="queue_kind"><option value="">posts a message</option><option value="research">posts and asks Vibe to look into it (research, runs on your allowance)</option><option value="code">posts and queues a code task for a worker</option><option value="other">posts and queues a task for a worker</option></select></label>
<label>Each alert <select name="queue_kind"><option value="">posts a message</option><option value="research">posts and asks Vibe to look into it (research, runs on your allowance)</option><option value="code">posts and queues a code task for a worker</option><option value="other">posts and queues a task for a worker</option></select></label>
<p><button type="submit">Make a hook</button></p></form>` : ''}</details>` : '';
<p><button type="submit">Make a hook</button></p></form>` : ''}</details>` : '';
const communityUrl = config.web.communityUrl;
const communityUrl = config.web.communityUrl;
- const attachList = can.manage ? `<section class="oc-set"><h2>Attached to</h2>${attachments.length ? `<ul class="oc-members">${attachments.map((a) => `<li><a href="${esc(a.service === 'community' ? `${communityUrl}/s/${encodeURIComponent(a.resource)}` : '#')}">${esc(a.title || a.resource)}</a> <span class="oc-muted">${esc(a.service === 'community' ? 'OpenVibe.Community space' : a.service)}</span><form class="oc-inline" method="post" action="/r/${esc(room.slug)}/attachments/${encodeURIComponent(a.service)}/${encodeURIComponent(a.resource)}/detach"><button type="submit" class="oc-link">Detach</button></form></li>`).join('')}</ul>` : '<p class="oc-muted oc-set-note">Not attached anywhere. A Community space you own can attach this room from the space\'s page.</p>'}</section>` : '';
+ const attachList = can.manage ? `<section class="oc-set"><h2>Attached to</h2>${attachments.length ? `<ul class="oc-members">${attachments.map((a) => `<li><a href="${esc(a.service === 'community' ? `${communityUrl}/forum/${encodeURIComponent(a.resource)}` : '#')}">${esc(a.title || a.resource)}</a> <span class="oc-muted">${esc(a.service === 'community' ? 'OpenVibe.Community space' : a.service)}</span><form class="oc-inline" method="post" action="/r/${esc(room.slug)}/attachments/${encodeURIComponent(a.service)}/${encodeURIComponent(a.resource)}/detach"><button type="submit" class="oc-link">Detach</button></form></li>`).join('')}</ul>` : '<p class="oc-muted oc-set-note">Not attached anywhere. A Community space you own can attach this room from the space\'s page.</p>'}</section>` : '';
await page(req, res, 200, {
await page(req, res, 200, {
actor, title: `${room.name}: settings`, path: `/r/${room.slug}/settings`, active: 'rooms', robots: 'noindex, nofollow', footer: 'compact', script: true, page: { view: 'settings' },
actor, title: `${room.name}: settings`, path: `/r/${room.slug}/settings`, active: 'rooms', robots: 'noindex, nofollow', footer: 'compact', script: true, page: { view: 'settings' },
body: `${ui.head({ title: 'Room settings', sub: esc(room.name), back: { href: `/r/${room.slug}`, label: 'Back to the room' } })}${saved}${error}
body: `${ui.head({ title: 'Room settings', sub: esc(room.name), back: { href: `/r/${room.slug}`, label: 'Back to the room' } })}${saved}${error}
@@ -311,9 +311,9 @@ t('the site: kinds on the rooms page, the call panel, roles and attachments in s
@@ -311,9 +311,9 @@ t('the site: kinds on the rooms page, the call panel, roles and attachments in s
assert.match(r.text, /· seen <time/, 'moderators see when people were last here');
assert.match(r.text, /· seen <time/, 'moderators see when people were last here');
await api('POST', '/tea-talk/attachments', own, { service: 'community', resource: 'general', title: 'General <b>' });
await api('POST', '/tea-talk/attachments', own, { service: 'community', resource: 'general', title: 'General <b>' });
r = await page('/r/tea-talk/settings', own);
r = await page('/r/tea-talk/settings', own);
- assert.match(r.text, /<a href="https:\/\/openvibe\.community\/s\/general">General <b><\/a>/);
+ assert.match(r.text, /<a href="https:\/\/openvibe\.community\/forum\/general">General <b><\/a>/);
assert.match(r.text, /action="\/r\/tea-talk\/attachments\/community\/general\/detach"/);
assert.match(r.text, /action="\/r\/tea-talk\/attachments\/community\/general\/detach"/);
- assert.ok(!(await page('/r/tea-talk', own)).text.includes('openvibe.community/s/general'), 'the room page itself makes no claim about the space');
+ assert.ok(!(await page('/r/tea-talk', own)).text.includes('openvibe.community/forum/general'), 'the room page itself makes no claim about the space');
r = await page('/r/openvibe-news', out);
r = await page('/r/openvibe-news', out);
assert.match(r.text, /Announcements from OpenVibe staff/);
assert.match(r.text, /Announcements from OpenVibe staff/);