11 changed files with 272 additions and 171 deletions
@ -0,0 +1,76 @@
|
||||
<button class="btn btn--primary" (click)="pollService.addChoice()"> |
||||
{{ 'dates.add' | translate }} |
||||
</button> |
||||
<div *ngFor="let choice of pollService.dateList; index as id" class="date-choice"> |
||||
<input |
||||
[(ngModel)]="choice.date_object" |
||||
name="dateChoices_{{ id }}" |
||||
id="dateChoices_{{ id }}" |
||||
useValueAsDate |
||||
type="date" |
||||
/> |
||||
<button (click)="pollService.dateList.splice(id, 1)" class="btn btn-warning"> |
||||
<i class="fa fa-times" aria-hidden="true"></i> |
||||
</button> |
||||
<button |
||||
(click)="pollService.addTimeToDate(choice, id)" |
||||
*ngIf="'true' === pollService.allowSeveralHours" |
||||
class="btn btn--primary" |
||||
> |
||||
{{ 'dates.add_time' | translate }} |
||||
</button> |
||||
<div *ngIf="'true' === pollService.allowSeveralHours" class="several-times"> |
||||
<div *ngFor="let timeItem of choice.timeList; index as idTime" class="time-choice"> |
||||
<input |
||||
[(ngModel)]="timeItem.literal" |
||||
name="dateTime_{{ id }}_Choices_{{ idTime }}" |
||||
id="dateTime_{{ id }}_Choices_{{ idTime }}" |
||||
type="text" |
||||
/> |
||||
<button (click)="choice.timeList.splice(idTime, 1)" class="btn btn-warning"> |
||||
<i class="fa fa-times" aria-hidden="true"></i> |
||||
</button> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
<button |
||||
(click)="pollService.showDateInterval = !pollService.showDateInterval" |
||||
[ngClass]="{ active: pollService.showDateInterval }" |
||||
class="btn btn--primary" |
||||
id="toggle_interval_button" |
||||
> |
||||
<i class="fa fa-clock-o" aria-hidden="true"></i> |
||||
{{ 'dates.add_interval' | translate }} |
||||
</button> |
||||
<section *ngIf="pollService.showDateInterval" class="date-interval form-row"> |
||||
<h2>{{ 'dates.add_interval' | translate }}</h2> |
||||
<div class="columns"> |
||||
<div class="column"> |
||||
{{ 'dates.interval_propose' | translate }} |
||||
</div> |
||||
<div class="column"> |
||||
<label for="start_interval" class="hidden">start</label> |
||||
<input |
||||
id="start_interval" |
||||
(change)="pollService.countDays()" |
||||
formControlName="startDateInterval" |
||||
type="date" |
||||
/> |
||||
</div> |
||||
</div> |
||||
<div class="columns"> |
||||
<div class="column"> |
||||
{{ 'dates.interval_span' | translate }} |
||||
</div> |
||||
<div class="column"> |
||||
<label for="end_interval" class="hidden">end</label> |
||||
<input id="end_interval" formControlName="endDateInterval" type="date" /> |
||||
</div> |
||||
</div> |
||||
<button (click)="pollService.addIntervalOfDates()" class="btn btn-block btn--primary"> |
||||
<i class="fa fa-plus" aria-hidden="true"></i> |
||||
{{ 'dates.interval_button' | translate }} |
||||
{{ pollService.intervalDays }} |
||||
{{ 'dates.interval_button_dates' | translate }} |
||||
</button> |
||||
</section> |
@ -0,0 +1,24 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; |
||||
|
||||
import { DateViewsComponent } from './date-views.component'; |
||||
|
||||
describe('DateViewsComponent', () => { |
||||
let component: DateViewsComponent; |
||||
let fixture: ComponentFixture<DateViewsComponent>; |
||||
|
||||
beforeEach(async(() => { |
||||
TestBed.configureTestingModule({ |
||||
declarations: [DateViewsComponent], |
||||
}).compileComponents(); |
||||
})); |
||||
|
||||
beforeEach(() => { |
||||
fixture = TestBed.createComponent(DateViewsComponent); |
||||
component = fixture.componentInstance; |
||||
fixture.detectChanges(); |
||||
}); |
||||
|
||||
it('should create', () => { |
||||
expect(component).toBeTruthy(); |
||||
}); |
||||
}); |
@ -0,0 +1,13 @@
|
||||
import { Component, OnInit } from '@angular/core'; |
||||
import { PollService } from '../../../../core/services/poll.service'; |
||||
|
||||
@Component({ |
||||
selector: 'app-date-views', |
||||
templateUrl: './date-views.component.html', |
||||
styleUrls: ['./date-views.component.scss'], |
||||
}) |
||||
export class DateViewsComponent implements OnInit { |
||||
constructor(public pollService: PollService) {} |
||||
|
||||
ngOnInit(): void {} |
||||
} |
@ -1,99 +1,127 @@
|
||||
<app-stepper [step_current]="4" [step_max]="5"></app-stepper> |
||||
<div class="step"> |
||||
<div class="min-height"> |
||||
<form action="#" [formGroup]="pollService.form"> |
||||
<app-stepper [step_current]="4" [step_max]="5"></app-stepper> |
||||
|
||||
<div class="creator-infos"> |
||||
<label class="" for="creatorEmail"> |
||||
<span> |
||||
{{ 'creation.name' | translate }} |
||||
</span> |
||||
</label> |
||||
<label class="hidden" for="creatorPseudo"> |
||||
<span> |
||||
{{ 'creation.email' | translate }} |
||||
</span> |
||||
</label> |
||||
<input #title matInput placeholder="pseudo" formControlName="creatorPseudo" id="creatorPseudo" required /> |
||||
<input |
||||
#title |
||||
matInput |
||||
placeholder="mon-email@example.com" |
||||
formControlName="creatorEmail" |
||||
id="creatorEmail" |
||||
required |
||||
/> |
||||
</div> |
||||
<div class="creator-infos"> |
||||
<label class="" for="creatorEmail"> |
||||
<span> |
||||
{{ 'creation.name' | translate }} |
||||
</span> |
||||
</label> |
||||
<input |
||||
#title |
||||
matInput |
||||
placeholder="pseudo" |
||||
formControlName="creatorPseudo" |
||||
id="creatorPseudo" |
||||
required |
||||
/> |
||||
<label class="hidden" for="creatorPseudo"> |
||||
<span> |
||||
{{ 'creation.email' | translate }} |
||||
</span> |
||||
</label> |
||||
<input |
||||
#title |
||||
matInput |
||||
placeholder="mon-email@example.com" |
||||
formControlName="creatorEmail" |
||||
id="creatorEmail" |
||||
required |
||||
/> |
||||
</div> |
||||
|
||||
<fieldset class="advanced-config"> |
||||
<button class="btn is-info" (click)="advancedDisplayEnabled = !advancedDisplayEnabled"> |
||||
<i class="fa fa-save"></i> |
||||
{{ 'creation.advanced' | translate }} |
||||
</button> |
||||
<fieldset class="complete well" *ngIf="advancedDisplayEnabled"> |
||||
<h2>{{ 'creation.advanced' | translate }}</h2> |
||||
<fieldset class="advanced-config"> |
||||
<button class="btn is-info" (click)="advancedDisplayEnabled = !advancedDisplayEnabled"> |
||||
<i class="fa fa-save"></i> |
||||
{{ 'creation.advanced' | translate }} |
||||
</button> |
||||
<fieldset class="complete well" *ngIf="advancedDisplayEnabled"> |
||||
<h2>{{ 'creation.advanced' | translate }}</h2> |
||||
|
||||
<br /> |
||||
<br /> |
||||
|
||||
<label for="slug">Url pour les participants </label> |
||||
<br /> |
||||
<span |
||||
>{{ urlPrefix }} <strong> {{ form.controls.custom_url.value }} </strong> |
||||
</span> |
||||
<app-copy-text [textToCopy]="urlPrefix + form.controls.custom_url.value"></app-copy-text> |
||||
<label for="slug">Url pour les participants </label> |
||||
<br /> |
||||
<span |
||||
>{{ urlPrefix }} <strong> {{ pollService.form.controls.custom_url.value }} </strong> |
||||
</span> |
||||
<app-copy-text |
||||
[textToCopy]="urlPrefix + pollService.form.controls.custom_url.value" |
||||
></app-copy-text> |
||||
|
||||
<button |
||||
mat-button |
||||
*ngIf="form.controls.custom_url.value" |
||||
matSuffix |
||||
mat-icon-button |
||||
aria-label="Clear" |
||||
(click)="slug.value = ''" |
||||
></button> |
||||
<input #slug matInput id="slug" placeholder="Url" formControlName="slug" required /> |
||||
<br /> |
||||
<div appearance="outline" class="is-not-flex"> |
||||
<mat-label>Nombre de jours avant expiration</mat-label> |
||||
<input |
||||
#expiracy |
||||
id="expiracy" |
||||
matInput |
||||
type="number" |
||||
placeholder="Nombre de jours avant expiration" |
||||
formControlName="expiracyNumberOfDays" |
||||
required |
||||
/> |
||||
<button |
||||
mat-button |
||||
*ngIf="expiracy.value" |
||||
matSuffix |
||||
mat-icon-button |
||||
aria-label="Clear" |
||||
(click)="expiracy.value = ''" |
||||
> |
||||
<i class="fa fa-close"></i> |
||||
<button |
||||
mat-button |
||||
*ngIf="form.controls.custom_url.value" |
||||
matSuffix |
||||
mat-icon-button |
||||
aria-label="Clear" |
||||
(click)="slug.value = ''" |
||||
></button> |
||||
<input #slug matInput id="slug" placeholder="Url" formControlName="slug" required /> |
||||
<br /> |
||||
<div appearance="outline" class="is-not-flex"> |
||||
<mat-label>Nombre de jours avant expiration</mat-label> |
||||
<input |
||||
#expiracy |
||||
id="expiracy" |
||||
matInput |
||||
type="number" |
||||
placeholder="Nombre de jours avant expiration" |
||||
formControlName="expiracyNumberOfDays" |
||||
required |
||||
/> |
||||
<button |
||||
mat-button |
||||
*ngIf="expiracy.value" |
||||
matSuffix |
||||
mat-icon-button |
||||
aria-label="Clear" |
||||
(click)="expiracy.value = ''" |
||||
> |
||||
<i class="fa fa-close"></i> |
||||
</button> |
||||
</div> |
||||
<br /> |
||||
<mat-checkbox class="is-not-flex" formControlName="areResultsPublic"> |
||||
Les participants pourront consulter les résultats |
||||
</mat-checkbox> |
||||
<br /> |
||||
<mat-checkbox class="is-not-flex" formControlName="isAboutDate"> |
||||
Les choix possibles concerneront des dates |
||||
</mat-checkbox> |
||||
<br /> |
||||
<mat-checkbox class="is-not-flex" formControlName="isProtectedByPassword"> |
||||
Le sondage sera protégé par un mot de passe |
||||
</mat-checkbox> |
||||
<br /> |
||||
<mat-checkbox class="is-not-flex" formControlName="isOwnerNotifiedByEmailOnNewVote"> |
||||
Vous recevrez un mail à chaque nouvelle participation |
||||
</mat-checkbox> |
||||
<br /> |
||||
<mat-checkbox class="is-not-flex" formControlName="isOwnerNotifiedByEmailOnNewComment"> |
||||
Vous recevrez un mail à chaque nouveau commentaire |
||||
</mat-checkbox> |
||||
<br /> |
||||
<mat-checkbox class="is-not-flex" formControlName="isMaybeAnswerAvailable"> |
||||
La réponse « peut-être » sera disponible |
||||
</mat-checkbox> |
||||
</fieldset> |
||||
</fieldset> |
||||
</form> |
||||
</div> |
||||
<div class="columns"> |
||||
<div class="column"> |
||||
<button class="button is-secondary is-fullwidth" [routerLink]="['/administration/step/4']"> |
||||
précédent |
||||
</button> |
||||
</div> |
||||
<div class="column"> |
||||
<!-- [disabled]="form.invalid"--> |
||||
<button class="button is-primary is-fullwidth" [routerLink]="['/administration/step/5']"> |
||||
suivant |
||||
</button> |
||||
</div> |
||||
<br /> |
||||
<mat-checkbox class="is-not-flex" formControlName="areResultsPublic"> |
||||
Les participants pourront consulter les résultats |
||||
</mat-checkbox> |
||||
<br /> |
||||
<mat-checkbox class="is-not-flex" formControlName="isAboutDate"> |
||||
Les choix possibles concerneront des dates |
||||
</mat-checkbox> |
||||
<br /> |
||||
<mat-checkbox class="is-not-flex" formControlName="isProtectedByPassword"> |
||||
Le sondage sera protégé par un mot de passe |
||||
</mat-checkbox> |
||||
<br /> |
||||
<mat-checkbox class="is-not-flex" formControlName="isOwnerNotifiedByEmailOnNewVote"> |
||||
Vous recevrez un mail à chaque nouvelle participation |
||||
</mat-checkbox> |
||||
<br /> |
||||
<mat-checkbox class="is-not-flex" formControlName="isOwnerNotifiedByEmailOnNewComment"> |
||||
Vous recevrez un mail à chaque nouveau commentaire |
||||
</mat-checkbox> |
||||
<br /> |
||||
<mat-checkbox class="is-not-flex" formControlName="isMaybeAnswerAvailable"> |
||||
La réponse « peut-être » sera disponible |
||||
</mat-checkbox> |
||||
</fieldset> |
||||
</fieldset> |
||||
</div> |
||||
</div> |
||||
|
@ -0,0 +1,9 @@
|
||||
@import '../../../../../styles/variables'; |
||||
|
||||
.ui-datepicker table td.ui-datepicker-today > a.ui-state-active, |
||||
.ui-datepicker table td.ui-datepicker-today > span.ui-state-active { |
||||
background-color: $primary-color !important; |
||||
} |
||||
.calendar { |
||||
margin-top: 1em; |
||||
} |
Loading…
Reference in new issue