-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtutorial-details.component.html
76 lines (71 loc) · 1.89 KB
/
tutorial-details.component.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
@if (viewMode){
@if (currentTutorial.id){
<h4>Tutorial</h4>
<div>
<label><strong>Title:</strong></label> {{ currentTutorial.title }}
</div>
<div>
<label><strong>Description:</strong></label>
{{ currentTutorial.description }}
</div>
<div>
<label><strong>Status:</strong></label>
{{ currentTutorial.published ? "Published" : "Pending" }}
</div>
<a class="badge badge-warning" routerLink="/tutorials/{{ currentTutorial.id }}">
Edit
</a>
} @else {<p>Please click on a Tutorial...</p>}
} @else {
@if (currentTutorial.id) {
<div class="edit-form">
<h4>Tutorial</h4>
<form>
<div class="form-group">
<label for="title">Title</label>
<input
type="text"
class="form-control"
id="title"
[(ngModel)]="currentTutorial.title"
name="title"
/>
</div>
<div class="form-group">
<label for="description">Description</label>
<input
type="text"
class="form-control"
id="description"
[(ngModel)]="currentTutorial.description"
name="description"
/>
</div>
<div class="form-group">
<label><strong>Status:</strong></label>
{{ currentTutorial.published ? "Published" : "Pending" }}
</div>
</form>
@if (currentTutorial.published) {
<button class="badge badge-primary mr-2"
(click)="updatePublished(false)" >
UnPublish
</button>
} @else {
<button class="badge badge-primary mr-2" (click)="updatePublished(true)">
Publish
</button>
}
<button class="badge badge-danger mr-2" (click)="deleteTutorial()">
Delete
</button>
<button
type="submit"
class="badge badge-success mb-2"
(click)="updateTutorial()">
Update
</button>
<p>{{ message }}</p>
</div>
} @else {<p>Cannot access this Tutorial...</p>}
}