final-task.component.html 28.1 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('finalTask_tooltip')"
6
    matTooltipPosition="before" [matTooltipDisabled]="!tooltipService.activatedTooltips"
7
    [class]="pieceDetailsService.piece == task ? 'isActive' : 'border'">
Romain DELEAU's avatar
Romain DELEAU committed
8 9 10
    <div class="piece-attach piece-attach-left"></div>

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

    <div class="piece-symbolchoice" [class]="displaySymbolChoice">
        <div class="piece-symbolchoice-header">
55
            <label>{{'task_common_label' | translate}}</label>
Romain DELEAU's avatar
Romain DELEAU committed
56 57 58
            <div><mat-icon fontIcon="delete" (click)="setSymbol('','')"></mat-icon></div>
        </div>
        <div class="piece-symbolchoice-symbols">
59 60 61 62 63 64 65 66 67
            <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
68 69
        </div>
        <div class="piece-symbolchoice-symbols">
70 71 72 73 74 75 76 77 78
            <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
79 80 81
        </div>
    </div>

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

    <div class="piece-form">
        <div class="piece-form-top">
144
            <input class="piece-form-top-identifier" name="identifier" type="text" [(ngModel)]="task.identifier" (change)="changeIdentifier($event)" placeholder="A" min="1" maxlength="5"
145
            [matTooltip]="translate.instant('task_identifier_tooltip')"
146
            matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"/>
147
            <div class="piece-form-top-title">{{'finalTask_title' | translate}}</div>
Romain DELEAU's avatar
Romain DELEAU committed
148
            <mat-icon class="piece-form-top-comment" fontIcon="comment" *ngIf="task.comments.length > 0"></mat-icon>
149
            <mat-icon class="piece-form-top-repeat" fontIcon="refresh" *ngIf="task.repeat.iteration > 0 || task.repeat.while != ''"></mat-icon>
150
            <button mat-button class="piece-form-top-symbol" (click)="changeDisplaySymbolChoice()"
151
            [matTooltip]="translate.instant('task_common_tooltip')"
152
            matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips">
Romain DELEAU's avatar
Romain DELEAU committed
153
                <mat-icon *ngIf="task.symbol.symbol" [style.color]="task.symbol.color" [fontIcon]="task.symbol.symbol"></mat-icon>
Romain DELEAU's avatar
Romain DELEAU committed
154 155
            </button>    
        </div>
156
        <textarea class="piece-form-content" [(ngModel)]="task.objective" (change)="editTrace($event,'Task_action')" [style.background-image]="(i == findFirstIndexOfTaskType('final')[0] && j == findFirstIndexOfTaskType('final')[1]) ? urlIcon : ''"
157
            *ngIf="!unityService.unity_isActive"  
158 159
            [placeholder]="translate.instant('finalTask_action_placeholder')"
            [matTooltip]="translate.instant('task_action_tooltip')"
160
            matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"></textarea>
161 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
        
        <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
324
        <div class="piece-form-bottom">
325
            <div class="piece-form-bottom-duration"
326
            [matTooltip]="translate.instant('task_duration_tooltip')"
327
            matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips">
328 329
                <input name="value" type="number" [(ngModel)]="task.duration" (input)="durationChange()" min="1" (change)="task.duration < 1 ? task.duration = 1 : ''; editTrace($event,'Task_duration')"/>
                <select name="unite" [(ngModel)]="task.durationUnit" (change)="durationChange(); editTrace($event,'Task_duration_unit')">
330 331 332
                    <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
333 334
                </select>
            </div>
Romain DELEAU's avatar
Romain DELEAU committed
335 336 337 338 339
            <mat-icon class="piece-form-character" fontIcon="person" *ngIf="task.characters.length > 0"
            [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>
            <mat-icon class="piece-form-interrupt" fontIcon="front_hand" *ngIf="task.interrupt != ''"></mat-icon>
            <button mat-button class="piece-form-bottom-prerequires" (click)="changeDisplayPrerequires()"
340
            [matTooltip]="translate.instant('task_prerequire_tooltip')"
Romain DELEAU's avatar
Romain DELEAU committed
341
            matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips">
342
                {{'task_prerequire_label' | translate}}
Romain DELEAU's avatar
Romain DELEAU committed
343
            </button>
Romain DELEAU's avatar
Romain DELEAU committed
344 345 346
        </div>
    </div>
</div>