Browse Source

UI finalized.

pull/337/head
Sebastian Stehle 7 years ago
parent
commit
d8445e0595
  1. 2
      src/Squidex/app/features/assets/pages/assets-page.component.html
  2. 1
      src/Squidex/app/features/content/declarations.ts
  3. 2
      src/Squidex/app/features/content/module.ts
  4. 4
      src/Squidex/app/features/content/pages/content/content-page.component.html
  5. 6
      src/Squidex/app/features/content/pages/content/content-page.component.scss
  6. 2
      src/Squidex/app/features/content/shared/assets-editor.component.html
  7. 17
      src/Squidex/app/features/content/shared/preview-button.component.html
  8. 2
      src/Squidex/app/features/content/shared/preview-button.component.scss
  9. 74
      src/Squidex/app/features/content/shared/preview-button.component.ts
  10. 2
      src/Squidex/app/features/schemas/pages/schema/schema-page.component.html
  11. 10
      src/Squidex/app/framework/utils/interpolator.ts
  12. 18
      src/Squidex/app/theme/icomoon/demo.html
  13. BIN
      src/Squidex/app/theme/icomoon/fonts/icomoon.eot
  14. 1
      src/Squidex/app/theme/icomoon/fonts/icomoon.svg
  15. BIN
      src/Squidex/app/theme/icomoon/fonts/icomoon.ttf
  16. BIN
      src/Squidex/app/theme/icomoon/fonts/icomoon.woff
  17. 2
      src/Squidex/app/theme/icomoon/selection.json
  18. 13
      src/Squidex/app/theme/icomoon/style.css

2
src/Squidex/app/features/assets/pages/assets-page.component.html

@ -35,7 +35,7 @@
</div>
</div>
<div class="col-auto pl-1">
<div class="btn-group" data-toggle="buttons">
<div class="btn-group">
<button type="button" class="btn btn-secondary btn-toggle" [class.btn-primary]="isListView" [disabled]="isListView" (click)="changeView(true)">
<i class="icon-list"></i>
</button>

1
src/Squidex/app/features/content/declarations.ts

@ -20,4 +20,5 @@ export * from './shared/content-status.component';
export * from './shared/contents-selector.component';
export * from './shared/due-time-selector.component';
export * from './shared/field-editor.component';
export * from './shared/preview-button.component';
export * from './shared/references-editor.component';

2
src/Squidex/app/features/content/module.ts

@ -35,6 +35,7 @@ import {
ContentStatusComponent,
DueTimeSelectorComponent,
FieldEditorComponent,
PreviewButtonComponent,
ReferencesEditorComponent,
SchemasPageComponent
} from './declarations';
@ -110,6 +111,7 @@ const routes: Routes = [
ContentsSelectorComponent,
DueTimeSelectorComponent,
FieldEditorComponent,
PreviewButtonComponent,
ReferencesEditorComponent,
SchemasPageComponent
]

4
src/Squidex/app/features/content/pages/content/content-page.component.html

@ -32,7 +32,9 @@
</ng-container>
<ng-template #notNew>
<div class="dropdown dropdown-options ml-1" *ngIf="content">
<button type="button" class="btn btn-outline-secondary" (click)="dropdown.toggle()" [disabled]="schema.isSingleton && !content.isPending"
<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" #optionsButton>
<sqx-content-status
[alignMiddle]="false"

6
src/Squidex/app/features/content/pages/content/content-page.component.scss

@ -1,2 +1,6 @@
@import '_vars';
@import '_mixins';
@import '_mixins';
.btn-status {
margin-left: 2rem;
}

2
src/Squidex/app/features/content/shared/assets-editor.component.html

@ -7,7 +7,7 @@
</div>
</div>
<div class="col-auto pl-1">
<div class="btn-group" data-toggle="buttons">
<div class="btn-group">
<button type="button" class="btn btn-secondary btn-toggle" [class.btn-primary]="isListView" [disabled]="isListView" (click)="changeView(true)">
<i class="icon-list"></i>
</button>

17
src/Squidex/app/features/content/shared/preview-button.component.html

@ -0,0 +1,17 @@
<ng-container *ngIf="selectedName">
<span>Preview: </span>
<div class="btn-group ml-1" #buttonGroup>
<button type="button" class="btn btn-secondary" (click)="follow(selectedName)">
<i class="icon-external-link"></i> {{selectedName}}
</button>
<div class="btn-group" *ngIf="alternativeNames.length > 0">
<button type="button" class="btn btn-secondary dropdown-toggle" (click)="dropdown.toggle()"></button>
<div class="dropdown-menu" *sqxModalView="dropdown;closeAlways:true" [sqxModalTarget]="buttonGroup" @fade>
<a *ngFor="let name of alternativeNames" class="dropdown-item" (click)="follow(name)">{{name}}</a>
</div>
</div>
</div>
</ng-container>

2
src/Squidex/app/features/content/shared/preview-button.component.scss

@ -0,0 +1,2 @@
@import '_vars';
@import '_mixins';

74
src/Squidex/app/features/content/shared/preview-button.component.ts

@ -0,0 +1,74 @@
/*
* Squidex Headless CMS
*
* @license
* Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved.
*/
import { ChangeDetectionStrategy, Component, Input, OnInit } from '@angular/core';
import {
ContentDto,
fadeAnimation,
interpolate,
LocalStoreService,
ModalModel,
SchemaDetailsDto
} from '@app/shared';
@Component({
selector: 'sqx-preview-button',
styleUrls: ['./preview-button.component.scss'],
templateUrl: './preview-button.component.html',
changeDetection: ChangeDetectionStrategy.OnPush,
animations: [
fadeAnimation
]
})
export class PreviewButtonComponent implements OnInit {
@Input()
public content: ContentDto;
@Input()
public schema: SchemaDetailsDto;
public dropdown = new ModalModel();
public selectedName: string | undefined;
public alternativeNames: string[];
constructor(
private readonly localStore: LocalStoreService
) {
}
public ngOnInit() {
let selectedName = this.localStore.get(`preview-button-${this.schema.id}`);
if (!selectedName || !this.schema.previewUrls[selectedName]) {
selectedName = Object.keys(this.schema.previewUrls)[0];
}
this.selectUrl(selectedName);
}
public follow(name: string) {
this.selectUrl(name);
const url = interpolate(this.schema.previewUrls[name], this.content, 'iv');
window.open(url, '_blank');
}
private selectUrl(selectedName: string) {
if (this.selectedName !== selectedName) {
const keys = Object.keys(this.schema.previewUrls);
this.selectedName = selectedName;
this.alternativeNames = keys.filter(x => x !== this.selectedName);
this.alternativeNames.sort();
}
}
}

2
src/Squidex/app/features/schemas/pages/schema/schema-page.component.html

@ -10,7 +10,7 @@
JSON Preview
</button>
<div class="btn-group mr-1" data-toggle="buttons" #buttonPublish>
<div class="btn-group mr-1" #buttonPublish>
<button type="button" class="btn btn-publishing btn-toggle" [class.btn-success]="schema.isPublished" [disabled]="schema.isPublished" (click)="publish()">
Published
</button>

10
src/Squidex/app/framework/utils/interpolator.ts

@ -17,12 +17,14 @@ export function interpolate(pattern: string, value?: any, shortcut?: string, fal
const path = match.substr(2, match.length - 3).split('.');
for (let segment of path) {
if (Types.isObject(replaced)) {
replaced = replaced[segment];
} else if (Types.isArray(replaced)) {
if (!replaced) {
return false;
}
if (Types.isArray(replaced)) {
replaced = replaced[Number.parseInt(segment, 10)];
} else {
break;
replaced = replaced[segment];
}
}

18
src/Squidex/app/theme/icomoon/demo.html

@ -9,7 +9,7 @@
<link rel="stylesheet" href="style.css"></head>
<body>
<div class="bgc1 clearfix">
<h1 class="mhmm mvm"><span class="fgc1">Font Name:</span> icomoon <small class="fgc1">(Glyphs:&nbsp;112)</small></h1>
<h1 class="mhmm mvm"><span class="fgc1">Font Name:</span> icomoon <small class="fgc1">(Glyphs:&nbsp;113)</small></h1>
</div>
<div class="clearfix mhl ptl">
<h1 class="mvm mtn fgc1">Grid Size: 14</h1>
@ -512,6 +512,22 @@
</div>
<div class="clearfix mhl ptl">
<h1 class="mvm mtn fgc1">Grid Size: 24</h1>
<div class="glyph fs2">
<div class="clearfix bshadow0 pbs">
<span class="icon-external-link">
</span>
<span class="mls"> icon-external-link</span>
</div>
<fieldset class="fs0 size1of1 clearfix hidden-false">
<input type="text" readonly value="e96d" class="unit size1of2" />
<input type="text" maxlength="1" readonly value="&#xe96d;" class="unitRight size1of2 talign-right" />
</fieldset>
<div class="fs0 bshadow0 clearfix hidden-true">
<span class="unit pvs fgc1">liga: </span>
<input type="text" readonly value="" class="liga unitRight" />
</div>
</div>
<div class="glyph fs2">
<div class="clearfix bshadow0 pbs">
<span class="icon-minus-square">

BIN
src/Squidex/app/theme/icomoon/fonts/icomoon.eot

Binary file not shown.

1
src/Squidex/app/theme/icomoon/fonts/icomoon.svg

@ -116,6 +116,7 @@
<glyph unicode="&#xe96a;" glyph-name="clone" d="M950.857 18.286v621.714c0 9.714-8.571 18.286-18.286 18.286h-621.714c-9.714 0-18.286-8.571-18.286-18.286v-621.714c0-9.714 8.571-18.286 18.286-18.286h621.714c9.714 0 18.286 8.571 18.286 18.286zM1024 640v-621.714c0-50.286-41.143-91.429-91.429-91.429h-621.714c-50.286 0-91.429 41.143-91.429 91.429v621.714c0 50.286 41.143 91.429 91.429 91.429h621.714c50.286 0 91.429-41.143 91.429-91.429zM804.571 859.428v-91.429h-73.143v91.429c0 9.714-8.571 18.286-18.286 18.286h-621.714c-9.714 0-18.286-8.571-18.286-18.286v-621.714c0-9.714 8.571-18.286 18.286-18.286h91.429v-73.143h-91.429c-50.286 0-91.429 41.143-91.429 91.429v621.714c0 50.286 41.143 91.429 91.429 91.429h621.714c50.286 0 91.429-41.143 91.429-91.429z" />
<glyph unicode="&#xe96b;" glyph-name="caret-bottom" horiz-adv-x="585" d="M585.143 411.443c0-9.728-3.986-18.871-10.862-25.71l-256-256c-6.839-6.839-16.018-10.862-25.71-10.862s-18.871 3.986-25.71 10.862l-256 256c-6.839 6.839-10.862 16.018-10.862 25.71 0 20.005 16.567 36.571 36.571 36.571h512c20.005 0 36.571-16.567 36.571-36.571zM585.143 740.557c0-9.728-3.986-18.871-10.862-25.71l-256-256c-6.839-6.839-16.018-10.862-25.71-10.862s-18.871 3.986-25.71 10.862l-256 256c-6.839 6.839-10.862 16.018-10.862 25.71 0 20.005 16.567 36.571 36.571 36.571h512c20.005 0 36.571-16.567 36.571-36.571z" />
<glyph unicode="&#xe96c;" glyph-name="caret-top" horiz-adv-x="585" d="M585.143 155.423c0-20.005-16.567-36.571-36.571-36.571h-512c-20.005 0-36.571 16.567-36.571 36.571 0 9.728 3.986 18.871 10.862 25.71l256 256c6.839 6.839 16.018 10.862 25.71 10.862s18.871-3.986 25.71-10.862l256-256c6.839-6.839 10.862-16.018 10.862-25.71zM585.143 484.577c0-20.005-16.567-36.571-36.571-36.571h-512c-20.005 0-36.571 16.567-36.571 36.571 0 9.728 3.986 18.871 10.862 25.71l256 256c6.839 6.839 16.018 10.862 25.71 10.862s18.871-3.986 25.71-10.862l256-256c6.839-6.839 10.862-16.018 10.862-25.71z" />
<glyph unicode="&#xe96d;" glyph-name="external-link" d="M768 426.667c-25.6 0-42.667-17.067-42.667-42.667v-256c0-25.6-17.067-42.667-42.667-42.667h-469.333c-25.6 0-42.667 17.067-42.667 42.667v469.333c0 25.6 17.067 42.667 42.667 42.667h256c25.6 0 42.667 17.067 42.667 42.667s-17.067 42.667-42.667 42.667h-256c-72.533 0-128-55.467-128-128v-469.333c0-72.533 55.467-128 128-128h469.333c72.533 0 128 55.467 128 128v256c0 25.6-17.067 42.667-42.667 42.667zM934.4 827.734c-4.267 8.533-12.8 17.067-21.333 21.333-4.267 4.267-12.8 4.267-17.067 4.267h-256c-25.6 0-42.667-17.067-42.667-42.667s17.067-42.667 42.667-42.667h153.6l-396.8-396.8c-17.067-17.067-17.067-42.667 0-59.733 8.533-8.533 17.067-12.8 29.867-12.8s21.333 4.267 29.867 12.8l396.8 396.8v-153.6c0-25.6 17.067-42.667 42.667-42.667s42.667 17.067 42.667 42.667v256c0 4.267 0 12.8-4.267 17.067z" />
<glyph unicode="&#xe9ca;" glyph-name="earth" d="M512 960c-282.77 0-512-229.23-512-512s229.23-512 512-512 512 229.23 512 512-229.23 512-512 512zM512-0.002c-62.958 0-122.872 13.012-177.23 36.452l233.148 262.29c5.206 5.858 8.082 13.422 8.082 21.26v96c0 17.674-14.326 32-32 32-112.99 0-232.204 117.462-233.374 118.626-6 6.002-14.14 9.374-22.626 9.374h-128c-17.672 0-32-14.328-32-32v-192c0-12.122 6.848-23.202 17.69-28.622l110.31-55.156v-187.886c-116.052 80.956-192 215.432-192 367.664 0 68.714 15.49 133.806 43.138 192h116.862c8.488 0 16.626 3.372 22.628 9.372l128 128c6 6.002 9.372 14.14 9.372 22.628v77.412c40.562 12.074 83.518 18.588 128 18.588 70.406 0 137.004-16.26 196.282-45.2-4.144-3.502-8.176-7.164-12.046-11.036-36.266-36.264-56.236-84.478-56.236-135.764s19.97-99.5 56.236-135.764c36.434-36.432 85.218-56.264 135.634-56.26 3.166 0 6.342 0.080 9.518 0.236 13.814-51.802 38.752-186.656-8.404-372.334-0.444-1.744-0.696-3.488-0.842-5.224-81.324-83.080-194.7-134.656-320.142-134.656z" />
<glyph unicode="&#xf00a;" glyph-name="grid" d="M292.571 237.714v-109.714c0-30.286-24.571-54.857-54.857-54.857h-182.857c-30.286 0-54.857 24.571-54.857 54.857v109.714c0 30.286 24.571 54.857 54.857 54.857h182.857c30.286 0 54.857-24.571 54.857-54.857zM292.571 530.286v-109.714c0-30.286-24.571-54.857-54.857-54.857h-182.857c-30.286 0-54.857 24.571-54.857 54.857v109.714c0 30.286 24.571 54.857 54.857 54.857h182.857c30.286 0 54.857-24.571 54.857-54.857zM658.286 237.714v-109.714c0-30.286-24.571-54.857-54.857-54.857h-182.857c-30.286 0-54.857 24.571-54.857 54.857v109.714c0 30.286 24.571 54.857 54.857 54.857h182.857c30.286 0 54.857-24.571 54.857-54.857zM292.571 822.857v-109.714c0-30.286-24.571-54.857-54.857-54.857h-182.857c-30.286 0-54.857 24.571-54.857 54.857v109.714c0 30.286 24.571 54.857 54.857 54.857h182.857c30.286 0 54.857-24.571 54.857-54.857zM658.286 530.286v-109.714c0-30.286-24.571-54.857-54.857-54.857h-182.857c-30.286 0-54.857 24.571-54.857 54.857v109.714c0 30.286 24.571 54.857 54.857 54.857h182.857c30.286 0 54.857-24.571 54.857-54.857zM1024 237.714v-109.714c0-30.286-24.571-54.857-54.857-54.857h-182.857c-30.286 0-54.857 24.571-54.857 54.857v109.714c0 30.286 24.571 54.857 54.857 54.857h182.857c30.286 0 54.857-24.571 54.857-54.857zM658.286 822.857v-109.714c0-30.286-24.571-54.857-54.857-54.857h-182.857c-30.286 0-54.857 24.571-54.857 54.857v109.714c0 30.286 24.571 54.857 54.857 54.857h182.857c30.286 0 54.857-24.571 54.857-54.857zM1024 530.286v-109.714c0-30.286-24.571-54.857-54.857-54.857h-182.857c-30.286 0-54.857 24.571-54.857 54.857v109.714c0 30.286 24.571 54.857 54.857 54.857h182.857c30.286 0 54.857-24.571 54.857-54.857zM1024 822.857v-109.714c0-30.286-24.571-54.857-54.857-54.857h-182.857c-30.286 0-54.857 24.571-54.857 54.857v109.714c0 30.286 24.571 54.857 54.857 54.857h182.857c30.286 0 54.857-24.571 54.857-54.857z" />
<glyph unicode="&#xf0c9;" glyph-name="list1" horiz-adv-x="878" d="M877.714 182.857v-73.143c0-20-16.571-36.571-36.571-36.571h-804.571c-20 0-36.571 16.571-36.571 36.571v73.143c0 20 16.571 36.571 36.571 36.571h804.571c20 0 36.571-16.571 36.571-36.571zM877.714 475.428v-73.143c0-20-16.571-36.571-36.571-36.571h-804.571c-20 0-36.571 16.571-36.571 36.571v73.143c0 20 16.571 36.571 36.571 36.571h804.571c20 0 36.571-16.571 36.571-36.571zM877.714 768v-73.143c0-20-16.571-36.571-36.571-36.571h-804.571c-20 0-36.571 16.571-36.571 36.571v73.143c0 20 16.571 36.571 36.571 36.571h804.571c20 0 36.571-16.571 36.571-36.571z" />

Before

Width:  |  Height:  |  Size: 87 KiB

After

Width:  |  Height:  |  Size: 88 KiB

BIN
src/Squidex/app/theme/icomoon/fonts/icomoon.ttf

Binary file not shown.

BIN
src/Squidex/app/theme/icomoon/fonts/icomoon.woff

Binary file not shown.

2
src/Squidex/app/theme/icomoon/selection.json

File diff suppressed because one or more lines are too long

13
src/Squidex/app/theme/icomoon/style.css

@ -1,10 +1,10 @@
@font-face {
font-family: 'icomoon';
src: url('fonts/icomoon.eot?vexzhv');
src: url('fonts/icomoon.eot?vexzhv#iefix') format('embedded-opentype'),
url('fonts/icomoon.ttf?vexzhv') format('truetype'),
url('fonts/icomoon.woff?vexzhv') format('woff'),
url('fonts/icomoon.svg?vexzhv#icomoon') format('svg');
src: url('fonts/icomoon.eot?5u1xcq');
src: url('fonts/icomoon.eot?5u1xcq#iefix') format('embedded-opentype'),
url('fonts/icomoon.ttf?5u1xcq') format('truetype'),
url('fonts/icomoon.woff?5u1xcq') format('woff'),
url('fonts/icomoon.svg?5u1xcq#icomoon') format('svg');
font-weight: normal;
font-style: normal;
}
@ -117,6 +117,9 @@
.icon-rules:before {
content: "\e947";
}
.icon-external-link:before {
content: "\e96d";
}
.icon-minus-square:before {
content: "\e969";
}

Loading…
Cancel
Save