Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion src/app/episode-details/episode-details.component.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,17 @@
margin-left: 15px;
width: 100px;
float:right;
}
}

.them-name {
cursor: pointer;
width: 100%;
display: flex;
padding: 10px;
vertical-align: center;
}

.them-name:hover {
box-shadow: 0 0 5px rgba(0,0,0,0.5);
border-radius: 10px;
}
83 changes: 46 additions & 37 deletions src/app/episode-details/episode-details.component.html
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<div *ngIf="episode">
<div *ngIf="currentUser.isAdmin" class="row">
<div class="col mb-2">
<button type="button" class="btn btn-block btn-outline-info" (click)="linkThemes(episode)">Link themes</button>
</div>
<div class="col mb-2">
<button type="button" class="btn btn-block btn-outline-info" (click)="linkThemes(episode)">Link themes</button>
</div>
</div>
<div class="row">
<div class="col">
Current: {{ now | date:'hh:mm:ss EEEE dd LLL' }}
</div>
<div class="col">
Current: {{ now | date:'hh:mm:ss EEEE dd LLL' }}
</div>
</div>
<div class="row mb-2">
<div class="col">
Started: {{ episode.startTime | date:'hh:mm:ss EEEE dd LLL'}}
</div>
<div class="row mb-2">
<div class="col">
Started: {{ episode.startTime | date:'hh:mm:ss EEEE dd LLL'}}
</div>
</div>
<div class="row mb-2">
<div class="col-4">
Expand All @@ -28,38 +28,47 @@ <h2>{{episode.name}}</h2>
</div>
<div *ngIf="currentUser.isAdmin" class="row mb-3">
<div class="col-6">
<button type="button" class="btn btn-warning btn-block" [disabled]='episode.started' (click)="startEpisode(episode)">Start episode</button>
<button type="button" class="btn btn-warning btn-block" [disabled]='episode.started'
(click)="startEpisode(episode)">Start episode
</button>
</div>
<div class="col-6">
<button type="button" class="btn btn-danger btn-block" [disabled]='!episode.started' (click)="stopEpisode(episode)">Stop episode</button>
</div>
<button type="button" class="btn btn-danger btn-block" [disabled]='!episode.started'
(click)="stopEpisode(episode)">Stop episode
</button>
</div>
</div>
<div class="row">
<div class="col">
<div class="table-responsive">
<table class="table table-hover">
<caption>Theme list</caption>
<thead class="thead-light">
<tr>
<th>Timecode</th>
<th class="hidden">Title</th>
<th></th>
</tr>
</thead>
<tbody>
<tr *ngFor="let theme of episode?.themeList" [class.table-success]="theme.passed">
<td>{{ theme.timecode }}</td>
<td [innerHTML]="theme.title | linkify"></td>
<td><button class="btn btn-dark item" [disabled]="!episode.started" (click)="track(episode, theme)">Track</button></td>
</tr>
</tbody>
</table>
</div>
<div class="col">
<div class="table-responsive">
<table class="table">
<caption>Theme list</caption>
<thead class="thead-light">
<tr>
<th>Timecode</th>
<th class="hidden">Title</th>
<th></th>
</tr>
</thead>
<tbody>
<tr *ngFor="let theme of episode?.themeList" [class.table-success]="theme.passed">
<td>{{ theme.timecode }}</td>
<td [innerHTML]="theme.title | linkify"></td>
<td>
<button type="button" class="btn btn-warning item" (click)="unlinkThemes(episode.id, theme.id)">Unlink</button>
<button type="button" class="btn btn-dark item" [disabled]="!episode.started" (click)="track(episode, theme)">Track</button>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div *ngIf="currentUser.isAdmin" class="row mb-5">
<div class="col-12 mb-5">
<button type="button" class="btn btn-info btn-sm btn-block" *ngIf='isFinished(episode)' (click)="export(episode)">Export this episode</button>
</div>
<div class="col-12 mb-5">
<button type="button" class="btn btn-info btn-sm btn-block" *ngIf='isFinished(episode)' (click)="export(episode)">
Export this episode
</button>
</div>
</div>
</div>
</div>
4 changes: 4 additions & 0 deletions src/app/episode-details/episode-details.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,8 @@ export class EpisodeDetailsComponent implements OnInit {
});
}

unlinkThemes(id: number, themeId: number) {
this.episodeService.unlinkThemesToEpisode(id, themeId).subscribe(data => { this.getEpisodeDetails()});
}

}
4 changes: 2 additions & 2 deletions src/app/post-details/post-details.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ <h6>Гости:</h6>
<h6>Темы:</h6>
<div class="col-12 mb-3 mx-3">
<ul *ngFor="let theme of episode?.themeList" class="list-group">
<li *ngIf="theme.timecode">{{theme.title}} - {{theme.timecode}}</li>
<li *ngIf="theme.timecode">{{theme.title}} - <em>{{theme.timecode}}</em></li>
</ul>
</div>

Expand Down Expand Up @@ -68,4 +68,4 @@ <h6> Стать патроном: <a href="http://patreon.com/automation_remarks
<app-sidenav></app-sidenav>
</div>
</div>
</div>
</div>
4 changes: 4 additions & 0 deletions src/app/service/episode.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ export class EpisodeService {
return this.apiClient.post(`${this.baseUrl}/${episode.id}`, selectedThemeIds)
}

unlinkThemesToEpisode(id: number, themeId: number): Observable<any> {
return this.apiClient.post(`${this.baseUrl}/${id}/theme/${themeId}/unlink`, {})
}

removeEpisode(id: Number): Observable<any> {
return this.apiClient.delete(`${this.baseUrl}/${id}/remove`)
}
Expand Down