1
0
mirror of https://github.com/bpatrik/pigallery2.git synced 2025-01-10 04:07:35 +02: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 {
color: #555;
color: var(--bs-gray-700);
padding: 0;
font-size: 0.875rem;
}
@ -45,24 +45,16 @@
font-size: 1.2rem;
}
.dir-link {
cursor: pointer;
}
.dir-link:hover {
text-decoration: underline;
}
.modal-header {
padding: 0.4rem 1rem;
}
.keywords a {
color: #212529;
.keywords a, a.dir-link {
color: var(--bs-gray-900);
}
.keywords a:hover {
.keywords a:hover, a.dir-link:hover {
text-decoration: underline;
}

View File

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

View File

@ -1,36 +1,15 @@
import {
Component,
EventEmitter,
Input,
OnChanges,
OnInit,
Output,
} from '@angular/core';
import {
CameraMetadata,
PhotoDTO,
PhotoMetadata,
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';
import {Component, EventEmitter, Input, OnChanges, OnInit, Output,} from '@angular/core';
import {CameraMetadata, PhotoDTO, PhotoMetadata, 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';
import {ContentService} from '../../content.service';
@Component({
selector: 'app-info-panel',
@ -51,6 +30,7 @@ export class InfoPanelLightboxComponent implements OnInit, OnChanges {
constructor(
public queryService: QueryService,
public galleryService: ContentService,
public mapService: MapService,
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 {
if (typeof (this.media as VideoDTO).metadata.bitRate === 'undefined') {
return null;