nodebb-plugin-customize 4.1.1 → 5.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/build/lib/controllers.js +8 -11
- package/build/lib/controllers.js.map +1 -1
- package/build/lib/database.js +2 -5
- package/build/lib/database.js.map +1 -1
- package/build/lib/pubsub.js +9 -17
- package/build/lib/pubsub.js.map +1 -1
- package/build/public/templates/404.tpl +16 -0
- package/build/public/templates/admin/plugins/customize.tpl +145 -106
- package/lib/controllers.ts +8 -9
- package/lib/database.ts +11 -4
- package/lib/pubsub.ts +10 -17
- package/lib/types.d.ts +6 -0
- package/package.json +2 -2
- package/public/templates/admin/plugins/customize.tpl +145 -106
- package/tsconfig.json +2 -1
package/build/lib/controllers.js
CHANGED
|
@@ -6,17 +6,14 @@ const util_1 = require("util");
|
|
|
6
6
|
const fs_extra_1 = require("fs-extra");
|
|
7
7
|
const pubsub_1 = require("./pubsub");
|
|
8
8
|
const db = require("./database");
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const Utils = require.main.require('./src/utils');
|
|
18
|
-
const { setupApiRoute, setupAdminPageRoute } = require.main.require('./src/routes/helpers');
|
|
19
|
-
const { formatApiResponse } = require.main.require('./src/controllers/helpers');
|
|
9
|
+
const nconf = nodebb.require('nconf');
|
|
10
|
+
const User = nodebb.require('./src/user');
|
|
11
|
+
const Languages = nodebb.require('./src/languages');
|
|
12
|
+
const File = nodebb.require('./src/file');
|
|
13
|
+
const Translator = nodebb.require('./src/translator');
|
|
14
|
+
const Utils = nodebb.require('./src/utils');
|
|
15
|
+
const { setupApiRoute, setupAdminPageRoute } = nodebb.require('./src/routes/helpers');
|
|
16
|
+
const { formatApiResponse } = nodebb.require('./src/controllers/helpers');
|
|
20
17
|
const escape = (dirty) => Translator.escape(Utils.escapeHTML(dirty));
|
|
21
18
|
const listLanguages = (0, util_1.promisify)(Languages.list);
|
|
22
19
|
const getSettings = (0, util_1.promisify)(User.getSettings);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"controllers.js","sourceRoot":"","sources":["../../lib/controllers.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"controllers.js","sourceRoot":"","sources":["../../lib/controllers.ts"],"names":[],"mappings":";;AA0IA,8BAUC;AAnJD,+BAAsC;AACtC,+BAAiC;AACjC,uCAAoC;AAEpC,qCAAiC;AACjC,iCAAiC;AAEjC,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;AACtC,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;AAC1C,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC;AACpD,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;AAC1C,MAAM,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;AACtD,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;AAC5C,MAAM,EAAE,aAAa,EAAE,mBAAmB,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC,sBAAsB,CAAC,CAAC;AACtF,MAAM,EAAE,iBAAiB,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC,2BAA2B,CAAC,CAAC;AAE1E,MAAM,MAAM,GAAG,CAAC,KAAa,EAAU,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC;AAErF,MAAM,aAAa,GAGZ,IAAA,gBAAS,EAAC,SAAS,CAAC,IAAI,CAAC,CAAC;AACjC,MAAM,WAAW,GAAmD,IAAA,gBAAS,EAAC,IAAI,CAAC,WAAW,CAAC,CAAC;AAChG,MAAM,IAAI,GAA+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CAAC,UAAU,CAAC,KAAK,CAAC,eAAe,CAAC,EAAE,UAAU,CAAC,CAAC;AACxH,CAAC"}
|
package/build/lib/database.js
CHANGED
|
@@ -11,11 +11,8 @@ const util_1 = require("util");
|
|
|
11
11
|
const path_1 = require("path");
|
|
12
12
|
const fs_extra_1 = require("fs-extra");
|
|
13
13
|
const diff_1 = require("diff");
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
const db = require.main.require('./src/database');
|
|
18
|
-
const nconf = require.main.require('nconf');
|
|
14
|
+
const db = nodebb.require('./src/database');
|
|
15
|
+
const nconf = nodebb.require('nconf');
|
|
19
16
|
const getSortedSetRange = (0, util_1.promisify)(db.getSortedSetRange);
|
|
20
17
|
const getObjects = (0, util_1.promisify)(db.getObjects);
|
|
21
18
|
const sortedSetAdd = (0, util_1.promisify)(db.sortedSetAdd);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"database.js","sourceRoot":"","sources":["../../lib/database.ts"],"names":[],"mappings":";AAAA,0CAA0C;;
|
|
1
|
+
{"version":3,"file":"database.js","sourceRoot":"","sources":["../../lib/database.ts"],"names":[],"mappings":";AAAA,0CAA0C;;AA8C1C,0CAgBC;AAED,0CAmBC;AAED,8CAKC;AAgBD,oCA0BC;AAED,oCAaC;AAED,wCAKC;AAxJD,+BAAiC;AACjC,+BAA4B;AAC5B,uCAA8C;AAC9C,+BAAkC;AAElC,MAAM,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC;AAC5C,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;AAEtC,MAAM,iBAAiB,GAIE,IAAA,gBAAS,EAAC,EAAE,CAAC,iBAAiB,CAAC,CAAC;AACzD,MAAM,UAAU,GAAwC,IAAA,gBAAS,EAAC,EAAE,CAAC,UAAU,CAAC,CAAC;AACjF,MAAM,YAAY,GAIG,IAAA,gBAAS,EAAC,EAAE,CAAC,YAAY,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AAC,IAAY;IAC/C,MAAM,OAAO,CAAC,GAAG,CAAC;QAChB,MAAM,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;QAC7B,eAAe,CAAC,YAAY,EAAE,IAAI,CAAC;KACpC,CAAC,CAAC;AACL,CAAC"}
|
package/build/lib/pubsub.js
CHANGED
|
@@ -3,30 +3,22 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.build = build;
|
|
4
4
|
const os_1 = require("os");
|
|
5
5
|
const build_1 = require("./build");
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const nconf = require.main.require('nconf');
|
|
10
|
-
const winston = require.main.require('winston');
|
|
11
|
-
const pubsub = require.main.require('./src/pubsub');
|
|
6
|
+
const nconf = nodebb.require('nconf');
|
|
7
|
+
const winston = nodebb.require('winston');
|
|
8
|
+
const pubsub = nodebb.require('./src/pubsub');
|
|
12
9
|
const primary = nconf.get('isPrimary') === 'true' || nconf.get('isPrimary') === true;
|
|
13
10
|
async function build() {
|
|
11
|
+
await (0, build_1.build)();
|
|
14
12
|
pubsub.publish('customize:build', {
|
|
15
|
-
hostname:
|
|
13
|
+
hostname: (0, os_1.hostname)(),
|
|
16
14
|
});
|
|
17
|
-
if (primary) {
|
|
18
|
-
await (0, build_1.build)();
|
|
19
|
-
}
|
|
20
15
|
}
|
|
21
|
-
const logErrors = (err) => {
|
|
22
|
-
if (err) {
|
|
23
|
-
winston.error(err);
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
16
|
if (primary) {
|
|
27
17
|
pubsub.on('customize:build', (data) => {
|
|
28
|
-
if (data.hostname !==
|
|
29
|
-
(0, build_1.build)().catch(
|
|
18
|
+
if (data.hostname !== (0, os_1.hostname)()) {
|
|
19
|
+
(0, build_1.build)().catch((err) => {
|
|
20
|
+
winston.error(err);
|
|
21
|
+
});
|
|
30
22
|
}
|
|
31
23
|
});
|
|
32
24
|
}
|
package/build/lib/pubsub.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pubsub.js","sourceRoot":"","sources":["../../lib/pubsub.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"pubsub.js","sourceRoot":"","sources":["../../lib/pubsub.ts"],"names":[],"mappings":";;AASA,sBAMC;AAfD,2BAA8B;AAC9B,mCAA+C;AAE/C,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;AACtC,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AAC1C,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;AAE9C,MAAM,OAAO,GAAG,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,KAAK,MAAM,IAAI,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;AAE9E,KAAK,UAAU,KAAK;IACzB,MAAM,IAAA,aAAW,GAAE,CAAC;IAEpB,MAAM,CAAC,OAAO,CAAC,iBAAiB,EAAE;QAChC,QAAQ,EAAE,IAAA,aAAQ,GAAE;KACrB,CAAC,CAAC;AACL,CAAC;AAED,IAAI,OAAO,EAAE,CAAC;IACZ,MAAM,CAAC,EAAE,CAAC,iBAAiB,EAAE,CAAC,IAA0B,EAAE,EAAE;QAC1D,IAAI,IAAI,CAAC,QAAQ,KAAK,IAAA,aAAQ,GAAE,EAAE,CAAC;YACjC,IAAA,aAAW,GAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;gBAC1B,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YACrB,CAAC,CAAC,CAAC;QACL,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
404 cuastom 1
|
|
2
|
+
<div class="flex-fill">
|
|
3
|
+
404 cuastom
|
|
4
|
+
<h2 class="fw-semibold tracking-tight text-center">{{tx("global:404.title")}}</h2>
|
|
5
|
+
|
|
6
|
+
<div class="mx-auto">
|
|
7
|
+
<div class="d-flex flex-column gap-3 justify-content-center text-center">
|
|
8
|
+
<div class="mx-auto p-4">
|
|
9
|
+
<i class="text-secondary fa fa-fw fa-4x {{{ if icon }}}{icon}{{{ else }}}fa-otter{{{ end }}}"></i>
|
|
10
|
+
</div>
|
|
11
|
+
{{{ if error }}}{{tx(error)}}{{{ else }}}{{tx("global:404.message", config.relative_path)}}{{{ end }}}
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
|
14
|
+
{{tx("global:posts")}} wow
|
|
15
|
+
</div>
|
|
16
|
+
|
|
@@ -4,124 +4,163 @@
|
|
|
4
4
|
<h4 class="fw-bold tracking-tight mb-0">{title}</h4>
|
|
5
5
|
</div>
|
|
6
6
|
<div class="col-12 col-md-4 px-0 px-md-3">
|
|
7
|
-
<button id="build" class="btn btn-primary btn-sm fw-semibold ff-secondary w-100 text-center text-nowrap">
|
|
7
|
+
<button id="build" class="btn btn-primary btn-sm fw-semibold ff-secondary w-100 text-center text-nowrap">{{tx("admin/admin:save-changes")}}</button>
|
|
8
8
|
</div>
|
|
9
9
|
</div>
|
|
10
10
|
|
|
11
11
|
<div class="row m-0">
|
|
12
12
|
<div id="spy-container" class="col-12 px-0 mb-4" tabindex="0">
|
|
13
|
-
<
|
|
14
|
-
<
|
|
15
|
-
<
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
</
|
|
27
|
-
</
|
|
28
|
-
<tbody id="translations-list">
|
|
29
|
-
<!-- IMPORT partials/admin/plugins/customize/translations-list.tpl -->
|
|
30
|
-
</tbody>
|
|
31
|
-
<tfoot>
|
|
32
|
-
<tr id="translation-edit" class="translation">
|
|
33
|
-
<td>
|
|
34
|
-
<select id="translation-edit-language" class="form-select">
|
|
35
|
-
<option value="">---</option>
|
|
36
|
-
{{{each languages}}}
|
|
37
|
-
<option value="{./code}" {{{if ./selected}}}selected{{{end}}}>{./name} ({./code})</option>
|
|
38
|
-
{{{end}}}
|
|
39
|
-
</select>
|
|
40
|
-
</td>
|
|
41
|
-
<td>
|
|
42
|
-
<select id="translation-edit-namespace" class="form-select">
|
|
43
|
-
<option value="">---</option>
|
|
44
|
-
{{{each namespaces}}}
|
|
45
|
-
<option value="{./name}">{./name}</option>
|
|
46
|
-
{{{end}}}
|
|
47
|
-
</select>
|
|
48
|
-
</td>
|
|
49
|
-
<td>
|
|
50
|
-
<select id="translation-edit-key" class="form-select">
|
|
51
|
-
<!-- automatically fetch possible keys and autopopulate this -->
|
|
52
|
-
</select>
|
|
53
|
-
</td>
|
|
54
|
-
<td>
|
|
55
|
-
<span id="translation-edit-original"><!-- original goes here --></span>
|
|
56
|
-
</td>
|
|
57
|
-
<td>
|
|
58
|
-
<!-- set to original value at first -->
|
|
59
|
-
<textarea id="translation-edit-value" class="form-control"></textarea>
|
|
60
|
-
</td>
|
|
61
|
-
<td>
|
|
62
|
-
<button class="btn btn-ghost" id="translation-edit-submit"><i class="fa fa-fw fa-check text-success"></i></button>
|
|
63
|
-
</td>
|
|
64
|
-
</tr>
|
|
65
|
-
</tfoot>
|
|
66
|
-
</table>
|
|
67
|
-
</div>
|
|
13
|
+
<ul class="nav nav-tabs mb-3" role="tablist">
|
|
14
|
+
<li class="nav-item" role="presentation">
|
|
15
|
+
<button
|
|
16
|
+
class="nav-link active fw-semibold"
|
|
17
|
+
id="template-customize-tab"
|
|
18
|
+
data-bs-toggle="tab"
|
|
19
|
+
data-bs-target="#template-customize-pane"
|
|
20
|
+
type="button"
|
|
21
|
+
role="tab"
|
|
22
|
+
aria-controls="template-customize-pane"
|
|
23
|
+
aria-selected="true"
|
|
24
|
+
>
|
|
25
|
+
Template Customizations
|
|
26
|
+
</button>
|
|
27
|
+
</li>
|
|
68
28
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
29
|
+
<li class="nav-item" role="presentation">
|
|
30
|
+
<button
|
|
31
|
+
class="nav-link fw-semibold"
|
|
32
|
+
id="translations-customize-tab"
|
|
33
|
+
data-bs-toggle="tab"
|
|
34
|
+
data-bs-target="#translations-customize-pane"
|
|
35
|
+
type="button"
|
|
36
|
+
role="tab"
|
|
37
|
+
aria-controls="translations-customize-pane"
|
|
38
|
+
aria-selected="false"
|
|
39
|
+
>
|
|
40
|
+
Translation Customizations
|
|
41
|
+
</button>
|
|
42
|
+
</li>
|
|
43
|
+
</ul>
|
|
44
|
+
|
|
45
|
+
<div class="tab-content">
|
|
46
|
+
<div class="tab-pane fade show active"
|
|
47
|
+
id="template-customize-pane"
|
|
48
|
+
role="tabpanel"
|
|
49
|
+
aria-labelledby="template-customize-tab"
|
|
50
|
+
tabindex="0">
|
|
51
|
+
<div class="card">
|
|
52
|
+
<table class="table">
|
|
53
|
+
<thead>
|
|
54
|
+
<tr>
|
|
55
|
+
<th>Template</th>
|
|
56
|
+
<th>Diff</th>
|
|
57
|
+
<th></th>
|
|
58
|
+
</tr>
|
|
59
|
+
</thead>
|
|
60
|
+
<tbody id="templates-list">
|
|
61
|
+
<!-- IMPORT partials/admin/plugins/customize/templates-list.tpl -->
|
|
62
|
+
</tbody>
|
|
63
|
+
<tfoot>
|
|
64
|
+
<tr id="template-edit" class="template">
|
|
65
|
+
<td>
|
|
66
|
+
<select id="template-edit-path" class="form-select">
|
|
67
|
+
<option value="">---</option>
|
|
68
|
+
{{{each templatePaths}}}
|
|
69
|
+
<option value="{@value}">{@value}</option>
|
|
70
|
+
{{{end}}}
|
|
71
|
+
</select>
|
|
72
|
+
</td>
|
|
73
|
+
<td>
|
|
74
|
+
<pre class="diff-preview"><code id="template-edit-diff"><!-- diff goes here --></code></pre>
|
|
75
|
+
</td>
|
|
76
|
+
<td>
|
|
77
|
+
<div class="d-flex gap-2">
|
|
78
|
+
<button class="btn btn-sm btn-primary" id="template-edit-open" data-bs-toggle="modal" data-bs-target="#template-edit-modal"><i class="fa fa-fw fa-pencil"></i></a>
|
|
79
|
+
<button class="btn btn-sm btn-success" id="template-edit-submit"><i class="fa fa-fw fa-check"></i></button>
|
|
80
|
+
</div>
|
|
81
|
+
</td>
|
|
82
|
+
</tr>
|
|
83
|
+
</tfoot>
|
|
84
|
+
</table>
|
|
101
85
|
</div>
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
86
|
+
</div>
|
|
87
|
+
<div class="tab-pane fade"
|
|
88
|
+
id="translations-customize-pane"
|
|
89
|
+
role="tabpanel"
|
|
90
|
+
aria-labelledby="translations-customize-tab"
|
|
91
|
+
tabindex="0">
|
|
92
|
+
<div class="card">
|
|
93
|
+
<table class="table">
|
|
94
|
+
<thead>
|
|
95
|
+
<tr>
|
|
96
|
+
<th>Language</th>
|
|
97
|
+
<th>Namespace</th>
|
|
98
|
+
<th>Key</th>
|
|
99
|
+
<th>Original</th>
|
|
100
|
+
<th>Replacement</th>
|
|
101
|
+
<th></th>
|
|
102
|
+
</tr>
|
|
103
|
+
</thead>
|
|
104
|
+
<tbody id="translations-list">
|
|
105
|
+
<!-- IMPORT partials/admin/plugins/customize/translations-list.tpl -->
|
|
106
|
+
</tbody>
|
|
107
|
+
<tfoot>
|
|
108
|
+
<tr id="translation-edit" class="translation">
|
|
109
|
+
<td>
|
|
110
|
+
<select id="translation-edit-language" class="form-select">
|
|
111
|
+
<option value="">---</option>
|
|
112
|
+
{{{each languages}}}
|
|
113
|
+
<option value="{./code}" {{{if ./selected}}}selected{{{end}}}>{./name} ({./code})</option>
|
|
114
|
+
{{{end}}}
|
|
115
|
+
</select>
|
|
116
|
+
</td>
|
|
117
|
+
<td>
|
|
118
|
+
<select id="translation-edit-namespace" class="form-select">
|
|
119
|
+
<option value="">---</option>
|
|
120
|
+
{{{each namespaces}}}
|
|
121
|
+
<option value="{./name}">{./name}</option>
|
|
122
|
+
{{{end}}}
|
|
123
|
+
</select>
|
|
124
|
+
</td>
|
|
125
|
+
<td>
|
|
126
|
+
<select id="translation-edit-key" class="form-select">
|
|
127
|
+
<!-- automatically fetch possible keys and autopopulate this -->
|
|
128
|
+
</select>
|
|
129
|
+
</td>
|
|
130
|
+
<td>
|
|
131
|
+
<span id="translation-edit-original"><!-- original goes here --></span>
|
|
132
|
+
</td>
|
|
133
|
+
<td>
|
|
134
|
+
<!-- set to original value at first -->
|
|
135
|
+
<textarea id="translation-edit-value" class="form-control"></textarea>
|
|
136
|
+
</td>
|
|
137
|
+
<td>
|
|
138
|
+
<button class="btn btn-ghost" id="translation-edit-submit"><i class="fa fa-fw fa-check text-success"></i></button>
|
|
139
|
+
</td>
|
|
140
|
+
</tr>
|
|
141
|
+
</tfoot>
|
|
142
|
+
</table>
|
|
143
|
+
</div>
|
|
144
|
+
</div>
|
|
106
145
|
</div>
|
|
107
146
|
|
|
108
147
|
<div class="modal fade" id="template-edit-modal" tabindex="-1" role="dialog" aria-labelledby="template-edit-modal-label">
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
148
|
+
<div class="modal-dialog modal-fullscreen" role="document">
|
|
149
|
+
<div class="modal-content">
|
|
150
|
+
<div class="modal-header">
|
|
151
|
+
<h4 class="modal-title" id="template-edit-modal-label">Edit Template Customization</h4>
|
|
152
|
+
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"><span aria-hidden="true"></span></button>
|
|
153
|
+
</div>
|
|
154
|
+
<div class="modal-body row">
|
|
155
|
+
<div class="col-md" id="template-edit-old"></div>
|
|
156
|
+
<div class="col-md" id="template-edit-value"></div>
|
|
157
|
+
</div>
|
|
158
|
+
<div class="modal-footer">
|
|
159
|
+
<button type="button" class="btn btn-outline-secondary" data-bs-dismiss="modal">Done</button>
|
|
160
|
+
</div>
|
|
161
|
+
</div>
|
|
122
162
|
</div>
|
|
123
163
|
</div>
|
|
124
|
-
</div>
|
|
125
164
|
</div>
|
|
126
165
|
</div>
|
|
127
166
|
</div>
|
package/lib/controllers.ts
CHANGED
|
@@ -6,15 +6,14 @@ import { readJson } from 'fs-extra';
|
|
|
6
6
|
import { build } from './pubsub';
|
|
7
7
|
import * as db from './database';
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const {
|
|
17
|
-
const { formatApiResponse } = require.main.require('./src/controllers/helpers');
|
|
9
|
+
const nconf = nodebb.require('nconf');
|
|
10
|
+
const User = nodebb.require('./src/user');
|
|
11
|
+
const Languages = nodebb.require('./src/languages');
|
|
12
|
+
const File = nodebb.require('./src/file');
|
|
13
|
+
const Translator = nodebb.require('./src/translator');
|
|
14
|
+
const Utils = nodebb.require('./src/utils');
|
|
15
|
+
const { setupApiRoute, setupAdminPageRoute } = nodebb.require('./src/routes/helpers');
|
|
16
|
+
const { formatApiResponse } = nodebb.require('./src/controllers/helpers');
|
|
18
17
|
|
|
19
18
|
const escape = (dirty: string): string => Translator.escape(Utils.escapeHTML(dirty));
|
|
20
19
|
|
package/lib/database.ts
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
// types and helper functions for database
|
|
2
2
|
|
|
3
3
|
import { promisify } from 'util';
|
|
4
|
-
import { join } from 'path';
|
|
4
|
+
import { join, resolve, sep } from 'path';
|
|
5
5
|
import { readJson, readFile } from 'fs-extra';
|
|
6
6
|
import { applyPatch } from 'diff';
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
const nconf = require.main.require('nconf');
|
|
8
|
+
const db = nodebb.require('./src/database');
|
|
9
|
+
const nconf = nodebb.require('nconf');
|
|
11
10
|
|
|
12
11
|
const getSortedSetRange: (
|
|
13
12
|
key: string,
|
|
@@ -133,11 +132,19 @@ export async function getTemplates(): Promise<Template[]> {
|
|
|
133
132
|
});
|
|
134
133
|
}
|
|
135
134
|
|
|
135
|
+
function assertPathWithinViews(path: string): void {
|
|
136
|
+
const resolved = resolve(viewsDir, path);
|
|
137
|
+
if (resolved !== viewsDir && !resolved.startsWith(viewsDir + sep)) {
|
|
138
|
+
throw new Error('[[error:invalid-path]]');
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
136
142
|
export async function editTemplate({
|
|
137
143
|
path,
|
|
138
144
|
diff,
|
|
139
145
|
old,
|
|
140
146
|
}: Template): Promise<void> {
|
|
147
|
+
assertPathWithinViews(path);
|
|
141
148
|
await Promise.all([
|
|
142
149
|
setObject<TemplateHash>(templateHashKey(path), {
|
|
143
150
|
path,
|
package/lib/pubsub.ts
CHANGED
|
@@ -1,33 +1,26 @@
|
|
|
1
1
|
import { hostname } from 'os';
|
|
2
2
|
import { build as buildAssets } from './build';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const pubsub = require.main.require('./src/pubsub');
|
|
4
|
+
const nconf = nodebb.require('nconf');
|
|
5
|
+
const winston = nodebb.require('winston');
|
|
6
|
+
const pubsub = nodebb.require('./src/pubsub');
|
|
8
7
|
|
|
9
8
|
const primary = nconf.get('isPrimary') === 'true' || nconf.get('isPrimary') === true;
|
|
10
9
|
|
|
11
10
|
export async function build(): Promise<void> {
|
|
11
|
+
await buildAssets();
|
|
12
|
+
|
|
12
13
|
pubsub.publish('customize:build', {
|
|
13
|
-
hostname:
|
|
14
|
+
hostname: hostname(),
|
|
14
15
|
});
|
|
15
|
-
|
|
16
|
-
if (primary) {
|
|
17
|
-
await buildAssets();
|
|
18
|
-
}
|
|
19
16
|
}
|
|
20
17
|
|
|
21
|
-
const logErrors = (err: Error): void => {
|
|
22
|
-
if (err) {
|
|
23
|
-
winston.error(err);
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
|
|
27
18
|
if (primary) {
|
|
28
19
|
pubsub.on('customize:build', (data: { hostname: string }) => {
|
|
29
|
-
if (data.hostname !==
|
|
30
|
-
buildAssets().catch(
|
|
20
|
+
if (data.hostname !== hostname()) {
|
|
21
|
+
buildAssets().catch((err) => {
|
|
22
|
+
winston.error(err);
|
|
23
|
+
});
|
|
31
24
|
}
|
|
32
25
|
});
|
|
33
26
|
}
|
package/lib/types.d.ts
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { Router, RequestHandler } from 'express';
|
|
2
2
|
|
|
3
3
|
declare global {
|
|
4
|
+
interface NodeBBGlobal {
|
|
5
|
+
require<T = any>(request: string): T;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
const nodebb: NodeBBGlobal;
|
|
9
|
+
|
|
4
10
|
type NodeBack<T> = (err?: Error | null, ...args: T[]) => void;
|
|
5
11
|
|
|
6
12
|
namespace Express {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nodebb-plugin-customize",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.1",
|
|
4
4
|
"description": "Customize NodeBB translations and templates",
|
|
5
5
|
"main": "build/lib",
|
|
6
6
|
"author": "Peter Jaszkowiak <p.jaszkow@gmail.com> (https://github.com/pitaj)",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"url": "https://github.com/NodeBB/nodebb-plugin-customize.git"
|
|
11
11
|
},
|
|
12
12
|
"nbbpm": {
|
|
13
|
-
"compatibility": "^
|
|
13
|
+
"compatibility": "^4.14.0"
|
|
14
14
|
},
|
|
15
15
|
"keywords": [
|
|
16
16
|
"nodebb",
|
|
@@ -4,124 +4,163 @@
|
|
|
4
4
|
<h4 class="fw-bold tracking-tight mb-0">{title}</h4>
|
|
5
5
|
</div>
|
|
6
6
|
<div class="col-12 col-md-4 px-0 px-md-3">
|
|
7
|
-
<button id="build" class="btn btn-primary btn-sm fw-semibold ff-secondary w-100 text-center text-nowrap">
|
|
7
|
+
<button id="build" class="btn btn-primary btn-sm fw-semibold ff-secondary w-100 text-center text-nowrap">{{tx("admin/admin:save-changes")}}</button>
|
|
8
8
|
</div>
|
|
9
9
|
</div>
|
|
10
10
|
|
|
11
11
|
<div class="row m-0">
|
|
12
12
|
<div id="spy-container" class="col-12 px-0 mb-4" tabindex="0">
|
|
13
|
-
<
|
|
14
|
-
<
|
|
15
|
-
<
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
</
|
|
27
|
-
</
|
|
28
|
-
<tbody id="translations-list">
|
|
29
|
-
<!-- IMPORT partials/admin/plugins/customize/translations-list.tpl -->
|
|
30
|
-
</tbody>
|
|
31
|
-
<tfoot>
|
|
32
|
-
<tr id="translation-edit" class="translation">
|
|
33
|
-
<td>
|
|
34
|
-
<select id="translation-edit-language" class="form-select">
|
|
35
|
-
<option value="">---</option>
|
|
36
|
-
{{{each languages}}}
|
|
37
|
-
<option value="{./code}" {{{if ./selected}}}selected{{{end}}}>{./name} ({./code})</option>
|
|
38
|
-
{{{end}}}
|
|
39
|
-
</select>
|
|
40
|
-
</td>
|
|
41
|
-
<td>
|
|
42
|
-
<select id="translation-edit-namespace" class="form-select">
|
|
43
|
-
<option value="">---</option>
|
|
44
|
-
{{{each namespaces}}}
|
|
45
|
-
<option value="{./name}">{./name}</option>
|
|
46
|
-
{{{end}}}
|
|
47
|
-
</select>
|
|
48
|
-
</td>
|
|
49
|
-
<td>
|
|
50
|
-
<select id="translation-edit-key" class="form-select">
|
|
51
|
-
<!-- automatically fetch possible keys and autopopulate this -->
|
|
52
|
-
</select>
|
|
53
|
-
</td>
|
|
54
|
-
<td>
|
|
55
|
-
<span id="translation-edit-original"><!-- original goes here --></span>
|
|
56
|
-
</td>
|
|
57
|
-
<td>
|
|
58
|
-
<!-- set to original value at first -->
|
|
59
|
-
<textarea id="translation-edit-value" class="form-control"></textarea>
|
|
60
|
-
</td>
|
|
61
|
-
<td>
|
|
62
|
-
<button class="btn btn-ghost" id="translation-edit-submit"><i class="fa fa-fw fa-check text-success"></i></button>
|
|
63
|
-
</td>
|
|
64
|
-
</tr>
|
|
65
|
-
</tfoot>
|
|
66
|
-
</table>
|
|
67
|
-
</div>
|
|
13
|
+
<ul class="nav nav-tabs mb-3" role="tablist">
|
|
14
|
+
<li class="nav-item" role="presentation">
|
|
15
|
+
<button
|
|
16
|
+
class="nav-link active fw-semibold"
|
|
17
|
+
id="template-customize-tab"
|
|
18
|
+
data-bs-toggle="tab"
|
|
19
|
+
data-bs-target="#template-customize-pane"
|
|
20
|
+
type="button"
|
|
21
|
+
role="tab"
|
|
22
|
+
aria-controls="template-customize-pane"
|
|
23
|
+
aria-selected="true"
|
|
24
|
+
>
|
|
25
|
+
Template Customizations
|
|
26
|
+
</button>
|
|
27
|
+
</li>
|
|
68
28
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
29
|
+
<li class="nav-item" role="presentation">
|
|
30
|
+
<button
|
|
31
|
+
class="nav-link fw-semibold"
|
|
32
|
+
id="translations-customize-tab"
|
|
33
|
+
data-bs-toggle="tab"
|
|
34
|
+
data-bs-target="#translations-customize-pane"
|
|
35
|
+
type="button"
|
|
36
|
+
role="tab"
|
|
37
|
+
aria-controls="translations-customize-pane"
|
|
38
|
+
aria-selected="false"
|
|
39
|
+
>
|
|
40
|
+
Translation Customizations
|
|
41
|
+
</button>
|
|
42
|
+
</li>
|
|
43
|
+
</ul>
|
|
44
|
+
|
|
45
|
+
<div class="tab-content">
|
|
46
|
+
<div class="tab-pane fade show active"
|
|
47
|
+
id="template-customize-pane"
|
|
48
|
+
role="tabpanel"
|
|
49
|
+
aria-labelledby="template-customize-tab"
|
|
50
|
+
tabindex="0">
|
|
51
|
+
<div class="card">
|
|
52
|
+
<table class="table">
|
|
53
|
+
<thead>
|
|
54
|
+
<tr>
|
|
55
|
+
<th>Template</th>
|
|
56
|
+
<th>Diff</th>
|
|
57
|
+
<th></th>
|
|
58
|
+
</tr>
|
|
59
|
+
</thead>
|
|
60
|
+
<tbody id="templates-list">
|
|
61
|
+
<!-- IMPORT partials/admin/plugins/customize/templates-list.tpl -->
|
|
62
|
+
</tbody>
|
|
63
|
+
<tfoot>
|
|
64
|
+
<tr id="template-edit" class="template">
|
|
65
|
+
<td>
|
|
66
|
+
<select id="template-edit-path" class="form-select">
|
|
67
|
+
<option value="">---</option>
|
|
68
|
+
{{{each templatePaths}}}
|
|
69
|
+
<option value="{@value}">{@value}</option>
|
|
70
|
+
{{{end}}}
|
|
71
|
+
</select>
|
|
72
|
+
</td>
|
|
73
|
+
<td>
|
|
74
|
+
<pre class="diff-preview"><code id="template-edit-diff"><!-- diff goes here --></code></pre>
|
|
75
|
+
</td>
|
|
76
|
+
<td>
|
|
77
|
+
<div class="d-flex gap-2">
|
|
78
|
+
<button class="btn btn-sm btn-primary" id="template-edit-open" data-bs-toggle="modal" data-bs-target="#template-edit-modal"><i class="fa fa-fw fa-pencil"></i></a>
|
|
79
|
+
<button class="btn btn-sm btn-success" id="template-edit-submit"><i class="fa fa-fw fa-check"></i></button>
|
|
80
|
+
</div>
|
|
81
|
+
</td>
|
|
82
|
+
</tr>
|
|
83
|
+
</tfoot>
|
|
84
|
+
</table>
|
|
101
85
|
</div>
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
86
|
+
</div>
|
|
87
|
+
<div class="tab-pane fade"
|
|
88
|
+
id="translations-customize-pane"
|
|
89
|
+
role="tabpanel"
|
|
90
|
+
aria-labelledby="translations-customize-tab"
|
|
91
|
+
tabindex="0">
|
|
92
|
+
<div class="card">
|
|
93
|
+
<table class="table">
|
|
94
|
+
<thead>
|
|
95
|
+
<tr>
|
|
96
|
+
<th>Language</th>
|
|
97
|
+
<th>Namespace</th>
|
|
98
|
+
<th>Key</th>
|
|
99
|
+
<th>Original</th>
|
|
100
|
+
<th>Replacement</th>
|
|
101
|
+
<th></th>
|
|
102
|
+
</tr>
|
|
103
|
+
</thead>
|
|
104
|
+
<tbody id="translations-list">
|
|
105
|
+
<!-- IMPORT partials/admin/plugins/customize/translations-list.tpl -->
|
|
106
|
+
</tbody>
|
|
107
|
+
<tfoot>
|
|
108
|
+
<tr id="translation-edit" class="translation">
|
|
109
|
+
<td>
|
|
110
|
+
<select id="translation-edit-language" class="form-select">
|
|
111
|
+
<option value="">---</option>
|
|
112
|
+
{{{each languages}}}
|
|
113
|
+
<option value="{./code}" {{{if ./selected}}}selected{{{end}}}>{./name} ({./code})</option>
|
|
114
|
+
{{{end}}}
|
|
115
|
+
</select>
|
|
116
|
+
</td>
|
|
117
|
+
<td>
|
|
118
|
+
<select id="translation-edit-namespace" class="form-select">
|
|
119
|
+
<option value="">---</option>
|
|
120
|
+
{{{each namespaces}}}
|
|
121
|
+
<option value="{./name}">{./name}</option>
|
|
122
|
+
{{{end}}}
|
|
123
|
+
</select>
|
|
124
|
+
</td>
|
|
125
|
+
<td>
|
|
126
|
+
<select id="translation-edit-key" class="form-select">
|
|
127
|
+
<!-- automatically fetch possible keys and autopopulate this -->
|
|
128
|
+
</select>
|
|
129
|
+
</td>
|
|
130
|
+
<td>
|
|
131
|
+
<span id="translation-edit-original"><!-- original goes here --></span>
|
|
132
|
+
</td>
|
|
133
|
+
<td>
|
|
134
|
+
<!-- set to original value at first -->
|
|
135
|
+
<textarea id="translation-edit-value" class="form-control"></textarea>
|
|
136
|
+
</td>
|
|
137
|
+
<td>
|
|
138
|
+
<button class="btn btn-ghost" id="translation-edit-submit"><i class="fa fa-fw fa-check text-success"></i></button>
|
|
139
|
+
</td>
|
|
140
|
+
</tr>
|
|
141
|
+
</tfoot>
|
|
142
|
+
</table>
|
|
143
|
+
</div>
|
|
144
|
+
</div>
|
|
106
145
|
</div>
|
|
107
146
|
|
|
108
147
|
<div class="modal fade" id="template-edit-modal" tabindex="-1" role="dialog" aria-labelledby="template-edit-modal-label">
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
148
|
+
<div class="modal-dialog modal-fullscreen" role="document">
|
|
149
|
+
<div class="modal-content">
|
|
150
|
+
<div class="modal-header">
|
|
151
|
+
<h4 class="modal-title" id="template-edit-modal-label">Edit Template Customization</h4>
|
|
152
|
+
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"><span aria-hidden="true"></span></button>
|
|
153
|
+
</div>
|
|
154
|
+
<div class="modal-body row">
|
|
155
|
+
<div class="col-md" id="template-edit-old"></div>
|
|
156
|
+
<div class="col-md" id="template-edit-value"></div>
|
|
157
|
+
</div>
|
|
158
|
+
<div class="modal-footer">
|
|
159
|
+
<button type="button" class="btn btn-outline-secondary" data-bs-dismiss="modal">Done</button>
|
|
160
|
+
</div>
|
|
161
|
+
</div>
|
|
122
162
|
</div>
|
|
123
163
|
</div>
|
|
124
|
-
</div>
|
|
125
164
|
</div>
|
|
126
165
|
</div>
|
|
127
166
|
</div>
|