nodebb-theme-harmony 2.0.10 → 2.0.12

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
@@ -15,6 +15,7 @@ const defaults = {
15
15
  centerHeaderElements: 'off',
16
16
  mobileTopicTeasers: 'off',
17
17
  stickyToolbar: 'on',
18
+ topicSidebarTools: 'off',
18
19
  autohideBottombar: 'on',
19
20
  openSidebars: 'off',
20
21
  chatModals: 'off',
@@ -147,6 +148,7 @@ library.loadThemeConfig = async function (uid) {
147
148
  config.centerHeaderElements = config.centerHeaderElements === 'on';
148
149
  config.mobileTopicTeasers = config.mobileTopicTeasers === 'on';
149
150
  config.stickyToolbar = config.stickyToolbar === 'on';
151
+ config.topicSidebarTools = config.topicSidebarTools === 'on';
150
152
  config.autohideBottombar = config.autohideBottombar === 'on';
151
153
  config.openSidebars = config.openSidebars === 'on';
152
154
  config.chatModals = config.chatModals === 'on';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-theme-harmony",
3
- "version": "2.0.10",
3
+ "version": "2.0.12",
4
4
  "nbbpm": {
5
5
  "compatibility": "^3.7.0"
6
6
  },
package/scss/mixins.scss CHANGED
@@ -35,24 +35,6 @@
35
35
  margin-left: 1.5rem;
36
36
  transition: border-color 1s ease-out;
37
37
 
38
- &:first-child {
39
- &:before {
40
- content: '';
41
- position: absolute;
42
- top: 0;
43
- height: 16px;
44
- width: 16px;
45
- background-color: $border-color;
46
- border-radius: 100%;
47
- transform: translate(calc(-50% - .5px), -100%);
48
- transition: background-color 1s ease-out;
49
- }
50
-
51
- &.highlight:before {
52
- background-color: $primary;
53
- }
54
- }
55
-
56
38
  &:last-child {
57
39
  padding-bottom: 2rem;
58
40
 
@@ -21,8 +21,8 @@ body.template-topic {
21
21
  min-width: 170px;
22
22
  }
23
23
  .scroller-container {
24
- left: 10px;
25
- height: 300px;
24
+ left: 16px;
25
+ height: 275px;
26
26
  border-left: 2px solid $border-color;
27
27
 
28
28
  .scroller-thumb {
@@ -37,6 +37,17 @@
37
37
  </label>
38
38
  </div>
39
39
 
40
+ <div class="form-check form-switch mb-3">
41
+ <input class="form-check-input" type="checkbox" role="switch" id="topicSidebarTools" name="topicSidebarTools" {{{ if theme.topicSidebarTools }}}checked{{{ end }}}>
42
+ <label class="form-check-label" for="topicSidebarTools">
43
+ [[themes/harmony:settings.topicSidebarTools]]
44
+ <p class="form-text mb-0">
45
+ [[themes/harmony:settings.topicSidebarTools.help]]
46
+ </p>
47
+ </label>
48
+ </div>
49
+
50
+
40
51
  <div class="form-check form-switch mb-3">
41
52
  <input class="form-check-input" type="checkbox" role="switch" id="autohideBottombar" name="autohideBottombar" {{{ if theme.autohideBottombar }}}checked{{{ end }}}>
42
53
  <label class="form-check-label" for="autohideBottombar">
@@ -30,6 +30,15 @@
30
30
  </p>
31
31
  </div>
32
32
  </div>
33
+ <div class="form-check form-switch">
34
+ <input type="checkbox" class="form-check-input" id="topicSidebarTools" name="topicSidebarTools" />
35
+ <div for="topicSidebarTools" class="form-check-label">
36
+ [[themes/harmony:settings.topicSidebarTools]]
37
+ <p class="form-text">
38
+ [[themes/harmony:settings.topicSidebarTools.help]]
39
+ </p>
40
+ </div>
41
+ </div>
33
42
  <div class="form-check form-switch">
34
43
  <input type="checkbox" class="form-check-input" id="autohideBottombar" name="autohideBottombar" />
35
44
  <div for="autohideBottombar" class="form-check-label">
@@ -1,14 +1,8 @@
1
- <div class="{{{ if config.theme.stickyToolbar }}}sticky-tools{{{ end }}}">
1
+ <div class="{{{ if config.theme.stickyToolbar }}}sticky-tools{{{ end }}} {{{ if config.theme.topicSidebarTools }}}d-block d-lg-none{{{ end }}}">
2
2
  <nav class="d-flex flex-nowrap my-2 p-0 border-0 rounded topic-main-buttons">
3
3
  <div class="d-flex flex-row p-2 text-bg-light border rounded w-100 align-items-center">
4
4
  <div class="d-flex me-auto mb-0 gap-2 align-items-center flex-wrap">
5
- {{{ if loggedIn }}}
6
- <button component="topic/mark-unread" class="btn btn-ghost btn-sm ff-secondary d-flex gap-2 align-items-center">
7
- <i class="fa fa-fw fa-inbox text-primary"></i>
8
- <span class="d-none d-md-inline fw-semibold">[[topic:mark-unread]]</span>
9
- </button>
10
- {{{ end }}}
11
-
5
+ <!-- IMPORT partials/topic/mark-unread.tpl -->
12
6
  <!-- IMPORT partials/topic/watch.tpl -->
13
7
  <!-- IMPORT partials/topic/sort.tpl -->
14
8
  <!-- IMPORT partials/topic/tools.tpl -->
@@ -16,10 +10,6 @@
16
10
  {{{ if (!feeds:disableRSS && rssFeedUrl) }}}
17
11
  <a class="btn btn-ghost btn-sm d-none d-lg-flex align-items-center align-self-stretch" target="_blank" href="{rssFeedUrl}" title="[[global:rss-feed]]"><i class="fa fa-rss text-primary"></i></a>
18
12
  {{{ end }}}
19
-
20
- {{{ if browsingUsers }}}
21
- <div class="hidden-xs"><!-- IMPORT partials/topic/browsing-users.tpl --></div>
22
- {{{ end }}}
23
13
  </div>
24
14
  <!-- IMPORT partials/topic/reply-button.tpl -->
25
15
  </div>
@@ -8,9 +8,9 @@
8
8
  </a>
9
9
 
10
10
  <ul class="dropdown-menu p-1 text-sm" role="menu">
11
- <li class="px-3 py-1 mb-2 d-flex flex-column gap-2">
11
+ <li class="px-2 py-1 mb-2 d-flex flex-column gap-2">
12
12
  <div component="category-selector-search">
13
- <input type="text" class="form-control" component="category/filter/search" placeholder="[[search:type-a-category]]">
13
+ <input type="text" class="form-control form-control-sm" component="category/filter/search" placeholder="[[search:type-a-category]]">
14
14
  </div>
15
15
  </li>
16
16
  <div component="category/list" class="overflow-auto ghost-scrollbar" style="max-height: 350px;"></div>
@@ -34,8 +34,8 @@
34
34
  </a>
35
35
 
36
36
  <ul class="dropdown-menu p-1 text-sm" style="width: 350px;" role="menu">
37
- <li class="px-3 py-1 d-flex flex-column gap-2">
38
- <input type="text" class="form-control" component="tag/filter/search" placeholder="[[search:type-a-tag]]">
37
+ <li class="px-2 py-1 d-flex flex-column gap-2">
38
+ <input type="text" class="form-control form-control-sm" component="tag/filter/search" placeholder="[[search:type-a-tag]]">
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">
@@ -44,7 +44,7 @@
44
44
  </div>
45
45
  {{{ end }}}
46
46
  </div>
47
- <hr/>
47
+ <hr class="my-2"/>
48
48
  <div component="tag/filter/results" class="d-flex flex-wrap gap-2">
49
49
  {{{ each tagFilterResults }}}
50
50
  <button class="btn btn-light btn-sm border" data-tag="{./valueEscaped}">{./valueEscaped}</button>
@@ -64,8 +64,8 @@
64
64
  </a>
65
65
 
66
66
  <ul class="dropdown-menu p-1 text-sm" style="width: 350px;" role="menu">
67
- <li class="px-3 py-1 d-flex flex-column gap-2">
68
- <input type="text" class="form-control" component="user/filter/search" placeholder="[[search:type-a-username]]">
67
+ <li class="px-2 py-1 d-flex flex-column gap-2">
68
+ <input type="text" class="form-control form-control-sm" component="user/filter/search" placeholder="[[search:type-a-username]]">
69
69
  <div component="user/filter/selected" class="d-flex flex-wrap gap-2">
70
70
  {{{ each userFilterSelected }}}
71
71
  <div class="d-flex px-2 py-1 rounded-1 text-bg-primary gap-2 align-items-center text-sm">
@@ -74,7 +74,7 @@
74
74
  </div>
75
75
  {{{ end }}}
76
76
  </div>
77
- <hr/>
77
+ <hr class="my-2"/>
78
78
  <div component="user/filter/results" class="d-flex flex-wrap gap-2">
79
79
  {{{ each userFilterResults }}}
80
80
  <button class="btn btn-light btn-sm border" data-uid="{./uid}" data-username="{./username}">{buildAvatar(@value, "16px", true)} {./username}</button>
@@ -95,12 +95,12 @@
95
95
  </a>
96
96
 
97
97
  <ul class="dropdown-menu p-1 text-sm" style="width: 300px;" role="menu">
98
- <li class="px-3 py-1 d-flex flex-nowrap gap-2">
99
- <select id="reply-count-filter" class="form-select py-2 ps-2 pe-3">
98
+ <li class="px-2 py-1 d-flex flex-nowrap gap-2">
99
+ <select id="reply-count-filter" class="form-select form-select-sm">
100
100
  <option value="atleast">[[search:at-least]]</option>
101
101
  <option value="atmost">[[search:at-most]]</option>
102
102
  </select>
103
- <input id="reply-count" type="number" min="0" class="form-control py-2 ps-2 pe-3" />
103
+ <input id="reply-count" type="number" min="0" class="form-control form-control-sm" />
104
104
  </li>
105
105
  </ul>
106
106
  </div>
@@ -115,12 +115,12 @@
115
115
  </a>
116
116
 
117
117
  <ul class="dropdown-menu p-1 text-sm" style="width: 350px;" role="menu">
118
- <li class="px-3 py-1 d-flex flex-nowrap gap-2">
119
- <select id="post-time-filter" class="form-select py-2 ps-2 pe-3">
118
+ <li class="px-2 py-1 d-flex flex-nowrap gap-2">
119
+ <select id="post-time-filter" class="form-select form-select-sm">
120
120
  <option value="newer">[[search:newer-than]]</option>
121
121
  <option value="older">[[search:older-than]]</option>
122
122
  </select>
123
- <select id="post-time-range" class="form-select py-2 ps-2 pe-3">
123
+ <select id="post-time-range" class="form-select form-select-sm">
124
124
  <option value="">[[search:any-date]]</option>
125
125
  <option value="86400">[[search:yesterday]]</option>
126
126
  <option value="604800">[[search:one-week]]</option>
@@ -144,8 +144,8 @@
144
144
  </a>
145
145
 
146
146
  <ul class="dropdown-menu p-1 text-sm" style="width: 250px;" role="menu">
147
- <li class="px-3 py-1 d-flex flex-column gap-2">
148
- <select id="post-sort-by" class="form-select py-2 ps-2 pe-3">
147
+ <li class="px-2 py-1 d-flex flex-column gap-2">
148
+ <select id="post-sort-by" class="form-select form-select-sm">
149
149
  <option value="relevance">[[search:relevance]]</option>
150
150
  <option value="timestamp">[[search:post-time]]</option>
151
151
  <option value="votes">[[search:votes]]</option>
@@ -158,7 +158,7 @@
158
158
  <option value="user.username">[[search:username]]</option>
159
159
  <option value="category.name">[[search:category]]</option>
160
160
  </select>
161
- <select id="post-sort-direction" class="form-select py-2 ps-2 pe-3">
161
+ <select id="post-sort-direction" class="form-select form-select-sm">
162
162
  <option value="desc">[[search:descending]]</option>
163
163
  <option value="asc">[[search:ascending]]</option>
164
164
  </select>
@@ -174,9 +174,9 @@
174
174
  </a>
175
175
 
176
176
  <ul class="dropdown-menu p-1 text-sm" style="width: 300px;" role="menu">
177
- <li class="px-3 py-1 d-flex flex-column gap-2">
178
- <button id="save-preferences" class="btn btn-primary">[[search:save-preferences]]</button>
179
- <button id="clear-preferences" class="btn btn-ghost border">[[search:clear-preferences]]</button>
177
+ <li class="px-2 py-1 d-flex flex-column gap-2">
178
+ <button id="save-preferences" class="btn btn-sm btn-primary">[[search:save-preferences]]</button>
179
+ <button id="clear-preferences" class="btn btn-sm btn-ghost border">[[search:clear-preferences]]</button>
180
180
  </li>
181
181
  </ul>
182
182
  </div>
@@ -0,0 +1,6 @@
1
+ {{{ if loggedIn }}}
2
+ <button component="topic/mark-unread" class="btn btn-ghost btn-sm ff-secondary d-flex gap-2 align-items-center">
3
+ <i class="fa fa-fw fa-inbox text-primary"></i>
4
+ <span class="d-none d-md-inline fw-semibold">[[topic:mark-unread]]</span>
5
+ </button>
6
+ {{{ end }}}
@@ -1,26 +1,22 @@
1
- <div class="pagination-block d-none d-lg-block flex-grow-1 mb-4">
2
- <div class="d-flex justify-content-end sticky-top mt-4" style="top:6rem;z-index:1;">
3
- <div class="ps-1 ps-md-0 d-inline-block">
4
- <div class="scroller-content d-flex gap-2 flex-column align-items-start">
5
- <button class="pagetop btn btn-ghost btn-sm ff-secondary d-inline-flex border-0 align-items-center gap-2" style="padding: 4px;"><i class="fa fa-chevron-up"></i> <span class="timeago text-xs text-muted text-nowrap" title="{./timestampISO}"></span></button>
6
- <div class="scroller-container position-relative">
7
- <div class="scroller-thumb d-flex gap-2 text-nowrap position-relative" style="height: 40px;">
8
- <div class="scroller-thumb-icon bg-primary rounded d-inline-block" style="width:9px; height: 40px;"></div>
9
- <div>
10
- <p class="small thumb-text d-none d-md-inline-block ff-secondary fw-semibold user-select-none mb-0"></p>
11
- <p class="meta thumb-timestamp timeago text-xs text-muted ff-secondary fw-semibold mb-0 user-select-none"></p>
12
- </div>
13
- </div>
1
+ <div class="pagination-block d-none d-lg-block">
2
+ <div class="scroller-content d-flex gap-2 flex-column align-items-start">
3
+ <button class="pagetop btn btn-ghost btn-sm ff-secondary d-inline-flex border-0 align-items-center gap-2" style="padding: 4px 8px;"><i class="fa fa-fw fa-chevron-up"></i> <span class="timeago text-xs text-muted text-nowrap" title="{./timestampISO}"></span></button>
4
+ <div class="scroller-container position-relative">
5
+ <div class="scroller-thumb d-flex gap-2 text-nowrap position-relative" style="height: 40px;">
6
+ <div class="scroller-thumb-icon bg-primary rounded d-inline-block" style="width:9px; height: 40px;"></div>
7
+ <div>
8
+ <p class="small thumb-text d-none d-md-inline-block ff-secondary fw-semibold user-select-none mb-0"></p>
9
+ <p class="meta thumb-timestamp timeago text-xs text-muted ff-secondary fw-semibold mb-0 user-select-none"></p>
10
+ </div>
11
+ </div>
14
12
 
15
- <div class="unread d-inline-block position-absolute bottom-0">
16
- <div class="meta small position-absolute top-50 translate-middle-y text-nowrap fw-semibold ms-2">
17
- <a class="text-decoration-none" href="{url}" tabindex="-1" aria-disabled="true" aria-label="[[topic:unread-posts-link]]"></a>
18
- </div>
19
- </div>
13
+ <div class="unread d-inline-block position-absolute bottom-0">
14
+ <div class="meta small position-absolute top-50 translate-middle-y text-nowrap fw-semibold ms-2">
15
+ <a class="text-decoration-none" href="{url}" tabindex="-1" aria-disabled="true" aria-label="[[topic:unread-posts-link]]"></a>
20
16
  </div>
21
- <button class="pagebottom btn btn-ghost btn-sm ff-secondary d-inline-flex border-0 align-items-center gap-2" style="padding: 4px;"><i class="fa fa-chevron-down"></i> <span class="timeago text-xs text-muted text-nowrap" title="{./lastposttimeISO}"></span></button>
22
17
  </div>
23
18
  </div>
19
+ <button class="pagebottom btn btn-ghost btn-sm ff-secondary d-inline-flex border-0 align-items-center gap-2" style="padding: 4px 8px;"><i class="fa fa-fw fa-chevron-down"></i> <span class="timeago text-xs text-muted text-nowrap" title="{./lastposttimeISO}"></span></button>
24
20
  </div>
25
21
  </div>
26
22
 
@@ -1,7 +1,7 @@
1
1
  {{{ if privileges.topics:reply }}}
2
2
  <div component="topic/reply/container" class="btn-group">
3
- <a href="{config.relative_path}/compose?tid={tid}" class="d-flex align-items-center btn btn-sm btn-primary px-3 fw-semibold" component="topic/reply" data-ajaxify="false" role="button"><i class="fa fa-reply d-sm-block d-md-none"></i><span class="d-none d-md-block"> [[topic:reply]]</span></a>
4
- <button type="button" class="btn btn-sm btn-primary dropdown-toggle" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false" aria-label="[[topic:reply-options]]">
3
+ <a href="{config.relative_path}/compose?tid={tid}" class="d-flex {{{ if !config.theme.topicSidebarTools}}}px-3{{{ end }}} gap-2 align-items-center btn btn-sm btn-primary fw-semibold" component="topic/reply" data-ajaxify="false" role="button"><i class="fa fa-fw fa-reply {{{ if !config.theme.topicSidebarTools}}} d-sm-block d-md-none {{{ end }}}"></i><span class="d-none d-md-block"> [[topic:reply]]</span></a>
4
+ <button type="button" class="btn btn-sm btn-primary dropdown-toggle flex-0" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false" aria-label="[[topic:reply-options]]">
5
5
  <span class="caret"></span>
6
6
  </button>
7
7
  <ul class="dropdown-menu dropdown-menu-end p-1 text-sm" role="menu">
@@ -67,9 +67,9 @@
67
67
 
68
68
  <div class="d-flex gap-0 gap-lg-5">
69
69
  <div class="posts-container" style="min-width: 0;">
70
- <ul component="topic" class="posts timeline list-unstyled mt-sm-2 p-0 py-3" style="min-width: 0;" data-tid="{tid}" data-cid="{cid}">
70
+ <ul component="topic" class="posts timeline list-unstyled p-0 py-3" style="min-width: 0;" data-tid="{tid}" data-cid="{cid}">
71
71
  {{{ each posts }}}
72
- <li component="post" class="pt-4 {{{ if posts.deleted }}}deleted{{{ end }}} {{{ if posts.selfPost }}}self-post{{{ end }}} {{{ if posts.topicOwnerPost }}}topic-owner-post{{{ end }}}" <!-- IMPORT partials/data/topic.tpl -->>
72
+ <li component="post" class="{{{ if (./index != 0) }}}pt-4{{{ end }}} {{{ if posts.deleted }}}deleted{{{ end }}} {{{ if posts.selfPost }}}self-post{{{ end }}} {{{ if posts.topicOwnerPost }}}topic-owner-post{{{ end }}}" <!-- IMPORT partials/data/topic.tpl -->>
73
73
  <a component="post/anchor" data-index="{./index}" id="{increment(./index, "1")}"></a>
74
74
  <meta itemprop="datePublished" content="{./timestampISO}">
75
75
  {{{ if ./editedISO }}}
@@ -93,8 +93,29 @@
93
93
  <!-- IMPORT partials/topic/quickreply.tpl -->
94
94
  {{{ end }}}
95
95
  </div>
96
-
97
- <!-- IMPORT partials/topic/navigator.tpl -->
96
+ <div class="d-flex d-none d-lg-block flex-grow-1 mt-2">
97
+ <div class="sticky-top" style="{{{ if config.theme.topicSidebarTools }}}top:2rem;{{{ else }}}top:6rem; {{{ end }}} z-index:1;">
98
+ <div class="d-flex flex-column gap-3 align-items-end">
99
+ {{{ if config.theme.topicSidebarTools }}}
100
+ <div class="d-flex flex-column gap-2" style="min-width: 170px;">
101
+ <!-- IMPORT partials/topic/reply-button.tpl -->
102
+ <!-- IMPORT partials/topic/mark-unread.tpl -->
103
+ <!-- IMPORT partials/topic/watch.tpl -->
104
+ <!-- IMPORT partials/topic/sort.tpl -->
105
+ <!-- IMPORT partials/topic/tools.tpl -->
106
+ </div>
107
+ {{{ end }}}
108
+ {{{ if config.theme.topicSidebarTools }}}<hr class="my-0" style="min-width: 170px;"/>{{{ end }}}
109
+ <!-- IMPORT partials/topic/navigator.tpl -->
110
+ {{{ if config.theme.topicSidebarTools }}}<hr class="my-0" style="min-width: 170px;" />{{{ end }}}
111
+ {{{ if browsingUsers }}}
112
+ <div class="d-flex flex-column ps-2 hidden-xs" style="min-width: 170px;">
113
+ <!-- IMPORT partials/topic/browsing-users.tpl -->
114
+ </div>
115
+ {{{ end }}}
116
+ </div>
117
+ </div>
118
+ </div>
98
119
  </div>
99
120
 
100
121
  {{{ if config.usePagination }}}