1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2025-01-14 14:43:17 +08:00

Adding folder name to infopanel to search results

This commit is contained in:
Patrik J. Braun 2023-01-11 22:30:28 +01:00
parent 2dbf9c2e9b
commit 181eaf1d7f
3 changed files with 42 additions and 48 deletions

View File

@ -20,7 +20,7 @@
} }
.details-sub { .details-sub {
color: #555; color: var(--bs-gray-700);
padding: 0; padding: 0;
font-size: 0.875rem; font-size: 0.875rem;
} }
@ -45,24 +45,16 @@
font-size: 1.2rem; font-size: 1.2rem;
} }
.dir-link {
cursor: pointer;
}
.dir-link:hover {
text-decoration: underline;
}
.modal-header { .modal-header {
padding: 0.4rem 1rem; padding: 0.4rem 1rem;
} }
.keywords a { .keywords a, a.dir-link {
color: #212529; color: var(--bs-gray-900);
} }
.keywords a:hover { .keywords a:hover, a.dir-link:hover {
text-decoration: underline; text-decoration: underline;
} }

View File

@ -4,14 +4,25 @@
<button type="button" class="btn-close" (click)="close()" aria-label="Close"> <button type="button" class="btn-close" (click)="close()" aria-label="Close">
</button> </button>
</div> </div>
<div class="row" *ngIf="galleryService.isSearchResult()">
<div class="col-2">
<span class="details-icon oi oi-folder"></span>
</div>
<div class="col-10">
<a class="details-main dir-link"
title="{{DirectoryPath}}"
[routerLink]="['/gallery', DirectoryPath]"
[queryParams]="queryService.getParams()">
{{DirectoryPathStr}}
</a>
</div>
</div>
<div class="row"> <div class="row">
<div class="col-2"> <div class="col-2">
<span class="details-icon oi oi-image"></span> <span class="details-icon oi oi-image"></span>
</div> </div>
<div class="col-10"> <div class="col-10">
<div class="details-main dir-link" title="{{FullPath}}" <div class="details-main" >
[routerLink]="['/gallery', DirectoryPath]"
[queryParams]="queryService.getParams()">
{{media.name}} {{media.name}}
</div> </div>
<div class="details-sub row"> <div class="details-sub row">

View File

@ -1,36 +1,15 @@
import { import {Component, EventEmitter, Input, OnChanges, OnInit, Output,} from '@angular/core';
Component, import {CameraMetadata, PhotoDTO, PhotoMetadata, PositionMetaData,} from '../../../../../../common/entities/PhotoDTO';
EventEmitter, import {Config} from '../../../../../../common/config/public/Config';
Input, import {MediaDTO, MediaDTOUtils,} from '../../../../../../common/entities/MediaDTO';
OnChanges, import {VideoDTO, VideoMetadata,} from '../../../../../../common/entities/VideoDTO';
OnInit, import {Utils} from '../../../../../../common/Utils';
Output, import {QueryService} from '../../../../model/query.service';
} from '@angular/core'; import {MapService} from '../../map/map.service';
import { import {SearchQueryTypes, TextSearch, TextSearchQueryMatchTypes,} from '../../../../../../common/entities/SearchQueryDTO';
CameraMetadata, import {AuthenticationService} from '../../../../model/network/authentication.service';
PhotoDTO, import {LatLngLiteral, marker, Marker, TileLayer, tileLayer} from 'leaflet';
PhotoMetadata, import {ContentService} from '../../content.service';
PositionMetaData,
} from '../../../../../../common/entities/PhotoDTO';
import { Config } from '../../../../../../common/config/public/Config';
import {
MediaDTO,
MediaDTOUtils,
} from '../../../../../../common/entities/MediaDTO';
import {
VideoDTO,
VideoMetadata,
} from '../../../../../../common/entities/VideoDTO';
import { Utils } from '../../../../../../common/Utils';
import { QueryService } from '../../../../model/query.service';
import { MapService } from '../../map/map.service';
import {
SearchQueryTypes,
TextSearch,
TextSearchQueryMatchTypes,
} from '../../../../../../common/entities/SearchQueryDTO';
import { AuthenticationService } from '../../../../model/network/authentication.service';
import { LatLngLiteral, marker, Marker, TileLayer, tileLayer } from 'leaflet';
@Component({ @Component({
selector: 'app-info-panel', selector: 'app-info-panel',
@ -51,6 +30,7 @@ export class InfoPanelLightboxComponent implements OnInit, OnChanges {
constructor( constructor(
public queryService: QueryService, public queryService: QueryService,
public galleryService: ContentService,
public mapService: MapService, public mapService: MapService,
private authService: AuthenticationService private authService: AuthenticationService
) { ) {
@ -77,6 +57,17 @@ export class InfoPanelLightboxComponent implements OnInit, OnChanges {
); );
} }
get DirectoryPathStr(): string {
const p = this.DirectoryPath;
if (p === '.') {
return $localize`Home`;
}
if (p.length > 25) {
return '...' + p.slice(-22);
}
return p;
}
get VideoData(): VideoMetadata { get VideoData(): VideoMetadata {
if (typeof (this.media as VideoDTO).metadata.bitRate === 'undefined') { if (typeof (this.media as VideoDTO).metadata.bitRate === 'undefined') {
return null; return null;