Node.js based forum software built for the modern web
feat: help modal for world page
Julian Lamcf291a518d68
diff --git a/install/package.json b/install/package.jsonindex 07b8dc8501..0385337da9 100644--- a/install/package.json+++ b/install/package.json@@ -103,7 +103,7 @@"nodebb-plugin-ntfy": "1.7.4","nodebb-plugin-spam-be-gone": "2.2.2","nodebb-rewards-essentials": "1.0.0",- "nodebb-theme-harmony": "2.0.0-pre.18",+ "nodebb-theme-harmony": "2.0.0-pre.19","nodebb-theme-lavender": "7.1.8","nodebb-theme-peace": "2.2.4","nodebb-theme-persona": "13.3.18",diff --git a/public/language/en-GB/activitypub.json b/public/language/en-GB/activitypub.jsonindex 82f562a812..54fa13b6e3 100644--- a/public/language/en-GB/activitypub.json+++ b/public/language/en-GB/activitypub.json@@ -1,9 +1,18 @@{"world.name": "World",- "world.description": "This forum is federated, and can interact with the social web (or \"fediverse\"). Your corner of the fediverse consists of topics created by — and shared from — from users you follow.",- "world.popular": "Popular topics from the past day",+ "world.description": "",+ "world.popular": "Popular topics",+ "world.recent": "All topics",+ "world.help": "Help","no-topics": "This forum doesn't know of any other topics yet.",+ "help.title": "What is this page?",+ "help.intro": "Welcome to your corner of the fediverse.",+ "help.fediverse": "The \"fediverse\" is a network of interconnected applications and websites that all talk to one another and whose users can see each other. This forum is federated, and can interact with that social web (or \"fediverse\"). This page is your corner of the fediverse. It consists solely of topics created by — and shared from — users <strong>you</strong> follow.",+ "help.build": "There might not be a lot of topics here to start; that's normal. You will start to see more content here over time when you start following other users.",+ "help.federating": "Likewise, if users from outside of this forum start following <em>you</em>, then your posts will start appearing on those apps and websites as well.",+ "help.next-generation": "This is the next generation of social media, start contributing today!",+"topic-event-announce-ago": "%1 shared <a href=\"%2\">this post</a> %3","topic-event-announce-on": "%1 shared <a href=\"%2\">this post</a> on %3"}\ No newline at end of filediff --git a/public/src/client/world.js b/public/src/client/world.jsindex 8ab38a02c1..84ed411d26 100644--- a/public/src/client/world.js+++ b/public/src/client/world.js@@ -1,6 +1,6 @@'use strict';-define('forum/world', ['topicList', 'sort', 'hooks', 'alerts', 'api'], function (topicList, sort, hooks, alerts, api) {+define('forum/world', ['topicList', 'sort', 'hooks', 'alerts', 'api', 'bootbox'], function (topicList, sort, hooks, alerts, api, bootbox) {const World = {};World.init = function () {@@ -10,6 +10,7 @@ define('forum/world', ['topicList', 'sort', 'hooks', 'alerts', 'api'], functionsort.handleSort('categoryTopicSort', 'world');handleIgnoreWatch(-1);+ handleHelp();hooks.fire('action:topics.loaded', { topics: ajaxify.data.topics });hooks.fire('action:category.loaded', { cid: ajaxify.data.cid });@@ -42,5 +43,28 @@ define('forum/world', ['topicList', 'sort', 'hooks', 'alerts', 'api'], function});}+ function handleHelp() {+ const trigger = document.getElementById('world-help');+ if (!trigger) {+ return;+ }++ const content = [+ '<p class="lead">[[activitypub:help.intro]]</p>',+ '<p>[[activitypub:help.fediverse]]</p>',+ '<p>[[activitypub:help.build]]</p>',+ '<p>[[activitypub:help.federating]]</p>',+ '<p>[[activitypub:help.next-generation]]</p>',+ ];++ trigger.addEventListener('click', () => {+ bootbox.dialog({+ title: '[[activitypub:help.title]]',+ message: content.join('\n'),+ size: 'large',+ });+ });+ }+return World;});diff --git a/src/categories/data.js b/src/categories/data.jsindex 9173e9ae9c..452ccf20b8 100644--- a/src/categories/data.js+++ b/src/categories/data.js@@ -16,7 +16,7 @@ const intFields = [const worldCategory = {cid: -1,name: 'Uncategorized',- description: 'Pseudo-category containing topics that do not strictly fit in with any existing categories',+ description: 'Topics that do not strictly fit in with any existing categories',icon: 'fa-globe',imageClass: 'cover',bgColor: '#eee',diff --git a/src/controllers/activitypub/topics.js b/src/controllers/activitypub/topics.jsindex 7022ba5ae9..d8ea8dd00e 100644--- a/src/controllers/activitypub/topics.js+++ b/src/controllers/activitypub/topics.js@@ -68,8 +68,6 @@ controller.list = async function (req, res) {targetUid: targetUid,});data.name = '[[activitypub:world.name]]';- data.description = '[[activitypub:world.description]]';- data.descriptionParsed = data.description;delete data.children;data.topicCount = await db.sortedSetIntersectCard(sets);