nodebb-theme-harmony 1.1.45 → 1.1.46

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-theme-harmony",
3
- "version": "1.1.45",
3
+ "version": "1.1.46",
4
4
  "nbbpm": {
5
5
  "compatibility": "^3.3.0"
6
6
  },
package/scss/chats.scss CHANGED
@@ -64,7 +64,7 @@ body.page-user-chats {
64
64
 
65
65
  .chat-message {
66
66
  .message-body-wrapper .controls {
67
- [data-action="restore"] {
67
+ [data-action="restore"], [data-action="unpin"] {
68
68
  display: none;
69
69
  }
70
70
  }
@@ -84,6 +84,17 @@ body.page-user-chats {
84
84
  opacity: 0.3;
85
85
  }
86
86
  }
87
+ .chat-message.pinned {
88
+ .message-body-wrapper .controls {
89
+ [data-action="pin"] {
90
+ display: none;
91
+ }
92
+
93
+ [data-action="unpin"] {
94
+ display: inline;
95
+ }
96
+ }
97
+ }
87
98
  }
88
99
  }
89
100
 
@@ -37,6 +37,7 @@
37
37
  </div>
38
38
 
39
39
  <!-- IMPORT partials/chats/user-list.tpl -->
40
+ <!-- IMPORT partials/chats/pinned-messages.tpl -->
40
41
  </div>
41
42
  {{{ end }}}
42
43
  </div>
@@ -1,4 +1,4 @@
1
- <li component="chat/message" class="chat-message mx-2 pe-2 {{{ if messages.deleted }}} deleted{{{ end }}} {{{ if messages.newSet }}}border-top pt-3{{{ end }}}" data-mid="{messages.messageId}" data-uid="{messages.fromuid}" data-self="{messages.self}" data-break="{messages.newSet}" data-timestamp="{messages.timestamp}" data-username="{messages.fromUser.username}">
1
+ <li component="chat/message" class="chat-message mx-2 pe-2 {{{ if messages.deleted }}} deleted{{{ end }}} {{{ if messages.pinned}}} pinned{{{ end }}} {{{ if messages.newSet }}}border-top pt-3{{{ end }}}" data-mid="{messages.messageId}" data-uid="{messages.fromuid}" data-self="{messages.self}" data-break="{messages.newSet}" data-timestamp="{messages.timestamp}" data-username="{messages.fromUser.username}">
2
2
 
3
3
  {{{ if messages.parent }}}
4
4
  <div class="d-flex ms-4 mb-2 align-items-center">
@@ -44,6 +44,10 @@
44
44
  <button class="btn btn-sm btn-link" data-action="delete" title="[[topic:delete]]"><i class="fa fa-trash"></i></button>
45
45
  <button class="btn btn-sm btn-link" data-action="restore" title="[[topic:restore]]"><i class="fa fa-repeat"></i></button>
46
46
  {{{ end }}}
47
+ {{{ if (isAdminOrGlobalMod || isOwner )}}}
48
+ <button class="btn btn-sm btn-link" data-action="pin" title="[[modules:chat.pin-message]]"><i class="fa fa-thumbtack"></i></button>
49
+ <button class="btn btn-sm btn-link" data-action="unpin" title="[[modules:chat.unpin-message]]"><i class="fa fa-thumbtack fa-rotate-90"></i></button>
50
+ {{{ end }}}
47
51
  {{{ if isAdminOrGlobalMod }}}
48
52
  <button class="btn btn-sm btn-link chat-ip-button" title="[[modules:chat.show-ip]]"><i class="fa fa-info-circle"></i></button>
49
53
  {{{ end }}}
@@ -42,6 +42,11 @@
42
42
  </ul>
43
43
  </div>
44
44
 
45
+ <!-- pinned messages -->
46
+ <button component="chat/pinned/messages/btn" class="btn-ghost-sm d-none d-lg-flex flex-nowrap" title="[[modules:chat.pinned-messages]]" data-bs-toggle="tooltip" data-bs-placement="bottom">
47
+ <i class="fa fa-thumb-tack text-muted"></i>
48
+ </button>
49
+
45
50
  <!-- manage/options dropdown -->
46
51
  <div class="dropdown d-flex" data-manual-tooltip="1" title="[[modules:chat.options]]">
47
52
  <button class="btn-ghost-sm" data-bs-toggle="dropdown" component="chat/controlsToggle">
@@ -0,0 +1,35 @@
1
+ <div component="chat/messages/pinned/container" class="d-flex flex-column expanded-chat border-start hidden" style="min-width:340px; width: 340px;">
2
+ <h3 class="fs-6 p-1 mb-0 text-center text-secondary">[[modules:chat.pinned-messages]]</h3>
3
+
4
+ <div component="chat/messages/pinned/empty" class="text-center p-4 d-flex flex-column">
5
+ <div class="p-4"><i class="fa-solid fa-wind fs-2 text-muted"></i></div>
6
+ <div class="text-xs fw-semibold text-muted">[[modules:chat.no-pinned-messages]]</div>
7
+ </div>
8
+
9
+ <ul component="chat/messages/pinned" class="chat-content list-unstyled d-flex flex-column gap-1 p-1 overflow-auto">
10
+ {{{ each messages }}}
11
+ <li component="chat/message" class="chat-message mx-2 pe-2 {{{ if messages.deleted }}} deleted{{{ end }}} {{{ if messages.pinned}}} pinned{{{ end }}} border-top pt-3" data-mid="{messages.messageId}" data-uid="{messages.fromuid}" data-self="{messages.self}" data-timestamp="{messages.timestamp}" data-username="{messages.fromUser.username}" data-index="{./index}">
12
+
13
+ <div class="message-header lh-1 d-flex align-items-center gap-2 text-sm pb-2">
14
+ <a href="{config.relative_path}/user/{messages.fromUser.userslug}" class="text-decoration-none">{buildAvatar(messages.fromUser, "18px", true, "not-responsive")}</a>
15
+ <span class="chat-user fw-semibold"><a href="{config.relative_path}/user/{messages.fromUser.userslug}">{messages.fromUser.displayname}</a></span>
16
+
17
+ <span class="chat-timestamp text-muted timeago" title="{messages.timestampISO}"></span>
18
+ </div>
19
+ <div class="message-body-wrapper hover-parent">
20
+ <div component="chat/message/body" class="message-body ps-0 py-0 overflow-auto text-break">
21
+ {messages.content}
22
+ </div>
23
+ <div component="chat/message/controls" class="position-relative">
24
+ <div class="d-flex border shadow-sm controls position-absolute bg-body hover-d-block end-0" style="bottom:1rem;">
25
+ {{{ if (isAdminOrGlobalMod || isOwner )}}}
26
+ <button class="btn btn-sm btn-link" data-action="pin" title="[[modules:chat.pin-message]]"><i class="fa fa-thumbtack"></i></button>
27
+ <button class="btn btn-sm btn-link" data-action="unpin" title="[[modules:chat.unpin-message]]"><i class="fa fa-thumbtack fa-rotate-90"></i></button>
28
+ {{{ end }}}
29
+ </div>
30
+ </div>
31
+ </div>
32
+ </li>
33
+ {{{ end }}}
34
+ </ul>
35
+ </div>