frontend/src/app/pages/editor/editor.page.html

87 lines
4.0 KiB
HTML
Raw Normal View History

2020-02-08 21:07:47 +00:00
<ng-container>
2020-10-13 16:57:56 +00:00
<ion-header>
2020-02-08 21:07:47 +00:00
<ion-toolbar>
<ion-buttons slot="start">
2020-10-12 16:59:32 +00:00
<ion-menu-button></ion-menu-button>
2020-02-08 21:07:47 +00:00
</ion-buttons>
2020-02-09 03:47:05 +00:00
<ion-title #titleBar>
2020-11-17 04:48:59 +00:00
<div style="display: flex; flex-direction: row;">
<i *ngIf="editorService.currentPageType" [ngClass]="typeIcons[editorService.currentPageType]" style="font-size: 18pt; margin: auto 10px;"></i>
<ion-input
style="flex: 1;"
[(ngModel)]="editorService.mutablePageName"
[readonly]="!editorService.canEdit()"
placeholder="Click to edit page name..."
class="title-input"
></ion-input>
</div>
2020-02-09 03:47:05 +00:00
</ion-title>
<ion-buttons slot="end">
2020-11-03 03:47:29 +00:00
<button
class="save-button"
(click)="editorService.triggerSave()"
title="Manually save this note"
*ngIf="editorService.isEditing && editorService.canEdit()"
>
<i *ngIf="!(editorService.isSaving || editorService.willSave)" class="fa fa-check-circle"></i>
{{ (editorService.isSaving || editorService.willSave) ? 'Saving...' : 'Saved!' }}
</button>
2020-11-20 18:16:05 +00:00
<button
2020-11-23 16:22:36 +00:00
*ngIf="editorService.isEditing && editorService.canEdit() && !isFilloutMode"
title="More page options"
(click)="onPageMenuClick($event)"
2020-11-20 18:16:05 +00:00
class="clear-btn"
style="padding: 10px;"
>
2020-11-03 03:47:29 +00:00
<i class="fa fa-ellipsis-v"></i>
2020-11-20 18:16:05 +00:00
</button>
</ion-buttons>
2020-02-08 21:07:47 +00:00
</ion-toolbar>
</ion-header>
2020-02-08 09:36:14 +00:00
2020-10-13 16:57:56 +00:00
<ion-content>
<ng-container *ngIf="editorService.notAvailable">
<div class="editor-root ion-padding" style="text-align: center; padding-top: 100px; color: #494949; font-size: 1.2em;">
Sorry, this page is not available offline yet.
</div>
</ng-container>
<ng-container *ngIf="!editorService.notAvailable">
<div class="editor-root ion-padding">
<div
class="host-container"
2020-10-14 12:37:14 +00:00
style="display: flex; margin-bottom: 20px;"
*ngFor="let node of editorService.immutableNodes"
>
2020-11-23 16:22:36 +00:00
<div class="host-icons" *ngIf="!isFilloutMode">
2020-11-17 04:48:59 +00:00
<i class="type-icon fa" [ngClass]="typeIcons[(node.isNorm() ? 'node' : node.type)] + ' ' + (node.isNorm() ? 'node' : (node.isForm() ? 'form-input ' + node.type : node.type))"></i>
2020-11-20 18:16:05 +00:00
<button (click)="onOptionsClick($event, node)" *ngIf="editorService.canEdit()" class="clear-btn">
2020-10-14 03:47:59 +00:00
<i class="fa fa-ellipsis-v" title="Node options"></i>
</button>
</div>
<ng-container *ngIf="node.isNorm()">
<editor-norm style="flex: 1;" [nodeId]="node.UUID" [editorUUID]="editorService.instanceUUID"></editor-norm>
</ng-container>
2020-10-16 17:20:16 +00:00
<ng-container *ngIf="node.type === 'markdown'">
<editor-markdown style="flex: 1;" [nodeId]="node.UUID" [editorUUID]="editorService.instanceUUID"></editor-markdown>
2020-10-16 17:20:16 +00:00
</ng-container>
2020-10-14 12:50:50 +00:00
<ng-container *ngIf="node.type === 'database_ref'">
<editor-database style="flex: 1;" [nodeId]="node.UUID" [editorUUID]="editorService.instanceUUID"></editor-database>
2020-10-14 12:50:50 +00:00
</ng-container>
2020-10-14 12:37:14 +00:00
<ng-container *ngIf="node.type === 'code_ref'">
<editor-code style="flex: 1;" [nodeId]="node.UUID" [editorUUID]="editorService.instanceUUID"></editor-code>
2020-10-14 12:37:14 +00:00
</ng-container>
<ng-container *ngIf="node.type === 'file_ref'">
<editor-files style="flex: 1;" [nodeId]="node.UUID" [editorUUID]="editorService.instanceUUID"></editor-files>
</ng-container>
2020-11-17 04:48:59 +00:00
<ng-container *ngIf="node.isForm()">
2020-11-23 16:22:36 +00:00
<editor-node-form-input style="flex: 1;" [isFilloutMode]="isFilloutMode" [nodeId]="node.UUID" [editorUUID]="editorService.instanceUUID"></editor-node-form-input>
2020-11-17 04:48:59 +00:00
</ng-container>
2020-02-08 21:07:47 +00:00
</div>
2020-11-23 16:22:36 +00:00
<button *ngIf="editorService.canEdit() && !isFilloutMode" class="host-add-button" (click)="onAddClick($event)">
<i class="fa fa-plus"></i> Add Node
</button>
2020-02-08 09:36:14 +00:00
</div>
2020-02-08 21:07:47 +00:00
</ng-container>
</ion-content>
2020-02-08 22:33:31 +00:00
</ng-container>