optionnal-task.component.html 28.4 KB
Newer Older
Romain DELEAU's avatar
Romain DELEAU committed
1
<div class="piece" [ngStyle]="{'width': pieceWidth+'px'}" (mouseover)="displayMenu='show'" (mouseleave)="displayMenu='hide'; displaySymbolChoice='hide'" (click)="onClickPiece()"
2 3
    [style.background]="task.supplementaryRole ?
    'linear-gradient(140deg, var(--piece-background-color) 0%, var(--piece-background-color) 55%,'+task.supplementaryRole.color+' 55%,'+task.supplementaryRole.color+' 100%)'
4
    : 'var(--piece-background-color)'"
5
    [matTooltip]="translate.instant('optionnalTask_tooltip')"
6
    matTooltipPosition="before" [matTooltipDisabled]="!tooltipService.activatedTooltips"
7
    [class]="pieceDetailsService.piece == task ? 'isActive' : 'border'">
Romain DELEAU's avatar
Romain DELEAU committed
8
    <div class="piece-attach piece-attach-left"></div>
9
    <div class="piece-attach piece-attach-right" [style.background]="task.supplementaryRole ? task.supplementaryRole.color : 'var(--piece-background-color)'"></div>
Romain DELEAU's avatar
Romain DELEAU committed
10 11

    <div class="piece-menu" [class]="displayMenu">
Romain DELEAU's avatar
Romain DELEAU committed
12
        <div>    
13
            <mat-icon fontIcon="change_circle" [matMenuTriggerFor]="menuChange"
14
            [matTooltip]="translate.instant('task_transform_tooltip')"
15
            matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"></mat-icon>
Romain DELEAU's avatar
Romain DELEAU committed
16
            <mat-menu #menuChange="matMenu">
17 18 19
                <button class="piece-menu-changeMenuButton" [style.background-color]="'#b9dfe3'" mat-menu-item (click)="onClickChange('normal')">{{'task_transform_normalTask' | translate}}</button>
                <button class="piece-menu-changeMenuButton" [style.background-color]="'#bccecc'" mat-menu-item (click)="onClickChange('annexe')">{{'task_transform_annexeTask' | translate}}</button>
                <button class="piece-menu-changeMenuButton" [style.background-color]="'#b28386'" mat-menu-item (click)="onClickChange('final')" *ngIf="canChangeInFinalTask()">{{'task_transform_finalTask' | translate}}</button>
Romain DELEAU's avatar
Romain DELEAU committed
20 21
            </mat-menu>
        </div>
22
        <mat-icon fontIcon="backspace" (click)="onClickErase()"
23
        [matTooltip]="translate.instant('clearPiece_tooltip')"
24 25
        matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"></mat-icon>
        <mat-icon fontIcon="delete" (click)="onClickDelete()"
26
        [matTooltip]="translate.instant('deletePiece_tooltip')"
27
        matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"></mat-icon>
28 29
        <div class="piece-menu-directioncross">
            <div class="piece-menu-directioncross-left">
30
                <mat-icon style="transform: rotate(0turn) scale(0.6);" fontIcon="arrow_back_ios" (click)="moveTask('left'); editMoveTrace($event,'Task_moveLeft')"
31
                [matTooltip]="translate.instant('moveLeft_tooltip')"
32 33 34 35
                matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"></mat-icon>                
            </div>
            <div class="piece-menu-directioncross-updownarrows">
                <div class="piece-menu-updownarrows-up">
36
                    <mat-icon style="transform: rotate(0.25turn) scale(0.6);" fontIcon="arrow_back_ios" (click)="moveTask('top'); editMoveTrace($event,'Task_moveTop')"
37
                    [matTooltip]="translate.instant('moveTop_tooltip')"
38 39 40
                    matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"></mat-icon>                
                </div>
                <div class="piece-menu-directioncross-updownarrows-down">
41
                    <mat-icon style="transform: rotate(0.75turn) scale(0.6);" fontIcon="arrow_back_ios" (click)="moveTask('bottom'); editMoveTrace($event,'Task_moveBottom')"
42
                    [matTooltip]="translate.instant('moveBottom_tooltip')"
43 44 45 46
                    matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"></mat-icon>
                </div>
            </div>
            <div class="piece-menu-directioncross-right">
47
                <mat-icon style="transform: rotate(0.5turn) scale(0.6);" fontIcon="arrow_back_ios" (click)="moveTask('right'); editMoveTrace($event,'Task_moveRight')"
48
                [matTooltip]="translate.instant('moveRight_tooltip')"
49 50 51
                matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"></mat-icon>
            </div>
        </div>
Romain DELEAU's avatar
Romain DELEAU committed
52 53 54 55
    </div>

    <div class="piece-symbolchoice" [class]="displaySymbolChoice">
        <div class="piece-symbolchoice-header">
56
            <label>{{'task_common_label' | translate}}</label>
Romain DELEAU's avatar
Romain DELEAU committed
57 58 59
            <div><mat-icon fontIcon="delete" (click)="setSymbol('','')"></mat-icon></div>
        </div>
        <div class="piece-symbolchoice-symbols">
60 61 62 63 64 65 66 67 68
            <mat-icon [style.color]="'#d79297'" fontIcon="favorite" (click)="canUseSymbol('favorite','#d79297') == 'enable' ? setSymbol('favorite','#d79297') : ''" [ngClass]="canUseSymbol('favorite','#d79297')"></mat-icon>
            <mat-icon [style.color]="'#9ad5ec'" fontIcon="diamond" (click)="canUseSymbol('diamond','#9ad5ec') == 'enable' ? setSymbol('diamond','#9ad5ec') : ''" [ngClass]="canUseSymbol('diamond','#9ad5ec')"></mat-icon>
            <mat-icon [style.color]="'#e9ec54'" fontIcon="star" (click)="canUseSymbol('star','#e9ec54') == 'enable' ? setSymbol('star','#e9ec54') : ''" [ngClass]="canUseSymbol('star','#e9ec54')"></mat-icon>
            <mat-icon [style.color]="'#f5cee3'" fontIcon="hexagon" (click)="canUseSymbol('hexagon','#f5cee3') == 'enable' ? setSymbol('hexagon','#f5cee3') : ''" [ngClass]="canUseSymbol('hexagon','#f5cee3')"></mat-icon>
            <mat-icon [style.color]="'#d3d2d2'" fontIcon="add" (click)="canUseSymbol('add','#d3d2d2') == 'enable' ? setSymbol('add','#d3d2d2') : ''" [ngClass]="canUseSymbol('add','#d3d2d2')"></mat-icon>
            <mat-icon [style.color]="'#9ad5ec'" fontIcon="circle" (click)="canUseSymbol('circle','#9ad5ec') == 'enable' ? setSymbol('circle','#9ad5ec') : ''" [ngClass]="canUseSymbol('circle','#9ad5ec')"></mat-icon>
            <mat-icon [style.color]="'#b6cc87'" fontIcon="eco" (click)="canUseSymbol('eco','#b6cc87') == 'enable' ? setSymbol('eco','#b6cc87') : ''" [ngClass]="canUseSymbol('eco','#b6cc87')"></mat-icon>
            <mat-icon [style.color]="'#d0bbdb'" fontIcon="play_arrow" (click)="canUseSymbol('play_arrow','#d0bbdb') == 'enable' ? setSymbol('play_arrow','#d0bbdb') : ''" [ngClass]="canUseSymbol('play_arrow','#d0bbdb')"></mat-icon>
            <mat-icon [style.color]="'#8b7e64'" fontIcon="remove" (click)="canUseSymbol('remove','#8b7e64') == 'enable' ? setSymbol('remove','#8b7e64') : ''" [ngClass]="canUseSymbol('remove','#8b7e64')"></mat-icon>
Romain DELEAU's avatar
Romain DELEAU committed
69 70
        </div>
        <div class="piece-symbolchoice-symbols">
71 72 73 74 75 76 77 78 79
            <mat-icon [style.color]="'#d79297'" fontIcon="square" (click)="canUseSymbol('square','#d79297') == 'enable' ? setSymbol('square','#d79297') : ''" [ngClass]="canUseSymbol('square','#d79297')"></mat-icon>
            <mat-icon [style.color]="'#9ad5ec'" fontIcon="square" (click)="canUseSymbol('square','#9ad5ec') == 'enable' ? setSymbol('square','#9ad5ec') : ''" [ngClass]="canUseSymbol('square','#9ad5ec')"></mat-icon>
            <mat-icon [style.color]="'#e9ec54'" fontIcon="square" (click)="canUseSymbol('square','#e9ec54') == 'enable' ? setSymbol('square','#e9ec54') : ''" [ngClass]="canUseSymbol('square','#e9ec54')"></mat-icon>
            <mat-icon [style.color]="'#f5cee3'" fontIcon="square" (click)="canUseSymbol('square','#f5cee3') == 'enable' ? setSymbol('square','#f5cee3') : ''" [ngClass]="canUseSymbol('square','#f5cee3')"></mat-icon>
            <mat-icon [style.color]="'#d3d2d2'" fontIcon="square" (click)="canUseSymbol('square','#d3d2d2') == 'enable' ? setSymbol('square','#d3d2d2') : ''" [ngClass]="canUseSymbol('square','#d3d2d2')"></mat-icon>
            <mat-icon [style.color]="'#9ad5ec'" fontIcon="square" (click)="canUseSymbol('square','#9ad5ec') == 'enable' ? setSymbol('square','#9ad5ec') : ''" [ngClass]="canUseSymbol('square','#9ad5ec')"></mat-icon>
            <mat-icon [style.color]="'#b6cc87'" fontIcon="square" (click)="canUseSymbol('square','#b6cc87') == 'enable' ? setSymbol('square','#b6cc87') : ''" [ngClass]="canUseSymbol('square','#b6cc87')"></mat-icon>
            <mat-icon [style.color]="'#d0bbdb'" fontIcon="square" (click)="canUseSymbol('square','#d0bbdb') == 'enable' ? setSymbol('square','#d0bbdb') : ''" [ngClass]="canUseSymbol('square','#d0bbdb')"></mat-icon>
            <mat-icon [style.color]="'#8b7e64'" fontIcon="square" (click)="canUseSymbol('square','#8b7e64') == 'enable' ? setSymbol('square','#8b7e64') : ''" [ngClass]="canUseSymbol('square','#8b7e64')"></mat-icon>
Romain DELEAU's avatar
Romain DELEAU committed
80 81 82
        </div>
    </div>

83
    <div class="piece-prerequires" [class]="pieceDetailsService.piece == task ? displayPrequires : 'hide'">
Romain DELEAU's avatar
Romain DELEAU committed
84
        <div class="piece-prerequires-prerequires">
85
            <label class="piece-prerequires-title">{{'task_prerequire_antecedents_title' | translate}}</label>
Romain DELEAU's avatar
Romain DELEAU committed
86
            <div class="piece-prerequires-form">
87 88 89
                <ng-container *ngIf="hasPossibleAntecedents()">
                    <ng-container *ngFor="let inlineTask of role.tasks">
                        <ng-container *ngFor="let element of inlineTask; let index = index">
90
                            <div class="piece-prerequires-prerequires-element" *ngIf="element?.identifier && (task.identifier != element?.identifier) && element?.type != 'annexe'">
91 92 93 94
                                <input name="antecedent" type="checkbox" [checked]="isCheckedTask(element)" (change)="checkboxChangedTask($event, element)"/>
                                <label for="antecedent">{{element?.identifier}}</label>
                            </div>
                        </ng-container>
Romain DELEAU's avatar
Romain DELEAU committed
95 96
                    </ng-container>
                </ng-container>
97
                <div style="text-align: center;" *ngIf="!hasPossibleAntecedents()">{{'task_prerequire_antecedents_err2' | translate}}</div>
Romain DELEAU's avatar
Romain DELEAU committed
98 99 100
            </div>
        </div>
        <div class="piece-prerequires-ressources">
101
            <label class="piece-prerequires-title">{{'task_prerequire_ressource_title' | translate}}</label>
Romain DELEAU's avatar
Romain DELEAU committed
102
            <div class="piece-prerequires-form">
Romain DELEAU's avatar
Romain DELEAU committed
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118
                <ng-container *ngFor="let ressource of scenario.ressources">
                    <div class="piece-prerequires-ressources-element" *ngIf="ressource.name">
                        <div class="piece-prerequires-ressources-element-checkbox">
                            <input name="ressource" type="checkbox" (change)="checkboxChangedRessource($event, ressource)" [checked]="isCheckedRessource(ressource)"/>
                            <label for="ressource">{{ressource.name}}</label>   
                        </div>
                        <div class="piece-prerequires-ressources-element-quantity" *ngIf="isCheckedRessource(ressource)">
                            <select name="ressource" [(ngModel)]="getAssociatePrerequireRessource(ressource).operator">
                                <option><</option>
                                <option><=</option>
                                <option>=</option>
                                <option>>=</option>
                                <option>></option>
                            </select>
                            <input type="text" value="1" [(ngModel)]="getAssociatePrerequireRessource(ressource).quantity"/> 
                        </div>
Romain DELEAU's avatar
Romain DELEAU committed
119
                    </div>
Romain DELEAU's avatar
Romain DELEAU committed
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136
                </ng-container>
                <ng-container *ngFor="let ressource of role.ressources">
                    <div class="piece-prerequires-ressources-element" *ngIf="ressource.name">
                        <div class="piece-prerequires-ressources-element-checkbox">
                            <input name="ressource" type="checkbox" (change)="checkboxChangedRessource($event, ressource)" [checked]="isCheckedRessource(ressource)"/>
                            <label for="ressource">{{ressource.name}}</label>   
                        </div>
                        <div class="piece-prerequires-ressources-element-quantity" *ngIf="isCheckedRessource(ressource)">
                            <select name="ressource" [(ngModel)]="getAssociatePrerequireRessource(ressource).operator">
                                <option><</option>
                                <option><=</option>
                                <option>=</option>
                                <option>>=</option>
                                <option>></option>
                            </select>
                            <input type="text" value="1" [(ngModel)]="getAssociatePrerequireRessource(ressource).quantity"/> 
                        </div>
Romain DELEAU's avatar
Romain DELEAU committed
137
                    </div>
Romain DELEAU's avatar
Romain DELEAU committed
138
                </ng-container>
Romain DELEAU's avatar
Romain DELEAU committed
139 140 141 142 143 144
            </div>
        </div>
    </div>

    <div class="piece-form">
        <div class="piece-form-top">
145
            <input class="piece-form-top-identifier" name="identifier" type="text" [(ngModel)]="task.identifier" (change)="changeIdentifier($event)" placeholder="A" min="1" maxlength="5"
146
            [matTooltip]="translate.instant('task_identifier_tooltip')"
147
            matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"/>
148
            <div class="piece-form-top-title">{{'optionnalTask_title1' | translate}}<br>{{'optionnalTask_title2' | translate}}</div>
Romain DELEAU's avatar
Romain DELEAU committed
149
            <mat-icon class="piece-form-top-comment" fontIcon="comment" *ngIf="task.comments.length > 0"></mat-icon>
150
            <mat-icon class="piece-form-top-repeat" fontIcon="refresh" *ngIf="(task.repeat.iteration > 0 || task.repeat.while != '') && !unityService.unity_isActive"></mat-icon>
151
            <button mat-button class="piece-form-top-symbol" (click)="changeDisplaySymbolChoice()"
152
            [matTooltip]="translate.instant('task_common_tooltip')"
153
            matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips">
Romain DELEAU's avatar
Romain DELEAU committed
154
                <mat-icon *ngIf="task.symbol.symbol" [style.color]="task.symbol.color" [fontIcon]="task.symbol.symbol"></mat-icon>
Romain DELEAU's avatar
Romain DELEAU committed
155 156
            </button>    
        </div>
157
        <textarea class="piece-form-content" [(ngModel)]="task.objective" (change)="editTrace($event,'Task_action')" [style.background-image]="(i == findFirstIndexOfTaskType('optionnal')[0] && j == findFirstIndexOfTaskType('optionnal')[1]) ? urlIcon : ''"
158
            *ngIf="!unityService.unity_isActive"    
159 160
            [placeholder]="translate.instant('optionnalTask_action_placeholder')"
            [matTooltip]="translate.instant('task_action_tooltip')"
161
            matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"></textarea>
162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324

        <div class="piece-form-content piece-form-content-unity" *ngIf="unityService.unity_isActive">
            <div class="piece-form-content-unity-type">
                <label for="type">{{'task_unity_type_label' | translate}}</label>
                <select name="type" [(ngModel)]="task.typeUnity" (change)="task.resetUnityContent()">
                    <option value="getObject">{{'task_unity_type_getObject' | translate}}</option>
                    <option value="character">{{'task_unity_type_character' | translate}}</option>
                    <option value="combineObjects">{{'task_unity_type_combineObjects' | translate}}</option>
                    <option value="talkWithRole">{{'task_unity_type_talkWithRole' | translate}}</option>
                    <option value="exchangeObjects">{{'task_unity_type_exchangeObjects' | translate}}</option>
                    <option value="depositObject">{{'task_unity_type_depositObject' | translate}}</option>
                    <option value="askToSeeRole">{{'task_unity_type_askToSeeRole' | translate}}</option>
                    <option value="interactObject">{{'task_unity_type_interactObject' | translate}}</option>
                    <option value="other">{{'task_unity_type_other' | translate}}</option>
                </select>
            </div>
            <div class="piece-form-content-unity-typeContent">
                    
                <div class="piece-form-content-unity-typeContent-getObject" *ngIf="task.typeUnity == 'getObject'">
                    <input type="number" [(ngModel)]="task.objectQuantity"/>
                    <select [(ngModel)]="task.object">
                        <option [ngValue]="null" selected disabled>{{'task_unity_objectName_label' | translate}}</option>
                        <ng-container *ngFor="let ressource of scenario.ressources">
                            <option [ngValue]="ressource" *ngIf="ressource.type == 'ressource'">{{ressource.name}}</option>
                        </ng-container>
                        <ng-container *ngFor="let role2 of mission.roles">
                            <ng-container *ngIf="role2 != role">
                                <ng-container *ngFor="let ressource of role2.ressources">
                                    <option [ngValue]="ressource" *ngIf="ressource.type == 'ressource'">{{ressource.name}}</option>
                                </ng-container>
                            </ng-container>
                        </ng-container>
                    </select>                    
                </div>

                <div class="piece-form-content-unity-typeContent-character" *ngIf="task.typeUnity == 'character'">
                    <select [(ngModel)]="task.character">
                        <option [ngValue]="null" selected disabled>{{'task_unity_characterName_label' | translate}}</option>
                        <option *ngFor="let character of scenario.characters" [ngValue]="character">{{character.name}}</option>
                    </select>
                </div>
    
                <div class="piece-form-content-unity-typeContent-combineObjects" *ngIf="task.typeUnity == 'combineObjects'">
                    <div class="piece-form-content-unity-typeContent-combineObjects-element" *ngFor="let element of task.combineObjects, let elementIndex = index">
                        <button mat-button class="piece-form-content-unity-typeContent-button" (click)="removeCombineObject(elementIndex)" *ngIf="task.combineObjects.length > 2"><mat-icon fontIcon="remove"></mat-icon></button>
                        <div class="piece-form-content-unity-typeContent-combineObjects-element-object">
                            <input type="number" [(ngModel)]="element[1]"/>
                            <select [(ngModel)]="element[0]">
                                <option [ngValue]="null" selected disabled>{{'task_unity_objectName_label' | translate}}</option>
                                <ng-container *ngFor="let ressource of role.ressources">
                                    <option [ngValue]="ressource" *ngIf="ressource.type == 'ressource'">{{ressource.name}}</option>
                                </ng-container>
                            </select>                        
                        </div>
                    </div>
                    <button mat-button class="piece-form-content-unity-typeContent-button piece-form-content-unity-typeContent-button-add" (click)="addCombineObject()"><mat-icon fontIcon="add"></mat-icon></button>
                </div>
    
                <div class="piece-form-content-unity-typeContent-talkWithRole" *ngIf="task.typeUnity == 'talkWithRole'">
                    <select [(ngModel)]="task.role">
                        <option [ngValue]="''" selected disabled>{{'task_unity_roleName_label' | translate}}</option>
                        <ng-container *ngFor="let selectableRole of mission.roles">
                            <option *ngIf="selectableRole != role && selectableRole.intitule != ''">{{selectableRole.intitule}}</option>
                        </ng-container>
                    </select>
                </div>
    
                <div class="piece-form-content-unity-typeContent-exchangeObjects" *ngIf="task.typeUnity == 'exchangeObjects'">
                    <div class="piece-form-content-unity-typeContent-exchangeObjects-give">
                        <label>{{'task_unity_exchangeObjects_give_label' | translate}}</label>
                        <div class="piece-form-content-unity-typeContent-exchangeObjects-element" *ngFor="let element of task.giveObjects, let elementIndex = index">
                            <button mat-button class="piece-form-content-unity-typeContent-button" (click)="removeExchangeGiveObject(elementIndex)" *ngIf="task.giveObjects.length > 1"><mat-icon fontIcon="remove"></mat-icon></button>
                            <div class="piece-form-content-unity-typeContent-exchangeObjects-element-object">
                                <input type="number" [(ngModel)]="element[1]"/>
                                <select [(ngModel)]="element[0]">
                                    <option [ngValue]="null" selected disabled>{{'task_unity_objectName_label' | translate}}</option>
                                    <ng-container *ngFor="let ressource of role.ressources">
                                        <option [ngValue]="ressource" *ngIf="ressource.type == 'ressource'">{{ressource.name}}</option>
                                    </ng-container>
                                </select>                        
                            </div>
                        </div>
                        <button mat-button class="piece-form-content-unity-typeContent-button piece-form-content-unity-typeContent-button-add" (click)="addExchangeGiveObject()"><mat-icon fontIcon="add"></mat-icon></button>
                    </div>
    
                    <div class="piece-form-content-unity-typeContent-exchangeObjects-receive">
                        <select [(ngModel)]="task.character">
                            <option [ngValue]="null" selected disabled>{{'task_unity_characterName_label' | translate}}</option>
                            <option *ngFor="let character of scenario.characters" [ngValue]="character">{{character.name}}</option>
                        </select>
                        <label>{{'task_unity_exchangeObjects_receive_label' | translate}}</label>
                        <div class="piece-form-content-unity-typeContent-exchangeObjects-element" *ngFor="let element of task.receiveObjects, let elementIndex = index">
                            <button mat-button class="piece-form-content-unity-typeContent-button" (click)="removeExchangeReceiveObject(elementIndex)" *ngIf="task.receiveObjects.length > 1"><mat-icon fontIcon="remove"></mat-icon></button>
                            <div class="piece-form-content-unity-typeContent-exchangeObjects-element-object">
                                <input type="number" [(ngModel)]="element[1]"/>
                                <select [(ngModel)]="element[0]">
                                    <option [ngValue]="null" selected disabled>{{'task_unity_objectName_label' | translate}}</option>
                                    <ng-container *ngFor="let ressource of scenario.ressources">
                                        <option [ngValue]="ressource" *ngIf="ressource.type == 'ressource'">{{ressource.name}}</option>
                                    </ng-container>
                                </select>                        
                            </div>
                        </div>
                        <button mat-button class="piece-form-content-unity-typeContent-button piece-form-content-unity-typeContent-button-add" (click)="addExchangeReceiveObject()"><mat-icon fontIcon="add"></mat-icon></button>
                    </div>
                </div>
    
                <div class="piece-form-content-unity-typeContent-depositObject" *ngIf="task.typeUnity == 'depositObject'">
                    <input type="number" [(ngModel)]="task.objectQuantity"/>
                    <select [(ngModel)]="task.object">
                        <option [ngValue]="null" selected disabled>{{'task_unity_objectName_label' | translate}}</option>
                        <ng-container *ngFor="let ressource of role.ressources">
                            <option [ngValue]="ressource" *ngIf="ressource.type == 'ressource'">{{ressource.name}}</option>
                        </ng-container>
                    </select>  
                </div>
    
                <div class="piece-form-content-unity-typeContent-askToSeeRole" *ngIf="task.typeUnity == 'askToSeeRole'">
                    <select [(ngModel)]="task.role">
                        <option [ngValue]="''" selected disabled>{{'task_unity_roleName_label' | translate}}</option>
                        <ng-container *ngFor="let selectableRole of mission.roles">
                            <option *ngIf="selectableRole != role && selectableRole.intitule != ''">{{selectableRole.intitule}}</option>
                        </ng-container>
                    </select>
                </div>
    
                <div class="piece-form-content-unity-typeContent-interactObject" *ngIf="task.typeUnity == 'interactObject'">
                    <div class="piece-form-content-unity-typeContent-interactObject-select">
                        <select [(ngModel)]="task.object">
                            <option [ngValue]="null" selected disabled>{{'task_unity_objectName_label' | translate}}</option>
                            <ng-container *ngFor="let ressource of scenario.ressources">
                                <option [ngValue]="ressource" *ngIf="ressource.type == 'ressource'">{{ressource.name}}</option>
                            </ng-container>
                            <ng-container *ngFor="let role2 of mission.roles">
                                <ng-container *ngFor="let ressource of role2.ressources">
                                    <option [ngValue]="ressource" *ngIf="ressource.type == 'ressource'">{{ressource.name}}</option>
                                </ng-container>
                            </ng-container>
                        </select>                         
                    </div>
     
                    <div class="piece-form-content-unity-typeContent-interactObject-name">
                        <input name="interactionName" type="text" [(ngModel)]="task.interactionName" [placeholder]="translate.instant('task_unity_interactName_placeholder')"/>
                    </div>
                </div>
    
                <div class="piece-form-content-unity-typeContent-other" *ngIf="task.typeUnity == 'other'">
                    <textarea [(ngModel)]="task.other"></textarea>
                </div>
            </div>
            
            <div class="piece-form-content-unity-infos">
                <div class="piece-form-content-unity-infos-name">
                    <label for="name">{{'task_unity_name_label' | translate}}</label>
                    <input name="name" type="text" [(ngModel)]="task.name"/>
                </div>
                <div class="piece-form-content-unity-infos-desc">
                    <label for="description">{{'task_unity_desc_label' | translate}}</label>
                    <textarea name="description" [(ngModel)]="task.objective"></textarea>
                </div>  
            </div>
        </div>

Romain DELEAU's avatar
Romain DELEAU committed
325
        <div class="piece-form-bottom">
326
            <div class="piece-form-bottom-duration"
327
            [matTooltip]="translate.instant('task_duration_tooltip')"
328
            matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips">
329
                <input name="value" type="number" [(ngModel)]="task.duration" (input)="durationChange()" min="0" (change)="task.duration < 0 ? task.duration = 0 : ''; editTrace($event,'Task_duration')"/>
330
                <select name="unite" [(ngModel)]="task.durationUnit" (change)="durationChange(); editTrace($event,'Task_duration_unit')">
331 332 333
                    <option value="UT">{{'task_duration_ut' | translate}}</option>
                    <option value="min">{{'task_duration_min' | translate}}</option>
                    <option value="tours">{{'task_duration_turn' | translate}}</option> 
Romain DELEAU's avatar
Romain DELEAU committed
334 335
                </select>
            </div>
336
            <mat-icon class="piece-form-character" fontIcon="person" *ngIf="task.characters.length > 0 && !unityService.unity_isActive"
Romain DELEAU's avatar
Romain DELEAU committed
337 338
            [style.color]="task.characters.length == 1 ? task.characters[0].color : 'black'"
            [style.background]="task.characters.length > 1 ? 'linear-gradient('+ task.characters[0].color +','+ task.characters[task.characters.length-1].color +')' : 'white'"></mat-icon>
339
            <mat-icon class="piece-form-interrupt" fontIcon="front_hand" *ngIf="task.interrupt != '' && !unityService.unity_isActive"></mat-icon>
Romain DELEAU's avatar
Romain DELEAU committed
340
            <button mat-button class="piece-form-bottom-prerequires" (click)="changeDisplayPrerequires()"
341
            [matTooltip]="translate.instant('task_prerequire_tooltip')"
Romain DELEAU's avatar
Romain DELEAU committed
342
            matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips">
343
                {{'task_prerequire_label' | translate}}
Romain DELEAU's avatar
Romain DELEAU committed
344
            </button>
Romain DELEAU's avatar
Romain DELEAU committed
345 346 347
        </div>
    </div>
</div>