add favorit button in entry page
This commit is contained in:
1 parent
62056bdc98
commit
299f566b96
6 files changed
+130
-45
No files matched your search
@@ -67,6 +67,11 @@
|
||||
margin-top: 200px !important;
|
||||
}
|
||||
|
||||
/* ! LEFT PART - SIDE INFO */
|
||||
.left-col {
|
||||
min-width: 240px;
|
||||
}
|
||||
|
||||
.poster {
|
||||
padding: px 10px 0 10px;
|
||||
}
|
||||
@@ -88,22 +93,27 @@
|
||||
background-color: transparent !important;
|
||||
}
|
||||
|
||||
/* ! DESCRIPTION */
|
||||
.side-info strong {
|
||||
color: var(--shz-blue-default);
|
||||
}
|
||||
|
||||
/* ! RIGHT PART - DESCRIPTION */
|
||||
.title {
|
||||
color: rgba(0, 0, 0, 0.868);
|
||||
font-weight: bolder;
|
||||
font-size: 2.9rem !important;
|
||||
}
|
||||
|
||||
|
||||
[data-bs-theme=dark] .title {
|
||||
color: white;
|
||||
}
|
||||
|
||||
.right-col .entry-actions span {
|
||||
color: black;
|
||||
}
|
||||
|
||||
.side-info strong {
|
||||
color: #008cff;
|
||||
|
||||
.right-col .entry-actions span:hover {
|
||||
color: var(--shz-blue-default);
|
||||
}
|
||||
|
||||
.btn-icon-only {
|
||||
@@ -121,7 +131,7 @@
|
||||
color: #008cff;
|
||||
}
|
||||
|
||||
.interaction-btns {
|
||||
/* .interaction-btns {
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
right: 15px;
|
||||
@@ -133,4 +143,19 @@
|
||||
padding-top: 0;
|
||||
padding-bottom: 0;
|
||||
width: 50px;
|
||||
} */
|
||||
|
||||
/* * favorit button */
|
||||
.btn-icon-only-favorite {
|
||||
border: none;
|
||||
background: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.right-col .entry-actions .favorite:hover span {
|
||||
color: var(--shz-red-danger);
|
||||
}
|
||||
|
||||
.right-col .entry-actions .favorite span {
|
||||
color: var(--shz-gold-1);
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
</div>
|
||||
<div class="container mt-5 content-wrapper main-container">
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<div class="col-md-3 left-col">
|
||||
<!-- Movie Poster -->
|
||||
<div class="poster">
|
||||
<img [src]="poster" alt="Movie Poster" class="img-fluid mb-3">
|
||||
@@ -33,21 +33,24 @@
|
||||
<!-- start watch history - item -->
|
||||
<div class="accordion-item" *ngFor="let seen of entry.entrySeen">
|
||||
<h2 class="accordion-header" id="heading{{seen.id}}">
|
||||
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse"
|
||||
<button class="accordion-button collapsed" type=" button" data-bs-toggle="collapse"
|
||||
[attr.data-bs-target]="'#collapse'+seen.id" aria-expanded="false"
|
||||
[attr.aria-controls]="'collapse' + seen.id">
|
||||
{{seen.date_seen.toString().substring(0, 10)}}
|
||||
{{seen.date_seen | dateFormat:"yyyy-MM-dd"}}
|
||||
</button>
|
||||
</h2>
|
||||
<div id="collapse{{seen.id}}" class="accordion-collapse collapse"
|
||||
[attr.aria-labelledby]="'heading' + seen.id" data-bs-parent="#accordionWatchHistory">
|
||||
<div class="accordion-body"> <strong>Seen With:</strong><br>{{seen.seen_with.split(", ").join("\n")}}
|
||||
<div class="accordion-body" *ngIf="seen.seen_with.length != 0">
|
||||
<strong>Seen With:</strong><br>
|
||||
{{seen.seen_with}}
|
||||
</div>
|
||||
<div class="d-flex justify-content-end">
|
||||
<button type="button" class="btn btn-icon-only">
|
||||
<span class="material-symbols-outlined" (click)="removeEntrySeen(seen.id)">
|
||||
delete_forever
|
||||
</span>
|
||||
<!-- TODO add edit button -->
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -61,13 +64,18 @@
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-md-8">
|
||||
<div class="col-md-8 right-col">
|
||||
<!-- Movie Title -->
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<div class="d-flex justify-content-between align-items-center ">
|
||||
<h2 class="title">{{this.entry.title}}</h2>
|
||||
|
||||
<!-- Interraction buttons -->
|
||||
<div class="row">
|
||||
<div class="row entry-actions">
|
||||
<button class="btn btn-icon-only-favorite wh-48" (click)="toggleFavorite()"
|
||||
[ngClass]="{ 'favorite': entry.favorit }">
|
||||
<span class="material-symbols-outlined">{{ entry.favorit ? 'workspace_premium' : 'license' }}</span>
|
||||
</button>
|
||||
|
||||
<button class="btn btn-icon-only-success wh-48" *ngIf="!entry.is_tvseries" (click)="openEntrySeenModal()">
|
||||
<span class="material-symbols-outlined">
|
||||
visibility
|
||||
|
||||
@@ -112,7 +112,7 @@ export class EntryPageComponent implements OnInit {
|
||||
if (!this.entry) return;
|
||||
|
||||
const dialogRef = this.dialog.open(SeenModalComponent, {
|
||||
width: '400px',
|
||||
width: '360px',
|
||||
});
|
||||
|
||||
console.log('Seen dialog opened');
|
||||
@@ -183,6 +183,20 @@ export class EntryPageComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
toggleFavorite() {
|
||||
this.entry.favorit = !this.entry.favorit;
|
||||
this.entryService.updateEntry(this.entry).subscribe({
|
||||
next: (entry) => {
|
||||
console.log(`Entry updated: `, entry);
|
||||
this.entry = entry;
|
||||
},
|
||||
error: (error) => {
|
||||
console.log(`Error updating entry: `, error);
|
||||
this.entry.favorit = !this.entry.favorit;
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
showAddToListModal() {
|
||||
if (this.entry) {
|
||||
const dialogRef = this.dialog.open(UserCollectionsModalComponent, {
|
||||
@@ -278,7 +292,7 @@ export class EntryPageComponent implements OnInit {
|
||||
if (episodeSeen == null) return;
|
||||
|
||||
const dialogRef = this.dialog.open(SeenModalComponent, {
|
||||
width: '400px',
|
||||
width: '360px',
|
||||
data: {
|
||||
watchDate: episodeSeen.date_seen,
|
||||
watchedWith: episodeSeen.seen_with,
|
||||
|
||||
Reference in new issue
Block a user