afficher les choix de plage horaires identiques

This commit is contained in:
Tykayn 2021-05-18 12:02:36 +02:00 committed by tykayn
parent 422090e997
commit 5028a54fb7
8 changed files with 39 additions and 31 deletions

View File

@ -30,7 +30,6 @@
</span>
</div>
<div class="actions columns">
<div class="column"></div>
<div class="column has-text-right">
<button
(click)="addTime()"
@ -65,13 +64,11 @@
réinitialiser
</span>
</button>
</div>
<fieldset class="range-container is-boxed">
<div class="range-time" *ngIf="!form.value.hasSeveralHours">
<h2>
<span class="count-dates-txt">
{{ 'dates.count_time' | translate }}
(identique pour chaque jour)
</span>
</h2>
<div class="title">
@ -86,9 +83,11 @@
</button>
</div>
</div>
<app-time-list [timeSlices]="timeList"></app-time-list>
</fieldset>
</div>
</div>
</div>
<hr />
<div class="main-box is-boxed">

View File

@ -52,4 +52,9 @@
.movable {
cursor: move;
}
app-time-list {
margin-top: 1em;
display: block;
}
}

View File

@ -26,8 +26,8 @@ export class DateSelectComponent implements OnInit {
@Input()
form: FormGroup;
displaySeveralHoursChoice = false;
allowSeveralHours = false;
displaySeveralHoursChoice = true;
allowSeveralHours = true;
today = new Date();
endDateInterval: string;

View File

@ -1,6 +1,5 @@
<p>time-list works!</p>
<div *ngFor="let time of timeList; index as id" class="time-choice">
<label for="timeChoices_{{ id }}">
<div *ngFor="let time of timeSlices; index as id" class="time-choice">
<label class="icon" for="timeChoices_{{ id }}">
<i class="fa fa-clock-o" aria-hidden="true"></i>
</label>
<input [(ngModel)]="time.literal" name="timeChoices_{{ id }}" type="text" id="timeChoices_{{ id }}" />

View File

@ -0,0 +1,6 @@
:host {
margin-top: 0.5em;
.icon {
margin-right: 1ch;
}
}

View File

@ -10,7 +10,6 @@ import { moveItemInArray, transferArrayItem } from '@angular/cdk/drag-drop';
export class TimeListComponent implements OnInit {
@Input()
public timeSlices: TimeSlices[];
timeList: any;
constructor() {}
ngOnInit(): void {}

View File

@ -18,8 +18,8 @@
{{ 'creation.want' | translate }}
</p>
<!-- <div class="step-choices" *ngIf="currentStep === 'base'">-->
<app-kind-select [form]="form"></app-kind-select>
<app-base-config [form]="form"></app-base-config>
<!-- <app-kind-select [form]="form"></app-kind-select>-->
<!-- <app-base-config [form]="form"></app-base-config>-->
<!-- </div>-->
<!-- <div class="step-choices" *ngIf="currentStep === 'choices'"> </div>-->
<app-date-select *ngIf="form.value && form.value.kind == 'date'" [form]="form"></app-date-select>

View File

@ -22,7 +22,7 @@ export class FormComponent implements OnInit {
public form: FormGroup;
public displayDatePicker = false;
public advancedDisplayEnabled = true;
public advancedDisplayEnabled = false;
public show_debug_data = false;
public currentStep = 'base';
public steps = ['base', 'choices', 'advanced'];