|
1 | | -@if (isMyUnit) { |
2 | | - <a href="{{ publishUnitUrl }}" class="share-button"> |
3 | | - <button mat-flat-button color="primary"> |
4 | | - <mat-icon>public</mat-icon> <ng-container i18n>Publish</ng-container> |
5 | | - </button> |
6 | | - </a> |
7 | | -} |
8 | | -<div class="project-icon-label flex gap-5"> |
9 | | - <span i18n>Unit Icon</span> |
10 | | - <button mat-raised-button color="primary" (click)="toggleEditProjectIconMode()" i18n>Edit</button> |
11 | | -</div> |
12 | | -<div class="project-icon-container"> |
13 | | - @if (isShowProjectIcon) { |
14 | | - <div> |
15 | | - <img [src]="projectIcon" class="project-icon" /> |
16 | | - </div> |
17 | | - } |
18 | | - @if (isShowProjectIconError) { |
19 | | - <div class="project-icon-error"> |
20 | | - <p class="red margin-bottom-20" i18n>This unit does not have a unit icon.</p> |
21 | | - <p class="red" i18n>Click the edit button to set one.</p> |
22 | | - </div> |
23 | | - } |
24 | | - @if (isShowProjectIconLoading) { |
25 | | - <div> |
26 | | - <mat-spinner /> |
27 | | - </div> |
28 | | - } |
29 | | -</div> |
30 | | -@if (isEditingProjectIcon) { |
31 | | - <div> |
32 | | - <div class="choose-project-icon-message flex gap-5"> |
33 | | - <span i18n |
34 | | - >Choose a new Unit Icon by clicking on one below or upload your own custom icon.</span |
35 | | - > |
36 | | - <button mat-raised-button color="primary" (click)="chooseCustomProjectIcon()" i18n> |
37 | | - Upload |
38 | | - </button> |
39 | | - </div> |
40 | | - <div class="flex flex-wrap"> |
41 | | - @for (projectIcon of projectIcons; track projectIcon) { |
42 | | - <img |
43 | | - class="project-icon-to-choose" |
44 | | - src="/projectIcons/{{ projectIcon }}" |
45 | | - (click)="setFeaturedProjectIcon(projectIcon)" |
46 | | - /> |
47 | | - } |
48 | | - </div> |
49 | | - <br /> |
50 | | - </div> |
51 | | -} |
52 | | -<br /> |
53 | | -@for (metadataField of metadataAuthoring.fields; track metadataField) { |
54 | | - <div> |
55 | | - @if (metadataField.type === 'textarea') { |
56 | | - <translatable-textarea |
57 | | - [content]="metadata" |
58 | | - [key]="metadataField.key" |
59 | | - [label]="metadataField.name" |
60 | | - (defaultLanguageTextChanged)="metadataChanged.next()" |
61 | | - class="textarea" |
62 | | - /> |
63 | | - } |
64 | | - @if (metadataField.type === 'input') { |
65 | | - <translatable-input |
66 | | - [content]="metadata" |
67 | | - [key]="metadataField.key" |
68 | | - [label]="metadataField.name" |
69 | | - (defaultLanguageTextChanged)="metadataChanged.next()" |
70 | | - class="input" |
71 | | - /> |
72 | | - } |
73 | | - @if (metadataField.name === 'Language') { |
74 | | - <edit-project-language-setting /> |
75 | | - } |
76 | | - @if (metadataField.type === 'radio' && metadataField.name !== 'Language') { |
77 | | - <label class="bold">{{ metadataField.name }}:</label> |
78 | | - <mat-radio-group class="radio-group margin-bottom-20 flex flex-col"> |
79 | | - @for (choice of metadataField.choices; track choice) { |
80 | | - <mat-radio-button |
81 | | - type="radio" |
82 | | - color="primary" |
83 | | - [value]="choice" |
84 | | - [checked]="metadataChoiceIsChecked(metadataField, choice)" |
85 | | - (click)="metadataRadioClicked(metadataField, choice)" |
86 | | - > |
87 | | - {{ getMetadataChoiceText(choice) }} |
88 | | - </mat-radio-button> |
89 | | - } |
90 | | - </mat-radio-group> |
91 | | - } |
92 | | - @if (metadataField.type === 'checkbox') { |
93 | | - <label class="bold">{{ metadataField.name }}:</label> |
94 | | - <div class="flex flex-col"> |
95 | | - @for (choice of metadataField.choices; track choice) { |
96 | | - <mat-checkbox |
97 | | - color="primary" |
98 | | - [(ngModel)]="metadataField.choicesMapping[choice]" |
99 | | - (click)="metadataCheckboxClicked(metadataField)" |
100 | | - > |
101 | | - {{ getMetadataChoiceText(choice) }} |
102 | | - </mat-checkbox> |
103 | | - } |
| 1 | +<div class="project-info-authoring"> |
| 2 | + <mat-tab-group animationDuration="0ms"> |
| 3 | + <mat-tab> |
| 4 | + <ng-template mat-tab-label> |
| 5 | + <mat-icon>settings</mat-icon> <span i18n>General</span> |
| 6 | + </ng-template> |
| 7 | + <div class="flex flex-col gap-5 mt-4"> |
| 8 | + <div> |
| 9 | + @for (metadataField of metadataAuthoring.fields; track metadataField) { |
| 10 | + @if (metadataField.key === 'title') { |
| 11 | + <translatable-input |
| 12 | + [content]="metadata" |
| 13 | + [key]="metadataField.key" |
| 14 | + [label]="metadataField.name" |
| 15 | + (defaultLanguageTextChanged)="metadataChanged.next()" |
| 16 | + /> |
| 17 | + } |
| 18 | + @if (metadataField.key === 'summary') { |
| 19 | + <translatable-textarea |
| 20 | + [content]="metadata" |
| 21 | + [key]="metadataField.key" |
| 22 | + [label]="metadataField.name" |
| 23 | + (defaultLanguageTextChanged)="metadataChanged.next()" |
| 24 | + /> |
| 25 | + } |
| 26 | + } |
| 27 | + </div> |
| 28 | + <div class="flex flex-col gap-4 p-3"> |
| 29 | + <div class="project-icon-label flex flex-row items-center gap-4"> |
| 30 | + <span i18n>Unit Icon</span> |
| 31 | + <button mat-raised-button color="primary" (click)="toggleEditProjectIconMode()" i18n> |
| 32 | + Edit |
| 33 | + </button> |
| 34 | + </div> |
| 35 | + @if (isShowProjectIcon) { |
| 36 | + <div> |
| 37 | + <img [src]="projectIcon" class="project-icon" /> |
| 38 | + </div> |
| 39 | + } @else if (isShowProjectIconError) { |
| 40 | + <div class="project-icon-error"> |
| 41 | + <p class="red mb-4" i18n>This unit does not have a unit icon.</p> |
| 42 | + <p class="red" i18n>Click the edit button to set one.</p> |
| 43 | + </div> |
| 44 | + } @else if (isShowProjectIconLoading) { |
| 45 | + <div> |
| 46 | + <mat-spinner /> |
| 47 | + </div> |
| 48 | + } |
| 49 | + @if (isEditingProjectIcon) { |
| 50 | + <div> |
| 51 | + <div class="flex items-center gap-4 mb-4"> |
| 52 | + <span i18n |
| 53 | + >Choose a new Unit Icon by clicking on one below or upload your own custom |
| 54 | + icon.</span |
| 55 | + > |
| 56 | + <button mat-raised-button color="primary" (click)="chooseCustomProjectIcon()" i18n> |
| 57 | + Upload |
| 58 | + </button> |
| 59 | + </div> |
| 60 | + <div class="flex flex-wrap"> |
| 61 | + @for (projectIcon of projectIcons; track projectIcon) { |
| 62 | + <img |
| 63 | + role="button" |
| 64 | + tabindex="0" |
| 65 | + class="project-icon-to-choose" |
| 66 | + src="/projectIcons/{{ projectIcon }}" |
| 67 | + (click)="setFeaturedProjectIcon(projectIcon)" |
| 68 | + (keydown.enter)="setFeaturedProjectIcon(projectIcon)" |
| 69 | + aria-label="Choose this project icon" |
| 70 | + i18n-aria-label |
| 71 | + /> |
| 72 | + } |
| 73 | + </div> |
| 74 | + <br /> |
| 75 | + </div> |
| 76 | + } |
| 77 | + </div> |
104 | 78 | </div> |
105 | | - } |
106 | | - </div> |
107 | | -} |
108 | | -<edit-unit-type [metadata]="metadata" /> |
109 | | -<edit-unit-resources [resources]="metadata.resources" /> |
| 79 | + </mat-tab> |
| 80 | + <mat-tab> |
| 81 | + <ng-template mat-tab-label> |
| 82 | + <mat-icon>translate</mat-icon> <span i18n>Language</span> |
| 83 | + </ng-template> |
| 84 | + <div class="mt-4" style="min-height: 800px"> |
| 85 | + <!-- min-height is set to 800px to show all language options without outer scrollbar --> |
| 86 | + <edit-project-language-setting /> |
| 87 | + </div> |
| 88 | + </mat-tab> |
| 89 | + <mat-tab> |
| 90 | + <ng-template mat-tab-label> |
| 91 | + <mat-icon>folder</mat-icon> <span i18n>Resources</span> |
| 92 | + </ng-template> |
| 93 | + <edit-unit-resources [resources]="metadata.resources" class="block mt-4" /> |
| 94 | + </mat-tab> |
| 95 | + </mat-tab-group> |
| 96 | +</div> |
0 commit comments