2021-01-11 19:33:24 +01:00
< div page-content class = "admin-pages" >
< div header >
2021-01-26 18:00:40 +01:00
< admin-tabs tab = "entity" [ portal ] = " portal " > < / admin-tabs >
2021-03-18 15:11:41 +01:00
< div * ngIf = "!showLoading" class = "uk-grid" uk-grid >
2021-01-11 19:33:24 +01:00
< div class = "uk-width-1-1" >
< ul * ngIf = "!isPortalAdministrator" class = "uk-subnav uk-subnav-pill" >
< li [ class . uk-active ] = " filterForm . get ( ' status ' ) . value = == ' all ' " > < a
(click)="filterForm.get('status').setValue('all')">< span
class="title">All entities< / span > < / a > < / li >
< li [ class . uk-active ] = " filterForm . get ( ' status ' ) . value = == ' enabled ' " > < a
(click)="filterForm.get('status').setValue('enabled')">< span class = "title" > Enabled< / span > < / a > < / li >
< li [ class . uk-active ] = " filterForm . get ( ' status ' ) . value = == ' disabled ' " > < a
(click)="filterForm.get('status').setValue('disabled')">< span class = "title" > Disabled< / span > < / a > < / li >
< / ul >
2019-12-18 16:14:21 +01:00
< / div >
2021-02-25 16:55:56 +01:00
< div class = "uk-width-1-1 uk-flex uk-flex-right@m uk-flex-center uk-flex-wrap uk-flex-middle uk-grid uk-margin-remove-top"
2021-03-18 15:11:41 +01:00
uk-grid>
< div # searchInputComponent search-input [ control ] = " filterForm . controls . keyword " [ showSearch ] = " false "
placeholder="Search entity"
2021-02-02 13:29:18 +01:00
[selected]="selectedKeyword" (closeEmitter)="onSearchClose()" (resetEmitter)="reset()"
2021-03-18 15:11:41 +01:00
[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 >
2021-01-12 11:23:26 +01:00
< div * ngIf = "isPortalAdministrator" >
2021-01-11 19:33:24 +01:00
< a ( click ) = " newEntity ( ) "
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 entity< / button >
< / a >
< / div >
2019-12-18 16:14:21 +01:00
< / div >
2021-02-25 16:55:56 +01:00
< / div >
2021-03-02 16:52:09 +01:00
< div * ngIf = "!showLoading && checkboxes.length > 0"
class="uk-margin-remove-top uk-margin-small-left uk-margin-small-bottom uk-display-inline"
[attr.uk-tooltip]="getSelectedEntities().length == 0 ? 'pos:left; cls: uk-active' : null"
title="Select at least one entity">< input id = "checkAll" type = "checkbox" ( click ) = " selectAll ( ) "
2021-03-18 15:11:41 +01:00
[ngModel]="getSelectedEntities().length ==checkboxes.length"/>
2021-02-25 16:55:56 +01:00
< span * ngIf = "getSelectedEntities().length > 0" class = "uk-margin-left uk-text-muted" >
{{getSelectedEntities().length}} entities selected < / span >
2021-03-18 15:11:41 +01:00
< a class = "uk-margin-left " > Actions < / a >
2021-02-25 16:55:56 +01:00
< div uk-dropdown = "mode: click" >
< ul class = "uk-nav uk-dropdown-nav"
[attr.uk-tooltip]="getSelectedEntities().length == 0 ? 'pos:left; cls: uk-active' : 'cls: uk-invisible'"
2021-03-02 16:52:09 +01:00
title="Select at least one entity">
2021-02-25 16:55:56 +01:00
< li * ngIf = "!isPortalAdministrator" > < a [ class ] = " getSelectedEntities ( ) . length = = 0 ? ' uk-disabled ' : ' ' "
(click)="toggleEntities(true,getSelectedEntities())">< i > < / i > Enable
< / a > < / li >
< li * ngIf = "!isPortalAdministrator" > < a [ class ] = " getSelectedEntities ( ) . length = = 0 ? ' uk-disabled ' : ' ' "
(click)="toggleEntities(false,getSelectedEntities())">< i > < / i > Disable
< / a >
< / li >
< li * ngIf = "isPortalAdministrator" > < a [ class ] = " getSelectedEntities ( ) . length = = 0 ? ' uk-disabled ' : ' ' "
(click)="confirmDeleteSelectedEntities()">< i > < / i > Delete < / a > < / li >
< / ul >
< / div >
2019-12-18 16:14:21 +01:00
< / div >
2021-01-11 19:33:24 +01:00
< / div >
< div inner >
2021-02-25 16:55:56 +01:00
< div * ngIf = "showLoading" class = "uk-position-center" >
2021-03-18 15:11:41 +01:00
< loading > < / loading >
2021-02-25 16:55:56 +01:00
< / div >
2021-02-01 20:17:55 +01:00
< div * ngIf = "!showLoading" >
2021-03-18 15:11:41 +01:00
< table * ngIf = "checkboxes.length > 0 " class = "uk-table uk-table-striped uk-table-hover uk-table-large" >
< thead class = "uk-card-header" >
< tr >
< th class = "uk-width-small" > < / th >
< th > Name< / th >
< th * ngIf = "!isPortalAdministrator" > Status< / th >
< th * ngIf = "!isPortalAdministrator" > Enable/Disable< / th >
< th * ngIf = "isPortalAdministrator" > Actions< / th >
< / tr >
< / thead >
< tbody >
< tr * ngFor = "let check of checkboxes; let i=index" >
< td > < input id = "{{check.entity._id}}" class = "checkBox" type = "checkbox"
name="entitiescb[]" value="{{check.entity._id}}" [(ngModel)]="check.checked">
< / td >
< td >
< div class = "name" href = "#" > {{check.entity.name}}< / div >
< / td >
< td * ngIf = "!isPortalAdministrator" >
< div class = "name" href = "#" > {{check.entity.isEnabled ? "Enabled" : "Disabled"}}< / div >
< / td >
< td * ngIf = "!isPortalAdministrator" >
< mat-slide-toggle [ checked ] = " check . entity . isEnabled "
(change)="($event.source.checked = check.entity.isEnabled);toggleEntities(!check.entity.isEnabled,[check.entity._id])"
uk-tooltip="title:< div class = 'uk-padding-small uk-width-large' > < div class = 'uk-text-bold ' > Disable an entity to hide it from community dashboard portal.< / div > < div class = ' uk-margin-top' > If an entity is disabled, all related search and advanced search pages will be hidden from the community dashborad and a message 'Can't find that page' will appear in case the url of that page is loaded. If the related page belongs to the menu the link will be removed from menu, too.< / div > < / div > "
>< / mat-slide-toggle >
< / td >
2019-12-18 16:14:21 +01:00
2021-03-18 15:11:41 +01:00
< td * ngIf = "isPortalAdministrator" >
< div class = "actions" href = "#" >
2022-01-13 14:46:22 +01:00
< icon class = "clickable" name = "edit" ( click ) = " editEntity ( i ) " > < / icon >
< icon class = "clickable uk-margin-small-left" [ customClass ] = " ' uk-text-danger ' " name = "remove" ( click ) = " confirmDeleteEntity ( check . entity . _id ) " > < / icon >
2021-01-11 19:33:24 +01:00
< / div >
2021-03-18 15:11:41 +01:00
< / 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 entities found< / div >
2021-01-11 19:33:24 +01:00
< / div >
2019-12-18 16:14:21 +01:00
< / div >
< / div >
< / div >
2021-01-28 17:33:16 +01:00
< modal-alert # editModal ( alertOutput ) = " entitySaveConfirmed ( $ event ) "
[okDisabled]="entityForm & & (entityForm.invalid || !entityForm.dirty)">
< form * ngIf = "entityForm" [ formGroup ] = " entityForm " class = "uk-grid uk-child-width-1-1" uk-grid >
< div dashboard-input [ formInput ] = " entityForm . get ( ' name ' ) "
type="text" placeholder="Write a name"
2019-12-18 16:14:21 +01:00
label="Entity Name">
< / div >
2021-01-28 17:33:16 +01:00
< div dashboard-input [ formInput ] = " entityForm . get ( ' pid ' ) "
type="text" placeholder="Write a pid"
2019-12-18 16:14:21 +01:00
label="Entity Pid">
< / div >
< / form >
< / modal-alert >
2021-01-28 17:33:16 +01:00
< modal-alert # relatedPages ( alertOutput ) = " continueToggling ( $ event ) " > < / modal-alert >
2019-12-18 16:14:21 +01:00
2021-01-28 17:33:16 +01:00
< modal-alert # deleteModal ( alertOutput ) = " confirmedDeleteEntities ( $ event ) " > < / modal-alert >