Skip to content

Commit

Permalink
11008 backup primera versión vista del ítem
Browse files Browse the repository at this point in the history
  • Loading branch information
178Pelado committed Sep 2, 2024
1 parent 8b06acb commit 5cd8673
Show file tree
Hide file tree
Showing 38 changed files with 1,481 additions and 248 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

<!-- Render simple value in a span -->
<ng-template #simple let-value="value">
<span class="dont-break-out preserve-line-breaks">{{value}}</span>
<span [innerHTML]="value" class="dont-break-out preserve-line-breaks"></span>
</ng-template>

<!-- Render value as a link to browse index -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

<ng-template #noInfo let-entry="entry">
<ul class="list-unstyled mb-0">
<li class="list-item text-truncate text-primary font-weight-bold">{{entry.value}}</li>
<li class="list-item text-truncate text-primary font-weight-bold">{{entry.display}}</li>
</ul>
</ng-template>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
<div class="simple-view-element" [class.d-none]="hideIfNoTextContent && content.textContent.trim().length === 0">
<!-- <div class="simple-view-element" [class.d-none]="hideIfNoTextContent && content.textContent.trim().length === 0">
<h2 class="simple-view-element-header" *ngIf="label">{{ label }}</h2>
<div #content class="simple-view-element-body">
<ng-content></ng-content>
</div>
</div> -->

<div class="simple-view-element" [ngClass]="{'not-inline-label': !inlineLabel }" [class.d-none]="hideIfNoTextContent && content.textContent.trim().length === 0">
<h6 class="simple-view-element-header" *ngIf="label">{{ label }}</h6>
<div #content>
<ng-content></ng-content>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -1,8 +1,23 @@
:host {
.simple-view-element {
margin-bottom: 15px;
.simple-view-element {
h6 {
display: inline;
margin-right: 0.5em;
}
.simple-view-element-header {
font-size: 1.25rem;
div {
display: inline;
}
}

.simple-view-element-header {
font-weight: bold;
}

.not-inline-label {
h6 {
display: block;
margin-right: 0;
}
div {
display: block;
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { NgIf } from '@angular/common';
import { NgIf, NgClass } from '@angular/common';
import {
Component,
Input,
Expand All @@ -13,7 +13,7 @@ import {
styleUrls: ['./metadata-field-wrapper.component.scss'],
templateUrl: './metadata-field-wrapper.component.html',
standalone: true,
imports: [NgIf],
imports: [NgIf, NgClass],
})
export class MetadataFieldWrapperComponent {

Expand All @@ -23,4 +23,12 @@ export class MetadataFieldWrapperComponent {
@Input() label: string;

@Input() hideIfNoTextContent = true;

@Input() inlineLabel: boolean;

ngOnInit() {
if (this.inlineLabel === undefined) {
this.inlineLabel = true;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { Item } from '../../../../../core/shared/item.model';
import { ITEM } from '../../../../../core/shared/item.resource-type';
import { hasValue } from '../../../../empty.util';
import { AccessStatusObject } from './access-status.model';
import { RemoteData } from 'src/app/core/data/remote-data';

@Component({
selector: 'ds-base-access-status-badge',
Expand Down Expand Up @@ -70,12 +71,17 @@ export class AccessStatusBadgeComponent {
}

const item = this.object as Item;
let accessStatus$;

if (item.accessStatus == null) {
// In case the access status has not been loaded, do it individually.
item.accessStatus = this.accessStatusDataService.findAccessStatusFor(item);
accessStatus$ = this.accessStatusDataService.findAccessStatusFor(item);
} else {
accessStatus$ = item.accessStatus;
}
this.accessStatus$ = item.accessStatus.pipe(
map((accessStatusRD) => {

this.accessStatus$ = accessStatus$.pipe(
map((accessStatusRD: RemoteData<AccessStatusObject>) => {
if (accessStatusRD.statusCode !== 401 && hasValue(accessStatusRD.payload)) {
return accessStatusRD.payload;
} else {
Expand Down
9 changes: 8 additions & 1 deletion src/assets/i18n/es.json5
Original file line number Diff line number Diff line change
Expand Up @@ -4104,7 +4104,7 @@
"item.preview.dc.identifier": "Identificador:",

// "item.preview.dc.relation.ispartof": "Journal or Series",
"item.preview.dc.relation.ispartof": "Revista o Serie",
"item.preview.dc.relation.ispartof": "Serie/Colección",

// "item.preview.dc.identifier.doi": "DOI",
"item.preview.dc.identifier.doi": "DOI",
Expand Down Expand Up @@ -8624,8 +8624,15 @@

"workflow-item.editaction.header": "Aprobando...",

// FALTAN
// workflow-item.editaction.notification.success.content
// workflow-item.editaction.notification.success.title

"workflow-item.selectCollection.header": "Elegir Coleccion",

// FALTAN
// workflow-item.selectCollection.notification.success.content
// workflow-item.selectCollection.notification.success.title

//"browse.search-form.placeholder": "Search the repository",
"browse.search-form.placeholder": "Buscar en el repositorio",
Expand Down
Binary file added src/assets/images/LAREFERENCIA.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<ds-metadata-field-wrapper [label]="label | translate" [inlineLabel]="false">
<a href="{{ badgeUrl }}" target="_blank" *ngIf="badgeUrl else badge">
<ng-container *ngTemplateOutlet="badge"></ng-container>
</a>
</ds-metadata-field-wrapper>

<ng-template #badge>
<div class="badge-group" [ngClass]="{'group-inline-block': badgeLabel}" *ngFor="let mdValue of mdValues">
<span class="badge badge-label" [ngClass]="badgeLabelType" *ngIf="badgeLabel">
{{badgeLabel}}
</span>
<span class="badge {{badgeType}}" [ngClass]="{'badge-content': badgeLabel}">
{{mdValue.value}}
<ng-container *ngIf="copyToClipboardButton">
<span class="d-none" #elementContentToCopy>{{mdValue.value}}</span>
<i id="copyButton-{{mdValue.value}}" class="copyButton fa fa-copy" aria-hidden="true" (click)="copyToClipboard(elementContentToCopy, 'copyButton-' + mdValue.value )"></i>
</ng-container>
</span>
</div>
</ng-template>

Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
.badge-label {
border-top-right-radius: unset;
border-bottom-right-radius: unset;
display: inline-block;
}

.badge-content {
border-top-left-radius: unset;
border-bottom-left-radius: unset;
display: inline-block;
}

.badge-group {
display: inline-block;
}

.badge-group::after {
white-space: pre;
content: " ";
}

.badge-identifier {
color: #505050;
background-color: #c3c3c3;
font-weight: inherit;
}

.group-inline-block {
display: inline-block;
}

::ng-deep .badge-group span {
padding: 0.4em;
padding-right: 0.5em;
}

.copyButton {
color: #fff;
cursor: pointer;
margin-left: 5px;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { Component, Input } from '@angular/core';
import { CommonModule } from '@angular/common';
import { TranslateModule } from '@ngx-translate/core';
import { MetadataValuesComponent } from 'src/app/item-page/field-components/metadata-values/metadata-values.component';
import { MetadataFieldWrapperComponent } from 'src/app/shared/metadata-field-wrapper/metadata-field-wrapper.component';

@Component({
selector: 'ds-badge-metadata-values',
standalone: true,
templateUrl: './badge-metadata-values.component.html',
styleUrls: ['./badge-metadata-values.component.scss'],
imports: [CommonModule, MetadataFieldWrapperComponent, TranslateModule],
})
export class BadgeMetadataValuesComponent extends MetadataValuesComponent {
@Input() badgeType: string;
@Input() badgeUrl: string;
@Input() badgeLabel: string;
@Input() badgeLabelType: string;
@Input() copyToClipboardButton: boolean = false;

copyToClipboard(el: HTMLDivElement, id: string) {
if (navigator.clipboard) {
navigator.clipboard.writeText(el.innerText).then(() => {
document.getElementById(id).classList.remove('fa-copy');
document.getElementById(id).classList.add('fa-check');
setTimeout(() => {
document.getElementById(id).classList.remove('fa-check');
document.getElementById(id).classList.add('fa-copy');
}, 1000);
}, (error) => {
console.log(error);
});
} else {
console.log('Browser do not support Clipboard API');
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<ds-metadata-field-wrapper [inlineLabel]="inlineLabel" [label]="label | translate">
<span class="dont-break-out">{{ dateString }}</span>
</ds-metadata-field-wrapper>
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import { Component, Input, OnInit } from '@angular/core';
import { MetadataValuesComponent } from 'src/app/item-page/field-components/metadata-values/metadata-values.component';
import { MetadataFieldWrapperComponent } from 'src/app/shared/metadata-field-wrapper/metadata-field-wrapper.component';
import { TranslateModule } from '@ngx-translate/core';

/**
* This component renders the configured 'values' into the ds-metadata-field-wrapper component.
* It puts the given 'separator' between each two values.
*/
@Component({
selector: 'ds-sedici-date-metadata-values',
templateUrl: './sedici-date-metadata-values.component.html',
standalone: true,
imports: [
TranslateModule,
MetadataValuesComponent,
MetadataFieldWrapperComponent,
],
})
export class SediciDateMetadataValuesComponent extends MetadataValuesComponent implements OnInit {
@Input() inlineLabel: boolean;
dateString: string;

ngOnInit(): void {
const date = this.mdValues?.[0]?.value;
if (date !== undefined) {
if (date.length === 10) {
this.dateString = new Date(date).toLocaleDateString('es-AR',{ year: 'numeric', month: 'long', day: 'numeric', timeZone: 'UTC' });
} else if (date.length === 7) {
this.dateString = new Date(date).toLocaleDateString('es-AR',{ year: 'numeric', month: 'long', timeZone: 'UTC' });
} else {
this.dateString = date;
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<ds-metadata-field-wrapper [inlineLabel]="inlineLabel" [label]="label | translate">
<span class="dont-break-out">{{ languageString }}</span>
</ds-metadata-field-wrapper>
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { Component, Input, OnInit } from '@angular/core';
import { MetadataValuesComponent } from 'src/app/item-page/field-components/metadata-values/metadata-values.component';
import { MetadataFieldWrapperComponent } from 'src/app/shared/metadata-field-wrapper/metadata-field-wrapper.component';
import { TranslateModule } from '@ngx-translate/core';

/**
* This component renders the configured 'values' into the ds-metadata-field-wrapper component.
* It puts the given 'separator' between each two values.
*/
@Component({
selector: 'ds-sedici-language-metadata-values',
templateUrl: './sedici-language-metadata-values.component.html',
standalone: true,
imports: [
TranslateModule,
MetadataValuesComponent,
MetadataFieldWrapperComponent,
],
})
export class SediciLanguageMetadataValuesComponent extends MetadataValuesComponent implements OnInit {
@Input() inlineLabel: boolean;
languageString: string;

ngOnInit(): void {
const language = this.mdValues?.[0]?.value;
if (language === 'es') {
this.languageString = 'Español';
} else if (language === 'en') {
this.languageString = 'Inlgés';
} else if (language === 'pt') {
this.languageString = 'Portugués';
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<div class="apa-citation-container" [class.expanded]="isExpanded">
<div class="toggle-button-container" *ngIf="showToggleButton">
<i class="toggleButton fa" [ngClass]="{'fa-chevron-down': !isExpanded, 'fa-chevron-up': isExpanded}" (click)="toggleExpand()"></i>
</div>
<div class="apa-citation" #elementContentToCopy>
{{ citation }}
</div>
</div>
<div class="copy-button-container">
<span class="copy-text">Copiar al portapapeles</span>
<i id="copyButton" class="copyButton fa fa-copy" aria-hidden="true" (click)="copyToClipboard(elementContentToCopy, 'copyButton')"></i>
</div>
Loading

0 comments on commit 5cd8673

Please sign in to comment.