Add blend multiply to all logos in page content header. Add placeholder logo to getLogoURL function. Fix a bug with active menu item. Finish UI of pages, entities, portals, classes and class page content.
This commit is contained in:
parent
950f50030f
commit
5e1fde7841
|
@ -31,22 +31,14 @@
|
|||
</span>
|
||||
</a>
|
||||
</div>
|
||||
<img *ngIf="communityLogos && communityLogos[community.id] else
|
||||
elseBlock"
|
||||
<img *ngIf="communityLogos && communityLogos[community.id]"
|
||||
[src]="communityLogos[community.id] |logoUrl"
|
||||
class="uk-blend-multiply"
|
||||
[alt]="((community.title)?community.title:(community.shortTitle?community.shortTitle:'')) + ' logo'"
|
||||
loading="lazy" style="max-height:70px">
|
||||
<ng-template #elseBlock>
|
||||
<img src="assets/common-assets/placeholder.png" alt="OpenAIRE placeholder logo"
|
||||
class="uk-blend-multiply" style="max-height:70px">
|
||||
</ng-template>
|
||||
|
||||
<div class="uk-margin-small-top">
|
||||
{{community.label}}
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</a>
|
||||
</ng-container>
|
||||
|
|
|
@ -1,11 +1,15 @@
|
|||
<div page-content (stickyEmitter)="stickyPageHeader = $event">
|
||||
<div header>
|
||||
<div class="uk-flex uk-flex-middle uk-margin-top info"
|
||||
<div *ngIf="!showLoading" class="uk-flex uk-flex-middle uk-margin-top info"
|
||||
[class.uk-active]="stickyPageHeader">
|
||||
<a routerLink="../pages/" class="uk-button uk-button-link uk-margin-right">
|
||||
<icon name="west" ratio="2" [flex]="true"></icon>
|
||||
</a>
|
||||
<div>
|
||||
<div class="uk-margin-remove uk-text-background uk-text-bold uk-h6">
|
||||
Admin Dashboard <span *ngIf="selectedPageId && page"> - Manage class help texts of {{page.name}}</span>
|
||||
Admin Dashboard <span *ngIf="selectedPageId && page"> - Manage class help texts</span>
|
||||
</div>
|
||||
<h1 class="uk-h4 uk-margin-remove">{{page.name}}</h1>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -14,106 +18,69 @@
|
|||
<loading></loading>
|
||||
</div>
|
||||
<div *ngIf="!showLoading">
|
||||
<div class="uk-grid uk-flex-middle uk-margin-top uk-margin-medium-bottom" uk-grid>
|
||||
<div class="uk-margin-top uk-margin-medium-bottom uk-flex-right@m uk-flex-center uk-flex-middle uk-grid" uk-grid>
|
||||
<div search-input [expandable]="true" [searchControl]="filterForm" searchInputClass="outer" placeholder="Search helptext" class="uk-width-1-3@xl uk-width-2-5@l uk-width-1-2@m uk-width-1-1">
|
||||
</div>
|
||||
<div>
|
||||
<a routerLink="../pages/" class="uk-button uk-button-link uk-text-uppercase uk-flex uk-flex-middle">
|
||||
<icon name="west" [flex]="true"></icon>
|
||||
<span class="uk-margin-small-left">Back to pages</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="uk-width-expand uk-flex uk-flex-right@m uk-flex-center uk-flex-wrap uk-flex-middle uk-grid" uk-grid>
|
||||
<div search-input [expandable]="true" [searchControl]="filterForm" searchInputClass="outer" placeholder="Search helptext" class="uk-width-1-3@xl uk-width-2-5@l uk-width-1-2@m uk-width-1-1">
|
||||
<div>
|
||||
<a (click)="newPageContent()"
|
||||
class="uk-flex uk-flex-middle uk-text-uppercase">
|
||||
<button class="large uk-icon-button uk-button-secondary">
|
||||
<icon name="add"></icon>
|
||||
</button>
|
||||
<button class="uk-button uk-button-link uk-margin-small-left uk-text-secondary">Add new class help text
|
||||
</button>
|
||||
</a>
|
||||
</div>
|
||||
<a (click)="newPageContent()"
|
||||
class="uk-flex uk-flex-middle uk-button uk-button-default">
|
||||
<icon [flex]="true" name="add"></icon>
|
||||
<span class="uk-margin-small-left">Add class help text</span>
|
||||
</a>
|
||||
</div>
|
||||
<div *ngIf="showLoading && checkboxes.length > 0"
|
||||
class="uk-padding uk-padding-remove-bottom uk-padding-remove-top uk-margin-remove-top uk-margin-small-bottom uk-display-inline"
|
||||
[attr.uk-tooltip]="getSelectedPageHelpContents().length == 0 ? 'pos:left; cls: uk-active' : 'cls: uk-invisible'"
|
||||
title="Select at least one help text"><input id="checkAll" type="checkbox" (click)="selectAll()"
|
||||
[ngModel]="getSelectedPageHelpContents().length ==checkboxes.length"/>
|
||||
<span *ngIf="getSelectedPageHelpContents().length > 0" class="uk-margin-left uk-text-muted">
|
||||
{{getSelectedPageHelpContents().length}} pages selected </span>
|
||||
<a class="uk-margin-left ">Actions </a>
|
||||
<div uk-dropdown="mode: click">
|
||||
<ul class="uk-nav uk-dropdown-nav"
|
||||
[attr.uk-tooltip]="getSelectedPageHelpContents().length == 0 ? 'pos:left; cls: uk-active' : 'cls: uk-invisible'"
|
||||
title="Select at least one help text">
|
||||
<li><a [class]="getSelectedPageHelpContents().length == 0 ? 'uk-disabled' : ''"
|
||||
(click)="togglePageHelpContents(true,getSelectedPageHelpContents())"><i></i> Enable
|
||||
</a></li>
|
||||
<li><a [class]="getSelectedPageHelpContents().length == 0 ? 'uk-disabled' : ''"
|
||||
(click)="togglePageHelpContents(false,getSelectedPageHelpContents())"><i></i> Disable
|
||||
</a>
|
||||
</li>
|
||||
<li><a [class]="getSelectedPageHelpContents().length == 0 ? 'uk-disabled' : ''"
|
||||
(click)="confirmDeleteSelectedPageHelpContents()"><i></i> Delete </a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="checkboxes.length > 0" class="uk-margin-medium-bottom">
|
||||
<ul class="uk-list pages">
|
||||
<li *ngFor="let check of checkboxes; let i=index" class="uk-card uk-card-default uk-margin-bottom">
|
||||
<div class="uk-grid uk-grid-divider uk-padding" uk-grid>
|
||||
<div class="uk-width-4-5 uk-first-column ">
|
||||
<div class="uk-grid uk-flex uk-flex-middle">
|
||||
<div><input id="{{check.divHelpContent._id}}" class="uk-checkbox" type="checkbox"
|
||||
name="entitiescb[]" value="{{check.divHelpContent._id}}"
|
||||
[(ngModel)]="check.checked">
|
||||
</div>
|
||||
<div class="uk-width-expand uk-margin-medium-bottom">
|
||||
|
||||
<div class="content multi-line-ellipsis lines-2">
|
||||
<p>{{check.divHelpContent.content|htmlToString}}</p></div>
|
||||
</div>
|
||||
<div class="uk-grid uk-width-1-1 uk-margin-left">
|
||||
<div class=" ">
|
||||
<span
|
||||
class="title">Class: </span>{{check.divHelpContent.divId.name ? check.divHelpContent.divId.name : check.divHelpContent.divId}}
|
||||
<div class="uk-section">
|
||||
<div *ngIf="checkboxes.length > 0">
|
||||
<div class="uk-grid uk-child-width-1-2@l uk-child-width-1-1" uk-height-match=".uk-card-body" uk-grid>
|
||||
<div *ngFor="let check of checkboxes; let i=index">
|
||||
<div class="uk-card uk-card-default uk-margin-bottom">
|
||||
<div class="uk-card-body">
|
||||
<div class="uk-margin-medium-bottom">
|
||||
<div class="multi-line-ellipsis lines-2">
|
||||
<p>{{check.divHelpContent.content | htmlToString}}</p>
|
||||
</div>
|
||||
<div class=" ">
|
||||
<span class="title uk-margin-small-right">Enable/disable: </span>
|
||||
<mat-slide-toggle [checked]="check.divHelpContent.isActive"
|
||||
(change)="($event.source.checked = check.divHelpContent.isActive);togglePageHelpContents(!check.divHelpContent.isActive,[check.divHelpContent._id])"
|
||||
uk-tooltip="title:<div class='uk-padding-small uk-width-large'><div class='uk-text-bold '> Enable or disable help text to show or hide it from the dashboard</div></div>"
|
||||
></mat-slide-toggle>
|
||||
<div class="uk-text-small">
|
||||
<span class="uk-text-meta">Class: </span>{{check.divHelpContent.divId.name ? check.divHelpContent.divId.name : check.divHelpContent.divId}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="uk-width-1-5 uk-first-column">
|
||||
|
||||
<div class=" uk-flex-center uk-flex">
|
||||
<div class="actions" href="#">
|
||||
<button (click)="editPageHelpContent(check.divHelpContent._id)" class="uk-button uk-button-secondary uk-margin-top uk-flex uk-flex-middle">
|
||||
<icon name="edit" [flex]="true"></icon>
|
||||
<span class="uk-margin-small-left">Edit</span>
|
||||
</button>
|
||||
<button (click)="confirmDeletePageHelpContent(check.divHelpContent._id)"
|
||||
class="uk-button uk-button-danger uk-margin-top uk-flex uk-flex-middle">
|
||||
<icon name="delete" [flex]="true"></icon>
|
||||
<span class="uk-margin-small-left">Delete</span>
|
||||
</button>
|
||||
<div class="uk-card-footer uk-padding-remove-vertical">
|
||||
<div class="uk-grid uk-grid-small uk-flex-nowrap uk-grid-divider uk-flex-right" uk-grid>
|
||||
<div>
|
||||
<div class="uk-padding-small uk-padding-remove-horizontal">
|
||||
<mat-slide-toggle [checked]="check.divHelpContent.isActive"
|
||||
(change)="($event.source.checked = check.divHelpContent.isActive);togglePageHelpContents(!check.divHelpContent.isActive,[check.divHelpContent._id])"
|
||||
uk-tooltip="title:<div><div class='uk-text-bold '> Enable or disable help text to show or hide it from the dashboard</div></div>">
|
||||
<span class="uk-text-small">Enable</span>
|
||||
</mat-slide-toggle>
|
||||
</div>
|
||||
</div>
|
||||
<div><div class="uk-padding-small uk-padding-remove-horizontal">
|
||||
<button class="uk-button uk-button-link uk-flex uk-flex-middle" (click)="editPageHelpContent(check.divHelpContent._id)">
|
||||
<icon name="edit" [flex]="true"></icon>
|
||||
<span class="uk-margin-xsmall-left"> Edit</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="uk-padding-small uk-padding-remove-horizontal">
|
||||
<button class="uk-button uk-button-link uk-flex uk-flex-middle"
|
||||
(click)="confirmDeletePageHelpContent(check.divHelpContent._id)">
|
||||
<icon name="delete" [flex]="true"></icon>
|
||||
<span class="uk-margin-xsmall-left"> Delete</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div *ngIf="checkboxes.length == 0"
|
||||
class="uk-card uk-card-default uk-padding-large uk-text-center uk-margin-bottom uk-text-bold">
|
||||
<div>No class help texts found</div>
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="checkboxes.length == 0"
|
||||
class="uk-card uk-card-default uk-padding-large uk-text-center uk-text-bold">
|
||||
<div>No class help texts found</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -141,15 +141,9 @@ export class ClassHelpContentsComponent implements OnInit {
|
|||
this.confirmModalOpen();
|
||||
}
|
||||
|
||||
public confirmDeleteSelectedPageHelpContents() {
|
||||
|
||||
this.selectedPageContents = this.getSelectedPageHelpContents();
|
||||
this.confirmModalOpen();
|
||||
}
|
||||
|
||||
private confirmModalOpen() {
|
||||
this.alertModalDeletePageHelpContents.alertTitle = 'Delete Confirmation';
|
||||
this.alertModalDeletePageHelpContents.message = 'Are you sure you want to delete the selected page content(s)?';
|
||||
this.alertModalDeletePageHelpContents.message = 'Are you sure you want to delete the selected class help text?';
|
||||
this.alertModalDeletePageHelpContents.okButtonText = 'Yes';
|
||||
this.alertModalDeletePageHelpContents.open();
|
||||
}
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
<div page-content (stickyEmitter)="stickyPageHeader = $event">
|
||||
<div header>
|
||||
<div class="uk-flex uk-flex-middle uk-margin-top info" [class.uk-active]="stickyPageHeader">
|
||||
<img *ngIf="logo" [src]="logo" class="uk-margin-right">
|
||||
<img *ngIf="!logo" src="assets/common-assets/placeholder.png" class="uk-margin-right">
|
||||
<ng-container *ngIf="showLogo && entity">
|
||||
<img [src]="entity | logoUrl" class="uk-margin-right uk-blend-multiply">
|
||||
</ng-container>
|
||||
<div>
|
||||
<div class="uk-margin-remove uk-text-background uk-text-bold uk-h6">Admin Dashboard - Manage Entities</div>
|
||||
<h1 class="uk-h4 uk-margin-remove">{{name?name:'Super Admin'}}</h1>
|
||||
|
|
|
@ -14,6 +14,10 @@ import {SearchInputComponent} from "../../sharedComponents/search-input/search-i
|
|||
import {StringUtils} from "../../utils/string-utils.class";
|
||||
import {Title} from "@angular/platform-browser";
|
||||
import {StakeholderService} from '../../monitor/services/stakeholder.service';
|
||||
import {CommunitiesService} from "../../connect/communities/communities.service";
|
||||
import {CommunityService} from "../../connect/community/community.service";
|
||||
import {CommunityInfo} from "../../connect/community/communityInfo";
|
||||
import {Stakeholder, StakeholderInfo} from "../../monitor/entities/stakeholder";
|
||||
|
||||
declare var UIkit;
|
||||
|
||||
|
@ -40,7 +44,8 @@ export class EntitiesComponent implements OnInit {
|
|||
public communities: Portal[] = [];
|
||||
public portal: string;
|
||||
public name: string;
|
||||
public logo: string;
|
||||
public entity: CommunityInfo | Stakeholder;
|
||||
public showLogo: boolean = true;
|
||||
|
||||
public toggleIds: string[];
|
||||
public toggleStatus: boolean;
|
||||
|
@ -57,6 +62,7 @@ export class EntitiesComponent implements OnInit {
|
|||
private _router: Router, private title: Title,
|
||||
private _helpContentService: HelpContentService,
|
||||
private userManagementService: UserManagementService, private _fb: FormBuilder,
|
||||
private communityService: CommunityService,
|
||||
private stakeholderService: StakeholderService) {
|
||||
}
|
||||
|
||||
|
@ -82,13 +88,19 @@ export class EntitiesComponent implements OnInit {
|
|||
this.subscriptions.push(this.stakeholderService.getStakeholderAsObservable().subscribe(stakeholder => {
|
||||
if(stakeholder) {
|
||||
this.name = stakeholder.name;
|
||||
this.logo = stakeholder.logoUrl;
|
||||
this.title.setTitle(stakeholder.name + ' | Entities');
|
||||
this.entity = stakeholder;
|
||||
this.title.setTitle(this.name + ' | Entities');
|
||||
}
|
||||
}));
|
||||
} else {
|
||||
// TODO: for portals as well
|
||||
this.title.setTitle(this.portal.toUpperCase() + ' | Entities');
|
||||
this.subscriptions.push(this.communityService.getCommunityAsObservable().subscribe(community => {
|
||||
if(community) {
|
||||
this.showLogo = false;
|
||||
this.name = community.shortTitle;
|
||||
this.entity = community;
|
||||
this.title.setTitle(this.name + ' | Entities');
|
||||
}
|
||||
}));
|
||||
}
|
||||
} else {
|
||||
this.title.setTitle('Administrator Dashboard | Entities');
|
||||
|
|
|
@ -13,11 +13,12 @@ import {EntitiesRoutingModule} from "./entities-routing.module";
|
|||
import {SearchInputModule} from "../../sharedComponents/search-input/search-input.module";
|
||||
import {IconsModule} from "../../utils/icons/icons.module";
|
||||
import {LoadingModule} from "../../utils/loading/loading.module";
|
||||
import {LogoUrlPipeModule} from "../../utils/pipes/logoUrlPipe.module";
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule, RouterModule, FormsModule, AdminToolServiceModule,
|
||||
AlertModalModule, ReactiveFormsModule, MatSlideToggleModule, InputModule, PageContentModule, AdminTabsModule, EntitiesRoutingModule, SearchInputModule, IconsModule, LoadingModule
|
||||
AlertModalModule, ReactiveFormsModule, MatSlideToggleModule, InputModule, PageContentModule, AdminTabsModule, EntitiesRoutingModule, SearchInputModule, IconsModule, LoadingModule, LogoUrlPipeModule
|
||||
],
|
||||
declarations: [EntitiesComponent],
|
||||
exports: [EntitiesComponent]
|
||||
|
|
|
@ -10,9 +10,11 @@
|
|||
<a (click)="changeActiveRootMenuItem(item)">
|
||||
<span class="title">{{item.title}}</span>
|
||||
</a>
|
||||
<span class="uk-invisible-hover uk-position-center-right color z-index-2">
|
||||
<span class="clickable" uk-icon="more-vertical"></span>
|
||||
<div #element uk-dropdown="mode: click; pos: bottom-right; offset: 20; delay-hide: 0; flip: false">
|
||||
<span class="uk-invisible-hover uk-position-center-right">
|
||||
<a class="uk-link-reset">
|
||||
<icon [flex]="true" name="more_vert"></icon>
|
||||
</a>
|
||||
<div class="uk-dropdown" uk-dropdown="mode: click; pos: bottom-right; offset: 20; delay-hide: 0; flip: false">
|
||||
<ul class="uk-nav uk-dropdown-nav">
|
||||
<li (click)="editMenuItem(item, false)">
|
||||
<a>Edit</a>
|
||||
|
@ -125,7 +127,7 @@
|
|||
<div class="uk-flex" *ngIf="activeRootMenu && !activeRootMenu.items.length">
|
||||
<div class="uk-text-bold uk-form-label uk-margin-small-right">Featured</div>
|
||||
<mat-slide-toggle [formControl]="menuItemForm.get('isFeatured')"
|
||||
uk-tooltip="title:<div class='uk-padding-small uk-width-large'><div class='uk-text-bold '>Enable this to show your custom menu item in the community-specific navigation bar.</div><div class=' uk-margin-top'>If disabled, your custom menu item will appear in the default navigation bar.</div><div class=' uk-margin-top'>*Note that featured menu items can't have any children menu items(as a dropdown).</div></div>">
|
||||
uk-tooltip="title:<div class='uk-width-large'><div class='uk-text-bold '>Enable this to show your custom menu item in the community-specific navigation bar.</div><div class=' uk-margin-top'>If disabled, your custom menu item will appear in the default navigation bar.</div><div class=' uk-margin-top'>*Note that featured menu items can't have any children menu items(as a dropdown).</div></div>">
|
||||
</mat-slide-toggle>
|
||||
</div>
|
||||
<div dashboard-input [formInput]="menuItemForm.get('type')" type="select" label="Type" placeholder="Choose a type"
|
||||
|
|
|
@ -20,12 +20,7 @@ declare var UIkit;
|
|||
|
||||
@Component({
|
||||
selector: 'menuSelector',
|
||||
templateUrl: './menu.component.html',
|
||||
styles: [`
|
||||
.z-index-2 {
|
||||
z-index: 2;
|
||||
}
|
||||
`]
|
||||
templateUrl: './menu.component.html'
|
||||
})
|
||||
export class MenuComponent implements OnInit {
|
||||
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
<div page-content (stickyEmitter)="stickyPageHeader = $event">
|
||||
<div header>
|
||||
<div class="uk-flex uk-flex-middle uk-margin-top info" [class.uk-active]="stickyPageHeader">
|
||||
<img *ngIf="logo" [src]="logo" class="uk-margin-right">
|
||||
<img *ngIf="!logo" src="assets/common-assets/placeholder.png" class="uk-margin-right">
|
||||
<ng-container *ngIf="showLogo && entity">
|
||||
<img [src]="entity | logoUrl" class="uk-margin-right uk-blend-multiply">
|
||||
</ng-container>
|
||||
<div>
|
||||
<div class="uk-margin-remove uk-text-background uk-text-bold uk-h6">Admin Dashboard - Manage Pages</div>
|
||||
<h1 class="uk-h4 uk-margin-remove">{{name ? name : 'Super Admin'}}</h1>
|
||||
|
@ -63,7 +64,7 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="checkboxes.length > 0" class="uk-grid uk-child-width-1-1 uk-child-width-1-2@m" uk-grid>
|
||||
<div *ngIf="checkboxes.length > 0" class="uk-grid uk-child-width-1-1" uk-height-match=".uk-card-body" uk-grid>
|
||||
<div *ngFor="let check of checkboxes; let i=index">
|
||||
<div class="uk-card uk-card-default">
|
||||
<div class="uk-card-body uk-flex">
|
||||
|
@ -72,8 +73,8 @@
|
|||
name="pagescb[]" value="{{check.page._id}}" [(ngModel)]="check.checked">
|
||||
</div>
|
||||
<div class="uk-width-expand uk-text-small">
|
||||
<div class="uk-margin-bottom uk-text-large uk-text-bold">{{check.page.name}}</div>
|
||||
<div *ngIf="check.page.entities && check.page.entities.length > 0">
|
||||
<h6>{{check.page.name}}</h6>
|
||||
<div *ngIf="check.page.entities && check.page.entities.length > 0" class="uk-margin-small-bottom">
|
||||
<span class="uk-text-meta">Entities: </span>{{getEntitiesAsString(check.page)}}
|
||||
</div>
|
||||
<div class="uk-margin-small-bottom">
|
||||
|
@ -91,15 +92,16 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="uk-card-footer uk-padding-remove-vertical">
|
||||
<div class="uk-grid uk-grid-divider uk-flex-right">
|
||||
<div class="uk-grid uk-grid-small uk-flex-nowrap uk-grid-divider uk-flex-right" uk-grid>
|
||||
<ng-container *ngIf="!isPortalAdministrator">
|
||||
<div *ngIf="check.page.top || check.page.bottom || check.page.left || check.page.right">
|
||||
<div class="uk-padding-small uk-padding-remove-horizontal">
|
||||
<a class="uk-button uk-button-link"
|
||||
[queryParams]="{pageId: check.page._id}"
|
||||
routerLink="../helptexts">
|
||||
<a class="uk-button uk-button-link uk-text-truncate"
|
||||
[queryParams]="{pageId: check.page._id}"
|
||||
routerLink="../helptexts">
|
||||
Manage page help texts
|
||||
<span *ngIf="pageHelpContentsCount[check.page._id]">({{pageHelpContentsCount[check.page._id]}})</span>
|
||||
<span *ngIf="pageHelpContentsCount[check.page._id]">({{pageHelpContentsCount[check.page._id]}}
|
||||
)</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -108,7 +110,9 @@
|
|||
<a class="uk-button uk-button-link"
|
||||
[queryParams]="{ pageId: check.page._id}"
|
||||
routerLink="../classContents">Manage class help texts
|
||||
<span *ngIf="pageClassContentsCount[check.page._id]">({{pageClassContentsCount[check.page._id]}})</span>
|
||||
<span
|
||||
*ngIf="pageClassContentsCount[check.page._id]">({{pageClassContentsCount[check.page._id]}}
|
||||
)</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -122,7 +126,8 @@
|
|||
</div>
|
||||
</div>
|
||||
</ng-container>
|
||||
<ng-container *ngIf="isPortalAdministrator || (check.page.portalType == properties.adminToolsPortalType && check.page.portalPid == portal)">
|
||||
<ng-container
|
||||
*ngIf="isPortalAdministrator || (check.page.portalType == properties.adminToolsPortalType && check.page.portalPid == portal)">
|
||||
<div>
|
||||
<div class="uk-padding-small uk-padding-remove-horizontal">
|
||||
<button [disabled]="!portal && check.page.portalPid"
|
||||
|
|
|
@ -17,6 +17,9 @@ import {SearchInputComponent} from '../../sharedComponents/search-input/search-i
|
|||
import {Title} from '@angular/platform-browser';
|
||||
import {StringUtils} from '../../utils/string-utils.class';
|
||||
import {StakeholderService} from '../../monitor/services/stakeholder.service';
|
||||
import {CommunityInfo} from "../../connect/community/communityInfo";
|
||||
import {Stakeholder} from "../../monitor/entities/stakeholder";
|
||||
import {CommunityService} from "../../connect/community/community.service";
|
||||
|
||||
declare var UIkit;
|
||||
|
||||
|
@ -44,8 +47,8 @@ export class PagesComponent implements OnInit {
|
|||
|
||||
public portal: string;
|
||||
public name: string;
|
||||
public logo: string;
|
||||
|
||||
public entity: CommunityInfo | Stakeholder;
|
||||
public showLogo: boolean = true;
|
||||
public pagesType: string;
|
||||
public properties: EnvProperties = properties;
|
||||
|
||||
|
@ -72,6 +75,7 @@ export class PagesComponent implements OnInit {
|
|||
private title: Title,
|
||||
private _router: Router, private _helpContentService: HelpContentService,
|
||||
private userManagementService: UserManagementService, private _fb: FormBuilder,
|
||||
private communityService: CommunityService,
|
||||
private stakeholderService: StakeholderService) {
|
||||
}
|
||||
|
||||
|
@ -102,13 +106,19 @@ export class PagesComponent implements OnInit {
|
|||
this.subscriptions.push(this.stakeholderService.getStakeholderAsObservable().subscribe(stakeholder => {
|
||||
if(stakeholder) {
|
||||
this.name = stakeholder.name;
|
||||
this.logo = stakeholder.logoUrl;
|
||||
this.title.setTitle(stakeholder.name + ' | Pages');
|
||||
this.entity = stakeholder;
|
||||
this.title.setTitle(this.name + ' | Pages');
|
||||
}
|
||||
}));
|
||||
} else {
|
||||
// TODO: for portals as well
|
||||
this.title.setTitle(this.portal.toUpperCase() + ' | Pages');
|
||||
this.subscriptions.push(this.communityService.getCommunityAsObservable().subscribe(community => {
|
||||
if(community) {
|
||||
this.showLogo = false;
|
||||
this.name = community.shortTitle;
|
||||
this.entity = community;
|
||||
this.title.setTitle(this.name + ' | Pages');
|
||||
}
|
||||
}));
|
||||
}
|
||||
} else {
|
||||
this.title.setTitle('Administrator Dashboard | Pages');
|
||||
|
|
|
@ -16,11 +16,12 @@ import {PagesRoutingModule} from "./pages-routing.module";
|
|||
import {SearchInputModule} from "../../sharedComponents/search-input/search-input.module";
|
||||
import {IconsModule} from "../../utils/icons/icons.module";
|
||||
import {LoadingModule} from "../../utils/loading/loading.module";
|
||||
import {LogoUrlPipeModule} from "../../utils/pipes/logoUrlPipe.module";
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule, RouterModule, FormsModule, AlertModalModule, ReactiveFormsModule, MatSlideToggleModule, AdminToolServiceModule, InputModule,
|
||||
MatAutocompleteModule, MatFormFieldModule, MatChipsModule, AdminTabsModule, PageContentModule, PagesRoutingModule, SearchInputModule, IconsModule, LoadingModule
|
||||
MatAutocompleteModule, MatFormFieldModule, MatChipsModule, AdminTabsModule, PageContentModule, PagesRoutingModule, SearchInputModule, IconsModule, LoadingModule, LogoUrlPipeModule
|
||||
],
|
||||
declarations: [PagesComponent],
|
||||
exports: [PagesComponent]
|
||||
|
|
|
@ -8,11 +8,11 @@ import { properties } from 'src/environments/environment';
|
|||
@Component({
|
||||
selector: 'admin-tabs',
|
||||
template: `
|
||||
<ul class="uk-tab">
|
||||
<ul class="uk-tab" uk-tab>
|
||||
<li *ngIf="isPortalAdmin && !portal" [class.uk-active]="tab === 'portal'"><a routerLink="../portals"><span class="title">Portals</span></a></li>
|
||||
<li [class.uk-active]="tab === 'page'"><a routerLink="../pages"><span class="title">Pages</span></a></li>
|
||||
<li [class.uk-active]="tab === 'entity'"><a routerLink="../entities"><span class="title">Entities</span></a></li>
|
||||
<li *ngIf="env === 'development' && portal && portal === 'connect'" [class.uk-active]="tab === 'menu'"><a routerLink="../menu"><span class="title">Menu</span></a></li>
|
||||
<li *ngIf="env === 'development' && portal && type === 'community'" [class.uk-active]="tab === 'menu'"><a routerLink="../menu"><span class="title">Menu</span></a></li>
|
||||
<li *ngIf="isPortalAdmin && !portal" [class.uk-active]="tab === 'class'"><a routerLink="../classes"><span class="title">Classes</span></a></li>
|
||||
</ul>
|
||||
`
|
||||
|
|
|
@ -95,10 +95,7 @@
|
|||
</modal-alert>
|
||||
<ng-template #resultPreview let-result="result">
|
||||
<div class="uk-flex uk-flex-center">
|
||||
<img *ngIf="result.logoUrl; else elseBlock" [src]="result | logoUrl" class="uk-blend-multiply"
|
||||
<img [src]="result | logoUrl" class="uk-blend-multiply"
|
||||
[alt]="((result.title)?result.title:result.shortTitle) + ' logo'" loading="lazy">
|
||||
<ng-template #elseBlock>
|
||||
<img src="assets/common-assets/placeholder.png" alt="OpenAIRE placeholder logo" class="uk-blend-multiply">
|
||||
</ng-template>
|
||||
</div>
|
||||
</ng-template>
|
||||
|
|
|
@ -56,8 +56,7 @@ export class MenuItem {
|
|||
private static isTheActiveMenuItem(menu: MenuItem, currentRoute: any, activeMenuItem: string) {
|
||||
return (
|
||||
((menu.route == currentRoute.route || menu.route == (currentRoute.route + "/")) && currentRoute.fragment == menu.fragment))
|
||||
|| (menu.routeActive && (
|
||||
currentRoute.route.includes(menu.routeActive)))
|
||||
|| (menu.routeActive && (currentRoute.route.startsWith(menu.routeActive)))
|
||||
|| (menu._id && menu._id === activeMenuItem);
|
||||
}
|
||||
|
||||
|
|
|
@ -311,7 +311,11 @@ export class StringUtils {
|
|||
}
|
||||
|
||||
public static getLogoUrl(result: Stakeholder | CommunityInfo): string {
|
||||
return (result.isUpload && result.logoUrl)?(properties.utilsService + '/download/' + result.logoUrl):result.logoUrl;
|
||||
if(result.logoUrl) {
|
||||
return (result.isUpload)?(properties.utilsService + '/download/' + result.logoUrl):result.logoUrl;
|
||||
} else {
|
||||
return "assets/common-assets/placeholder.png";
|
||||
}
|
||||
}
|
||||
|
||||
public static isValidUrl(url: string): boolean {
|
||||
|
|
Loading…
Reference in New Issue