mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-15 05:53:03 +00:00
79597: Add alt text to ds-thumbnail
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
<div class="thumbnail">
|
<div class="thumbnail">
|
||||||
<img [src]="src | dsSafeUrl" (error)="errorHandler()" class="img-fluid"/>
|
<img [src]="src | dsSafeUrl" [alt]="alt | translate" (error)="errorHandler()" class="img-fluid"/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@@ -1,3 +1,31 @@
|
|||||||
img {
|
img {
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.outer { // .outer/.inner generated ~ https://ratiobuddy.com/
|
||||||
|
position: relative;
|
||||||
|
&:before {
|
||||||
|
display: block;
|
||||||
|
content: "";
|
||||||
|
width: 100%;
|
||||||
|
padding-top: (210 / 297) * 100%; // A4 ratio
|
||||||
|
}
|
||||||
|
> .inner {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
|
||||||
|
> .thumbnail-placeholder {
|
||||||
|
background: var(--bs-gray-100);
|
||||||
|
border: var(--bs-gray-200) 1px;
|
||||||
|
color: var(--bs-gray-600);
|
||||||
|
font-weight: bold;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@@ -18,7 +18,6 @@ export const THUMBNAIL_PLACEHOLDER = 'data:image/svg+xml;charset=UTF-8,%3Csvg%20
|
|||||||
templateUrl: './thumbnail.component.html'
|
templateUrl: './thumbnail.component.html'
|
||||||
})
|
})
|
||||||
export class ThumbnailComponent implements OnInit {
|
export class ThumbnailComponent implements OnInit {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The thumbnail Bitstream
|
* The thumbnail Bitstream
|
||||||
*/
|
*/
|
||||||
@@ -34,6 +33,11 @@ export class ThumbnailComponent implements OnInit {
|
|||||||
*/
|
*/
|
||||||
src: string;
|
src: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* i18n key of thumbnail alt text
|
||||||
|
*/
|
||||||
|
@Input() alt? = 'thumbnail.default.alt';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize the thumbnail.
|
* Initialize the thumbnail.
|
||||||
* Use a default image if no actual image is available.
|
* Use a default image if no actual image is available.
|
||||||
|
@@ -3539,6 +3539,10 @@
|
|||||||
"submission.workflow.tasks.pool.show-detail": "Show detail",
|
"submission.workflow.tasks.pool.show-detail": "Show detail",
|
||||||
|
|
||||||
|
|
||||||
|
"thumbnail.default.alt": "Thumbnail Image",
|
||||||
|
|
||||||
|
"thumbnail.default.placeholder": "No Thumbnail Available",
|
||||||
|
|
||||||
|
|
||||||
"title": "DSpace",
|
"title": "DSpace",
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user