This is the codeAbility Sharing Platform! Learn more about the codeAbility Sharing Platform.

Skip to content
Snippets Groups Projects
Commit 23aeb22f authored by Michael Breu's avatar Michael Breu :speech_balloon:
Browse files

Intermediate commit: Minor cleanUp

parent c1e1c515
Branches
No related merge requests found
......@@ -70,9 +70,9 @@
<div style="float: left;">
<p class="card-text" jhiTranslate="exercise.details.bookmark"></p>
</div>
<div class="form-check" style="float: right; padding-right: 10px;" [ngbTooltip]="helpComingSoon" placement="right">
<input class="form-check-input" type="checkbox" value=""
id="modal-defaultCheck1" disabled>
<div class="form-check" style="float: right; padding-right: 10px;" placement="right">
<input class="form-check-input" type="checkbox" [checked]="isOnCurrentWatchlist(exercise)" (change)="handleForCurrentWatchlist(exercise)" value=""
id="modal-defaultCheck1">
<label class="form-check-label" for="modal-defaultCheck1"></label>
</div>
</div> <!-- modal bookmark end-->
......
......@@ -9,6 +9,7 @@ import { Account } from 'app/core/user/account.model';
import { SearchService } from 'app/search/service/search-service.ts';
import { HttpResponse } from '@angular/common/http';
import { JhiAlertService } from 'ng-jhipster';
import { WatchlistManager } from 'app/shared/watchlist/watchlist-manager';
@Component({
selector: 'jhi-exercise-details',
......@@ -24,8 +25,9 @@ export class ExerciseDetailsComponent implements OnInit, OnDestroy {
private accountService: AccountService,
protected pluginService: PluginService,
private searchService: SearchService,
private jhiAlertService: JhiAlertService
) {}
private jhiAlertService: JhiAlertService,
private watchlistManager: WatchlistManager,
) {}
ngOnInit(): void {
this.authSubscription = this.accountService.getAuthenticationState().subscribe(account => (this.account = account));
......@@ -39,6 +41,16 @@ export class ExerciseDetailsComponent implements OnInit, OnDestroy {
public isAuthenticated(): boolean {
return this.accountService.isAuthenticated();
}
isOnCurrentWatchlist(e: Exercise): boolean {
return this.watchlistManager.isExerciseOnCurrentWatchlist(e);
}
handleForCurrentWatchlist(e: Exercise) {
this.watchlistManager.handleCheckForCurrentWatchlist(e);
}
public startAction(action: PluginActionInfo, exercise: Exercise): void {
const basketInfo: ShoppingBasketInfo = {
......
......@@ -8,7 +8,7 @@ import { ExerciseModule } from 'app/exercise/exercise.module';
import { SearchComponent } from './search.component';
import { SearchInputComponent } from './search-input/search-input.component';
import { WatchlistComponent } from '../watchlist/watchlist.component';
import { WatchlistComponent } from '../exercise/watchlist/watchlist.component';
@NgModule({
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment