Added attribution to environments

This commit is contained in:
WBHarry 2025-08-17 02:19:22 +02:00
parent 54da1e1872
commit c73f6202bd
26 changed files with 280 additions and 145 deletions

View file

@ -130,7 +130,8 @@ export default function DHApplicationMixin(Base) {
async _renderFrame(options) {
const frame = await super._renderFrame(options);
if (this.document.system.metadata.hasAttribution) {
const headerAttribution = !['environment'].includes(this.document.type);
if (this.document.system.metadata.hasAttribution && headerAttribution) {
const { source, page } = this.document.system.attribution;
const attribution = [source, page ? `pg ${page}.` : null].filter(x => x).join('. ');
const element = `<label class="attribution-header-label">${attribution}</label>`;
@ -144,7 +145,8 @@ export default function DHApplicationMixin(Base) {
* Refresh the custom parts of the application frame
*/
refreshFrame() {
if (this.document.system.metadata.hasAttribution) {
const headerAttribution = !['environment'].includes(this.document.type);
if (this.document.system.metadata.hasAttribution && headerAttribution) {
const { source, page } = this.document.system.attribution;
const attribution = [source, page ? `pg ${page}.` : null].filter(x => x).join('. ');