openaire-library/dashboard/portal/portals.component.html

102 lines
4.9 KiB
HTML

<div page-content (stickyEmitter)="stickyPageHeader = $event">
<div header>
<div class="uk-flex uk-flex-middle uk-margin-top info" [class.uk-active]="stickyPageHeader">
<div>
<div class="uk-margin-remove uk-text-background uk-text-bold uk-h6">Admin Dashboard</div>
</div>
</div>
<div class="uk-margin uk-margin-remove-bottom">
<admin-tabs tab="portal"></admin-tabs>
</div>
</div>
<div inner>
<div *ngIf="showLoading" class="uk-position-center">
<loading></loading>
</div>
<ng-container *ngIf="!showLoading">
<div class="uk-grid uk-flex-middle uk-margin-top uk-margin-medium-bottom" uk-grid>
<div class="uk-width-1-1">
<ul class="uk-subnav uk-subnav-pill">
<li [class.uk-active]="filterForm.get('type').value === 'all'" class="uk-margin-small-bottom"><a
(click)="filterForm.get('type').setValue('all')"><span
class="title">All portals</span></a></li>
<li *ngFor="let type of portalUtils.portalTypes; let i=index"
[class.uk-active]="filterForm.get('type').value === type.value" class="uk-margin-small-bottom"><a
(click)="filterForm.get('type').setValue(type.value)"><span
class="title">{{type.label}}</span></a></li>
</ul>
</div>
<div class="uk-width-1-1 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.get('keyword')" searchInputClass="outer" placeholder="Search portal"
[bordered]="true" colorClass="uk-text-secondary" class="uk-width-1-3@xl uk-width-2-5@l uk-width-1-2@m uk-width-1-1"></div>
<div>
<button class="uk-button uk-button-secondary">Bulk Actions</button>
<div uk-dropdown="mode: click">
<ul class="uk-nav uk-dropdown-nav"
[attr.uk-tooltip]="getSelectedPortals().length == 0 ? 'pos:left; cls: uk-active' : 'cls: uk-invisible'"
title="Select at least one portal">
<li><a [class]="getSelectedPortals().length == 0 ? 'uk-disabled' : ''"
(click)="confirmDeleteSelectedPortals()"><i></i> Delete </a></li>
</ul>
</div>
</div>
<div>
<button class="uk-button uk-button-default uk-flex uk-flex-middle" (click)="newPortal()">
<icon name="add" [flex]="true"></icon>
<span class="uk-margin-small-left uk-text-bold uk-text-uppercase">Add portal</span>
</button>
</div>
</div>
</div>
<table *ngIf="checkboxes.length > 0" class="uk-table uk-table-striped uk-table-hover">
<thead class="uk-card-header">
<tr>
<th><input id="allCommunityCheckbox" type="checkbox" (change)="toggleCheckBoxes($event)"></th>
<th>Name</th>
<th>Type</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let check of checkboxes; let i=index">
<td><input id="{{check.portal._id}}" class="checkBox" type="checkbox"
name="communitiescb[]" value="{{check.portal._id}}" [(ngModel)]="check.checked">
</td>
<td>
<div class="name" href="#">{{check.portal.name}}</div>
</td>
<td>
<div class="type" href="#">{{check.portal.type}}</div>
</td>
<td>
<div class="actions" href="#">
<icon class="clickable" name="edit" (click)="editPortal(i)"></icon>
<icon class="clickable uk-margin-small-left" [customClass]="'uk-text-danger'" name="delete" (click)="confirmDeletePortal(check.portal._id)"></icon>
</div>
</td>
</tr>
</tbody>
</table>
<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 portals found</div>
</div>
</ng-container>
</div>
</div>
<modal-alert #editModal (alertOutput)="portalSaveConfirmed($event)"
[okDisabled]="portalForm && (portalForm.invalid || !portalForm.dirty)">
<form *ngIf="portalForm" [formGroup]="portalForm" class="uk-grid uk-child-width-1-1" uk-grid>
<div input [formInput]="portalForm.get('name')" placeholder="Portal Name"></div>
<div input [formInput]="portalForm.get('type')" placeholder="Portal Type"
[options]="portalUtils.portalTypes" type="select"></div>
<div input [formInput]="portalForm.get('pid')" placeholder="Portal persistent id for portal"></div>
<div input [formInput]="portalForm.get('piwik')" placeholder="Piwik ID"></div>
<div *ngIf="properties.environment == 'development'" input [formInput]="portalForm.get('twitterAccount')" placeholder="Twitter Account"></div>
</form>
</modal-alert>
<modal-alert #deleteModal (alertOutput)="confirmedDeletePortals($event)"></modal-alert>