mirror of https://github.com/Squidex/squidex.git
20 changed files with 197 additions and 310 deletions
@ -1,38 +1,60 @@ |
|||||
<div class="form-horizontal"> |
<ng-container *ngIf="enableShortcut"> |
||||
<div [formGroup]="searchForm"> |
<sqx-shortcut keys="ctrl+shift+f" (trigger)="inputFind.focus()"></sqx-shortcut> |
||||
<div class="form-group row"> |
</ng-container> |
||||
<label class="col col-2 col-form-label" for="odataSearch">Text</label> |
|
||||
|
|
||||
<div class="col col-10"> |
<form class="form-inline search-form" (ngSubmit)="search()"> |
||||
<input type="input" class="form-control" id="search" (blur)="updateQuery()" formControlName="odataSearch" placeholder="Fulltext search" /> |
<input class="form-control form-control-expandable" #inputFind [formControl]="contentsFilter" placeholder="Search for content" /> |
||||
|
|
||||
|
<a class="expand-search" (click)="searchModal.toggle()" #archive> |
||||
|
<i class="icon-caret-down"></i> |
||||
|
</a> |
||||
|
</form> |
||||
|
|
||||
|
<sqx-onboarding-tooltip id="contentArchive" [for]="archive" position="bottomRight" after="60000"> |
||||
|
Click this icon to show the advanced search menu and to show the archive! |
||||
|
</sqx-onboarding-tooltip> |
||||
|
|
||||
|
<sqx-onboarding-tooltip id="contentFind" [for]="inputFind" position="bottomRight" after="120000"> |
||||
|
Search for content using full text search over all fields and languages! |
||||
|
</sqx-onboarding-tooltip> |
||||
|
|
||||
|
<div class="dropdown-menu" *sqxModalView="searchModal" [sqxModalTarget]="inputFind"> |
||||
|
<div class="form-horizontal"> |
||||
|
<div [formGroup]="searchForm"> |
||||
|
<div class="form-group row"> |
||||
|
<label class="col col-2 col-form-label" for="odataSearch">Text</label> |
||||
|
|
||||
|
<div class="col col-10"> |
||||
|
<input type="input" class="form-control" id="search" (blur)="updateQuery()" formControlName="odataSearch" placeholder="Fulltext search" /> |
||||
|
</div> |
||||
</div> |
</div> |
||||
</div> |
|
||||
|
|
||||
<div class="form-group row"> |
<div class="form-group row"> |
||||
<label class="col col-2 col-form-label" for="filter">Filter</label> |
<label class="col col-2 col-form-label" for="filter">Filter</label> |
||||
|
|
||||
<div class="col col-10"> |
<div class="col col-10"> |
||||
<input type="input" class="form-control" id="filter" (blur)="updateQuery()" formControlName="odataFilter" placeholder="data/[MY_FIELD]/iv eq 100" /> |
<input type="input" class="form-control" id="filter" (blur)="updateQuery()" formControlName="odataFilter" placeholder="data/[MY_FIELD]/iv eq 100" /> |
||||
|
</div> |
||||
</div> |
</div> |
||||
</div> |
|
||||
|
|
||||
<div class="form-group row"> |
<div class="form-group row"> |
||||
<label class="col col-2 col-form-label" for="orderBy">Order</label> |
<label class="col col-2 col-form-label" for="orderBy">Order</label> |
||||
|
|
||||
<div class="col col-10"> |
<div class="col col-10"> |
||||
<input type="input" class="form-control" id="orderBy" (blur)="updateQuery()" formControlName="odataOrderBy" placeholder="data/[MY_FIELD]/iv desc" /> |
<input type="input" class="form-control" id="orderBy" (blur)="updateQuery()" formControlName="odataOrderBy" placeholder="data/[MY_FIELD]/iv desc" /> |
||||
|
</div> |
||||
</div> |
</div> |
||||
</div> |
</div> |
||||
</div> |
|
||||
|
|
||||
<div class="form-check" *ngIf="canArchive"> |
<div class="form-check" *ngIf="canArchive"> |
||||
<input class="form-check-input" type="checkbox" id="archivedItems" [ngModel]="archived" (ngModelChange)="archivedChanged.emit($event)" /> |
<input class="form-check-input" type="checkbox" id="archivedItems" [ngModel]="archived" (ngModelChange)="archivedChanged.emit($event)" /> |
||||
<label class="form-check-label" for="archivedItems"> |
<label class="form-check-label" for="archivedItems"> |
||||
Archived items |
Archived items |
||||
</label> |
</label> |
||||
</div> |
</div> |
||||
|
|
||||
<div class="link"> |
<div class="link"> |
||||
Read more about filtering in the <a href="https://docs.squidex.io/04-guides/02-api.html" target="_blank">Documentation</a>. |
Read more about filtering in the <a href="https://docs.squidex.io/04-guides/02-api.html" target="_blank">Documentation</a>. |
||||
|
</div> |
||||
</div> |
</div> |
||||
</div> |
</div> |
||||
@ -0,0 +1,38 @@ |
|||||
|
/* |
||||
|
* Squidex Headless CMS |
||||
|
* |
||||
|
* @license |
||||
|
* Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. |
||||
|
*/ |
||||
|
|
||||
|
import { Injectable } from '@angular/core'; |
||||
|
import { ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot } from '@angular/router'; |
||||
|
import { Observable } from 'rxjs'; |
||||
|
|
||||
|
import { allParams } from '@app/framework'; |
||||
|
|
||||
|
import { SchemasState } from './../state/schemas.state'; |
||||
|
|
||||
|
@Injectable() |
||||
|
export class SchemaMustExistPublishedGuard implements CanActivate { |
||||
|
constructor( |
||||
|
private readonly schemasState: SchemasState, |
||||
|
private readonly router: Router |
||||
|
) { |
||||
|
} |
||||
|
|
||||
|
public canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean> { |
||||
|
const schemaName = allParams(route)['schemaName']; |
||||
|
|
||||
|
const result = |
||||
|
this.schemasState.selectSchema(schemaName) |
||||
|
.do(dto => { |
||||
|
if (!dto || !dto.isPublished) { |
||||
|
this.router.navigate(['/404']); |
||||
|
} |
||||
|
}) |
||||
|
.map(s => s !== null && s.isPublished); |
||||
|
|
||||
|
return result; |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue