mirror of https://github.com/Squidex/squidex.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
143 lines
6.6 KiB
143 lines
6.6 KiB
<sqx-title [message]="schema.displayName"></sqx-title>
|
|
|
|
<form [formGroup]="contentForm.form" (ngSubmit)="saveAndPublish()">
|
|
<sqx-panel desiredWidth="*" minWidth="60rem" [showSidebar]="hasContent">
|
|
<ng-container title>
|
|
<a class="btn btn-text" (click)="back()" *ngIf="!schema.isSingleton">
|
|
<i class="icon-angle-left"></i>
|
|
</a>
|
|
|
|
<ng-container *ngIf="content else noContentTitle">
|
|
<sqx-title message="Edit Content"></sqx-title>
|
|
|
|
Edit Content
|
|
</ng-container>
|
|
<ng-template #noContentTitle>
|
|
<sqx-title message="New Content"></sqx-title>
|
|
|
|
New Content
|
|
</ng-template>
|
|
</ng-container>
|
|
|
|
<ng-container menu>
|
|
<ng-container *ngIf="!content; else notNew">
|
|
<button type="button" class="btn btn-secondary" (click)="save()" *ngIf="contentsState.canCreate | async">
|
|
Save
|
|
</button>
|
|
|
|
<button type="submit" class="btn btn-primary ml-1" title="CTRL + S" *ngIf="contentsState.canCreateAndPublish | async">
|
|
Save and Publish
|
|
</button>
|
|
|
|
<sqx-shortcut keys="ctrl+s" (trigger)="saveAndPublish()"></sqx-shortcut>
|
|
</ng-container>
|
|
|
|
<ng-template #notNew>
|
|
<div class="dropdown dropdown-options ml-1" *ngIf="content">
|
|
<sqx-preview-button [schema]="schema" [content]="content"></sqx-preview-button>
|
|
|
|
<button type="button" class="btn btn-outline-secondary btn-status" (click)="dropdown.toggle()" [disabled]="schema.isSingleton && !content.isPending"
|
|
[class.active]="dropdown.isOpen | async" #buttonOptions>
|
|
<sqx-content-status
|
|
[status]="content.status"
|
|
[statusColor]="content.statusColor"
|
|
[scheduledTo]="content.scheduleJob?.status"
|
|
[scheduledAt]="content.scheduleJob?.dueTime"
|
|
[isPending]="content.isPending"
|
|
showLabel="true">
|
|
</sqx-content-status>
|
|
</button>
|
|
|
|
<ng-container *ngIf="content.isPending || !schema.isSingleton">
|
|
<ng-container *sqxModal="dropdown;closeAlways:true">
|
|
<div class="dropdown-menu" [sqxAnchoredTo]="buttonOptions" @fade>
|
|
<a class="dropdown-item" (click)="discardChanges()" *ngIf="content.canDraftDiscard">
|
|
Discard changes
|
|
</a>
|
|
|
|
<div class="dropdown-divider"></div>
|
|
|
|
<a class="dropdown-item" (click)="publishChanges()" *ngIf="content.canDraftPublish">
|
|
Publish changes
|
|
</a>
|
|
|
|
<ng-container *ngIf="!schema.isSingleton">
|
|
<a class="dropdown-item" *ngFor="let info of content.statusUpdates" (click)="changeStatus(info.status)">
|
|
Change to <i class="icon-circle icon-sm" [style.color]="info.color"></i> {{info.status}}
|
|
</a>
|
|
|
|
<div class="dropdown-divider"></div>
|
|
|
|
<a class="dropdown-item dropdown-item-delete"
|
|
[class.disabled]="!content.canDelete"
|
|
(sqxConfirmClick)="delete()"
|
|
confirmTitle="Delete content"
|
|
confirmText="Do you really want to delete the content?">
|
|
Delete
|
|
</a>
|
|
</ng-container>
|
|
</div>
|
|
</ng-container>
|
|
</ng-container>
|
|
</div>
|
|
|
|
<button type="button" class="btn btn-secondary ml-1" (click)="saveAsDraft()" *ngIf="content.canDraftPropose">
|
|
Save as Draft
|
|
</button>
|
|
|
|
<ng-container *ngIf="content.canUpdate">
|
|
<button type="submit" class="btn btn-primary ml-1" title="CTRL + S">
|
|
Save
|
|
</button>
|
|
|
|
<sqx-shortcut keys="ctrl+s" (trigger)="saveAndPublish()"></sqx-shortcut>
|
|
</ng-container>
|
|
</ng-template>
|
|
|
|
<sqx-form-error bubble="true" closeable="true" [error]="contentForm.error | async"></sqx-form-error>
|
|
</ng-container>
|
|
|
|
<ng-container content>
|
|
<div class="panel-alert panel-alert-danger" *ngIf="contentVersion; let version">
|
|
<div class="float-right">
|
|
<a class="force" (click)="showLatest()">View latest</a>
|
|
</div>
|
|
|
|
Viewing <strong>version {{version.value}}</strong>.
|
|
</div>
|
|
|
|
<ng-container *ngFor="let field of schema.fields; trackBy: trackByFieldFn">
|
|
<sqx-content-field
|
|
[form]="contentForm"
|
|
[formContext]="formContext"
|
|
[field]="field"
|
|
[fieldForm]="contentForm.form.get(field.name)"
|
|
[fieldFormCompare]="contentFormCompare?.form.get(field.name)"
|
|
[schema]="schema"
|
|
[languages]="languages"
|
|
[(language)]="language">
|
|
</sqx-content-field>
|
|
</ng-container>
|
|
</ng-container>
|
|
|
|
<ng-container sidebar>
|
|
<div class="panel-nav">
|
|
<a class="panel-link" routerLink="comments" routerLinkActive="active" title="Comments" titlePosition="left">
|
|
<i class="icon-comments"></i>
|
|
</a>
|
|
|
|
<a class="panel-link" routerLink="history" routerLinkActive="active" title="History" titlePosition="left" #linkHistory>
|
|
<i class="icon-time"></i>
|
|
</a>
|
|
|
|
<sqx-onboarding-tooltip helpId="history" [for]="linkHistory" position="left-top" after="120000">
|
|
The sidebar navigation contains useful context specific links. Here you can view the history how this schema has changed over time.
|
|
</sqx-onboarding-tooltip>
|
|
</div>
|
|
</ng-container>
|
|
</sqx-panel>
|
|
</form>
|
|
|
|
<router-outlet></router-outlet>
|
|
|
|
<sqx-due-time-selector #dueTimeSelector></sqx-due-time-selector>
|