((resolve, reject) => {
+ imgEl.nativeElement.addEventListener('load', () => resolve());
+ imgEl.nativeElement.addEventListener('error', () => resolve());
+ });
+ }
+
+ // Executes again because the 'img' element could have been updated due to a loading error
+ fixture.detectChanges();
+ });
+
+ it('should render or not the component',
+ () => {
+ const componentEl = fixture.debugElement.query(By.css('.item-page-field'));
+ expect(Boolean(componentEl)).toBe(testCase.expected.render);
+ },
+ );
+
+ it('should show/hide CC license name',
+ () => {
+ const nameEl = fixture.debugElement.query(de => de.nativeElement.id === 'cc-name');
+ expect(Boolean(nameEl)).toBe(testCase.expected.showName);
+ if (nameEl && testCase.expected.showName) {
+ expect(nameEl.nativeElement.innerHTML).toContain(licenseNameMock);
+ }
+ },
+ );
+
+ it('should show CC license image',
+ () => {
+ const imgEl = fixture.debugElement.query(By.css('img'));
+ expect(Boolean(imgEl)).toBe(testCase.expected.showImage);
+ },
+ );
+
+ it('should use name fallback when CC image fails loading',
+ () => {
+ const nameEl = fixture.debugElement.query(de => de.nativeElement.id === 'cc-name');
+ expect(Boolean(nameEl)).toBe(testCase.expected.showName);
+ if (nameEl && testCase.expected.showName) {
+ expect(nameEl.nativeElement.innerHTML).toContain(licenseNameMock);
+ }
+ },
+ );
+
+ it('should show or not CC license disclaimer',
+ () => {
+ const disclaimerEl = fixture.debugElement.query(By.css('span'));
+ if (testCase.expected.showDisclaimer) {
+ expect(disclaimerEl).toBeTruthy();
+ expect(disclaimerEl.nativeElement.innerHTML).toContain('item.page.cc.license.disclaimer');
+ } else if (testCase.expected.render) {
+ expect(disclaimerEl).toBeTruthy();
+ expect(disclaimerEl.nativeElement.innerHTML).not.toContain('item.page.cc.license.disclaimer');
+ } else {
+ expect(disclaimerEl).toBeFalsy();
+ }
+ },
+ );
+ });
+ });
+});
diff --git a/src/app/item-page/simple/field-components/specific-field/cc-license/item-page-cc-license-field.component.ts b/src/app/item-page/simple/field-components/specific-field/cc-license/item-page-cc-license-field.component.ts
new file mode 100644
index 00000000000..5d19fe4b4e2
--- /dev/null
+++ b/src/app/item-page/simple/field-components/specific-field/cc-license/item-page-cc-license-field.component.ts
@@ -0,0 +1,73 @@
+import {
+ NgClass,
+ NgIf,
+ NgStyle,
+} from '@angular/common';
+import {
+ Component,
+ Input,
+ OnInit,
+} from '@angular/core';
+import { TranslateModule } from '@ngx-translate/core';
+import { Item } from 'src/app/core/shared/item.model';
+import { MetadataFieldWrapperComponent } from 'src/app/shared/metadata-field-wrapper/metadata-field-wrapper.component';
+
+@Component({
+ selector: 'ds-item-page-cc-license-field',
+ templateUrl: './item-page-cc-license-field.component.html',
+ standalone: true,
+ imports: [NgIf, NgClass, NgStyle, TranslateModule, MetadataFieldWrapperComponent],
+})
+/**
+ * Displays the item's Creative Commons license image in it's simple item page
+ */
+export class ItemPageCcLicenseFieldComponent implements OnInit {
+ /**
+ * The item to display the CC license image for
+ */
+ @Input() item: Item;
+
+ /**
+ * 'full' variant shows image, a disclaimer (optional) and name (always), better for the item page content.
+ * 'small' variant shows image and name (optional), better for the item page sidebar
+ */
+ @Input() variant?: 'small' | 'full' = 'small';
+
+ /**
+ * Filed name containing the CC license URI, as configured in the back-end, in the 'dspace.cfg' file, propertie
+ * 'cc.license.uri'
+ */
+ @Input() ccLicenseUriField? = 'dc.rights.uri';
+
+ /**
+ * Filed name containing the CC license name, as configured in the back-end, in the 'dspace.cfg' file, propertie
+ * 'cc.license.name'
+ */
+ @Input() ccLicenseNameField? = 'dc.rights';
+
+ /**
+ * Shows the CC license name with the image. Always show if image fails to load
+ */
+ @Input() showName? = true;
+
+ /**
+ * Shows the disclaimer in the 'full' variant of the component
+ */
+ @Input() showDisclaimer? = true;
+
+ uri: string;
+ name: string;
+ showImage = true;
+ imgSrc: string;
+
+ ngOnInit() {
+ this.uri = this.item.firstMetadataValue(this.ccLicenseUriField);
+ this.name = this.item.firstMetadataValue(this.ccLicenseNameField);
+
+ // Extracts the CC license code from the URI
+ const regex = /.*creativecommons.org\/(licenses|publicdomain)\/([^/]+)/gm;
+ const matches = regex.exec(this.uri ?? '') ?? [];
+ const ccCode = matches.length > 2 ? matches[2] : null;
+ this.imgSrc = ccCode ? `assets/images/cc-licenses/${ccCode}.png` : null;
+ }
+}
diff --git a/src/app/item-page/simple/item-types/untyped-item/untyped-item.component.html b/src/app/item-page/simple/item-types/untyped-item/untyped-item.component.html
index 35a00dc7b7f..66300f35ca4 100644
--- a/src/app/item-page/simple/item-types/untyped-item/untyped-item.component.html
+++ b/src/app/item-page/simple/item-types/untyped-item/untyped-item.component.html
@@ -86,6 +86,8 @@
[fields]="['datacite.relation.isReferencedBy']"
[label]="'item.page.dataset'">
+
+
{{"item.page.link.full" | translate}}
diff --git a/src/app/item-page/simple/item-types/untyped-item/untyped-item.component.ts b/src/app/item-page/simple/item-types/untyped-item/untyped-item.component.ts
index 74b4b50875b..3ee6ee9401e 100644
--- a/src/app/item-page/simple/item-types/untyped-item/untyped-item.component.ts
+++ b/src/app/item-page/simple/item-types/untyped-item/untyped-item.component.ts
@@ -21,6 +21,7 @@ import { ThemedMediaViewerComponent } from '../../../media-viewer/themed-media-v
import { MiradorViewerComponent } from '../../../mirador-viewer/mirador-viewer.component';
import { ThemedFileSectionComponent } from '../../field-components/file-section/themed-file-section.component';
import { ItemPageAbstractFieldComponent } from '../../field-components/specific-field/abstract/item-page-abstract-field.component';
+import { ItemPageCcLicenseFieldComponent } from '../../field-components/specific-field/cc-license/item-page-cc-license-field.component';
import { ItemPageDateFieldComponent } from '../../field-components/specific-field/date/item-page-date-field.component';
import { GenericItemPageFieldComponent } from '../../field-components/specific-field/generic/generic-item-page-field.component';
import { ThemedItemPageTitleFieldComponent } from '../../field-components/specific-field/title/themed-item-page-field.component';
@@ -39,7 +40,7 @@ import { ItemComponent } from '../shared/item.component';
templateUrl: './untyped-item.component.html',
changeDetection: ChangeDetectionStrategy.OnPush,
standalone: true,
- imports: [NgIf, ThemedResultsBackButtonComponent, MiradorViewerComponent, ThemedItemPageTitleFieldComponent, DsoEditMenuComponent, MetadataFieldWrapperComponent, ThemedThumbnailComponent, ThemedMediaViewerComponent, ThemedFileSectionComponent, ItemPageDateFieldComponent, ThemedMetadataRepresentationListComponent, GenericItemPageFieldComponent, ItemPageAbstractFieldComponent, ItemPageUriFieldComponent, CollectionsComponent, RouterLink, AsyncPipe, TranslateModule],
+ imports: [NgIf, ThemedResultsBackButtonComponent, MiradorViewerComponent, ThemedItemPageTitleFieldComponent, DsoEditMenuComponent, MetadataFieldWrapperComponent, ThemedThumbnailComponent, ThemedMediaViewerComponent, ThemedFileSectionComponent, ItemPageDateFieldComponent, ThemedMetadataRepresentationListComponent, GenericItemPageFieldComponent, ItemPageAbstractFieldComponent, ItemPageUriFieldComponent, CollectionsComponent, RouterLink, AsyncPipe, TranslateModule, ItemPageCcLicenseFieldComponent],
})
export class UntypedItemComponent extends ItemComponent {
diff --git a/src/assets/i18n/en.json5 b/src/assets/i18n/en.json5
index 43e1d48fb0e..5da05fa0eda 100644
--- a/src/assets/i18n/en.json5
+++ b/src/assets/i18n/en.json5
@@ -6647,4 +6647,8 @@
"search.filters.filter.notifyEndorsement.placeholder": "Notify Endorsement",
"search.filters.filter.notifyEndorsement.label": "Search Notify Endorsement",
+
+ "item.page.cc.license.title": "Creative Commons license",
+
+ "item.page.cc.license.disclaimer": "Except where otherwised noted, this item's license is described as",
}
diff --git a/src/assets/images/cc-licenses/by-nc-nd.png b/src/assets/images/cc-licenses/by-nc-nd.png
new file mode 100644
index 00000000000..5a8dbd0652e
Binary files /dev/null and b/src/assets/images/cc-licenses/by-nc-nd.png differ
diff --git a/src/assets/images/cc-licenses/by-nc-sa.png b/src/assets/images/cc-licenses/by-nc-sa.png
new file mode 100644
index 00000000000..b9a55533c0c
Binary files /dev/null and b/src/assets/images/cc-licenses/by-nc-sa.png differ
diff --git a/src/assets/images/cc-licenses/by-nc.png b/src/assets/images/cc-licenses/by-nc.png
new file mode 100644
index 00000000000..25e284099a0
Binary files /dev/null and b/src/assets/images/cc-licenses/by-nc.png differ
diff --git a/src/assets/images/cc-licenses/by-nd.png b/src/assets/images/cc-licenses/by-nd.png
new file mode 100644
index 00000000000..fc3d26789a0
Binary files /dev/null and b/src/assets/images/cc-licenses/by-nd.png differ
diff --git a/src/assets/images/cc-licenses/by-sa.png b/src/assets/images/cc-licenses/by-sa.png
new file mode 100644
index 00000000000..8770732928c
Binary files /dev/null and b/src/assets/images/cc-licenses/by-sa.png differ
diff --git a/src/assets/images/cc-licenses/by.png b/src/assets/images/cc-licenses/by.png
new file mode 100644
index 00000000000..c8473a24786
Binary files /dev/null and b/src/assets/images/cc-licenses/by.png differ
diff --git a/src/assets/images/cc-licenses/zero.png b/src/assets/images/cc-licenses/zero.png
new file mode 100644
index 00000000000..4ff09a0bb26
Binary files /dev/null and b/src/assets/images/cc-licenses/zero.png differ
diff --git a/src/themes/custom/app/item-page/simple/item-types/untyped-item/untyped-item.component.ts b/src/themes/custom/app/item-page/simple/item-types/untyped-item/untyped-item.component.ts
index d9b5fabc0f2..39653665859 100644
--- a/src/themes/custom/app/item-page/simple/item-types/untyped-item/untyped-item.component.ts
+++ b/src/themes/custom/app/item-page/simple/item-types/untyped-item/untyped-item.component.ts
@@ -25,6 +25,7 @@ import { MetadataFieldWrapperComponent } from '../../../../../../../app/shared/m
import { listableObjectComponent } from '../../../../../../../app/shared/object-collection/shared/listable-object/listable-object.decorator';
import { ThemedResultsBackButtonComponent } from '../../../../../../../app/shared/results-back-button/themed-results-back-button.component';
import { ThemedThumbnailComponent } from '../../../../../../../app/thumbnail/themed-thumbnail.component';
+import { ItemPageCcLicenseFieldComponent } from 'src/app/item-page/simple/field-components/specific-field/cc-license/item-page-cc-license-field.component';
/**
* Component that represents an untyped Item page
@@ -56,6 +57,7 @@ import { ThemedThumbnailComponent } from '../../../../../../../app/thumbnail/the
RouterLink,
ItemPageUriFieldComponent,
ItemPageAbstractFieldComponent,
+ ItemPageCcLicenseFieldComponent,
],
})
export class UntypedItemComponent extends BaseComponent {
diff --git a/src/themes/sistedes/app/entity-groups/sistedes-entities/item-pages/sistedes-publication/sistedes-publication.component.html b/src/themes/sistedes/app/entity-groups/sistedes-entities/item-pages/sistedes-publication/sistedes-publication.component.html
index 0303291841c..aa433784620 100644
--- a/src/themes/sistedes/app/entity-groups/sistedes-entities/item-pages/sistedes-publication/sistedes-publication.component.html
+++ b/src/themes/sistedes/app/entity-groups/sistedes-entities/item-pages/sistedes-publication/sistedes-publication.component.html
@@ -39,10 +39,14 @@
[fields]="['dc.relation.ispartof']"
[label]="'item.page.is-part-of'">
-
-
+
+
+
+
+
+
diff --git a/src/themes/sistedes/app/entity-groups/sistedes-entities/item-pages/sistedes-publication/sistedes-publication.component.ts b/src/themes/sistedes/app/entity-groups/sistedes-entities/item-pages/sistedes-publication/sistedes-publication.component.ts
index e73bcef2dad..26a2c89aa6c 100644
--- a/src/themes/sistedes/app/entity-groups/sistedes-entities/item-pages/sistedes-publication/sistedes-publication.component.ts
+++ b/src/themes/sistedes/app/entity-groups/sistedes-entities/item-pages/sistedes-publication/sistedes-publication.component.ts
@@ -33,6 +33,7 @@ import { MetadataValue } from 'src/app/core/shared/metadata.models';
import { MetadataUriValuesComponent } from 'src/app/item-page/field-components/metadata-uri-values/metadata-uri-values.component';
import { Citation } from 'src/themes/sistedes/app/shared/citations/citation-util.module';
import { CollectionsWithParentComponent } from 'src/themes/sistedes/app/item-page/field-components/collections/collections-with-parent.component';
+import { ItemPageCcLicenseFieldComponent } from 'src/app/item-page/simple/field-components/specific-field/cc-license/item-page-cc-license-field.component';
/**
* Component that represents a conference publication Item page
@@ -70,6 +71,7 @@ import { CollectionsWithParentComponent } from 'src/themes/sistedes/app/item-pag
AsyncPipe,TranslateModule,
MetadataUriValuesComponent,
CollectionsWithParentComponent,
+ ItemPageCcLicenseFieldComponent,
],
})
export class SistedesPublicationComponent extends ItemComponent {
diff --git a/src/themes/sistedes/assets/i18n/es.json5 b/src/themes/sistedes/assets/i18n/es.json5
index 4793e404cfe..074048b96a8 100644
--- a/src/themes/sistedes/assets/i18n/es.json5
+++ b/src/themes/sistedes/assets/i18n/es.json5
@@ -80,6 +80,9 @@
"community.page.handle": "URI permantente para esta comunidad:",
"community.page.report-error": "Notificar un error en esta comunidad",
"community.search.results.head": "Resultados de la búsqueda",
+ "curation-task.task.filtermedia.label": "Filtrar medios",
+ "curation-task.task.movecclicense.label": "Mover licencia Creative Commons",
+ "curation-task.task.registerexternalhandle.label": "Registrar Handle externo",
"curation-task.task.registerdoi.label": "Registro DOI",
"dso-selector.set-scope.community.button": "Buscar en toda la biblioteca",
"dso.name.unnamed": "Sin nombre",
@@ -124,6 +127,8 @@
"item.page.bibtex.download": "Descargar cita en BibTeX",
"item.page.bibtex.hide": "Ocultar cita en BibTeX",
"item.page.bibtex.show": "Mostrar cita en BibTeX",
+ "item.page.cc.license.disclaimer": "Salvo indicación contraria, la licencia de este elemento se describe como",
+ "item.page.cc.license.title": "Licencia Creative Commons",
"item.page.cite.hide": "Ocultar cita",
"item.page.cite.show": "Mostrar cita",
"item.page.filesection.other.bundle": "Otros",