diff --git a/src/app/collection-page/collection-form/collection-form.models.ts b/src/app/collection-page/collection-form/collection-form.models.ts index 22998af674e..20d829b3f8c 100644 --- a/src/app/collection-page/collection-form/collection-form.models.ts +++ b/src/app/collection-page/collection-form/collection-form.models.ts @@ -54,4 +54,9 @@ export const collectionFormModels: DynamicFormControlModel[] = [ name: 'dc.rights.license', spellCheck: environment.form.spellCheck, }), + new DynamicTextAreaModel({ + id: 'thumbnail', + name: 'dspace.thumbnail.description', + spellCheck: environment.form.spellCheck, + }), ]; diff --git a/src/app/collection-page/collection-page.component.html b/src/app/collection-page/collection-page.component.html index 4a3e28c6aad..da6d8165118 100644 --- a/src/app/collection-page/collection-page.component.html +++ b/src/app/collection-page/collection-page.component.html @@ -10,10 +10,15 @@ - - + + [alternateText]="collection.descriptionThumbnail"> + + + diff --git a/src/app/community-page/community-form/community-form.component.ts b/src/app/community-page/community-form/community-form.component.ts index d32d9e408f2..4b6a22aa873 100644 --- a/src/app/community-page/community-form/community-form.component.ts +++ b/src/app/community-page/community-form/community-form.component.ts @@ -101,6 +101,11 @@ export class CommunityFormComponent extends ComColFormComponent imple name: 'dc.description.tableofcontents', spellCheck: environment.form.spellCheck, }), + new DynamicTextAreaModel({ + id: 'thumbnail', + name: 'dspace.thumbnail.description', + spellCheck: environment.form.spellCheck, + }), ]; public constructor(protected formService: DynamicFormService, diff --git a/src/app/community-page/community-page.component.html b/src/app/community-page/community-page.component.html index a695e2019a3..2262e6ae5e3 100644 --- a/src/app/community-page/community-page.component.html +++ b/src/app/community-page/community-page.component.html @@ -6,8 +6,11 @@
- - + + + + + diff --git a/src/app/core/shared/collection.model.ts b/src/app/core/shared/collection.model.ts index b929e54ccb4..cf61b724ebc 100644 --- a/src/app/core/shared/collection.model.ts +++ b/src/app/core/shared/collection.model.ts @@ -130,6 +130,14 @@ export class Collection extends DSpaceObject implements ChildHALResource, Handle return this.firstMetadataValue('dc.description.tableofcontents'); } + /** + * The thumbail description of this Collection + * Corresponds to the metadata field dspace.thumbnail.description + */ + get descriptionThumbnail(): string { + return this.firstMetadataValue('dspace.thumbnail.description'); + } + getParentLinkKey(): keyof this['_links'] { return 'parentCommunity'; } diff --git a/src/app/core/shared/community.model.ts b/src/app/core/shared/community.model.ts index 31b00398ffb..8e384cc063e 100644 --- a/src/app/core/shared/community.model.ts +++ b/src/app/core/shared/community.model.ts @@ -111,6 +111,14 @@ export class Community extends DSpaceObject implements ChildHALResource, HandleO return this.firstMetadataValue('dc.description.tableofcontents'); } + /** + * The thumbail description of this Community + * Corresponds to the metadata field dspace.thumbnail.description + */ + get descriptionThumbnail(): string { + return this.firstMetadataValue('dspace.thumbnail.description'); + } + getParentLinkKey(): keyof this['_links'] { return 'parentCommunity'; } diff --git a/src/app/thumbnail/thumbnail.component.html b/src/app/thumbnail/thumbnail.component.html index e151684a01f..eed6b1994c8 100644 --- a/src/app/thumbnail/thumbnail.component.html +++ b/src/app/thumbnail/thumbnail.component.html @@ -7,8 +7,10 @@ - + +
diff --git a/src/app/thumbnail/thumbnail.component.ts b/src/app/thumbnail/thumbnail.component.ts index cc583c3998f..0f6f5bf877e 100644 --- a/src/app/thumbnail/thumbnail.component.ts +++ b/src/app/thumbnail/thumbnail.component.ts @@ -3,6 +3,7 @@ import { Component, Input, OnChanges, + OnInit, SimpleChanges, } from '@angular/core'; import { TranslateModule } from '@ngx-translate/core'; @@ -35,12 +36,17 @@ import { VarDirective } from '../shared/utils/var.directive'; standalone: true, imports: [VarDirective, CommonModule, ThemedLoadingComponent, TranslateModule, SafeUrlPipe], }) -export class ThumbnailComponent implements OnChanges { +export class ThumbnailComponent implements OnInit, OnChanges { /** * The thumbnail Bitstream */ @Input() thumbnail: Bitstream | RemoteData; + /** + * Variable that listens to the thumbnail value + */ + listenThumbnail: RemoteData; + /** * The default image, used if the thumbnail isn't set or can't be downloaded. * If defaultImage is null, a HTML placeholder is used instead. @@ -59,6 +65,11 @@ export class ThumbnailComponent implements OnChanges { */ @Input() alt? = 'thumbnail.default.alt'; + /** + * Custom thumbnail description for alt text + */ + customDescription: string; + /** * i18n key of HTML placeholder text */ @@ -82,6 +93,19 @@ export class ThumbnailComponent implements OnChanges { ) { } + /** + * Getting the description from the thumbnail file + * when rendering the screen. + */ + ngOnInit(): void{ + if (this.thumbnail){ + if ('payload' in this.thumbnail) { + this.listenThumbnail = this.thumbnail; + this.customDescription = this.listenThumbnail.payload.metadata['dc.description'][0].value; + } + } + } + /** * Resolve the thumbnail. * Use a default image if no actual image is available. diff --git a/src/assets/i18n/en.json5 b/src/assets/i18n/en.json5 index 8c71e9b7394..981e7457fe1 100644 --- a/src/assets/i18n/en.json5 +++ b/src/assets/i18n/en.json5 @@ -6763,4 +6763,8 @@ "register-page.registration.aria.label": "Enter your e-mail address", "forgot-email.form.aria.label": "Enter your e-mail address", -} + + "community.form.thumbnail": "Thumbnail Description", + + "collection.form.thumbnail": "Thumbnail Description", +} \ No newline at end of file diff --git a/src/assets/i18n/es.json5 b/src/assets/i18n/es.json5 index 6ce558741cb..65baf242038 100644 --- a/src/assets/i18n/es.json5 +++ b/src/assets/i18n/es.json5 @@ -9164,6 +9164,15 @@ // "vocabulary-treeview.search.form.add": "Add", "vocabulary-treeview.search.form.add": "Añadir", + // "community.form.thumbnail": "Thumbnail Description", + "community.form.thumbnail": "Descripción del logotipo de la comunidad", + + // "collection.form.thumbnail": "Thumbnail Description", + "collection.form.thumbnail": "Descripción del logo de la colección", + + // "file-download-link.download": "Download ", + "file-download-link.download": "Descargar ", + // "admin.notifications.publicationclaim.breadcrumbs": "Publication Claim", "admin.notifications.publicationclaim.breadcrumbs": "Reclamo de publicación", @@ -10192,5 +10201,6 @@ // "forgot-email.form.aria.label": "Enter your e-mail address", "forgot-email.form.aria.label": "Introduzca su dirección de correo electrónico", - -} \ No newline at end of file + // "search.sidebar.advanced-search.add": "Add", + "search.sidebar.advanced-search.add": "Añadir", +} diff --git a/src/assets/i18n/pt-BR.json5 b/src/assets/i18n/pt-BR.json5 index 262dfa6d056..d3b55c8f93f 100644 --- a/src/assets/i18n/pt-BR.json5 +++ b/src/assets/i18n/pt-BR.json5 @@ -10229,9 +10229,15 @@ // "item.page.cc.license.disclaimer": "Except where otherwised noted, this item's license is described as", "item.page.cc.license.disclaimer": "Exceto quando indicado de outra forma, a licença deste item é descrita como", - //"browse.search-form.placeholder": "Search the repository", + // "browse.search-form.placeholder": "Search the repository", "browse.search-form.placeholder": "Buscar no repositório", + // "community.form.thumbnail": "Thumbnail Description", + "community.form.thumbnail": "Descrição do logotipo da comunidade", + + // "collection.form.thumbnail": "Thumbnail Description", + "collection.form.thumbnail": "Descrição do logotipo da coleção", + // "file-download-link.download": "Download ", "file-download-link.download": "Baixar ", diff --git a/src/assets/i18n/pt-PT.json5 b/src/assets/i18n/pt-PT.json5 index 7a3d326eca1..d284e550295 100644 --- a/src/assets/i18n/pt-PT.json5 +++ b/src/assets/i18n/pt-PT.json5 @@ -10361,4 +10361,10 @@ // "item.preview.dc.identifier.eisbn": "EISBN", "item.preview.dc.identifier.eisbn": "EISBN", + // "community.form.thumbnail": "Thumbnail Description", + "community.form.thumbnail": "Descrição do logotipo da comunidade", + + // "collection.form.thumbnail": "Thumbnail Description", + "collection.form.thumbnail": "Descrição do logotipo da coleção", + }