forked from tykayn/funky-framadate-front
display in advanced params
This commit is contained in:
parent
191d87d0a5
commit
3a51474a53
@ -122,15 +122,13 @@ export class PollService implements Resolve<Poll> {
|
||||
custom_url: [this.uuidService.getUUID(), [Validators.required]],
|
||||
description: ['', []],
|
||||
password: ['', []],
|
||||
password_repeat: ['', []],
|
||||
choices: new FormArray([]),
|
||||
whoModifiesAnswers: ['', [Validators.required]],
|
||||
whoCanChangeAnswers: ['', [Validators.required]],
|
||||
whoModifiesAnswers: ['self', [Validators.required]],
|
||||
whoCanChangeAnswers: ['self', [Validators.required]],
|
||||
isAboutDate: [true, [Validators.required]],
|
||||
expiresDaysDelay: [environment.expiresDaysDelay, []],
|
||||
expiracy_date: [
|
||||
this.DateUtilitiesService.addDaysToDate(environment.expiresDaysDelay, new Date()),
|
||||
[Validators.required],
|
||||
],
|
||||
expiracy_date: [this.DateUtilitiesService.addDaysToDate(environment.expiresDaysDelay, new Date()), []],
|
||||
isZeroKnoledge: [false, [Validators.required]],
|
||||
isProtectedByPassword: [false, [Validators.required]],
|
||||
isOwnerNotifiedByEmailOnNewVote: [true, [Validators.required]],
|
||||
|
@ -17,12 +17,30 @@
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<hr />
|
||||
<div class="rounded-block">
|
||||
<h3 class="title is-3">
|
||||
{{ 'advanced.custom_link' | translate }}
|
||||
</h3>
|
||||
<label for="custom_url">
|
||||
Url personnalisée pour les participants
|
||||
{{ 'advanced.custom_label' | translate }}
|
||||
</label>
|
||||
<p class="description small-text">
|
||||
{{ 'advanced.custom_desc' | translate }}
|
||||
</p>
|
||||
<br />
|
||||
|
||||
<div class="domain-custom-box">
|
||||
<div class="domain">{{ domain_url }}</div>
|
||||
<input
|
||||
class="inline-input"
|
||||
#custom_url
|
||||
matInput
|
||||
id="custom_url"
|
||||
placeholder="Url"
|
||||
formControlName="custom_url"
|
||||
required
|
||||
/>
|
||||
</div>
|
||||
<button
|
||||
*ngIf="form.controls.custom_url.value"
|
||||
aria-label="Clear"
|
||||
@ -30,40 +48,20 @@
|
||||
>
|
||||
<i class="fa fa-recycle"></i> régénérer
|
||||
</button>
|
||||
<input #custom_url matInput id="custom_url" placeholder="Url" formControlName="custom_url" required />
|
||||
<br />
|
||||
<div appearance="outline" class="is-not-flex">
|
||||
<mat-label
|
||||
>Nombre de jours avant expiration de la possibilité de voter, après le sondage reste consultable
|
||||
</mat-label>
|
||||
<input
|
||||
#expiresDaysDelay
|
||||
id="expiresDaysDelay"
|
||||
matInput
|
||||
type="number"
|
||||
formControlName="expiresDaysDelay"
|
||||
required
|
||||
/>
|
||||
</div>
|
||||
<div class="rounded-box">
|
||||
<mat-checkbox class="is-not-flex" formControlName="areResultsPublic">
|
||||
Les participants pourront consulter les résultats
|
||||
</mat-checkbox>
|
||||
</div>
|
||||
<div class="rounded-box">
|
||||
<h3 class="title is-3">
|
||||
{{ 'advanced.password_title' | translate }}
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
<mat-checkbox class="is-not-flex" formControlName="isProtectedByPassword">
|
||||
{{ 'advanced.password_label' | translate }}
|
||||
</mat-checkbox>
|
||||
</div>
|
||||
|
||||
<div class="password-box" *ngIf="form.value.isProtectedByPassword">
|
||||
<br />
|
||||
<div class="rounded-block">
|
||||
<h3 class="title is-3">
|
||||
{{ 'advanced.password_title' | translate }}
|
||||
</h3>
|
||||
<p>
|
||||
{{ 'advanced.password_title' | translate }}
|
||||
</p>
|
||||
<div class="password-box">
|
||||
<input
|
||||
#password
|
||||
id="password"
|
||||
id="password_first"
|
||||
matInput
|
||||
[type]="displayClearPassword ? 'text' : 'password'"
|
||||
formControlName="password"
|
||||
@ -78,61 +76,160 @@
|
||||
<i class="fa fa-eye" *ngIf="!displayClearPassword"></i>
|
||||
<i class="fa fa-eye-slash" *ngIf="displayClearPassword"></i>
|
||||
</button>
|
||||
<input
|
||||
#password
|
||||
id="password"
|
||||
matInput
|
||||
[type]="displayClearPassword ? 'text' : 'password'"
|
||||
formControlName="password_repeat"
|
||||
required
|
||||
/>
|
||||
<button
|
||||
class="button"
|
||||
[ngClass]="{ 'is-primary': displayClearPassword, 'is-info': !displayClearPassword }"
|
||||
(click)="displayClearPassword = !displayClearPassword"
|
||||
>
|
||||
voir
|
||||
<i class="fa fa-eye" *ngIf="!displayClearPassword"></i>
|
||||
<i class="fa fa-eye-slash" *ngIf="displayClearPassword"></i>
|
||||
</button>
|
||||
<div class="pass-validation" *ngIf="form.value.password == form.value.password_repeat">
|
||||
<img class="icon" aria-hidden="true" src="assets/icons/book.svg" />
|
||||
{{ 'advanced.password_validation_ok' | translate }}
|
||||
</div>
|
||||
<div class="visibility_password_results">
|
||||
<mat-checkbox class="is-not-flex" formControlName="areResultsPublic">
|
||||
{{ 'advanced.password_display_without' | translate }}
|
||||
</mat-checkbox>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="rounded-block permissions-modification">
|
||||
<h3 class="title is-3">
|
||||
<i class="fa fa-envelope-open"></i>
|
||||
Notifications
|
||||
{{ 'advanced.allowances_title' | translate }}
|
||||
</h3>
|
||||
<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>
|
||||
<div class="proposed-answers">
|
||||
<h3 class="title is-3">
|
||||
<i class="fa fa-check-square"></i>
|
||||
Réponses proposées
|
||||
</h3>
|
||||
|
||||
<mat-checkbox class="is-not-flex" formControlName="isYesAnswerAvailable">
|
||||
La réponse « oui » sera disponible
|
||||
<img class="image is-24x24 pull-right" src="assets/img/icon_voter_YES.svg" />
|
||||
</mat-checkbox>
|
||||
<br />
|
||||
<mat-checkbox class="is-not-flex" formControlName="isMaybeAnswerAvailable">
|
||||
La réponse « peut-être » sera disponible
|
||||
<img class="image is-24x24 pull-right" src="assets/img/icon_voter_MAYBE.svg" />
|
||||
</mat-checkbox>
|
||||
<br />
|
||||
<mat-checkbox class="is-not-flex" formControlName="isNoAnswerAvailable">
|
||||
La réponse « non » sera disponible
|
||||
<img class="image is-24x24 pull-right" src="assets/img/icon_voter_NO.svg" />
|
||||
</mat-checkbox>
|
||||
<div class="choice">
|
||||
<label for="self_can_change_answers">
|
||||
{{ 'advanced.allowances_own' | translate }}
|
||||
</label>
|
||||
<input type="radio" formControlName="whoCanChangeAnswers" value="self" id="self_can_change_answers" />
|
||||
</div>
|
||||
<div class="choice">
|
||||
<label for="everybody_can_change_answers">
|
||||
{{ 'advanced.allowances_all' | translate }}
|
||||
</label>
|
||||
<input
|
||||
type="radio"
|
||||
formControlName="whoCanChangeAnswers"
|
||||
value="everybody"
|
||||
id="everybody_can_change_answers"
|
||||
/>
|
||||
</div>
|
||||
<hr />
|
||||
<div class="choice">
|
||||
<label for="none_can_change_answers">
|
||||
{{ 'advanced.allowances_none' | translate }}
|
||||
</label>
|
||||
<input type="radio" formControlName="whoCanChangeAnswers" value="none" id="none_can_change_answers" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="rounded-block notifications">
|
||||
<h3 class="title is-3">
|
||||
<i class="fa fa-user-secret"></i>
|
||||
Restrictions visiteurs
|
||||
{{ 'advanced.notifications_title' | translate }}
|
||||
</h3>
|
||||
<mat-checkbox class="is-not-flex" formControlName="allowComments">
|
||||
Autoriser les commentaires
|
||||
</mat-checkbox>
|
||||
<mat-checkbox class="is-not-flex" formControlName="hideResults">
|
||||
Cacher les résultats au public
|
||||
</mat-checkbox>
|
||||
<br />
|
||||
<mat-checkbox class="is-not-flex" formControlName="hasMaxCountOfAnswers">
|
||||
Nombre de réponses limitées à ce nombre.
|
||||
</mat-checkbox>
|
||||
<p>
|
||||
Utile pour réserver des places à un évènement.
|
||||
{{ 'advanced.notifications_description' | translate }}
|
||||
</p>
|
||||
<div class="choice">
|
||||
<mat-checkbox class="is-not-flex" formControlName="isOwnerNotifiedByEmailOnNewComment">
|
||||
{{ 'advanced.notifications_vote' | translate }}
|
||||
</mat-checkbox>
|
||||
</div>
|
||||
<div class="choice">
|
||||
<mat-checkbox class="is-not-flex" formControlName="isOwnerNotifiedByEmailOnNewVote">
|
||||
{{ 'advanced.notifications_comment' | translate }}
|
||||
</mat-checkbox>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- hidden configs, work in progress-->
|
||||
<fieldset class="work-in-progress" *ngIf="environment.display_wip">
|
||||
<div class="rounded-block archive_config">
|
||||
<div appearance="outline" class="is-not-flex">
|
||||
<mat-label
|
||||
>Nombre de jours avant expiration de la possibilité de voter, après le sondage reste consultable
|
||||
</mat-label>
|
||||
<input
|
||||
#expiresDaysDelay
|
||||
id="expiresDaysDelay"
|
||||
matInput
|
||||
type="number"
|
||||
formControlName="expiresDaysDelay"
|
||||
required
|
||||
/>
|
||||
</div>
|
||||
<div class="rounded-box"></div>
|
||||
<div class="rounded-box">
|
||||
<h3 class="title is-3">
|
||||
{{ 'advanced.password_title' | translate }}
|
||||
</h3>
|
||||
|
||||
<mat-checkbox class="is-not-flex" formControlName="isProtectedByPassword">
|
||||
{{ 'advanced.password_label' | translate }}
|
||||
</mat-checkbox>
|
||||
</div>
|
||||
|
||||
<h3 class="title is-3">
|
||||
<i class="fa fa-envelope-open"></i>
|
||||
Notifications
|
||||
</h3>
|
||||
<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>
|
||||
<div class="proposed-answers">
|
||||
<h3 class="title is-3">
|
||||
<i class="fa fa-check-square"></i>
|
||||
Réponses proposées
|
||||
</h3>
|
||||
|
||||
<mat-checkbox class="is-not-flex" formControlName="isYesAnswerAvailable">
|
||||
La réponse « oui » sera disponible
|
||||
<img class="image is-24x24 pull-right" src="assets/img/icon_voter_YES.svg" />
|
||||
</mat-checkbox>
|
||||
<br />
|
||||
<mat-checkbox class="is-not-flex" formControlName="isMaybeAnswerAvailable">
|
||||
La réponse « peut-être » sera disponible
|
||||
<img class="image is-24x24 pull-right" src="assets/img/icon_voter_MAYBE.svg" />
|
||||
</mat-checkbox>
|
||||
<br />
|
||||
<mat-checkbox class="is-not-flex" formControlName="isNoAnswerAvailable">
|
||||
La réponse « non » sera disponible
|
||||
<img class="image is-24x24 pull-right" src="assets/img/icon_voter_NO.svg" />
|
||||
</mat-checkbox>
|
||||
</div>
|
||||
<h3 class="title is-3">
|
||||
<i class="fa fa-user-secret"></i>
|
||||
Restrictions visiteurs
|
||||
</h3>
|
||||
<mat-checkbox class="is-not-flex" formControlName="allowComments">
|
||||
Autoriser les commentaires
|
||||
</mat-checkbox>
|
||||
<mat-checkbox class="is-not-flex" formControlName="hideResults">
|
||||
Cacher les résultats au public
|
||||
</mat-checkbox>
|
||||
<br />
|
||||
<mat-checkbox class="is-not-flex" formControlName="hasMaxCountOfAnswers">
|
||||
Nombre de réponses limitées à ce nombre.
|
||||
</mat-checkbox>
|
||||
<p>
|
||||
Utile pour réserver des places à un évènement.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<h2 class="title is-2">
|
||||
<i class="fa fa-wikidata"></i>
|
||||
Fonctionnalités pas encore disponibles:
|
||||
|
@ -5,9 +5,48 @@
|
||||
margin-left: 1em;
|
||||
}
|
||||
}
|
||||
|
||||
input,
|
||||
textarea {
|
||||
margin-top: 0.5em;
|
||||
margin-bottom: 1.5em;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.domain-custom-box {
|
||||
border-radius: 3px;
|
||||
height: 1.5em;
|
||||
width: 100%;
|
||||
margin: 1rem;
|
||||
display: block;
|
||||
|
||||
.domain {
|
||||
border: solid 1px #eee;
|
||||
padding: 0.5rem;
|
||||
float: left;
|
||||
width: 40%;
|
||||
background: #ddd;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.inline-input {
|
||||
border: solid 1px #ddd !important;
|
||||
padding: 0.5rem;
|
||||
display: inline-block;
|
||||
background: #fff;
|
||||
margin: 0;
|
||||
float: left;
|
||||
width: 49%;
|
||||
}
|
||||
}
|
||||
.permissions-modification {
|
||||
input {
|
||||
height: 1.5rem;
|
||||
width: 1.5rem;
|
||||
margin-right: 1rem;
|
||||
}
|
||||
label {
|
||||
float: right;
|
||||
width: 90%;
|
||||
}
|
||||
}
|
||||
|
@ -17,7 +17,12 @@ export class AdvancedConfigComponent implements OnInit {
|
||||
public poll?: Poll;
|
||||
@Input()
|
||||
public form: FormGroup;
|
||||
domain_url: string;
|
||||
constructor(public pollService: PollService) {}
|
||||
|
||||
ngOnInit(): void {}
|
||||
ngOnInit(): void {
|
||||
this.domain_url = 'https://' + new URL(window.location.href).hostname + '/';
|
||||
|
||||
this.form.patchValue({ custom_url: this.pollService.makeSlug(this.pollService.form) });
|
||||
}
|
||||
}
|
||||
|
@ -132,8 +132,8 @@
|
||||
"custom_label": "Saisissez le lien de votre sondage",
|
||||
"custom_desc": "Modifier le lien de votre sondage le rend plus facilement accessible à tous le monde. Il est recommandé de le protéger par mot de passe.",
|
||||
"password_title": "Protéger par mot de passe",
|
||||
"password_label": "Cette étape est facultative.",
|
||||
"password_label_repeat": "Cette étape est facultative.",
|
||||
"password_label": "Mot de passe",
|
||||
"password_label_repeat": "Confirmer mot de passe",
|
||||
"password_validation_ok": "Vos mots de passe sont identiques",
|
||||
"password_display_without": "Les résultats sont visibles sans mot de passe",
|
||||
"allowances_title": "Permissions",
|
||||
|
Loading…
Reference in New Issue
Block a user