192 lines
9.8 KiB
HTML
192 lines
9.8 KiB
HTML
|
<div page-content>
|
||
|
<div header>
|
||
|
<div class="uk-section-xsmall uk-margin-top">
|
||
|
<div class="uk-flex-middle uk-grid" uk-grid>
|
||
|
<div class="uk-width-expand">
|
||
|
<a routerLink="../pages" class="uk-flex uk-flex-middle uk-h5 uk-link-reset">
|
||
|
<span class="uk-margin-right">
|
||
|
<icon name="west" ratio="1.7" [flex]="true"></icon>
|
||
|
</span>
|
||
|
<h1 *ngIf="page" class="uk-h5 uk-margin-remove">{{page.name}}</h1>
|
||
|
</a>
|
||
|
</div>
|
||
|
<div search-input [disabled]="showLoading" [expandable]="true" [searchControl]="filterForm" searchInputClass="outer" placeholder="Search plugins" class="uk-width-1-3@xl uk-width-2-5@l uk-width-1-2@m uk-width-1-1">
|
||
|
</div>
|
||
|
<div>
|
||
|
<button (click)="newPlugin()" [disabled]="showLoading" [class.uk-disabled]="showLoading || this.pluginTemplates.length ==0"
|
||
|
class="uk-flex uk-flex-middle uk-button uk-button-default" >
|
||
|
<icon [flex]="true" name="add"></icon>
|
||
|
<span class="uk-margin-small-left">Add new plugin</span>
|
||
|
</button>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div inner>
|
||
|
<div class="uk-section uk-section-small uk-position-relative" style="min-height: 60vh">
|
||
|
<div *ngIf="showLoading" class="uk-position-center">
|
||
|
<loading></loading>
|
||
|
</div>
|
||
|
<ng-container *ngIf="!showLoading">
|
||
|
<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 plugins found</div>
|
||
|
</div>
|
||
|
<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">
|
||
|
<!--<div *ngIf="!portal" class="uk-margin-right">
|
||
|
<input [id]="check.template._id" class="uk-checkbox" type="checkbox"
|
||
|
name="pagescb[]" value="{{check.page._id}}" [(ngModel)]="check.checked">
|
||
|
</div>-->
|
||
|
<div class="uk-width-expand uk-text-small">
|
||
|
<ng-container *ngIf="check.template">
|
||
|
<h6>{{check.template.name}}</h6>
|
||
|
<div class="uk-margin-small-bottom">
|
||
|
{{check.template.description}}
|
||
|
</div>
|
||
|
</ng-container>
|
||
|
<ng-container *ngIf="!check.template">
|
||
|
<h6>{{check.plugin.code}}</h6>
|
||
|
<div class="uk-margin-small-bottom uk-text-warning">
|
||
|
Plugin is not supported anymore!
|
||
|
</div>
|
||
|
</ng-container>
|
||
|
<div class="uk-margin-small-bottom">
|
||
|
<span class="uk-text-meta">Placement: </span>{{check.plugin.placement}}
|
||
|
</div>
|
||
|
<div *ngFor="let key of getKeys(check.template.attributes)">
|
||
|
<div *ngIf="check.template.attributes[key]['type'] =='HTML' ">
|
||
|
{{check.template.attributes[key]['name']}}:
|
||
|
<div [innerHTML]="check.plugin.values[key]"></div>
|
||
|
</div>
|
||
|
<div *ngIf="check.template.attributes[key]['type'] =='text' ">
|
||
|
{{check.template.attributes[key]['name']}}:
|
||
|
<div >{{check.plugin.values[key]}}</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<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">
|
||
|
<button
|
||
|
class="uk-button uk-button-link uk-flex uk-flex-middle" (click)="edit(i)" [class.uk-disabled]="!check.template">
|
||
|
<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)="confirmDelete(check.plugin._id)">
|
||
|
<icon name="delete" [flex]="true"></icon>
|
||
|
<span class="uk-margin-xsmall-left"> Delete</span>
|
||
|
</button>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</ng-container>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
<modal-alert #editModal (alertOutput)="saveConfirmed($event)" [large]="true"
|
||
|
[okDisabled]="templateForm && (templateForm.invalid || !templateForm.dirty)" classTitle="uk-background-primary uk-light">
|
||
|
{{selectedPlugin}} {{selectedTemplate}} {{pluginTemplates.length}}
|
||
|
<div *ngIf="!selectedPlugin && !selectedTemplate">
|
||
|
<div *ngIf="pluginTemplates.length > 0" class="uk-grid uk-child-width-1-1" uk-height-match=".uk-card-body" uk-grid>
|
||
|
<div *ngFor="let template of pluginTemplates; let i=index">
|
||
|
<div class="uk-card uk-card-default">
|
||
|
<div class="uk-card-body uk-flex">
|
||
|
<div class="uk-width-expand uk-text-small">
|
||
|
<h6>{{template.name}}</h6>
|
||
|
<div class="uk-margin-small-bottom">
|
||
|
<span class="uk-text-meta">Placements: </span>{{template.placements.join(", ")}}
|
||
|
</div>
|
||
|
<div class="uk-margin-small-bottom">
|
||
|
{{template.description}}
|
||
|
</div>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<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">
|
||
|
<button
|
||
|
class="uk-button uk-button-link uk-flex uk-flex-middle" (click)="newPlugin(template)">
|
||
|
<!-- <icon name="edit" [flex]="true"></icon>-->
|
||
|
<span class="uk-margin-xsmall-left"> Select Template</span>
|
||
|
</button>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
</div>
|
||
|
<form *ngIf="templateForm" [formGroup]="templateForm" class="uk-grid" uk-grid>
|
||
|
|
||
|
|
||
|
<ng-container *ngIf="selectedTemplate || selectedPlugin">
|
||
|
<div class="uk-text-large ">{{selectedTemplate.name}}</div>
|
||
|
<div class="uk-text-meta uk-width-1-1">{{selectedTemplate.description}}</div>
|
||
|
<div input [formInput]="templateForm.get('placement')" placeholder="Placements" [options]="placementsOptions" type="select" class="uk-width-1-2"></div>
|
||
|
|
||
|
<div *ngFor="let attrForm of attrFormArray.controls; let i=index" class="uk-width-1-1 uk-grid uk-child-width-1-2 uk-margin-top" uk-grid>
|
||
|
|
||
|
|
||
|
<div class="uk-heading-divider uk-text-small uk-width-1-1 uk-margin-bottom uk-text-meta">
|
||
|
<div class="uk-grid">
|
||
|
<div>Field #{{i +1}}</div>
|
||
|
<!--<div *ngIf="attrFormArray.length > 1" class=" uk-width-expand uk-text-right ">
|
||
|
<a class=" " (click)="removeAttr(i)">Remove</a>
|
||
|
</div>-->
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<!-- <div input [formInput]="attrForm.get('value')" [placeholder]="attrForm.get"></div>
|
||
|
<div input [formInput]="attrForm.get('name')" placeholder="Name"></div>
|
||
|
<div input [formInput]="attrForm.get('type')" placeholder="Type" [options]="attrTypeOptions" type="select" (valueChange)="attributeTypeChanged(attrForm)"></div>
|
||
|
-->
|
||
|
<div *ngIf="this.selectedTemplate.attributes[attrForm.get('key').value].type == 'text'" input [formInput]="attrForm.get('value')" [placeholder]="selectedTemplate.attributes[attrForm.get('key').value].name" type="text" ></div>
|
||
|
<div *ngIf="this.selectedTemplate.attributes[attrForm.get('key').value].type == 'URL'" input [formInput]="attrForm.get('value')" [placeholder]="selectedTemplate.attributes[attrForm.get('key').value].name" type="URL" [validators]="urlValidator"></div>
|
||
|
<div *ngIf="this.selectedTemplate.attributes[attrForm.get('key').value].type == 'boolean'" input [formInput]="attrForm.get('value')" [placeholder]="selectedTemplate.attributes[attrForm.get('key').value].name" type="select"
|
||
|
[options]="[{label: 'yes', value:true}, {label: 'no', value:false}]"></div>
|
||
|
<div *ngIf="this.selectedTemplate.attributes[attrForm.get('key').value].type == 'HTML'" class="uk-width-1-1">
|
||
|
<label>
|
||
|
{{selectedTemplate.attributes[attrForm.get('key').value].name}}:
|
||
|
</label>
|
||
|
<ckeditor [readonly]="false"
|
||
|
debounce="500"
|
||
|
[formControl]="attrForm.get('value')"
|
||
|
[config]="{ extraAllowedContent: '* [uk-*](*) ; span', disallowedContent: 'script; *[on*]',
|
||
|
removeButtons: 'Save,NewPage,DocProps,Preview,Print,' +
|
||
|
'Form,Checkbox,Radio,TextField,Textarea,Select,Button,ImageButton,HiddenField,' +
|
||
|
'CreateDiv,Flash,PageBreak,' +
|
||
|
'Subscript,Superscript,Anchor,Smiley,Iframe,Styles,Font,About,Language',
|
||
|
extraPlugins: 'divarea'}">
|
||
|
</ckeditor>
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
</ng-container>
|
||
|
</form>
|
||
|
</modal-alert>
|
||
|
<modal-alert #deleteModal (alertOutput)="confirmedDelete()" classTitle="uk-background-primary uk-light"></modal-alert>
|