nodebb-theme-persona 13.3.36 → 14.0.0-pre.2

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/library.js CHANGED
@@ -51,7 +51,7 @@ library.defineWidgetAreas = async function (areas) {
51
51
  const templates = [
52
52
  'categories.tpl', 'category.tpl', 'topic.tpl', 'users.tpl',
53
53
  'unread.tpl', 'recent.tpl', 'popular.tpl', 'top.tpl', 'tags.tpl', 'tag.tpl',
54
- 'login.tpl', 'register.tpl',
54
+ 'login.tpl', 'register.tpl', 'world.tpl',
55
55
  ];
56
56
  function capitalizeFirst(str) {
57
57
  return str.charAt(0).toUpperCase() + str.slice(1);
@@ -93,5 +93,3 @@ library.getThemeConfig = async function (config) {
93
93
  config.enableQuickReply = settings.enableQuickReply === 'on';
94
94
  return config;
95
95
  };
96
-
97
-
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "nodebb-theme-persona",
3
- "version": "13.3.36",
3
+ "version": "14.0.0-pre.2",
4
4
  "nbbpm": {
5
- "compatibility": "^3.7.0"
5
+ "compatibility": "^4.0.0"
6
6
  },
7
7
  "description": "Persona theme for NodeBB",
8
8
  "main": "library.js",
@@ -1,4 +1,4 @@
1
- .categories, .category > ul {
1
+ .categories, .category > ul, .world > ul {
2
2
  list-style-type: none;
3
3
  padding: 0;
4
4
 
@@ -1,4 +1,4 @@
1
- .category {
1
+ .category, .world {
2
2
 
3
3
  .topic-list {
4
4
  overflow: visible;
package/scss/mixins.scss CHANGED
@@ -23,6 +23,20 @@
23
23
  z-index: 1;
24
24
  box-shadow: 0 0 0 ($spacer * .5) $body-bg;
25
25
  }
26
+
27
+ [component="user/locality"] {
28
+ transform: translate(-75%, -100%);
29
+ z-index: 2;
30
+ background-color: $body-bg;
31
+ font-size: .75rem;
32
+ margin-left: -15px;
33
+ }
34
+
35
+ [component="user/status"] {
36
+ transform: translate(-80%, -100%);
37
+ z-index: 2;
38
+ margin-left: -15px;
39
+ }
26
40
  }
27
41
 
28
42
  @include media-breakpoint-down(sm) {
@@ -81,6 +95,16 @@
81
95
  }
82
96
  }
83
97
  }
98
+
99
+ [component="user/status"] {
100
+ padding: 5px;
101
+ top: 36px;
102
+ left: 36px;
103
+ }
104
+
105
+ [component="user/locality"] {
106
+ font-size: .75rem;
107
+ }
84
108
  }
85
109
  }
86
110
 
package/scss/persona.scss CHANGED
@@ -8,6 +8,7 @@
8
8
  @import "noscript";
9
9
  @import "categories";
10
10
  @import "header";
11
+ @import "status";
11
12
  @import "account";
12
13
  @import "groups";
13
14
  @import "chats";
@@ -0,0 +1,25 @@
1
+ .status {
2
+ padding: 3px;
3
+
4
+ &.online {
5
+ background-color: $success;
6
+ }
7
+
8
+ &.away {
9
+ background-color: $warning;
10
+ }
11
+
12
+ &.dnd {
13
+ background-color: $danger;
14
+ }
15
+
16
+ &.offline {
17
+ background-color: $gray-600;
18
+ }
19
+ }
20
+
21
+ @include media-breakpoint-up(sm) {
22
+ .status {
23
+ padding: 5px;
24
+ }
25
+ }
@@ -119,7 +119,7 @@
119
119
  <h2 class="h4">[[flags:quick-actions]]</h2>
120
120
 
121
121
  <div class="d-grid gap-1">
122
- <a class="btn btn-light" href="{config.relative_path}/{type_path}/{targetId}">
122
+ <a class="btn btn-light" href="{config.relative_path}/{type_path}/{encodeURIComponent(targetId)}">
123
123
  <i class="fa fa-external-link"></i>
124
124
  [[flags:go-to-target]]
125
125
  </a>
@@ -21,6 +21,7 @@
21
21
  <ul class="dropdown-menu" role="menu">
22
22
  <li><a href="#" class="dropdown-item" data-action="bulk-assign" role="menuitem">[[flags:assign-to-me]]</a></li>
23
23
  <li><a href="#" class="dropdown-item" data-action="bulk-mark-resolved" role="menuitem">[[flags:bulk-resolve]]</a></li>
24
+ <li><a href="#" class="dropdown-item" data-action="bulk-purge" role="menuitem">[[flags:bulk-purge]]</a></li>
24
25
  </ul>
25
26
  </div>
26
27
 
@@ -15,7 +15,10 @@
15
15
  </li>
16
16
  <!-- ENDIF canChat -->
17
17
  <li>
18
- <a class="dropdown-item" component="account/flag" href="#" role="menuitem">[[user:flag-profile]]</a>
18
+ <a {{{if flagId }}}hidden{{{end}}} class="dropdown-item" component="account/flag" href="#" role="menuitem">[[user:flag-profile]]</a>
19
+ </li>
20
+ <li>
21
+ <a {{{if !flagId }}}hidden{{{end}}} class="dropdown-item" component="account/already-flagged" href="#" role="menuitem" data-flag-id="{flagId}">[[user:profile-flagged]]</a>
19
22
  </li>
20
23
  <li>
21
24
  <a class="dropdown-item {{{ if ./isBlocked }}}hidden{{{ end }}}" component="account/block" href="#" role="menuitem">[[user:block-user]]</a>
@@ -31,7 +31,7 @@
31
31
  </div>
32
32
  </div>
33
33
  <div>
34
- <button class="mark-read btn btn-ghost btn-sm d-flex align-items-center justify-content-center flex-grow-0 flex-shrink-0 p-1" style="width: 1.5rem; height: 1.5rem;">
34
+ <button class="mark-read btn-ghost-sm" style="width: 1.5rem; height: 1.5rem;">
35
35
  <i class="unread fa fa-2xs fa-circle text-primary"></i>
36
36
  </button>
37
37
  </div>
@@ -1,6 +1,6 @@
1
1
  <li component="post" class="posts-list-item row<!-- IF ../deleted --> deleted<!-- ELSE --><!-- IF ../topic.deleted --> deleted<!-- ENDIF --><!-- ENDIF -->{{{ if ../topic.scheduled }}} scheduled{{{ end }}}" data-pid="{../pid}" data-uid="{../uid}">
2
2
  <div class="col-lg-11 col-sm-10 col-9 post-body">
3
- <a class="topic-title" href="{config.relative_path}/post/{../pid}">
3
+ <a class="topic-title" href="{config.relative_path}/post/{encodeURIComponent(../pid)}">
4
4
  <!-- IF !../isMainPost -->RE: <!-- ENDIF -->{../topic.title}
5
5
  </a>
6
6
 
@@ -12,7 +12,7 @@
12
12
  <div class="card-body">
13
13
  <div>
14
14
  <a href="{config.relative_path}/user/{./user.userslug}">{buildAvatar(./user, "24px", true)}</a>
15
- <span class="search-result-text search-result-title"><a href="{config.relative_path}/post/{posts.pid}">{./topic.title}</a></span>
15
+ <span class="search-result-text search-result-title"><a href="{config.relative_path}/post/{encodeURIComponent(posts.pid)}">{./topic.title}</a></span>
16
16
  </div>
17
17
 
18
18
  {{{ if showAsPosts }}}
@@ -84,11 +84,24 @@
84
84
  </li>
85
85
  {{{ end }}}
86
86
 
87
+ {{{ if !posts.display_original_url }}}
87
88
  <li>
88
89
  <a class="dropdown-item d-flex align-items-center gap-2" role="menuitem" href="#" data-clipboard-text="{posts.absolute_url}">
89
90
  <i class="fa fa-fw fa-link"></i> [[topic:copy-permalink]]
90
91
  </a>
91
92
  </li>
93
+ {{{ else }}}
94
+ <li>
95
+ <a class="dropdown-item" role="menuitem" href="#" data-clipboard-text="{{{ if posts.url }}}{posts.url}{{{ else }}}{posts.pid}{{{ end }}}">
96
+ <i class="fa fa-fw fa-link"></i> [[topic:copy-permalink]]
97
+ </a>
98
+ </li>
99
+ <li>
100
+ <a class="dropdown-item" role="menuitem" href="{{{ if posts.url }}}{posts.url}{{{ else }}}{posts.pid}{{{ end }}}">
101
+ <i class="fa fa-fw fa-external-link"></i> [[topic:go-to-original]]
102
+ </a>
103
+ </li>
104
+ {{{ end }}}
92
105
 
93
106
  <!-- IF postSharing.length -->
94
107
  <!-- IF config.loggedIn --><li class="dropdown-divider"></li><!-- ENDIF config.loggedIn -->
@@ -108,7 +121,7 @@
108
121
  <a class="dropdown-item d-flex align-items-center gap-2" component="post/flag" role="menuitem" href="#"><i class="fa fa-fw fa-flag"></i> [[topic:flag-post]]</a>
109
122
  </li>
110
123
  <li {{{ if !posts.flags.flagged }}}hidden{{{ end }}} class="disabled text-muted">
111
- <a class="dropdown-item d-flex align-items-center gap-2" component="post/already-flagged" role="menuitem" href="#"><i class="fa fa-fw fa-flag"></i> [[topic:already-flagged]]</a>
124
+ <a class="dropdown-item d-flex align-items-center gap-2" component="post/already-flagged" role="menuitem" href="#" data-flag-id="{posts.flagId}"><i class="fa fa-fw fa-flag"></i> [[topic:already-flagged]]</a>
112
125
  </li>
113
126
 
114
127
  {{{ if (!posts.selfPost && posts.uid) }}}
@@ -10,7 +10,14 @@
10
10
  <div class="icon float-start">
11
11
  <a href="<!-- IF posts.user.userslug -->{config.relative_path}/user/{posts.user.userslug}<!-- ELSE -->#<!-- ENDIF posts.user.userslug -->">
12
12
  {buildAvatar(posts.user, "48px", true, "", "user/picture")}
13
- <i component="user/status" class="fa fa-circle status {posts.user.status}" title="[[global:{posts.user.status}]]"></i>
13
+ {{{ if ./user.isLocal }}}
14
+ <span component="user/status" class="position-absolute top-100 start-100 border border-white border-2 rounded-circle status {posts.user.status}"><span class="visually-hidden">[[global:{posts.user.status}]]</span></span>
15
+ {{{ else }}}
16
+ <span component="user/locality" class="position-absolute top-100 start-100 lh-1 border border-white border-2 rounded-circle small" title="[[global:remote-user]]">
17
+ <span class="visually-hidden">[[global:remote-user]]</span>
18
+ <i class="fa fa-globe"></i>
19
+ </span>
20
+ {{{ end }}}
14
21
  </a>
15
22
  </div>
16
23
 
@@ -99,6 +106,10 @@
99
106
  <a component="post/quote" href="#" class="btn btn-sm btn-link user-select-none <!-- IF !privileges.topics:reply -->hidden<!-- ENDIF !privileges.topics:reply -->">[[topic:quote]]</a>
100
107
  </span>
101
108
 
109
+ {{{ if ./announces }}}
110
+ <a component="post/announce-count" href="#" class="btn-ghost-sm" title="[[activitypub:announcers]]"><i class="fa fa-share-alt text-primary"></i> {./announces}</a>
111
+ {{{ end }}}
112
+
102
113
  <!-- IF !reputation:disabled -->
103
114
  <span class="votes">
104
115
  <a component="post/upvote" href="#" class="btn btn-sm btn-link <!-- IF posts.upvoted -->upvoted<!-- ENDIF posts.upvoted -->">
@@ -4,7 +4,7 @@
4
4
  <a data-uid="{loggedInUser.uid}" href="{{{ if loggedInUser.userslug }}}{config.relative_path}/user/{loggedInUser.userslug}{{{ else }}}#{{{ end }}}">
5
5
  {buildAvatar(loggedInUser, "48px", true, "", "user/picture")}
6
6
  {{{ if loggedInUser.status }}}
7
- <i component="user/status" class="fa fa-circle status {loggedInUser.status}" title="[[global:{loggedInUser.status}]]"></i>
7
+ <i component="user/status" class="fa fa-circle status position-absolute top-100 start-100 {loggedInUser.status}" title="[[global:{loggedInUser.status}]]"></i>
8
8
  {{{ end }}}
9
9
  </a>
10
10
  </div>
@@ -37,7 +37,7 @@
37
37
  <i component="topic/scheduled" class="fa fa-clock-o {{{ if !topics.scheduled }}}hidden{{{ end }}}" title="[[topic:scheduled]]"></i>
38
38
  <i component="topic/pinned" class="fa fa-thumb-tack {{{ if (topics.scheduled || !topics.pinned) }}}hidden{{{ end }}}" title="{{{ if !../pinExpiry }}}[[topic:pinned]]{{{ else }}}[[topic:pinned-with-expiry, {../pinExpiryISO}]]{{{ end }}}"></i>
39
39
  <i component="topic/locked" class="fa fa-lock {{{ if !topics.locked }}}hidden{{{ end }}}" title="[[topic:locked]]"></i>
40
- <i component="topic/moved" class="fa fa-arrow-circle-right {{{ if !topics.oldCid }}}hidden{{{ end }}}" title="[[topic:moved]]"></i>
40
+ <i component="topic/moved" class="fa fa-arrow-circle-right {{{ if (!./oldCid || (./oldCid == "-1")) }}}hidden{{{ end }}}" title="[[topic:moved]]"></i>
41
41
  {{{each topics.icons}}}{@value}{{{end}}}
42
42
 
43
43
  {{{ if topics.noAnchor }}}
@@ -47,13 +47,13 @@
47
47
  {{{ end }}}
48
48
  </h2>
49
49
  <div class="info">
50
- <!-- IF !template.category -->
50
+ {{{ if (!template.category && !template.world) }}}
51
51
  <div class="category-item d-inline-block">
52
52
  {buildCategoryIcon(./category, "24px", "rounded-circle")}
53
53
  <a class="text-muted" href="{config.relative_path}/category/{topics.category.slug}">{topics.category.name}</a>
54
54
  </div>
55
55
  &bull;
56
- <!-- ENDIF !template.category -->
56
+ {{{ end }}}
57
57
 
58
58
 
59
59
  <span data-tid="{./tid}" component="topic/tags" class="tag-list hidden-xs {{{ if !./tags.length }}}hidden{{{ end}}}">
@@ -33,7 +33,7 @@
33
33
  <span component="topic/locked" class="badge badge border border-gray-300 text-body {{{ if !locked }}}hidden{{{ end }}}">
34
34
  <i class="fa fa-lock"></i> [[topic:locked]]
35
35
  </span>
36
- <a component="topic/moved" href="{config.relative_path}/category/{oldCid}" class="badge badge border border-gray-300 text-body text-decoration-none {{{ if !oldCid }}}hidden{{{ end }}}">
36
+ <a component="topic/moved" href="{config.relative_path}/category/{oldCid}" class="badge badge border border-gray-300 text-body text-decoration-none {{{ if (!oldCid || (oldCid == "-1")) }}}hidden{{{ end }}}">
37
37
  <i class="fa fa-arrow-circle-right"></i> {{{ if privileges.isAdminOrMod }}}[[topic:moved-from, {oldCategory.name}]]{{{ else }}}[[topic:moved]]{{{ end }}}
38
38
  </a>
39
39
  {{{each icons}}}<span class="lh-1">{@value}</span>{{{end}}}
@@ -0,0 +1,59 @@
1
+ <!-- IMPORT partials/breadcrumbs.tpl -->
2
+ <div data-widget-area="header">
3
+ {{{ each widgets.header }}}
4
+ {{widgets.header.html}}
5
+ {{{ end }}}
6
+ </div>
7
+ <div class="row">
8
+ <div class="world {{{if widgets.sidebar.length }}}col-lg-9 col-sm-12{{{ else }}}col-lg-12{{{ end }}}">
9
+ {{{ if (topics.length || privileges.topics:create) }}}
10
+ <div class="topic-list-header sticky-top btn-toolbar justify-content-between py-2 mb-2 flex-nowrap">
11
+ <div class="d-flex gap-1 align-items-stretch">
12
+ {{{ if privileges.topics:create }}}
13
+ <a href="{config.relative_path}/compose?cid={cid}" component="category/post" id="new_topic" class="btn btn-primary text-nowrap" data-ajaxify="false" role="button">[[category:new-topic-button]]</a>
14
+ {{{ else }}}
15
+ {{{ if !loggedIn }}}
16
+ <a component="category/post/guest" href="{config.relative_path}/login" class="btn btn-primary">[[category:guest-login-post]]</a>
17
+ {{{ end }}}
18
+ {{{ end }}}
19
+
20
+ <a href="{url}" class="d-inline-block">
21
+ <div class="alert alert-warning h-100 m-0 px-2 py-1 d-flex gap-1 align-items-center hide" id="new-topics-alert"><i class="fa fa-fw fa-rotate-right"></i>[[recent:load-new-posts]]</div>
22
+ </a>
23
+ </div>
24
+ <div component="category/controls" class="d-flex gap-1 align-items-stretch">
25
+ <!-- IMPORT partials/category/watch.tpl -->
26
+ <!-- IMPORT partials/category/sort.tpl -->
27
+ <!-- IMPORT partials/category/tools.tpl -->
28
+ </div>
29
+ </div>
30
+ {{{ end }}}
31
+
32
+ {{{ if (!topics.length && privileges.topics:create)}}}
33
+ <hr class="visible-xs" />
34
+ <div class="alert alert-info" id="category-no-topics">[[activitypub:no-topics]]</div>
35
+ {{{ end }}}
36
+
37
+ <!-- IMPORT partials/topics_list.tpl -->
38
+
39
+ {{{ if config.usePagination }}}
40
+ <!-- IMPORT partials/paginator.tpl -->
41
+ {{{ end }}}
42
+ </div>
43
+ <div data-widget-area="sidebar" class="col-lg-3 col-sm-12 {{{ if !widgets.sidebar.length }}}hidden{{{ end }}}">
44
+ {{{ each widgets.sidebar }}}
45
+ {{widgets.sidebar.html}}
46
+ {{{ end }}}
47
+ </div>
48
+ </div>
49
+ <div data-widget-area="footer">
50
+ {{{each widgets.footer}}}
51
+ {{widgets.footer.html}}
52
+ {{{end}}}
53
+ </div>
54
+
55
+ <!-- IF !config.usePagination -->
56
+ <noscript>
57
+ <!-- IMPORT partials/paginator.tpl -->
58
+ </noscript>
59
+ <!-- ENDIF !config.usePagination -->