add media page + backend + minor changes to media related stuff & sidebar
This commit is contained in:
1 parent
c46309e458
commit
eba9721a3c
20 files changed
+597
-73
No files matched your search
@@ -21,20 +21,16 @@
|
||||
|
||||
.media-dialog-main #posters .card-img-top {
|
||||
height: auto;
|
||||
/* Height should adjust to maintain aspect ratio */
|
||||
width: 100%;
|
||||
aspect-ratio: 2 / 3;
|
||||
/* Using the aspect-ratio property to specify a 2:3 ratio */
|
||||
object-fit: cover;
|
||||
/* Crop to cover the area of the container */
|
||||
}
|
||||
|
||||
/* Banner images */
|
||||
.media-dialog-main #banners .card-img-top {
|
||||
/* backdrops images */
|
||||
.media-dialog-main #backdrops .card-img-top {
|
||||
height: auto;
|
||||
width: 100%;
|
||||
aspect-ratio: 8 / 3;
|
||||
/* An example ratio for wide banners */
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
@@ -43,24 +39,25 @@
|
||||
height: auto;
|
||||
width: 100%;
|
||||
aspect-ratio: 2 / 1;
|
||||
/* More wide than tall for logos */
|
||||
object-fit: contain;
|
||||
/* Ensure the entire logo is visible */
|
||||
}
|
||||
|
||||
|
||||
|
||||
.media-dialog-main .card .card-img-top {
|
||||
display: block;
|
||||
/* Ensure images are block elements to fill space correctly */
|
||||
}
|
||||
|
||||
.add-btn {
|
||||
color: var(--shz-blue-1);
|
||||
}
|
||||
|
||||
.add-btn:hover {
|
||||
color: var(--shz-blue-default);
|
||||
}
|
||||
|
||||
/* ! media hover buttons */
|
||||
.image-hover-container {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
/* Ensures no overflow outside the container */
|
||||
}
|
||||
|
||||
.image-hover-container img {
|
||||
@@ -68,10 +65,8 @@
|
||||
display: block;
|
||||
transition: transform 0.3s ease;
|
||||
transform-origin: center;
|
||||
/* Ensures scaling is centered */
|
||||
}
|
||||
|
||||
|
||||
.image-hover-overlay {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
@@ -79,7 +74,6 @@
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background: rgba(0, 0, 0, 0.6);
|
||||
/* Semi-transparent overlay */
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
@@ -92,19 +86,21 @@
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
|
||||
.image-hover-container:hover img {
|
||||
/* transform: scale(1.05); */
|
||||
}
|
||||
|
||||
.btn-icon {
|
||||
background: transparent;
|
||||
border: none;
|
||||
color: white;
|
||||
font-size: 24px;
|
||||
/* Adjust size as needed */
|
||||
}
|
||||
|
||||
.btn-icon:hover {
|
||||
color: var(--shz-gold-1);
|
||||
.btn-icon-delete:hover {
|
||||
color: var(--shz-red-danger);
|
||||
}
|
||||
|
||||
.btn-icon-select:hover {
|
||||
color: var(--shz-blue-default);
|
||||
}
|
||||
|
||||
.btn-icon-expand:hover {
|
||||
color: var(--shz-green-success);
|
||||
}
|
||||
@@ -12,37 +12,40 @@
|
||||
role="tab" aria-controls="posters" aria-selected="true" (click)="setTab('poster')">Posters</button>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<button class="nav-link" id="banners-tab" data-bs-toggle="tab" data-bs-target="#banners" type="button"
|
||||
role="tab" aria-controls="banners" aria-selected="false" (click)="setTab('backdrop')">Banners</button>
|
||||
<button class="nav-link" id="backdrops-tab" data-bs-toggle="tab" data-bs-target="#backdrops" type="button"
|
||||
role="tab" aria-controls="backdrops" aria-selected="false" (click)="setTab('backdrop')">Backdrops</button>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<button class="nav-link" id="logos-tab" data-bs-toggle="tab" data-bs-target="#logos" type="button" role="tab"
|
||||
aria-controls="logos" aria-selected="false"(click)="setTab('logo')">Logos</button>
|
||||
aria-controls="logos" aria-selected="false" (click)="setTab('logo')">Logos</button>
|
||||
</li>
|
||||
</div>
|
||||
<li class="nav-item">
|
||||
<button class="btn btn-primary rounded-0 p-1 bg-transparent border-0" type="button" (click)="openUploadModal()">
|
||||
<span class="material-symbols-outlined">
|
||||
<button class="btn btn-primary rounded-0 p-1 bg-transparent border-0 add-btn d-flex align-items-center"
|
||||
type="button" (click)="openUploadModal()">
|
||||
<span class="material-symbols-outlined me-1">
|
||||
add_photo_alternate
|
||||
</span>
|
||||
Add An Image
|
||||
</button>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content" id="mediaTabContent">
|
||||
<div class="tab-pane fade show active" id="posters" role="tabpanel" aria-labelledby="posters-tab">
|
||||
<div class="row row-cols-1 row-cols-md-3 g-4">
|
||||
<div class="row row-cols-1 row-cols-md-4 g-4">
|
||||
<div class="col" *ngFor="let media of filterMedia('poster')">
|
||||
<div class="card image-hover-container">
|
||||
<img [src]="getPath('/posters/' + media.path)" class="card-img-top" alt="Media Image">
|
||||
<img [src]="getPath('posters', media.path)" class="card-img-top" alt="Media Image">
|
||||
<div class="image-hover-overlay">
|
||||
<button class="btn btn-icon" (click)="deleteMedia(media.id)">
|
||||
<button class="btn btn-icon btn-icon-delete" (click)="deleteMedia(media.id)">
|
||||
<span class="material-symbols-outlined">delete</span>
|
||||
</button>
|
||||
<button class="btn btn-icon" (click)="selectMedia(media)">
|
||||
<button class="btn btn-icon btn-icon-select" (click)="selectMedia(media)">
|
||||
<span class="material-symbols-outlined">check_circle</span>
|
||||
</button>
|
||||
<button class="btn btn-icon" (click)="expandMedia(media)">
|
||||
<button class="btn btn-icon btn-icon-expand" (click)="expandMedia(media)">
|
||||
<span class="material-symbols-outlined">zoom_out_map</span>
|
||||
</button>
|
||||
</div>
|
||||
@@ -50,20 +53,42 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="banners" role="tabpanel" aria-labelledby="banners-tab">
|
||||
<div class="row row-cols-1 row-cols-md-3 g-4">
|
||||
<div class="tab-pane fade" id="backdrops" role="tabpanel" aria-labelledby="backdrops-tab">
|
||||
<div class="row row-cols-1 row-cols-md-2 g-4">
|
||||
<div class="col" *ngFor="let media of filterMedia('backdrop')">
|
||||
<div class="card">
|
||||
<img [src]="getPath('/backdrops/' + media.path)" class="card-img-top" alt="Poster">
|
||||
<div class="card image-hover-container">
|
||||
<img [src]="getPath('backdrops', media.path)" class="card-img-top" alt="Media Image">
|
||||
<div class="image-hover-overlay">
|
||||
<button class="btn btn-icon btn-icon-delete" (click)="deleteMedia(media.id)">
|
||||
<span class="material-symbols-outlined">delete</span>
|
||||
</button>
|
||||
<button class="btn btn-icon btn-icon-select" (click)="selectMedia(media)">
|
||||
<span class="material-symbols-outlined">check_circle</span>
|
||||
</button>
|
||||
<button class="btn btn-icon btn-icon-expand" (click)="expandMedia(media)">
|
||||
<span class="material-symbols-outlined">zoom_out_map</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="logos" role="tabpanel" aria-labelledby="logos-tab">
|
||||
<div class="row row-cols-1 row-cols-md-3 g-4">
|
||||
<div class="row row-cols-1 row-cols-md-2 g-4">
|
||||
<div class="col" *ngFor="let media of filterMedia('logo')">
|
||||
<div class="card">
|
||||
<img [src]="getPath('/logos/' + media.path)" class="card-img-top" alt="Poster">
|
||||
<div class="card image-hover-container">
|
||||
<img [src]="getPath('logos', media.path)" class="card-img-top" alt="Media Image">
|
||||
<div class="image-hover-overlay">
|
||||
<button class="btn btn-icon btn-icon-delete" (click)="deleteMedia(media.id)">
|
||||
<span class="material-symbols-outlined">delete</span>
|
||||
</button>
|
||||
<button class="btn btn-icon btn-icon-select" (click)="selectMedia(media)">
|
||||
<span class="material-symbols-outlined">check_circle</span>
|
||||
</button>
|
||||
<button class="btn btn-icon btn-icon-expand" (click)="expandMedia(media)">
|
||||
<span class="material-symbols-outlined">zoom_out_map</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -28,6 +28,7 @@ export class MediaModalComponent implements OnInit {
|
||||
ngOnInit(): void {
|
||||
if (this.data && this.data.entry) {
|
||||
this.entry = this.data.entry;
|
||||
// console.log(this.entry.medias);
|
||||
} else {
|
||||
this.dialogRef.close();
|
||||
}
|
||||
@@ -56,8 +57,8 @@ export class MediaModalComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
getPath(mediaEnd: string) {
|
||||
return environment.API_URL + '/media/entries' + mediaEnd;
|
||||
getPath(fileType: string, filePath: string) {
|
||||
return `${environment.API_URL}/media/entries/${fileType}/preview/${filePath}`;
|
||||
}
|
||||
|
||||
setTab(tab: string) {
|
||||
@@ -81,10 +82,10 @@ export class MediaModalComponent implements OnInit {
|
||||
next: (result) => {
|
||||
this.entry.medias.forEach((m) => {
|
||||
if (m.type == media.type) {
|
||||
m.is_selected = false;
|
||||
m.isSelected = false;
|
||||
}
|
||||
if ((m.id = result.id)) {
|
||||
m.is_selected = true;
|
||||
m.isSelected = true;
|
||||
}
|
||||
});
|
||||
},
|
||||
@@ -95,6 +96,7 @@ export class MediaModalComponent implements OnInit {
|
||||
}
|
||||
|
||||
expandMedia(media: any) {
|
||||
// Implementation to expand or view media in a larger view
|
||||
const fullSizePath = `${environment.API_URL}/media/entries/${media.type}s/original/${media.path}`;
|
||||
window.open(fullSizePath, '_blank');
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -21,8 +21,8 @@
|
||||
|
||||
</div>
|
||||
<div class="col-12 mt-3 d-flex justify-content-end gap-3">
|
||||
<button type="button" class="btn btn-primary px-4 rounded-0" (click)="onSubmit()">Confirmer</button>
|
||||
<button type="button" class="btn btn-secondary px-4 rounded-0" (click)="onClose()">Annuler</button>
|
||||
<button type="button" class="btn btn-primary px-4 rounded-0" (click)="onSubmit()">Confirm</button>
|
||||
<button type="button" class="btn btn-secondary px-4 rounded-0" (click)="onClose()">Cancel</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user