|
8 | 8 | not call another time init method from CodeMirrorEditor service. |
9 | 9 | --> |
10 | 10 | @for (file of files(); track file) { |
11 | | - <mat-tab #tab> |
12 | | - <ng-template mat-tab-label> |
13 | | - @if (tab.isActive && isRenamingFile()) { |
14 | | - <form |
15 | | - (submit)="renameFile($event, file.filename)" |
16 | | - (docsClickOutside)="closeRenameFile()"> |
| 11 | + <mat-tab #tab> |
| 12 | + <ng-template mat-tab-label> |
| 13 | + @if (tab.isActive && isRenamingFile()) { |
| 14 | + <form |
| 15 | + (submit)="renameFile($event, file.filename)" |
| 16 | + (docsClickOutside)="closeRenameFile()" |
| 17 | + > |
| 18 | + <input |
| 19 | + name="rename-file" |
| 20 | + class="adev-rename-file-input" |
| 21 | + #renameFileInput |
| 22 | + (keydown)="$event.stopPropagation()" |
| 23 | + /> |
| 24 | + </form> |
| 25 | + } @else if(restrictedMode()) { |
| 26 | + {{ file.filename.replace('src/app/', '') }} |
| 27 | + } @else { |
| 28 | + {{ file.filename.replace('src/', '') }} |
| 29 | + } |
| 30 | + |
| 31 | + @if (tab.isActive && canRenameFile(file.filename)) { |
| 32 | + <button |
| 33 | + class="docs-rename-file" |
| 34 | + aria-label="rename file" |
| 35 | + (click)="onRenameButtonClick()" |
| 36 | + > |
| 37 | + <docs-icon>edit</docs-icon> |
| 38 | + </button> |
| 39 | + } |
| 40 | + @if (tab.isActive && canDeleteFile(file.filename)) { |
| 41 | + <button |
| 42 | + class="docs-delete-file" |
| 43 | + aria-label="Delete file" |
| 44 | + (click)="deleteFile(file.filename)" |
| 45 | + > |
| 46 | + <docs-icon>delete</docs-icon> |
| 47 | + </button> |
| 48 | + } |
| 49 | + </ng-template> |
| 50 | + </mat-tab> |
| 51 | + } |
| 52 | + @if (isCreatingFile()) { |
| 53 | + <mat-tab> |
| 54 | + <ng-template mat-tab-label> |
| 55 | + <form (submit)="createFile($event)"> |
17 | 56 | <input |
18 | | - name="rename-file" |
19 | | - class="adev-rename-file-input" |
20 | | - #renameFileInput |
| 57 | + name="new-file" |
| 58 | + class="adev-new-file-input" |
| 59 | + #createFileInput |
21 | 60 | (keydown)="$event.stopPropagation()" |
22 | 61 | /> |
23 | 62 | </form> |
24 | | - } @else { |
25 | | - {{ file.filename.replace('src/', '') }} |
26 | | - } |
27 | | - @if (tab.isActive && canRenameFile(file.filename)) { |
28 | | - <button |
29 | | - class="docs-rename-file" |
30 | | - aria-label="rename file" |
31 | | - (click)="onRenameButtonClick()" |
32 | | - > |
33 | | - <docs-icon>edit</docs-icon> |
34 | | - </button> |
35 | | - } |
36 | | - @if (tab.isActive && canDeleteFile(file.filename)) { |
37 | | - <button |
38 | | - class="docs-delete-file" |
39 | | - aria-label="Delete file" |
40 | | - (click)="deleteFile(file.filename)" |
41 | | - > |
42 | | - <docs-icon>delete</docs-icon> |
43 | | - </button> |
44 | | - } |
45 | | - </ng-template> |
46 | | - </mat-tab> |
47 | | - } @if (isCreatingFile()) { |
48 | | - <mat-tab> |
49 | | - <ng-template mat-tab-label> |
50 | | - <form (submit)="createFile($event)"> |
51 | | - <input |
52 | | - name="new-file" |
53 | | - class="adev-new-file-input" |
54 | | - #createFileInput |
55 | | - (keydown)="$event.stopPropagation()" |
56 | | - /> |
57 | | - </form> |
58 | | - </ng-template> |
59 | | - </mat-tab> |
| 63 | + </ng-template> |
| 64 | + </mat-tab> |
60 | 65 | } |
61 | 66 | </mat-tab-group> |
62 | 67 |
|
63 | | - <button class="adev-add-file" (click)="onAddButtonClick()" aria-label="Add a new file"> |
64 | | - <docs-icon>add</docs-icon> |
65 | | - </button> |
| 68 | + @if (canCreateFile()) { |
| 69 | + <button class="adev-add-file" (click)="onAddButtonClick()" aria-label="Add a new file"> |
| 70 | + <docs-icon>add</docs-icon> |
| 71 | + </button> |
| 72 | + } |
66 | 73 | </div> |
67 | 74 |
|
68 | 75 | <button |
|
76 | 83 | <!-- launcher dropdown window --> |
77 | 84 | <ng-template #launcherMenu> |
78 | 85 | <div class="adev-editor-dropdown" cdkMenu> |
79 | | - <button cdkMenuItem (click)="openCurrentSolutionInIDX()"> |
80 | | - <span>Open in IDX </span> |
81 | | - <img class="icon" src="assets/images/tutorials/common/idx_logo.svg" height="32"> |
82 | | - </button> |
83 | | - <button cdkMenuItem (click)="openCurrentCodeInStackBlitz()"> |
84 | | - Open in StackBlitz |
85 | | - </button> |
| 86 | + <button cdkMenuItem (click)="openCurrentSolutionInIDX()"> |
| 87 | + <span>Open in IDX </span> |
| 88 | + <img class="icon" src="assets/images/tutorials/common/idx_logo.svg" height="32" /> |
| 89 | + </button> |
| 90 | + <button cdkMenuItem (click)="openCurrentCodeInStackBlitz()">Open in StackBlitz</button> |
86 | 91 | </div> |
87 | 92 | </ng-template> |
88 | 93 | <button |
|
100 | 105 | <div #codeEditorWrapper class="adev-code-editor-wrapper"></div> |
101 | 106 |
|
102 | 107 | @if (displayErrorsBox()) { |
103 | | -<div class="adev-inline-errors-box"> |
104 | | - <button type="button" (click)="closeErrorsBox()"> |
105 | | - <docs-icon class="docs-icon_high-contrast">close</docs-icon> |
106 | | - </button> |
107 | | - <ul> |
108 | | - @for (error of errors(); track error) { |
109 | | - <li>(line: {{ error.lineNumber }}:{{ error.characterPosition }}) {{ error.message }}</li> |
110 | | - } |
111 | | - </ul> |
112 | | -</div> |
| 108 | + <div class="adev-inline-errors-box"> |
| 109 | + <button type="button" (click)="closeErrorsBox()"> |
| 110 | + <docs-icon class="docs-icon_high-contrast">close</docs-icon> |
| 111 | + </button> |
| 112 | + <ul> |
| 113 | + @for (error of errors(); track error) { |
| 114 | + <li>(line: {{ error.lineNumber }}:{{ error.characterPosition }}) {{ error.message }}</li> |
| 115 | + } |
| 116 | + </ul> |
| 117 | + </div> |
113 | 118 | } |
0 commit comments