mirror of
https://github.com/xuthus83/pigallery2.git
synced 2024-11-03 21:04:03 +08:00
disabling search at photos
This commit is contained in:
parent
ad3d6911bd
commit
540df6c6a8
@ -72,7 +72,6 @@ export class GalleryMWs {
|
||||
}
|
||||
|
||||
let type:SearchTypes;
|
||||
console.log()
|
||||
if (req.query.type) {
|
||||
type = parseInt(req.query.type);
|
||||
}
|
||||
|
@ -44,15 +44,15 @@ export class GalleryRouter {
|
||||
};
|
||||
|
||||
private addSearch() {
|
||||
this.app.get("/api/gallery/search/:text",
|
||||
// AuthenticationMWs.authenticate,
|
||||
this.app.get("/api/search/:text",
|
||||
AuthenticationMWs.authenticate,
|
||||
GalleryMWs.search,
|
||||
RenderingMWs.renderResult
|
||||
);
|
||||
};
|
||||
|
||||
private addInstantSearch() {
|
||||
this.app.get("/api/gallery/instant-search/:text",
|
||||
this.app.get("/api/instant-search/:text",
|
||||
AuthenticationMWs.authenticate,
|
||||
GalleryMWs.instantSearch,
|
||||
RenderingMWs.renderResult
|
||||
@ -60,7 +60,7 @@ export class GalleryRouter {
|
||||
};
|
||||
|
||||
private addAutoComplete() {
|
||||
this.app.get("/api/gallery/autocomplete/:text",
|
||||
this.app.get("/api/autocomplete/:text",
|
||||
AuthenticationMWs.authenticate,
|
||||
GalleryMWs.autocomplete,
|
||||
RenderingMWs.renderResult
|
||||
|
@ -40,7 +40,7 @@ export class GalleryService {
|
||||
return Promise.resolve(new Message(null, null));
|
||||
}
|
||||
|
||||
let queryString = "/gallery/search/" + text;
|
||||
let queryString = "/search/" + text;
|
||||
if (type) {
|
||||
queryString += "?type=" + type;
|
||||
}
|
||||
@ -72,7 +72,7 @@ export class GalleryService {
|
||||
this.searchId = null;
|
||||
}, 3000); //TODO: set timeout to config
|
||||
|
||||
return this._networkService.getJson("/gallery/instant-search/" + text).then(
|
||||
return this._networkService.getJson("/instant-search/" + text).then(
|
||||
(message:Message<ContentWrapper>) => {
|
||||
if (!message.error && message.result) {
|
||||
this.content = message.result;
|
||||
|
@ -5,16 +5,21 @@
|
||||
|
||||
<div class="photo-position" *ngIf="gridPhoto.photo.metadata.positionData">
|
||||
<span class="glyphicon glyphicon-map-marker"></span>
|
||||
<a [routerLink]="['Search',{searchText: getPositionText(), type:SearchTypes[SearchTypes.position]}]"
|
||||
*ngIf="getPositionText()">
|
||||
{{getPositionText()}}
|
||||
</a>
|
||||
<template [ngIf]="getPositionText()">
|
||||
<a [routerLink]="['Search',{searchText: getPositionText(), type:SearchTypes[SearchTypes.position]}]"
|
||||
*ngIf="searchEnabled">
|
||||
{{getPositionText()}}
|
||||
</a>
|
||||
<span *ngIf="!searchEnabled">{{getPositionText()}}</span>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="photo-keywords">
|
||||
<template ngFor let-keyword [ngForOf]="gridPhoto.photo.metadata.keywords" let-last="last">
|
||||
<a [routerLink]="['Search',{searchText: keyword, type: SearchTypes[SearchTypes.keyword]}]">#{{keyword}}</a>
|
||||
<a *ngIf="searchEnabled"
|
||||
[routerLink]="['Search',{searchText: keyword, type: SearchTypes[SearchTypes.keyword]}]">#{{keyword}}</a>
|
||||
<span *ngIf="!searchEnabled">#{{keyword}}</span>
|
||||
<template [ngIf]="!last">,</template>
|
||||
</template>
|
||||
|
||||
|
@ -5,6 +5,7 @@ import {IRenderable, Dimension} from "../../../model/IRenderable";
|
||||
import {GridPhoto} from "../GridPhoto";
|
||||
import {SearchTypes} from "../../../../../common/entities/AutoCompleteItem";
|
||||
import {RouterLink} from "@angular/router-deprecated";
|
||||
import {Config} from "../../../config/Config";
|
||||
|
||||
@Component({
|
||||
selector: 'gallery-grid-photo',
|
||||
@ -22,9 +23,11 @@ export class GalleryPhotoComponent implements IRenderable {
|
||||
background: ""
|
||||
};
|
||||
SearchTypes:any = [];
|
||||
searchEnabled:boolean = true;
|
||||
|
||||
constructor() {
|
||||
this.SearchTypes = SearchTypes;
|
||||
this.searchEnabled = Config.Client.Search.searchEnabled;
|
||||
}
|
||||
|
||||
getPositionText():string {
|
||||
|
@ -13,7 +13,7 @@ export class AutoCompleteService {
|
||||
}
|
||||
|
||||
public autoComplete(text:string):Promise<Message<Array<AutoCompleteItem> >> {
|
||||
return this._networkService.getJson("/gallery/autocomplete/" + text);
|
||||
return this._networkService.getJson("/autocomplete/" + text);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user