nodebb-plugin-admin-chats 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/client.js +7 -4
  2. package/package.json +1 -1
package/client.js CHANGED
@@ -24,14 +24,17 @@ $(document).ready(function() {
24
24
 
25
25
  $(window).on('action:ajaxify.end', function(ev, data) {
26
26
 
27
- if (app.user.isAdmin && (data.tpl_url === 'account/profile' || ajaxify.data.template.name === 'account/profile')) {
27
+ if (app.user.isAdmin && ajaxify.data.template.name.startsWith('account/')) {
28
28
  const userSlug = ajaxify.data.userslug || (ajaxify.data.user && ajaxify.data.user.userslug);
29
+
29
30
  if (userSlug) {
30
- const buttonText = isEnglishSystem() ? "View Chats" : "צפה בצ'אטים";
31
+ const buttonText = isEnglishSystem() ? "View Chats" : "צפיה בצ'אטים";
32
+
33
+ const relativePath = config.relative_path || '';
31
34
 
32
35
  const btnHtml = `
33
36
  <li role="presentation">
34
- <a class="dropdown-item rounded-1 d-flex align-items-center gap-2" href="/user/${userSlug}/chats" role="menuitem">
37
+ <a class="dropdown-item rounded-1 d-flex align-items-center gap-2" href="${relativePath}/user/${userSlug}/chats" role="menuitem">
35
38
  <i class="far fa-fw fa-comments"></i>
36
39
  <span>${buttonText}</span>
37
40
  </a>
@@ -56,4 +59,4 @@ $(document).ready(function() {
56
59
  $(window).on('action:chat.closed', function() {
57
60
  setTimeout(replaceAdminEmptyStateText, 200);
58
61
  });
59
- });
62
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-admin-chats",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "A plugin that allows the administrator to view and manage user chats.",
5
5
  "main": "library.js",
6
6
  "dependencies": {