Add subjects section in Home page

This commit is contained in:
argirok 2021-11-24 15:56:38 +02:00
parent 6e363e678a
commit d242b3cc61
2 changed files with 34 additions and 1 deletions

View File

@ -206,6 +206,18 @@
<numbers #numbersComponent [defaultInit]="false" backgroundClass="numbers-background" <numbers #numbersComponent [defaultInit]="false" backgroundClass="numbers-background"
(results)="numbers = $event"></numbers> (results)="numbers = $event"></numbers>
</div> </div>
<div class="uk-section uk-padding-large uk-grid uk-child-width-1-2@m uk-child-width-1-1@s uk-margin-large-top uk-margin-large-bottom">
<div class="uk-flex uk-flex-middle uk-flex-center">
<h3 class="uk-text-center uk-margin-medium-bottom">Start browsing by subject</h3>
</div>
<div>
<div class="uk-text-center uk-padding-large uk-padding-remove-vertical ">
<span *ngFor="let subject of specialSubjects " class=" uk-text-capitalize uk-link-reset uk-button uk-button-default uk-button-secondary uk-margin-small-right uk-margin-small-bottom">
<a [routerLink]=" properties.searchLinkToAdvancedResults"
[queryParams]="getSubjectParameter(subject.value) ">{{subject.label}}</a></span>
</div>
</div>
</div>
<!--<div class="uk-section uk-padding-remove-bottom"> <!--<div class="uk-section uk-padding-remove-bottom">
<div class="uk-container uk-text-center uk-margin-medium-bottom"> <div class="uk-container uk-text-center uk-margin-medium-bottom">
<div class="uk-margin-medium uk-flex-center"> <div class="uk-margin-medium uk-flex-center">

View File

@ -20,6 +20,7 @@ import {HelperService} from "../openaireLibrary/utils/helper/helper.service";
import {Filter} from "../openaireLibrary/searchPages/searchUtils/searchHelperClasses.class"; import {Filter} from "../openaireLibrary/searchPages/searchUtils/searchHelperClasses.class";
import {properties} from "../../environments/environment"; import {properties} from "../../environments/environment";
import {Numbers, NumbersComponent} from "../openaireLibrary/sharedComponents/numbers/numbers.component"; import {Numbers, NumbersComponent} from "../openaireLibrary/sharedComponents/numbers/numbers.component";
import {StringUtils} from "../openaireLibrary/utils/string-utils.class";
@Component({ @Component({
selector: 'home', selector: 'home',
@ -146,7 +147,24 @@ export class HomeComponent {
}; };
public pageContents = null; public pageContents = null;
@ViewChild("numbersComponent", { static: true }) numbersComponent: NumbersComponent; @ViewChild("numbersComponent", { static: true }) numbersComponent: NumbersComponent;
specialSubjects = [
{value: "Physics::Atomic Physics", label: "Atomic Physics"},
{value: "Mathematics::Combinatorics", label: "Mathematics Combinatorics"},
{value: "lcsh:Medicine", label: "Medicine"},
{value: "lcsh:Science", label: "Science"},
{value: "lcsh:Biology (General)", label: "Biology"},
{value: "lcsh:Chemistry", label: "Chemistry"},
{value: "lcsh:Engineering (General). Civil engineering (General)", label: "Civil engineering"},
{value: "lcsh:Technology", label: "Technology"},
/* "Mathematics::Combinatorics",
"lcsh:Medicine",
"lcsh:Science",
"lcsh:Biology (General)",
"lcsh:Chemistry",
"lcsh:Engineering (General). Civil engineering (General)",
"lcsh:Technology"*/
];
stringUtils = new StringUtils();
constructor( constructor(
private route: ActivatedRoute, private route: ActivatedRoute,
private _router: Router, private _router: Router,
@ -285,4 +303,7 @@ export class HomeComponent {
} }
this._router.navigate([url], {queryParams: this.routerHelper.createQueryParams(parameterNames, parameterValues)}); this._router.navigate([url], {queryParams: this.routerHelper.createQueryParams(parameterNames, parameterValues)});
} }
getSubjectParameter(param){
return {'f0':'resultsubject','fv0':'"' +(param)+'"'};
}
} }