nodebb-plugin-customize 4.0.2 → 4.1.0
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/build.js +54 -55
- package/build/lib/build.js.map +1 -1
- package/build/lib/controllers.js +120 -119
- package/build/lib/controllers.js.map +1 -1
- package/build/lib/database.js +103 -91
- package/build/lib/database.js.map +1 -1
- package/build/lib/index.js +18 -18
- package/build/lib/pubsub.js +32 -33
- package/build/lib/pubsub.js.map +1 -1
- package/build/public/language/pl-PL/admin/plugins/customize.json +5 -0
- package/build/public/lib/index.js +10 -0
- package/build/public/lib/index.js.map +1 -0
- package/build/public/lib/shared.js +25 -0
- package/build/public/lib/shared.js.map +1 -0
- package/build/public/lib/templates.js +157 -0
- package/build/public/lib/templates.js.map +1 -0
- package/build/public/lib/translations.js +148 -0
- package/build/public/lib/translations.js.map +1 -0
- package/build/public/templates/404.tpl +12 -0
- package/build/public/templates/admin/plugins/customize.tpl +125 -110
- package/build/public/templates/partials/admin/plugins/customize/templates-list.tpl +1 -1
- package/lib/controllers.ts +1 -0
- package/lib/database.ts +24 -5
- package/package.json +17 -17
- package/public/lib/types.d.ts +2 -0
- package/public/templates/admin/plugins/customize.tpl +128 -115
- package/build/public/lib/admin.js +0 -345
- package/build/public/lib/admin.js.map +0 -1
|
@@ -1,118 +1,133 @@
|
|
|
1
|
-
<div class="
|
|
2
|
-
|
|
3
|
-
<
|
|
1
|
+
<div class="acp-page-container" style="max-width: 1200px;">
|
|
2
|
+
<div component="settings/main/header" class="row border-bottom py-2 m-0 sticky-top acp-page-main-header align-items-center">
|
|
3
|
+
<div class="col-12 col-md-8 px-0 mb-1 mb-md-0">
|
|
4
|
+
<h4 class="fw-bold tracking-tight mb-0">{title}</h4>
|
|
5
|
+
</div>
|
|
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">[[admin/admin:save-changes]]</button>
|
|
8
|
+
</div>
|
|
4
9
|
</div>
|
|
5
|
-
<table class="table">
|
|
6
|
-
<thead>
|
|
7
|
-
<tr>
|
|
8
|
-
<th>Language</th>
|
|
9
|
-
<th>Namespace</th>
|
|
10
|
-
<th>Key</th>
|
|
11
|
-
<th>Original</th>
|
|
12
|
-
<th>Replacement</th>
|
|
13
|
-
<th></th>
|
|
14
|
-
</tr>
|
|
15
|
-
</thead>
|
|
16
|
-
<tbody id="translations-list">
|
|
17
|
-
<!-- IMPORT partials/admin/plugins/customize/translations-list.tpl -->
|
|
18
|
-
</tbody>
|
|
19
|
-
<tfoot>
|
|
20
|
-
<tr id="translation-edit" class="translation">
|
|
21
|
-
<td>
|
|
22
|
-
<select id="translation-edit-language">
|
|
23
|
-
<option value="">---</option>
|
|
24
|
-
{{{each languages}}}
|
|
25
|
-
<option value="{./code}" {{{if ./selected}}}selected{{{end}}}>{./name} ({./code})</option>
|
|
26
|
-
{{{end}}}
|
|
27
|
-
</select>
|
|
28
|
-
</td>
|
|
29
|
-
<td>
|
|
30
|
-
<select id="translation-edit-namespace">
|
|
31
|
-
<option value="">---</option>
|
|
32
|
-
{{{each namespaces}}}
|
|
33
|
-
<option value="{./name}">{./name}</option>
|
|
34
|
-
{{{end}}}
|
|
35
|
-
</select>
|
|
36
|
-
</td>
|
|
37
|
-
<td>
|
|
38
|
-
<select id="translation-edit-key">
|
|
39
|
-
<!-- automatically fetch possible keys and autopopulate this -->
|
|
40
|
-
</select>
|
|
41
|
-
</td>
|
|
42
|
-
<td>
|
|
43
|
-
<span id="translation-edit-original"><!-- original goes here --></span>
|
|
44
|
-
</td>
|
|
45
|
-
<td>
|
|
46
|
-
<!-- set to original value at first -->
|
|
47
|
-
<textarea id="translation-edit-value"></textarea>
|
|
48
|
-
</td>
|
|
49
|
-
<td>
|
|
50
|
-
<button class="btn btn-submit" id="translation-edit-submit"><i class="fa fa-fw fa-check"></i></button>
|
|
51
|
-
</td>
|
|
52
|
-
</tr>
|
|
53
|
-
</tfoot>
|
|
54
|
-
</table>
|
|
55
|
-
</div>
|
|
56
10
|
|
|
57
|
-
<div class="
|
|
58
|
-
|
|
59
|
-
<h3 class="card-title">Template Customizations</h3>
|
|
60
|
-
</div>
|
|
61
|
-
<table class="table">
|
|
62
|
-
<thead>
|
|
63
|
-
<tr>
|
|
64
|
-
<th>Template</th>
|
|
65
|
-
<th>Diff</th>
|
|
66
|
-
<th></th>
|
|
67
|
-
</tr>
|
|
68
|
-
</thead>
|
|
69
|
-
<tbody id="templates-list">
|
|
70
|
-
<!-- IMPORT partials/admin/plugins/customize/templates-list.tpl -->
|
|
71
|
-
</tbody>
|
|
72
|
-
<tfoot>
|
|
73
|
-
<tr id="template-edit" class="template">
|
|
74
|
-
<td>
|
|
75
|
-
<select id="template-edit-path">
|
|
76
|
-
<option value="">---</option>
|
|
77
|
-
{{{each templatePaths}}}
|
|
78
|
-
<option value="{@value}">{@value}</option>
|
|
79
|
-
{{{end}}}
|
|
80
|
-
</select>
|
|
81
|
-
</td>
|
|
82
|
-
<td>
|
|
83
|
-
<pre><code id="template-edit-diff"><!-- diff goes here --></code></pre>
|
|
84
|
-
</td>
|
|
85
|
-
<td>
|
|
86
|
-
<button class="btn btn-primary" id="template-edit-open" data-toggle="modal" data-target="#template-edit-modal"><i class="fa fa-fw fa-pencil"></i></a>
|
|
87
|
-
<button class="btn btn-success" id="template-edit-submit"><i class="fa fa-fw fa-check"></i></button>
|
|
88
|
-
</td>
|
|
89
|
-
</tr>
|
|
90
|
-
</tfoot>
|
|
91
|
-
</table>
|
|
92
|
-
</div>
|
|
11
|
+
<div class="row m-0">
|
|
12
|
+
<div id="spy-container" class="col-12 px-0 mb-4" tabindex="0">
|
|
93
13
|
|
|
94
|
-
<div class="
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
<
|
|
99
|
-
|
|
14
|
+
<div class="card">
|
|
15
|
+
<div class="card-header">
|
|
16
|
+
<h4 class="card-title">Translation Customizations</h4>
|
|
17
|
+
</div>
|
|
18
|
+
<table class="table">
|
|
19
|
+
<thead>
|
|
20
|
+
<tr>
|
|
21
|
+
<th>Language</th>
|
|
22
|
+
<th>Namespace</th>
|
|
23
|
+
<th>Key</th>
|
|
24
|
+
<th>Original</th>
|
|
25
|
+
<th>Replacement</th>
|
|
26
|
+
<th></th>
|
|
27
|
+
</tr>
|
|
28
|
+
</thead>
|
|
29
|
+
<tbody id="translations-list">
|
|
30
|
+
<!-- IMPORT partials/admin/plugins/customize/translations-list.tpl -->
|
|
31
|
+
</tbody>
|
|
32
|
+
<tfoot>
|
|
33
|
+
<tr id="translation-edit" class="translation">
|
|
34
|
+
<td>
|
|
35
|
+
<select id="translation-edit-language" class="form-select">
|
|
36
|
+
<option value="">---</option>
|
|
37
|
+
{{{each languages}}}
|
|
38
|
+
<option value="{./code}" {{{if ./selected}}}selected{{{end}}}>{./name} ({./code})</option>
|
|
39
|
+
{{{end}}}
|
|
40
|
+
</select>
|
|
41
|
+
</td>
|
|
42
|
+
<td>
|
|
43
|
+
<select id="translation-edit-namespace" class="form-select">
|
|
44
|
+
<option value="">---</option>
|
|
45
|
+
{{{each namespaces}}}
|
|
46
|
+
<option value="{./name}">{./name}</option>
|
|
47
|
+
{{{end}}}
|
|
48
|
+
</select>
|
|
49
|
+
</td>
|
|
50
|
+
<td>
|
|
51
|
+
<select id="translation-edit-key" class="form-select">
|
|
52
|
+
<!-- automatically fetch possible keys and autopopulate this -->
|
|
53
|
+
</select>
|
|
54
|
+
</td>
|
|
55
|
+
<td>
|
|
56
|
+
<span id="translation-edit-original"><!-- original goes here --></span>
|
|
57
|
+
</td>
|
|
58
|
+
<td>
|
|
59
|
+
<!-- set to original value at first -->
|
|
60
|
+
<textarea id="translation-edit-value" class="form-control"></textarea>
|
|
61
|
+
</td>
|
|
62
|
+
<td>
|
|
63
|
+
<button class="btn btn-ghost" id="translation-edit-submit"><i class="fa fa-fw fa-check text-success"></i></button>
|
|
64
|
+
</td>
|
|
65
|
+
</tr>
|
|
66
|
+
</tfoot>
|
|
67
|
+
</table>
|
|
100
68
|
</div>
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
<div
|
|
69
|
+
|
|
70
|
+
<div class="card">
|
|
71
|
+
<div class="card-header">
|
|
72
|
+
<h4 class="card-title">Template Customizations</h4>
|
|
73
|
+
</div>
|
|
74
|
+
<table class="table">
|
|
75
|
+
<thead>
|
|
76
|
+
<tr>
|
|
77
|
+
<th>Template</th>
|
|
78
|
+
<th>Diff</th>
|
|
79
|
+
<th></th>
|
|
80
|
+
</tr>
|
|
81
|
+
</thead>
|
|
82
|
+
<tbody id="templates-list">
|
|
83
|
+
<!-- IMPORT partials/admin/plugins/customize/templates-list.tpl -->
|
|
84
|
+
</tbody>
|
|
85
|
+
<tfoot>
|
|
86
|
+
<tr id="template-edit" class="template">
|
|
87
|
+
<td>
|
|
88
|
+
<select id="template-edit-path" class="form-select">
|
|
89
|
+
<option value="">---</option>
|
|
90
|
+
{{{each templatePaths}}}
|
|
91
|
+
<option value="{@value}">{@value}</option>
|
|
92
|
+
{{{end}}}
|
|
93
|
+
</select>
|
|
94
|
+
</td>
|
|
95
|
+
<td>
|
|
96
|
+
<pre class="diff-preview"><code id="template-edit-diff"><!-- diff goes here --></code></pre>
|
|
97
|
+
</td>
|
|
98
|
+
<td>
|
|
99
|
+
<div class="d-flex gap-2">
|
|
100
|
+
<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>
|
|
101
|
+
<button class="btn btn-sm btn-success" id="template-edit-submit"><i class="fa fa-fw fa-check"></i></button>
|
|
102
|
+
</div>
|
|
103
|
+
</td>
|
|
104
|
+
</tr>
|
|
105
|
+
</tfoot>
|
|
106
|
+
</table>
|
|
104
107
|
</div>
|
|
105
|
-
|
|
106
|
-
|
|
108
|
+
|
|
109
|
+
<div class="modal fade" id="template-edit-modal" tabindex="-1" role="dialog" aria-labelledby="template-edit-modal-label">
|
|
110
|
+
<div class="modal-dialog modal-fullscreen" role="document">
|
|
111
|
+
<div class="modal-content">
|
|
112
|
+
<div class="modal-header">
|
|
113
|
+
<h4 class="modal-title" id="template-edit-modal-label">Edit Template Customization</h4>
|
|
114
|
+
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"><span aria-hidden="true"></span></button>
|
|
115
|
+
</div>
|
|
116
|
+
<div class="modal-body row">
|
|
117
|
+
<div class="col-md" id="template-edit-old"></div>
|
|
118
|
+
<div class="col-md" id="template-edit-value"></div>
|
|
119
|
+
</div>
|
|
120
|
+
<div class="modal-footer">
|
|
121
|
+
<button type="button" class="btn btn-outline-secondary" data-bs-dismiss="modal">Done</button>
|
|
122
|
+
</div>
|
|
123
|
+
</div>
|
|
124
|
+
</div>
|
|
107
125
|
</div>
|
|
108
|
-
|
|
109
|
-
|
|
126
|
+
</div>
|
|
127
|
+
</div>
|
|
110
128
|
</div>
|
|
111
129
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
>
|
|
117
|
-
<i class="material-icons">build</i>
|
|
118
|
-
</button>
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
data-json="{./json}"
|
|
7
7
|
>
|
|
8
8
|
<td>{./path}</td>
|
|
9
|
-
<td><pre><code>{./diff}</code></pre></td>
|
|
9
|
+
<td><pre class="diff-preview"><code>{./diff}</code></pre></td>
|
|
10
10
|
<td>
|
|
11
11
|
<button class="btn btn-link edit"><i class="fa fa-fw fa-cog"></i></a>
|
|
12
12
|
<button class="btn btn-link delete"><i class="fa fa-fw fa-trash text-danger"></i></a>
|
package/lib/controllers.ts
CHANGED
package/lib/database.ts
CHANGED
|
@@ -97,6 +97,14 @@ interface TemplateHash {
|
|
|
97
97
|
old: string;
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
+
const PATCH_FAILED_NOTICE = `
|
|
101
|
+
<!--
|
|
102
|
+
Attention: PATCH FAILED
|
|
103
|
+
To fix this, you will need to delete this customization
|
|
104
|
+
and then recreate it manually.
|
|
105
|
+
-->
|
|
106
|
+
`;
|
|
107
|
+
|
|
100
108
|
export async function getTemplates(): Promise<Template[]> {
|
|
101
109
|
const paths = await getSortedSetRange(templatesSet, 0, -1);
|
|
102
110
|
const [hashes, currentValues]: [TemplateHash[], string[]] = await Promise.all([
|
|
@@ -107,11 +115,22 @@ export async function getTemplates(): Promise<Template[]> {
|
|
|
107
115
|
})),
|
|
108
116
|
]);
|
|
109
117
|
|
|
110
|
-
return currentValues.map((current, i) =>
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
118
|
+
return currentValues.map((current, i) => {
|
|
119
|
+
const patched = applyPatch(hashes[i].old, hashes[i].diff);
|
|
120
|
+
if (patched === false) {
|
|
121
|
+
return {
|
|
122
|
+
...hashes[i],
|
|
123
|
+
path: paths[i],
|
|
124
|
+
value: PATCH_FAILED_NOTICE + hashes[i].old,
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
return {
|
|
129
|
+
...hashes[i],
|
|
130
|
+
path: paths[i],
|
|
131
|
+
value: patched as string,
|
|
132
|
+
};
|
|
133
|
+
});
|
|
115
134
|
}
|
|
116
135
|
|
|
117
136
|
export async function editTemplate({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nodebb-plugin-customize",
|
|
3
|
-
"version": "4.0
|
|
3
|
+
"version": "4.1.0",
|
|
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": "^3.0.0"
|
|
13
|
+
"compatibility": "^3.2.0 || ^4.0.0"
|
|
14
14
|
},
|
|
15
15
|
"keywords": [
|
|
16
16
|
"nodebb",
|
|
@@ -20,26 +20,26 @@
|
|
|
20
20
|
"template"
|
|
21
21
|
],
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"diff": "^5.
|
|
24
|
-
"fs-extra": "^11.
|
|
23
|
+
"diff": "^5.2.0",
|
|
24
|
+
"fs-extra": "^11.2.0",
|
|
25
25
|
"lodash": "^4.17.21"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@types/ace": "^0.0.48",
|
|
29
|
-
"@types/bootstrap": "^5.2.
|
|
30
|
-
"@types/diff": "^5.
|
|
31
|
-
"@types/express": "^4.17.
|
|
32
|
-
"@types/fs-extra": "^11.0.
|
|
33
|
-
"@types/jquery": "^3.5.
|
|
34
|
-
"@types/lodash": "^4.
|
|
35
|
-
"@types/nconf": "^0.10.
|
|
36
|
-
"@types/node": "^20.
|
|
37
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
38
|
-
"@typescript-eslint/parser": "^
|
|
39
|
-
"eslint": "^8.
|
|
29
|
+
"@types/bootstrap": "^5.2.10",
|
|
30
|
+
"@types/diff": "^5.2.1",
|
|
31
|
+
"@types/express": "^4.17.21",
|
|
32
|
+
"@types/fs-extra": "^11.0.4",
|
|
33
|
+
"@types/jquery": "^3.5.30",
|
|
34
|
+
"@types/lodash": "^4.17.6",
|
|
35
|
+
"@types/nconf": "^0.10.6",
|
|
36
|
+
"@types/node": "^20.14.9",
|
|
37
|
+
"@typescript-eslint/eslint-plugin": "^7.14.1",
|
|
38
|
+
"@typescript-eslint/parser": "^7.14.1",
|
|
39
|
+
"eslint": "^8.57.0",
|
|
40
40
|
"eslint-config-airbnb-base": "^15.0.0",
|
|
41
|
-
"eslint-plugin-import": "^2.
|
|
42
|
-
"typescript": "^5.
|
|
41
|
+
"eslint-plugin-import": "^2.29.1",
|
|
42
|
+
"typescript": "^5.5.2"
|
|
43
43
|
},
|
|
44
44
|
"scripts": {
|
|
45
45
|
"lint": "eslint lib/* && eslint public/lib/*",
|
package/public/lib/types.d.ts
CHANGED
|
@@ -1,119 +1,132 @@
|
|
|
1
|
-
<div class="
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
<th>Key</th>
|
|
11
|
-
<th>Original</th>
|
|
12
|
-
<th>Replacement</th>
|
|
13
|
-
<th></th>
|
|
14
|
-
</tr>
|
|
15
|
-
</thead>
|
|
16
|
-
<tbody id="translations-list">
|
|
17
|
-
<!-- IMPORT partials/admin/plugins/customize/translations-list.tpl -->
|
|
18
|
-
</tbody>
|
|
19
|
-
<tfoot>
|
|
20
|
-
<tr id="translation-edit" class="translation">
|
|
21
|
-
<td>
|
|
22
|
-
<select id="translation-edit-language">
|
|
23
|
-
<option value="">---</option>
|
|
24
|
-
{{{each languages}}}
|
|
25
|
-
<option value="{./code}" {{{if ./selected}}}selected{{{end}}}>{./name} ({./code})</option>
|
|
26
|
-
{{{end}}}
|
|
27
|
-
</select>
|
|
28
|
-
</td>
|
|
29
|
-
<td>
|
|
30
|
-
<select id="translation-edit-namespace">
|
|
31
|
-
<option value="">---</option>
|
|
32
|
-
{{{each namespaces}}}
|
|
33
|
-
<option value="{./name}">{./name}</option>
|
|
34
|
-
{{{end}}}
|
|
35
|
-
</select>
|
|
36
|
-
</td>
|
|
37
|
-
<td>
|
|
38
|
-
<select id="translation-edit-key">
|
|
39
|
-
<!-- automatically fetch possible keys and autopopulate this -->
|
|
40
|
-
</select>
|
|
41
|
-
</td>
|
|
42
|
-
<td>
|
|
43
|
-
<span id="translation-edit-original"><!-- original goes here --></span>
|
|
44
|
-
</td>
|
|
45
|
-
<td>
|
|
46
|
-
<!-- set to original value at first -->
|
|
47
|
-
<textarea id="translation-edit-value"></textarea>
|
|
48
|
-
</td>
|
|
49
|
-
<td>
|
|
50
|
-
<button class="btn btn-submit" id="translation-edit-submit"><i class="fa fa-fw fa-check"></i></button>
|
|
51
|
-
</td>
|
|
52
|
-
</tr>
|
|
53
|
-
</tfoot>
|
|
54
|
-
</table>
|
|
55
|
-
</div>
|
|
1
|
+
<div class="acp-page-container" style="max-width: 1200px;">
|
|
2
|
+
<div component="settings/main/header" class="row border-bottom py-2 m-0 sticky-top acp-page-main-header align-items-center">
|
|
3
|
+
<div class="col-12 col-md-8 px-0 mb-1 mb-md-0">
|
|
4
|
+
<h4 class="fw-bold tracking-tight mb-0">{title}</h4>
|
|
5
|
+
</div>
|
|
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">[[admin/admin:save-changes]]</button>
|
|
8
|
+
</div>
|
|
9
|
+
</div>
|
|
56
10
|
|
|
57
|
-
<div class="
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
11
|
+
<div class="row m-0">
|
|
12
|
+
<div id="spy-container" class="col-12 px-0 mb-4" tabindex="0">
|
|
13
|
+
<div class="card">
|
|
14
|
+
<div class="card-header">
|
|
15
|
+
<h4 class="card-title">Translation Customizations</h4>
|
|
16
|
+
</div>
|
|
17
|
+
<table class="table">
|
|
18
|
+
<thead>
|
|
19
|
+
<tr>
|
|
20
|
+
<th>Language</th>
|
|
21
|
+
<th>Namespace</th>
|
|
22
|
+
<th>Key</th>
|
|
23
|
+
<th>Original</th>
|
|
24
|
+
<th>Replacement</th>
|
|
25
|
+
<th></th>
|
|
26
|
+
</tr>
|
|
27
|
+
</thead>
|
|
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>
|
|
93
68
|
|
|
94
|
-
<div class="
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
69
|
+
<div class="card">
|
|
70
|
+
<div class="card-header">
|
|
71
|
+
<h4 class="card-title">Template Customizations</h4>
|
|
72
|
+
</div>
|
|
73
|
+
<table class="table">
|
|
74
|
+
<thead>
|
|
75
|
+
<tr>
|
|
76
|
+
<th>Template</th>
|
|
77
|
+
<th>Diff</th>
|
|
78
|
+
<th></th>
|
|
79
|
+
</tr>
|
|
80
|
+
</thead>
|
|
81
|
+
<tbody id="templates-list">
|
|
82
|
+
<!-- IMPORT partials/admin/plugins/customize/templates-list.tpl -->
|
|
83
|
+
</tbody>
|
|
84
|
+
<tfoot>
|
|
85
|
+
<tr id="template-edit" class="template">
|
|
86
|
+
<td>
|
|
87
|
+
<select id="template-edit-path" class="form-select">
|
|
88
|
+
<option value="">---</option>
|
|
89
|
+
{{{each templatePaths}}}
|
|
90
|
+
<option value="{@value}">{@value}</option>
|
|
91
|
+
{{{end}}}
|
|
92
|
+
</select>
|
|
93
|
+
</td>
|
|
94
|
+
<td>
|
|
95
|
+
<pre class="diff-preview"><code id="template-edit-diff"><!-- diff goes here --></code></pre>
|
|
96
|
+
</td>
|
|
97
|
+
<td>
|
|
98
|
+
<div class="d-flex gap-2">
|
|
99
|
+
<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>
|
|
100
|
+
<button class="btn btn-sm btn-success" id="template-edit-submit"><i class="fa fa-fw fa-check"></i></button>
|
|
101
|
+
</div>
|
|
102
|
+
</td>
|
|
103
|
+
</tr>
|
|
104
|
+
</tfoot>
|
|
105
|
+
</table>
|
|
106
|
+
</div>
|
|
107
|
+
|
|
108
|
+
<div class="modal fade" id="template-edit-modal" tabindex="-1" role="dialog" aria-labelledby="template-edit-modal-label">
|
|
109
|
+
<div class="modal-dialog modal-fullscreen" role="document">
|
|
110
|
+
<div class="modal-content">
|
|
111
|
+
<div class="modal-header">
|
|
112
|
+
<h4 class="modal-title" id="template-edit-modal-label">Edit Template Customization</h4>
|
|
113
|
+
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"><span aria-hidden="true"></span></button>
|
|
114
|
+
</div>
|
|
115
|
+
<div class="modal-body row">
|
|
116
|
+
<div class="col-md" id="template-edit-old"></div>
|
|
117
|
+
<div class="col-md" id="template-edit-value"></div>
|
|
118
|
+
</div>
|
|
119
|
+
<div class="modal-footer">
|
|
120
|
+
<button type="button" class="btn btn-outline-secondary" data-bs-dismiss="modal">Done</button>
|
|
121
|
+
</div>
|
|
122
|
+
</div>
|
|
123
|
+
</div>
|
|
124
|
+
</div>
|
|
125
|
+
</div>
|
|
126
|
+
</div>
|
|
110
127
|
</div>
|
|
111
128
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
title="[[admin/plugins/customize:build_description]]"
|
|
117
|
-
>
|
|
118
|
-
<i class="fa fa-fw fas fa-hammer"></i>
|
|
119
|
-
</button>
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
|