diff --git a/lib/controllers.js b/lib/controllers.js index 379ec06..846d153 100644 --- a/lib/controllers.js +++ b/lib/controllers.js @@ -27,3 +27,25 @@ Controllers.renderThemeSettings = async (req, res, next) => { res.render('account/theme', userData); }; + +Controllers.renderProfilePage = (req, res) => { + res.send(` + + + + + `); + res.end(); +}; diff --git a/library.js b/library.js index ccb3414..a0eae8c 100644 --- a/library.js +++ b/library.js @@ -231,7 +231,7 @@ const getChatroomForGroup = async (slug) => { }; library.addChatToCategory = function (data, callback) { - privileges.categories.list(data.category.cid).then((res, err) => { + privileges.categories.list(data.category.cid).then((res) => { const projectGroup = res.groups.find(group => group.isPrivate && group.name.startsWith('Project ')); if (!projectGroup) { return callback(null, data); @@ -243,3 +243,11 @@ library.addChatToCategory = function (data, callback) { }); }); }; + +library.openCatalystProfilePage = async function (data) { + const config = await library.loadThemeConfig(0); + const baseUrl = config.catalystBaseUrl.endsWith('/') ? + config.catalystBaseUrl.replace('https://', '').slice(0, -1) : + config.catalystBaseUrl.replace('https://', ''); + controllers.renderProfilePage({ ...data.req, redirectUrl: `https://${baseUrl}/profile/${data.templateData.username}` }, data.res); +}; diff --git a/plugin.json b/plugin.json index c171386..5e5d91c 100644 --- a/plugin.json +++ b/plugin.json @@ -16,7 +16,8 @@ { "hook": "filter:user.whitelistFields", "method": "whitelistFields" }, { "hook": "filter:category.get", "method": "addChatToCategory"}, - { "hook": "filter:parse.post", "method": "filterProfileLinks", "priority": 11} + { "hook": "filter:parse.post", "method": "filterProfileLinks", "priority": 11}, + { "hook": "filter:account/profile.build", "method": "openCatalystProfilePage"} ], "scripts": [ diff --git a/templates/admin/plugins/harmony.tpl b/templates/admin/plugins/harmony.tpl index 7cb3dbc..2497b25 100644 --- a/templates/admin/plugins/harmony.tpl +++ b/templates/admin/plugins/harmony.tpl @@ -49,8 +49,8 @@
- - + +
diff --git a/templates/partials/chats/message.tpl b/templates/partials/chats/message.tpl deleted file mode 100644 index 938dbc7..0000000 --- a/templates/partials/chats/message.tpl +++ /dev/null @@ -1,76 +0,0 @@ -
  • - - {{{ if messages.parent }}} - - {{{ end }}} - -
    - - - - {messages.fromUser.displayname} - - {{{ if messages.fromUser.banned }}} - [[user:banned]] - {{{ end }}} - {{{ if messages.fromUser.deleted }}} - [[user:deleted]] - {{{ end }}} - - -
    -
    -
    -
    - {messages.content} -
    - -
    -
    - - - -
    - - -
    -
    -
    -
    -
  • \ No newline at end of file diff --git a/templates/partials/topic/post.tpl b/templates/partials/topic/post.tpl index 29446aa..d57febe 100644 --- a/templates/partials/topic/post.tpl +++ b/templates/partials/topic/post.tpl @@ -47,8 +47,8 @@ - - {posts.user.displayname} + {posts.user.displayname} + {{{ each posts.user.selectedGroups }}}