nodebb-theme-harmony 3.0.0-beta.2 → 3.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-theme-harmony",
3
- "version": "3.0.0-beta.2",
3
+ "version": "3.0.1",
4
4
  "nbbpm": {
5
5
  "compatibility": "^4.14.0"
6
6
  },
package/public/harmony.js CHANGED
@@ -141,7 +141,7 @@ $(document).ready(function () {
141
141
  }
142
142
 
143
143
  function setupDrafts() {
144
- require(['composer/drafts', 'bootbox', 'api'], function (drafts, bootbox, api) {
144
+ require(['composer/drafts', 'modals', 'api'], function (drafts, modals, api) {
145
145
  const draftsEl = $('[component="sidebar/drafts"]');
146
146
  const bottomBarDraftsEl = $('[component="bottombar"] [component="sidebar/drafts"]');
147
147
  function updateBadgeCount() {
@@ -183,7 +183,7 @@ $(document).ready(function () {
183
183
 
184
184
  draftsEl.on('click', '[component="drafts/delete"]', function () {
185
185
  const save_id = $(this).attr('data-save-id');
186
- bootbox.confirm({
186
+ modals.confirm({
187
187
  title: '[[modules:bootbox.confirm]]',
188
188
  message: '[[modules:composer.discard-draft-confirm]]',
189
189
  callback: function (ok) {
@@ -151,7 +151,7 @@
151
151
  {{{ end }}}
152
152
  </div>
153
153
  <p class="mb-1">
154
- <span class="reason">[[user:info.banned-reason-label]]: <strong>{./reason}</strong></span>
154
+ <span class="reason">[[user:info.banned-reason-label]]: <strong>{tx(./reason)}</strong></span>
155
155
  </p>
156
156
  <p>
157
157
  {{{ if ./until }}}
@@ -205,7 +205,7 @@
205
205
  {{{ end }}}
206
206
  </div>
207
207
  <p class="mb-1">
208
- <span class="reason">[[user:info.banned-reason-label]]: <strong>{./reason}</strong></span>
208
+ <span class="reason">[[user:info.banned-reason-label]]: <strong>{tx(./reason)}</strong></span>
209
209
  </p>
210
210
  <p>
211
211
  {{{ if ./until }}}
@@ -21,7 +21,7 @@
21
21
  </div>
22
22
 
23
23
  {{{ if !posts.length }}}
24
- <div class="alert alert-warning text-center">{noItemsFoundKey}</div>
24
+ <div class="alert alert-warning text-center">{tx(noItemsFoundKey)}</div>
25
25
  {{{ end }}}
26
26
 
27
27
  <div>
@@ -7,7 +7,7 @@
7
7
  </div>
8
8
 
9
9
  {{{ if !topics.length }}}
10
- <div class="alert alert-warning text-center">{noItemsFoundKey}</div>
10
+ <div class="alert alert-warning text-center">{tx(noItemsFoundKey)}</div>
11
11
  {{{ end }}}
12
12
 
13
13
  <div class="category">
@@ -32,7 +32,7 @@
32
32
 
33
33
 
34
34
  {{{ if !topics.length }}}
35
- <div class="alert alert-warning text-center">{noItemsFoundKey}</div>
35
+ <div class="alert alert-warning text-center">{tx(noItemsFoundKey)}</div>
36
36
  {{{ end }}}
37
37
 
38
38
  <div class="category">
@@ -8,7 +8,7 @@
8
8
  </div>
9
9
  <div class="post-content text-xs text-break line-clamp-sm-2 lh-sm position-relative flex-fill">
10
10
  <a class="stretched-link" tabindex="-1" href="{config.relative_path}/topic/{./topic.slug}{{{ if ./index }}}/{./index}{{{ end }}}" aria-label="[[global:lastpost]]"></a>
11
- {{./content}}
11
+ {{renderContent(./content, ./deleted)}}
12
12
  </div>
13
13
  </div>
14
14
  {{{ end }}}
@@ -1,3 +1,3 @@
1
1
  {{{ each tags }}}
2
- <a href="{config.relative_path}/tags/{./valueEncoded}"><span class="badge border border-gray-300 fw-normal tag tag-class-{./class}" data-tag="{./value}">{./valueEscaped}</span></a>
2
+ <a href="{config.relative_path}/tags/{./valueEncoded}"><span class="badge border border-gray-300 fw-normal tag tag-class-{./class}" data-tag="{./value}">{./value}</span></a>
3
3
  {{{ end }}}
@@ -14,14 +14,14 @@
14
14
  </div>
15
15
 
16
16
  <div component="post/content" class="content text-sm text-break">
17
- {{./content}}
17
+ {{renderContent(./content, ./deleted)}}
18
18
  </div>
19
19
  </div>
20
20
  <div class="mb-3 d-flex flex-wrap gap-1 w-100">
21
21
  {{buildCategoryLabel(./category, "a", "border")}}
22
22
  <span data-tid="{./topic.tid}" component="topic/tags" class="lh-1 tag-list d-flex flex-wrap gap-1 {{{ if !./topic.tags.length }}}hidden{{{ end }}}">
23
23
  {{{ each ./topic.tags }}}
24
- <a href="{config.relative_path}/tags/{./valueEncoded}"><span class="badge border border-gray-300 fw-normal tag tag-class-{./class}" data-tag="{./value}">{./valueEscaped}</span></a>
24
+ <a href="{config.relative_path}/tags/{./valueEncoded}"><span class="badge border border-gray-300 fw-normal tag tag-class-{./class}" data-tag="{./value}">{./value}</span></a>
25
25
  {{{ end }}}
26
26
  </span>
27
27
  </div>
@@ -3,7 +3,7 @@
3
3
  <div class="post-search-item">
4
4
  <div component="category/filter" class="dropdown" data-filter-name="category">
5
5
  <a component="category/filter/button" class="filter-btn btn btn-light btn-sm border {{{ if filters.categories.active }}}active-filter{{{ end }}} dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" data-bs-auto-close="outside" aria-haspopup="true" aria-expanded="false">
6
- <span class="filter-label">{{{ if filters.categories.active }}}{filters.categories.label}{{{ else }}}[[search:categories]]{{{ end }}}</span>
6
+ <span class="filter-label">{{{ if filters.categories.active }}}{tx(filters.categories.label)}{{{ else }}}[[search:categories]]{{{ end }}}</span>
7
7
  <span class="caret text-primary opacity-75"></span>
8
8
  </a>
9
9
 
@@ -29,7 +29,7 @@
29
29
  <div class="post-search-item">
30
30
  <div component="tag/filter" class="dropdown" data-filter-name="tag">
31
31
  <a component="tag/filter/button" class="filter-btn btn btn-light btn-sm border {{{ if filters.tags.active }}}active-filter{{{ end }}} dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" data-bs-auto-close="outside" aria-haspopup="true" aria-expanded="false">
32
- <span class="filter-label">{{{ if filters.tags.active }}}{filters.tags.label}{{{ else }}}[[search:tags]]{{{ end }}}</span>
32
+ <span class="filter-label">{{{ if filters.tags.active }}}{{tx(filters.tags.label)}}{{{ else }}}[[search:tags]]{{{ end }}}</span>
33
33
  <span class="caret text-primary opacity-75"></span>
34
34
  </a>
35
35
 
@@ -39,15 +39,15 @@
39
39
  <div component="tag/filter/selected" class="d-flex flex-wrap gap-2">
40
40
  {{{ each tagFilterSelected }}}
41
41
  <div class="d-flex px-2 py-1 rounded-1 text-bg-primary gap-2 align-items-center text-sm">
42
- <div>{./valueEscaped}</div>
43
- <button component="tag/filter/delete" data-tag="{./valueEscaped}" class="btn btn-primary btn-sm py-0"><i class="fa fa-times fa-xs"></i></button>
42
+ <div>{./value}</div>
43
+ <button component="tag/filter/delete" data-tag="{./value}" class="btn btn-primary btn-sm py-0"><i class="fa fa-times fa-xs"></i></button>
44
44
  </div>
45
45
  {{{ end }}}
46
46
  </div>
47
47
  <hr class="my-2"/>
48
48
  <div component="tag/filter/results" class="d-flex flex-wrap gap-2">
49
49
  {{{ each tagFilterResults }}}
50
- <button class="btn btn-light btn-sm border" data-tag="{./valueEscaped}">{./valueEscaped}</button>
50
+ <button class="btn btn-light btn-sm border" data-tag="{./value}">{./value}</button>
51
51
  {{{ end }}}
52
52
  </div>
53
53
  </li>
@@ -59,7 +59,7 @@
59
59
  <div class="post-search-item">
60
60
  <div component="user/filter" class="dropdown" data-filter-name="user">
61
61
  <a component="user/filter/button" class="filter-btn btn btn-light btn-sm border {{{ if filters.users.active }}}active-filter{{{ end }}} dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" data-bs-auto-close="outside" aria-haspopup="true" aria-expanded="false">
62
- <span class="filter-label">{{{ if filters.users.active }}}{filters.users.label}{{{ else }}}[[search:posted-by]]{{{ end }}}</span>
62
+ <span class="filter-label">{{{ if filters.users.active }}}{{tx(filters.users.label)}}{{{ else }}}[[search:posted-by]]{{{ end }}}</span>
63
63
  <span class="caret text-primary opacity-75"></span>
64
64
  </a>
65
65
 
@@ -90,7 +90,7 @@
90
90
  <div class="post-search-item">
91
91
  <div class="dropdown" data-filter-name="replies">
92
92
  <a id="reply-count-button" class="filter-btn btn btn-light btn-sm border {{{ if filters.replies.active }}}active-filter{{{ end }}} dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
93
- <span class="filter-label">{{{ if filters.replies.active }}}{filters.replies.label}{{{ else }}}[[search:replies]]{{{ end }}}</span>
93
+ <span class="filter-label">{{{ if filters.replies.active }}}{tx(filters.replies.label)}{{{ else }}}[[search:replies]]{{{ end }}}</span>
94
94
  <span class="caret text-primary opacity-75"></span>
95
95
  </a>
96
96
 
@@ -110,7 +110,7 @@
110
110
  <div class="post-search-item">
111
111
  <div class="dropdown" data-filter-name="time">
112
112
  <a id="post-time-button" class="filter-btn btn btn-light btn-sm border {{{ if filters.time.active }}}active-filter{{{ end }}} dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
113
- <span class="filter-label">{{{ if filters.time.active }}}{filters.time.label}{{{ else }}}[[search:time]]{{{ end }}}</span>
113
+ <span class="filter-label">{{{ if filters.time.active }}}{tx(filters.time.label)}{{{ else }}}[[search:time]]{{{ end }}}</span>
114
114
  <span class="caret text-primary opacity-75"></span>
115
115
  </a>
116
116
 
@@ -139,7 +139,7 @@
139
139
  <div class="post-search-item">
140
140
  <div class="dropdown" data-filter-name="sort">
141
141
  <a id="sort-by-button" class="filter-btn btn btn-light btn-sm border {{{ if filters.sort.active }}}active-filter{{{ end }}} dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
142
- <span class="filter-label">{{{ if filters.sort.active }}}{filters.sort.label}{{{ else }}}[[search:sort]]{{{ end }}}</span>
142
+ <span class="filter-label">{{{ if filters.sort.active }}}{tx(filters.sort.label)}{{{ else }}}[[search:sort]]{{{ end }}}</span>
143
143
  <span class="caret text-primary opacity-75"></span>
144
144
  </a>
145
145
 
@@ -37,12 +37,12 @@
37
37
  <div class="d-grid" style="grid-template-columns: 1fr 1fr;">
38
38
  {{{ each bootswatchSkinOptions.default }}}
39
39
  <li>
40
- <a href="#" class="dropdown-item rounded-1" data-value="{./value}" role="menuitem">{./name} <i class="fa fa-fw fa-check {{{ if !./selected }}} invisible {{{ end }}}"></i></a>
40
+ <a href="#" class="dropdown-item rounded-1" data-value="{./value}" role="menuitem">{tx(./name)} <i class="fa fa-fw fa-check {{{ if !./selected }}} invisible {{{ end }}}"></i></a>
41
41
  </li>
42
42
  {{{ end }}}
43
43
  {{{ each bootswatchSkinOptions.custom }}}
44
44
  <li>
45
- <a href="#" class="dropdown-item rounded-1" data-value="{./value}" role="menuitem">{./name} <i class="fa fa-fw fa-check {{{ if !./selected }}} invisible {{{ end }}}"></i></a>
45
+ <a href="#" class="dropdown-item rounded-1" data-value="{./value}" role="menuitem">{tx(./name)} <i class="fa fa-fw fa-check {{{ if !./selected }}} invisible {{{ end }}}"></i></a>
46
46
  </li>
47
47
  {{{ end }}}
48
48
  </div>
@@ -0,0 +1,4 @@
1
+ <span class="badge border {./classes}">
2
+ {{{ if ./icon }}}<i class="fa {./icon}"></i>{{{ end }}}
3
+ {{{ if ./label }}}<span> {tx(./label)}</span>{{{ end }}}
4
+ </span>
@@ -8,4 +8,4 @@
8
8
  <span class="timeago text-nowrap text-muted" title="{post.timestampISO}"></span>
9
9
  </div>
10
10
 
11
- <div class="text-sm">{{post.content}}</div>
11
+ <div class="text-sm">{{renderContent(post.content, post.deleted)}}</div>
@@ -78,7 +78,7 @@
78
78
  </div>
79
79
 
80
80
  <div class="content text-break" component="post/content" itemprop="text">
81
- {{posts.content}}
81
+ {{renderContent(posts.content, posts.deleted)}}
82
82
  </div>
83
83
 
84
84
  <div component="post/footer" class="post-footer border-bottom pb-2">
@@ -98,7 +98,7 @@
98
98
  {{{ end }}}
99
99
  </span>
100
100
 
101
- <span class="ms-2 replies-count fw-semibold text-nowrap" component="post/reply-count/text" data-replies="{posts.replies.count}">{posts.replies.text}</span>
101
+ <span class="ms-2 replies-count fw-semibold text-nowrap" component="post/reply-count/text" data-replies="{posts.replies.count}">{tx(posts.replies.text)}</span>
102
102
  <span class="ms-2 replies-last hidden-xs fw-semibold">[[topic:last-reply-time]] <span class="timeago" title="{posts.replies.timestampISO}"></span></span>
103
103
 
104
104
  <i class="fa fa-fw fa-chevron-down" component="post/replies/open"></i>
@@ -1 +1 @@
1
- <a href="{config.relative_path}/tags/{./valueEncoded}"><span class="badge border border-gray-300 text-xs tag tag-class-{./class}" data-tag="{./value}">{./valueEscaped}</span></a>
1
+ <a href="{config.relative_path}/tags/{./valueEncoded}"><span class="badge border border-gray-300 text-xs tag tag-class-{./class}" data-tag="{./value}">{./value}</span></a>
@@ -21,7 +21,7 @@
21
21
  </div>
22
22
  <div class="flex-grow-1 d-flex flex-wrap gap-1 position-relative">
23
23
  <h3 component="topic/header" class="title text-break text-wrap-pretty fs-5 fw-semibold m-0 tracking-tight w-100 {{{ if showSelect }}}me-4 me-lg-0{{{ end }}}">
24
- <a class="text-reset" href="{{{ if topics.noAnchor }}}#{{{ else }}}{config.relative_path}/topic/{./slug}{{{ if ./bookmark }}}/{./bookmark}{{{ end }}}{{{ end }}}">{./title}</a>
24
+ <a class="text-reset" href="{{{ if topics.noAnchor }}}#{{{ else }}}{config.relative_path}/topic/{./slug}{{{ if ./bookmark }}}/{./bookmark}{{{ end }}}{{{ end }}}">{renderContent(./title, ./deleted)}</a>
25
25
  </h3>
26
26
  <span component="topic/labels" class="d-flex flex-wrap gap-1 w-100">
27
27
  <span component="topic/watched" class="badge border border-gray-300 text-body {{{ if !./followed }}}hidden{{{ end }}}">
@@ -48,7 +48,7 @@
48
48
  <i class="fa fa-arrow-circle-right"></i>
49
49
  <span>[[topic:moved]]</span>
50
50
  </span>
51
- {{{each ./icons}}}<span class="lh-1">{@value}</span>{{{end}}}
51
+ {{{ each ./icons }}}<!-- IMPORT partials/topic/icon.tpl -->{{{ end }}}
52
52
 
53
53
  {{{ if (!template.category || (cid != ./cid)) }}}
54
54
  {{buildCategoryLabel(./category, "a", "border")}}
@@ -56,7 +56,7 @@
56
56
 
57
57
  <span data-tid="{./tid}" component="topic/tags" class="lh-1 tag-list d-flex flex-wrap gap-1 {{{ if !./tags.length }}}hidden{{{ end }}}">
58
58
  {{{ each ./tags }}}
59
- <a href="{config.relative_path}/tags/{./valueEncoded}"><span class="badge border border-gray-300 fw-normal tag tag-class-{./class}" data-tag="{./value}">{./valueEscaped}</span></a>
59
+ <a href="{config.relative_path}/tags/{./valueEncoded}"><span class="badge border border-gray-300 fw-normal tag tag-class-{./class}" data-tag="{./value}">{./value}</span></a>
60
60
  {{{ end }}}
61
61
  </span>
62
62
 
@@ -119,7 +119,7 @@
119
119
  </div>
120
120
  <div class="post-content text-xs ps-2 line-clamp-sm-2 lh-sm text-break position-relative flex-fill">
121
121
  <a class="stretched-link" tabindex="-1" href="{config.relative_path}/topic/{./slug}/{./teaser.index}" aria-label="[[global:lastpost]]"></a>
122
- {{./teaser.content}}
122
+ {{renderContent(./teaser.content)}}
123
123
  </div>
124
124
  {{{ end }}}
125
125
  {{{ end }}}
@@ -34,7 +34,7 @@
34
34
  <a component="topic/moved" href="{config.relative_path}/category/{oldCid}" class="badge border border-gray-300 text-body text-decoration-none {{{ if (!oldCid || (oldCid == "-1")) }}}hidden{{{ end }}}">
35
35
  <i class="fa fa-arrow-circle-right"></i> {{{ if privileges.isAdminOrMod }}}[[topic:moved-from, {oldCategory.name}]]{{{ else }}}[[topic:moved]]{{{ end }}}
36
36
  </a>
37
- {{{each icons}}}<span class="lh-1">{@value}</span>{{{end}}}
37
+ {{{ each ./icons }}}<!-- IMPORT partials/topic/icon.tpl -->{{{ end }}}
38
38
  </span>
39
39
  {{buildCategoryLabel(category, "a", "border")}}
40
40
  <div data-tid="{./tid}" component="topic/tags" class="lh-1 tags tag-list d-flex flex-wrap hidden-xs hidden-empty gap-2"><!-- IMPORT partials/topic/tags.tpl --></div>