add links to special subjects in the landing page

This commit is contained in:
argirok 2021-11-09 16:02:32 +02:00
parent 3632510e38
commit 3d6b358c9a
1 changed files with 34 additions and 7 deletions

View File

@ -1,4 +1,5 @@
import {Component, Input} from '@angular/core';
import {properties} from "../../../../environments/environment";
@Component({
selector: 'showSubjects',
@ -11,15 +12,18 @@ import {Component, Input} from '@angular/core';
<ng-container *ngIf="classifiedSubjects && classifiedSubjects.size > 0">
<div *ngFor="let key of getKeys(classifiedSubjects)" style="line-height: 20px">
<span uk-icon="tag"></span>
<span class="uk-text-bold uk-text-uppercase"> {{key}}: </span>
<span class="uk-text-bold"> {{key}}: </span>
<ng-container *ngFor="let subject of classifiedSubjects.get(key)">
<span class="uk-display-inline-block label-classified">{{subject}}</span>
<span class="uk-display-inline-block label-classified">
<span *ngIf="specialSubjects.indexOf(subject) == -1 ">{{subject}}</span>
<a class="uk-link-reset" *ngIf="specialSubjects.indexOf(subject) != -1" [href]="properties.domain + properties.searchLinkToAdvancedResults +'?f0=resultsubject&fv0='+getSubjectParameter(subject) ">{{subject}}</a>
</span>
</ng-container>
</div>
</ng-container>
<div *ngIf="(subjects && subjects.length > 0) || (otherSubjects && otherSubjects.size > 0)" class="uk-text-break">
<span uk-icon="tag"></span>
<span class="uk-text-bold uk-text-uppercase"> free text keywords: </span>
<span class="uk-text-bold"> free text keywords: </span>
<span *ngIf="subjects && subjects.length > 0">{{subjects.join(', ')}}</span>
<span *ngIf="(subjects && subjects.length > 0) && (otherSubjects && otherSubjects.size > 0)">, </span>
<span *ngIf="otherSubjects && otherSubjects.size > 0">
@ -40,16 +44,39 @@ export class ShowSubjectsComponent {
@Input() subjects: string[];
@Input() otherSubjects: Map<string, string[]>;
@Input() classifiedSubjects: Map<string, string[]>;
properties = properties;
specialSubjects = [
"Physics::Optics",
"Astrophysics::Cosmology and Extragalactic Astrophysics",
"Computer Science::Information Theory",
"Physics::Accelerator Physics",
"Condensed Matter::Superconductivity",
"Physics::Atomic Physics",
"Computer Science::Robotics",
"Computer Science::Computer Science and Game Theory",
"Computer Science::Neural and Evolutionary Computation",
"Mathematics::Combinatorics",
"Mathematics::Probability",
"Computer Science::Operating Systems",
"lcsh:Medicine",
"lcsh:Science",
"lcsh:Biology (General)",
"lcsh:Chemistry",
"lcsh:Engineering (General). Civil engineering (General)",
"lcsh:Technology"
];
// private showClassifiedSbj: boolean = false;
constructor() {
}
ngOnInit() {
}
public getKeys(map) {
return Array.from(map.keys());
}
getSubjectParameter(param){
return '"' +encodeURIComponent(param)+'"';
}
}