nodebb-theme-harmony 1.0.0-beta.110 → 1.0.0-beta.112

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
@@ -1,5 +1,6 @@
1
1
  'use strict';
2
2
 
3
+ const nconf = require.main.require('nconf');
3
4
  const meta = require.main.require('./src/meta');
4
5
  const _ = require.main.require('lodash');
5
6
  const user = require.main.require('./src/user');
@@ -29,8 +30,26 @@ library.init = async function (params) {
29
30
  middleware.canViewUsers,
30
31
  middleware.checkAccountPermissions,
31
32
  ], controllers.renderThemeSettings);
33
+
34
+ if (nconf.get('isPrimary') && process.env.NODE_ENV === 'production') {
35
+ setTimeout(buildSkins, 0);
36
+ }
32
37
  };
33
38
 
39
+ async function buildSkins() {
40
+ try {
41
+ const plugins = require.main.require('./src/plugins');
42
+ await plugins.prepareForBuild(['client side styles']);
43
+ for (const skin of meta.css.supportedSkins) {
44
+ // eslint-disable-next-line no-await-in-loop
45
+ await meta.css.buildBundle(`client-${skin}`, true);
46
+ }
47
+ require.main.require('./src/meta/minifier').killAll();
48
+ } catch (err) {
49
+ console.error(err.stack);
50
+ }
51
+ }
52
+
34
53
  library.addAdminNavigation = async function (header) {
35
54
  header.plugins.push({
36
55
  route: '/plugins/harmony',
@@ -99,6 +118,16 @@ library.defineWidgetAreas = async function (areas) {
99
118
  template: 'global',
100
119
  location: 'brand-header',
101
120
  },
121
+ {
122
+ name: 'About me (before)',
123
+ template: 'account/profile.tpl',
124
+ location: 'profile-aboutme-before',
125
+ },
126
+ {
127
+ name: 'About me (after)',
128
+ template: 'account/profile.tpl',
129
+ location: 'profile-aboutme-after',
130
+ },
102
131
  ]);
103
132
 
104
133
  return areas;
@@ -121,7 +150,7 @@ async function loadThemeConfig(uid) {
121
150
  }
122
151
 
123
152
  library.getThemeConfig = async function (config) {
124
- config.theme = await loadThemeConfig(config.uid);;
153
+ config.theme = await loadThemeConfig(config.uid);
125
154
  config.openDraftsOnPageLoad = false;
126
155
  return config;
127
156
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-theme-harmony",
3
- "version": "1.0.0-beta.110",
3
+ "version": "1.0.0-beta.112",
4
4
  "nbbpm": {
5
5
  "compatibility": "^3.0.0"
6
6
  },
package/scss/chats.scss CHANGED
@@ -4,6 +4,19 @@
4
4
  max-width: 100%;
5
5
  }
6
6
 
7
+ .stacked-avatars {
8
+ width: 32px;
9
+ height: 32px;
10
+ span:first-child {
11
+ top: 0;
12
+ left: 8px;
13
+ }
14
+ span:last-child {
15
+ left: 0;
16
+ top: 8px;
17
+ }
18
+ }
19
+
7
20
  body.page-user-chats {
8
21
  overflow: hidden;
9
22
  [data-widget-area="footer"] {
@@ -1,10 +1,27 @@
1
1
  <!-- IMPORT partials/account/header.tpl -->
2
+
3
+ {{{ if widgets.profile-aboutme-before.length }}}
4
+ <div data-widget-area="profile-aboutme-before">
5
+ {{{each widgets.profile-aboutme-before}}}
6
+ {./html}
7
+ {{{end}}}
8
+ </div>
9
+ {{{ end }}}
10
+
2
11
  {{{ if aboutme }}}
3
12
  <div component="aboutme" class="text-sm text-break">
4
13
  {aboutmeParsed}
5
14
  </div>
6
15
  {{{ end }}}
7
16
 
17
+ {{{ if widgets.profile-aboutme-after.length }}}
18
+ <div data-widget-area="profile-aboutme-after">
19
+ {{{each widgets.profile-aboutme-after}}}
20
+ {./html}
21
+ {{{end}}}
22
+ </div>
23
+ {{{ end }}}
24
+
8
25
  <div class="account-stats container">
9
26
  <div class="row row-cols-2 row-cols-xl-3 row-cols-xxl-4 g-2">
10
27
  {{{ if !reputation:disabled }}}
@@ -5,9 +5,9 @@
5
5
  <a class="stretched-link" href="{config.relative_path}/me/chats/{./roomId}"></a>
6
6
  {{{ if ./users.length }}}
7
7
  {{{ if ./groupChat}}}
8
- <div class="position-relative" style="width:32px; height:32px;">
9
- <span class="text-decoration-none position-absolute top-0" style="left: 8px;" href="{config.relative_path}/user/{./users.1.userslug}">{buildAvatar(./users.1, "24px", true)}</span>
10
- <span class="text-decoration-none position-absolute start-0" style="top: 8px;" href="{config.relative_path}/user/{./users.0.userslug}" >{buildAvatar(./users.0, "24px", true)}</span>
8
+ <div class="position-relative stacked-avatars">
9
+ <span class="text-decoration-none position-absolute" href="{config.relative_path}/user/{./users.1.userslug}">{buildAvatar(./users.1, "24px", true)}</span>
10
+ <span class="text-decoration-none position-absolute" href="{config.relative_path}/user/{./users.0.userslug}" >{buildAvatar(./users.0, "24px", true)}</span>
11
11
  </div>
12
12
  {{{ else }}}
13
13
  <span href="{config.relative_path}/user/{./users.0.userslug}" class="text-decoration-none">{buildAvatar(./users.0, "32px", true)}</span>