Federica 1 year ago
parent
commit
66405c1ecd

+ 0 - 2
src/app/components/content-viewer/content-viewer.component.ts

@@ -84,8 +84,6 @@ export class ContentViewerComponent implements OnDestroy {
   ]).pipe(
     map(([data, itemsToHighlight, itemsLemsToHighlight, editionLevel, textFlow]) => {
       if (this.toBeHighlighted()) {
-        console.log('proviamo se items', itemsToHighlight )
-        console.log('proviamo se lems', itemsLemsToHighlight )
         return {
           data,
           highlightData: this.getHighlightData(data, itemsToHighlight),

+ 8 - 9
src/app/components/lemmatized-entity-ref/lemmatized-entity-ref.component.scss

@@ -6,11 +6,10 @@
   &:not(.noDetails) {
     cursor: pointer;
     &.opened {
-      border-bottom: 3px solid rgba(158, 148, 122, 0.7);
+      border-bottom: 3px solid rgba(208, 208, 208, 10);
       font-weight: 600;
       font-style: italic;
-      background-color: rgba(158, 148, 122, 0.5
-      );
+      background-color: rgba(208, 208, 208, 0.5);
     }
   }
   &:not(.opened):not(:hover) {
@@ -19,7 +18,7 @@
 }
 
 .lemmatizedEntityRef:hover {
-    background-color:  rgba(158, 148, 122, 0.7);
+    background-color:  rgba(208, 208, 208, 10);
 }
 
 .lemmatizedEntityRef:hover:not(.noDetails),
@@ -46,21 +45,21 @@
 }
 
 .lemmaHighlight {
-  background: rgba(158, 148, 122, 0.7)!important;
+  background: rgba(208, 208, 208, 10)!important;
 }
 
 .ne-container.lem .ne-occurrence {
   border-radius: 4px;
   padding: 4px 6px;
-  background: rgba(158, 148, 122, 0.7);
+  background: rgba(208, 208, 208, 10);
   margin-right: 3px;
-  font-size: 0.7rem;
+  font-size: 10rem;
   margin-bottom: 3px;
   display: inline-block !important;
   cursor: pointer;
-  line-height: 0.9rem;
+  line-height: 10rem;
 }
 
 .lemmatizedEntityRef.highlighted {
-  background-color: rgba(158, 148, 122, 0.7);
+  background-color: rgba(208, 208, 208, 10);
 }

+ 29 - 5
src/app/components/lemmatized-entity/lemmatized-entity-detail/lemmatized-entity-detail.component.html

@@ -2,16 +2,40 @@
     <span class="icon">
         <evt-icon [iconInfo]="iconData[data.label] || defaultIcon"></evt-icon>
     </span>
-    <span class="label" *ngIf="data.label">{{ data.label }}: </span>
+    <span class="label" *ngIf="data.label=='lem'">Lemma: </span>
     <span class="text">
         <ng-container *ngFor="let element of data.content">
             <evt-content-viewer [content]="element"></evt-content-viewer>
             <ul class="attributes-list">
-                <li *ngFor="let item of element.attributes | keyvalue">
-                    <span class="label">{{ item.key }}: </span> {{ item.value }}
-                </li>
+                <div *ngFor="let item of element.attributes | keyvalue">
+                    <li *ngIf="item.key!=='lemmaRef'">
+                        <span *ngIf="item.key==='norm' && item.key!=='lemmaRef'" class="label">Forma normalizzata: </span>
+                        <span *ngIf="item.key==='type' && item.key!=='lemmaRef'" class="label">Iperlemma: </span>
+                        <span *ngIf="item.key==='pos' && item.key!=='lemmaRef'" class="label">Categoria grammaticale: </span> 
+                        <span *ngIf="item.key!=='lemmaRef'">{{ item.value }}</span>
+                    </li>
+                </div>
             </ul>
         </ng-container>
-
+        <span class="icon">
+            <evt-icon [iconInfo]="iconData['relations'] || defaultIcon"></evt-icon>
+        </span>
+        <span class="label" *ngIf="data.label=='lem'">Risorse esterne</span>
+        <span class="text">
+            <ng-container *ngFor="let element of data.content">
+                <ul *ngFor="let item of element.attributes | keyvalue" class="attributes-list">
+                    <li *ngIf="item.key ==='lemmaRef'">
+                        <div>
+                            <span (click)="openlinkLem()" [class.pointer]="linkLem">
+                                <a *ngIf="linkLem" [href]="linkLem" target="_blank" class="ml-2 external-link-alt">
+                                Consulta la voce su TLIO
+                                <evt-icon [iconInfo]="{icon: 'external-link-alt', iconSet: 'fas'}"></evt-icon>
+                                </a>
+                            </span> 
+                        </div>
+                    </li>
+                </ul>
+            </ng-container>
+        </span>
     </span>
 </div>

+ 13 - 0
src/app/components/lemmatized-entity/lemmatized-entity-detail/lemmatized-entity-detail.component.ts

@@ -1,6 +1,7 @@
 import { Component, Input } from '@angular/core';
 import { LemmatizedEntityInfo } from '../../../models/evt-models';
 import { register } from '../../../services/component-register.service';
+import { normalizeUrl } from '../../../utils/js-utils';
 
 @Component({
   selector: 'evt-lemmatized-entity-detail',
@@ -31,7 +32,19 @@ export class LemmatizedEntityDetailComponent {
     residence: { icon: 'home' },
     settlement: { icon: 'location-arrow' },
     sex: { icon: 'venus-mars' },
+    link: { icon: 'external-link-alt', iconSet: 'fas'}
   };
 
   defaultIcon = { icon: 'info-circle' };
+  
+  get linkLem() {
+    var link = this.data.attributes.lemmaRef
+    return normalizeUrl(link); 
+  }
+
+  openlinkLem() {
+    if (this.linkLem) {
+      window.open(this.linkLem, '_blank');
+    }
+  }
 }

+ 4 - 4
src/app/components/lemmatized-entity/lemmatized-entity.component.html

@@ -29,7 +29,7 @@
                 </ng-template>
             </li>
             <li [ngbNavItem]="'occurrences_'+data.id">
-                <a ngbNavLink class="ui-font">{{'Occurrences' | translate}}</a>
+                <a ngbNavLink class="ui-font">{{'Occorrenze' | translate}}</a>
                 <ng-template ngbNavContent>
                     <div class="ne-detail-content ui-font" *ngIf="occurrences$ | async as occurrences">
                         <span *ngIf="occurrences.length === 0">{{'noLemOccurrences' | translate}}</span>
@@ -56,8 +56,8 @@
                     </div>
                 </ng-template>
             </li>
-            <li [ngbNavItem]="'link_'+data.id">
-                <a ngbNavLink class="ui-font">{{'Link' | translate}}</a>
+            <!-- <li [ngbNavItem]="'link_'+data.id">
+                <a ngbNavLink class="ui-font">{{'Risorse esterne' | translate}}</a>
                 <ng-template ngbNavContent>
                     <div class="ne-detail-content">
                         <span (click)="openlinkLem()" class="edition-font" [class.pointer]="linkLem">Link alla voce su TLIO</span>
@@ -67,7 +67,7 @@
                             </a>
                     </div>
                 </ng-template>
-            </li>
+            </li> -->
         </ul>
         <div [ngbNavOutlet]="lemDetails"></div>
     </div>

+ 2 - 0
src/app/components/lemmatized-entity/lemmatized-entity.component.ts

@@ -1,3 +1,5 @@
+// import { Attribute } from '@angular/core';
+// import { LemmatizedEntityLabel } from './../../models/evt-models';
 import { Component, Input, OnInit, ViewChild } from '@angular/core';
 import { NgbNav } from '@ng-bootstrap/ng-bootstrap';
 import { map, shareReplay } from 'rxjs/operators';

+ 2 - 2
src/app/components/named-entity/named-entity.component.html

@@ -28,7 +28,7 @@
                 </ng-template>
             </li>
             <li [ngbNavItem]="'occurrences_'+data.id">
-                <a ngbNavLink class="ui-font">{{'Occurrences' | translate}}</a>
+                <a ngbNavLink class="ui-font">{{'Occorrenze' | translate}}</a>
                 <ng-template ngbNavContent>
                     <div class="ne-detail-content ui-font" *ngIf="occurrences$ | async as occurrences">
                         <span *ngIf="occurrences.length === 0">{{'noOccurrences' | translate}}</span>
@@ -37,7 +37,7 @@
                 </ng-template>
             </li>
             <li [ngbNavItem]="'relations_'+data.id">
-                <a ngbNavLink class="ui-font">{{'Relations' | translate}}</a>
+                <a ngbNavLink class="ui-font">{{'Relazioni' | translate}}</a>
                 <ng-template ngbNavContent>
                     <div class="ne-detail-content" *ngIf="relations$ | async as relations">
                         <span *ngIf="relations.length === 0" class="ui-font">{{'noRelations' | translate}}</span>

+ 6 - 6
src/assets/config/edition_config.json

@@ -58,32 +58,32 @@
 				{
 					"value": "w[pos='s.m.']",
 					"label": "Sostantivo maschile",
-					"color": "rgb(139, 93, 26)"
+					"color": "#F6F3EC"
 				},
 				{
 					"value": "w[pos='s.f.']",
 					"label": "Sostantivo femminile",
-					"color": "rgb(139, 80, 236)"
+					"color": "#EFE7E5"
 				},
 				{
 					"value": "w[pos='agg.']",
 					"label": "Aggettivo",
-					"color": "rgb(19, 98, 236)"
+					"color": "#D9C1A5"
 				},
 				{
 					"value": "w[pos='avv.']",
 					"label": "Avverbio",
-					"color": "rgb(139, 98, 26)"
+					"color": "#C8CBD0"
 				},
 				{
 					"value": "w[pos='n.p.']",
 					"label": "Nome proprio",
-					"color": "rgb(19, 8, 236)"
+					"color": "#AFB9C2"
 				},
 				{
 					"value": "w[pos='v.']",
 					"label": "Verbo",
-					"color": "rgb(39, 98, 26)"
+					"color": "rgba(148,162,173, 0.9)"
 				},
 				{
 					"value": "w",

File diff suppressed because it is too large
+ 158 - 158
src/assets/data/main.xml


+ 4 - 0
src/styles.scss

@@ -235,4 +235,8 @@ evt-lemmatized-entity.ng-star-inserted div.ne-detail-content.ng-star-inserted {
 // Provvisorio 
 .lemmatizedEntityRef.highlighted {
     background-color: antiquewhite;
+}
+
+.external-link-alt {
+    color: #000;
 }

Some files were not shown because too many files changed in this diff