[plugins-functionality | DONE | ADDED ] add display title and shortitle and use them instead of title/ short title

This commit is contained in:
argirok 2024-05-14 14:49:59 +03:00
parent 2bfd744ab8
commit 1b99c3b405
4 changed files with 10 additions and 6 deletions

View File

@ -92,6 +92,8 @@ export class CommunityService {
const community: CommunityInfo = new CommunityInfo();
community.title = resData.name;
community.shortTitle = resData.shortName;
community.displayTitle = resData.displayName?resData.displayName:resData.name;
community.displayShortTitle = resData.displayShortName?resData.displayShortName:resData.shortName;
community.communityId = resData.id;
community.queryId = resData.queryId;
community.logoUrl = resData.logoUrl;

View File

@ -4,6 +4,8 @@ import {SelectionCriteria} from "../../utils/entities/contentProvider";
export class CommunityInfo {
title: string;
shortTitle:string;
displayTitle: string;
displayShortTitle:string;
communityId: string;
queryId: string;
type: string;

View File

@ -7,10 +7,10 @@
<div *ngIf="portal && community" class="">
<div *ngIf="pluginObject.showShortTitle"
class="uk-text-primary">
{{community.shortTitle}}
{{community.displayShortTitle}}
</div>
<h1 *ngIf="pluginObject.showTitle" class=" uk-h2 uk-margin-remove">
{{community.title}}
{{community.displayTitle}}
</h1>
<div *ngIf="pluginObject.description" [innerHTML]="community.description"></div>
@ -40,7 +40,7 @@
Try browsing by:
</div>
<div class="link-actions uk-flex uk-flex-column uk-flex-top uk-margin-small-top">
<a *ngIf="pluginObject.sdgs && isRouteEnabled('/sdgs')"
<a *ngIf="pluginObject.sdgs && isRouteEnabled('/sdgs')" [class.uk-disabled] =previewInAdmin
class="uk-display-inline-block uk-text-uppercase uk-button uk-button-text uk-margin-small-bottom"
routerLinkActive="router-link-active" routerLink="/sdgs">
<span class="uk-flex uk-flex-middle">
@ -50,7 +50,7 @@
class="uk-text-lowercase">s</span>)</span>
</span>
</a>
<a *ngIf="pluginObject.fos&& isRouteEnabled('/fields-of-science') "
<a *ngIf="pluginObject.fos&& isRouteEnabled('/fields-of-science') " [class.uk-disabled] =previewInAdmin
class="uk-display-inline-block uk-text-uppercase uk-button uk-button-text"
routerLinkActive="router-link-active" routerLink="/fields-of-science">
<span class="uk-flex uk-flex-middle">

View File

@ -28,7 +28,7 @@ export class PluginSearchBar extends PluginBaseInfo{
<div class="uk-container uk-container-large uk-flex uk-flex-center">
<div class="uk-width-2-3@m uk-width-1-2@l uk-margin-large-top uk-margin-large-bottom">
<h1 *ngIf="pluginObject.showShortTitle" class="uk-text-center uk-h2 uk-margin-remove">
{{community.shortTitle}}
{{community.displayShortTitle}}
</h1>
<h1 *ngIf="pluginObject.alternativeTitle.length > 0"
class="uk-text-center uk-h2 uk-margin-remove">
@ -36,7 +36,7 @@ export class PluginSearchBar extends PluginBaseInfo{
</h1>
<div *ngIf="pluginObject.showTitle"
class="uk-text-center uk-margin-top">
{{community.title}}
{{community.displayTitle}}
</div>
<div [class.uk-invisible]="disableSelect" class="uk-margin-medium-top">