Skip to content

Commit fc6c491

Browse files
committed
Fix display module version on configuration
1 parent bb0cb66 commit fc6c491

File tree

3 files changed

+27
-33
lines changed

3 files changed

+27
-33
lines changed

ps17/views/templates/admin/configuration.tpl

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,19 +44,17 @@
4444
#content.nobootstrap div.bootstrap.panel {
4545
display: none;
4646
}
47-
#content.nobootstrap .page-head h4.page-subtitle {
48-
display: none;
49-
}
5047
</style>
5148
5249
<script>
53-
// Enhance page title with subtitle and module version
54-
const pageTitle = document.querySelector('#content.nobootstrap .page-head h2.page-title');
55-
const pageSubtitle = document.querySelector('#content.nobootstrap .page-head h4.page-subtitle');
50+
// Enhance page subtitle with module version
51+
const pageSubtitles = document.querySelectorAll('#content.nobootstrap .page-head .page-subtitle, #content.bootstrap .page-head .page-subtitle');
52+
const moduleVersion = window?.store?.context?.moduleVersion ? ' v' + window.store.context.moduleVersion : '';
5653
57-
if (pageTitle) {
58-
pageTitle.textContent = pageTitle.textContent
59-
+ (pageSubtitle ? ' ' + pageSubtitle.textContent : '')
60-
+ (window?.store?.context?.moduleVersion ? ' v' + window.store.context.moduleVersion : '')
61-
}
54+
pageSubtitles?.forEach((pageSubtitle) => {
55+
if (pageSubtitle) {
56+
pageSubtitle.textContent = pageSubtitle.textContent
57+
+ moduleVersion;
58+
}
59+
});
6260
</script>

ps8/views/templates/admin/configuration.tpl

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,19 +44,17 @@
4444
#content.nobootstrap div.bootstrap.panel {
4545
display: none;
4646
}
47-
#content.nobootstrap .page-head h4.page-subtitle {
48-
display: none;
49-
}
5047
</style>
5148
5249
<script>
53-
// Enhance page title with subtitle and module version
54-
const pageTitle = document.querySelector('#content .page-head .page-title');
55-
const pageSubtitle = document.querySelector('#content .page-head .page-subtitle');
50+
// Enhance page subtitle with module version
51+
const pageSubtitles = document.querySelectorAll('#content.nobootstrap .page-head .page-subtitle, #content.bootstrap .page-head .page-subtitle');
52+
const moduleVersion = window?.store?.context?.moduleVersion ? ' v' + window.store.context.moduleVersion : '';
5653
57-
if (pageTitle) {
58-
pageTitle.textContent = pageTitle.textContent
59-
+ (pageSubtitle ? ' ' + pageSubtitle.textContent : '')
60-
+ (window?.store?.context?.moduleVersion ? ' v' + window.store.context.moduleVersion : '')
61-
}
54+
pageSubtitles?.forEach((pageSubtitle) => {
55+
if (pageSubtitle) {
56+
pageSubtitle.textContent = pageSubtitle.textContent
57+
+ moduleVersion;
58+
}
59+
});
6260
</script>

ps9/views/templates/admin/configuration.tpl

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,19 +44,17 @@
4444
#content.nobootstrap div.bootstrap.panel {
4545
display: none;
4646
}
47-
#content.nobootstrap .page-head h4.page-subtitle {
48-
display: none;
49-
}
5047
</style>
5148
5249
<script>
53-
// Enhance page title with subtitle and module version
54-
const pageTitle = document.querySelector('#content .page-head .page-title');
55-
const pageSubtitle = document.querySelector('#content .page-head .page-subtitle');
50+
// Enhance page subtitle with module version
51+
const pageSubtitles = document.querySelectorAll('#content.nobootstrap .page-head .page-subtitle, #content.bootstrap .page-head .page-subtitle');
52+
const moduleVersion = window?.store?.context?.moduleVersion ? ' v' + window.store.context.moduleVersion : '';
5653
57-
if (pageTitle) {
58-
pageTitle.textContent = pageTitle.textContent
59-
+ (pageSubtitle ? ' ' + pageSubtitle.textContent : '')
60-
+ (window?.store?.context?.moduleVersion ? ' v' + window.store.context.moduleVersion : '')
61-
}
54+
pageSubtitles?.forEach((pageSubtitle) => {
55+
if (pageSubtitle) {
56+
pageSubtitle.textContent = pageSubtitle.textContent
57+
+ moduleVersion;
58+
}
59+
});
6260
</script>

0 commit comments

Comments
 (0)