mirror of
https://framagit.org/framasoft/framadate/funky-framadate-front.git
synced 2023-08-25 13:53:14 +02:00
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]],
|
custom_url: [this.uuidService.getUUID(), [Validators.required]],
|
||||||
description: ['', []],
|
description: ['', []],
|
||||||
password: ['', []],
|
password: ['', []],
|
||||||
|
password_repeat: ['', []],
|
||||||
choices: new FormArray([]),
|
choices: new FormArray([]),
|
||||||
whoModifiesAnswers: ['', [Validators.required]],
|
whoModifiesAnswers: ['self', [Validators.required]],
|
||||||
whoCanChangeAnswers: ['', [Validators.required]],
|
whoCanChangeAnswers: ['self', [Validators.required]],
|
||||||
isAboutDate: [true, [Validators.required]],
|
isAboutDate: [true, [Validators.required]],
|
||||||
expiresDaysDelay: [environment.expiresDaysDelay, []],
|
expiresDaysDelay: [environment.expiresDaysDelay, []],
|
||||||
expiracy_date: [
|
expiracy_date: [this.DateUtilitiesService.addDaysToDate(environment.expiresDaysDelay, new Date()), []],
|
||||||
this.DateUtilitiesService.addDaysToDate(environment.expiresDaysDelay, new Date()),
|
|
||||||
[Validators.required],
|
|
||||||
],
|
|
||||||
isZeroKnoledge: [false, [Validators.required]],
|
isZeroKnoledge: [false, [Validators.required]],
|
||||||
isProtectedByPassword: [false, [Validators.required]],
|
isProtectedByPassword: [false, [Validators.required]],
|
||||||
isOwnerNotifiedByEmailOnNewVote: [true, [Validators.required]],
|
isOwnerNotifiedByEmailOnNewVote: [true, [Validators.required]],
|
||||||
|
@ -17,12 +17,30 @@
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<hr />
|
|
||||||
<div class="rounded-block">
|
<div class="rounded-block">
|
||||||
|
<h3 class="title is-3">
|
||||||
|
{{ 'advanced.custom_link' | translate }}
|
||||||
|
</h3>
|
||||||
<label for="custom_url">
|
<label for="custom_url">
|
||||||
Url personnalisée pour les participants
|
{{ 'advanced.custom_label' | translate }}
|
||||||
</label>
|
</label>
|
||||||
|
<p class="description small-text">
|
||||||
|
{{ 'advanced.custom_desc' | translate }}
|
||||||
|
</p>
|
||||||
<br />
|
<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
|
<button
|
||||||
*ngIf="form.controls.custom_url.value"
|
*ngIf="form.controls.custom_url.value"
|
||||||
aria-label="Clear"
|
aria-label="Clear"
|
||||||
@ -30,40 +48,20 @@
|
|||||||
>
|
>
|
||||||
<i class="fa fa-recycle"></i> régénérer
|
<i class="fa fa-recycle"></i> régénérer
|
||||||
</button>
|
</button>
|
||||||
<input #custom_url matInput id="custom_url" placeholder="Url" formControlName="custom_url" required />
|
</div>
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
<div appearance="outline" class="is-not-flex">
|
<div class="rounded-block">
|
||||||
<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">
|
<h3 class="title is-3">
|
||||||
{{ 'advanced.password_title' | translate }}
|
{{ 'advanced.password_title' | translate }}
|
||||||
</h3>
|
</h3>
|
||||||
|
<p>
|
||||||
<mat-checkbox class="is-not-flex" formControlName="isProtectedByPassword">
|
{{ 'advanced.password_title' | translate }}
|
||||||
{{ 'advanced.password_label' | translate }}
|
</p>
|
||||||
</mat-checkbox>
|
<div class="password-box">
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="password-box" *ngIf="form.value.isProtectedByPassword">
|
|
||||||
<input
|
<input
|
||||||
#password
|
#password
|
||||||
id="password"
|
id="password_first"
|
||||||
matInput
|
matInput
|
||||||
[type]="displayClearPassword ? 'text' : 'password'"
|
[type]="displayClearPassword ? 'text' : 'password'"
|
||||||
formControlName="password"
|
formControlName="password"
|
||||||
@ -78,6 +76,107 @@
|
|||||||
<i class="fa fa-eye" *ngIf="!displayClearPassword"></i>
|
<i class="fa fa-eye" *ngIf="!displayClearPassword"></i>
|
||||||
<i class="fa fa-eye-slash" *ngIf="displayClearPassword"></i>
|
<i class="fa fa-eye-slash" *ngIf="displayClearPassword"></i>
|
||||||
</button>
|
</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">
|
||||||
|
{{ 'advanced.allowances_title' | translate }}
|
||||||
|
</h3>
|
||||||
|
<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">
|
||||||
|
{{ 'advanced.notifications_title' | translate }}
|
||||||
|
</h3>
|
||||||
|
<p>
|
||||||
|
{{ '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>
|
</div>
|
||||||
|
|
||||||
<h3 class="title is-3">
|
<h3 class="title is-3">
|
||||||
@ -131,8 +230,6 @@
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- hidden configs, work in progress-->
|
|
||||||
<fieldset class="work-in-progress" *ngIf="environment.display_wip">
|
|
||||||
<h2 class="title is-2">
|
<h2 class="title is-2">
|
||||||
<i class="fa fa-wikidata"></i>
|
<i class="fa fa-wikidata"></i>
|
||||||
Fonctionnalités pas encore disponibles:
|
Fonctionnalités pas encore disponibles:
|
||||||
|
@ -5,9 +5,48 @@
|
|||||||
margin-left: 1em;
|
margin-left: 1em;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
input,
|
input,
|
||||||
textarea {
|
textarea {
|
||||||
margin-top: 0.5em;
|
margin-top: 0.5em;
|
||||||
margin-bottom: 1.5em;
|
margin-bottom: 1.5em;
|
||||||
width: 100%;
|
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;
|
public poll?: Poll;
|
||||||
@Input()
|
@Input()
|
||||||
public form: FormGroup;
|
public form: FormGroup;
|
||||||
|
domain_url: string;
|
||||||
constructor(public pollService: PollService) {}
|
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_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.",
|
"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_title": "Protéger par mot de passe",
|
||||||
"password_label": "Cette étape est facultative.",
|
"password_label": "Mot de passe",
|
||||||
"password_label_repeat": "Cette étape est facultative.",
|
"password_label_repeat": "Confirmer mot de passe",
|
||||||
"password_validation_ok": "Vos mots de passe sont identiques",
|
"password_validation_ok": "Vos mots de passe sont identiques",
|
||||||
"password_display_without": "Les résultats sont visibles sans mot de passe",
|
"password_display_without": "Les résultats sont visibles sans mot de passe",
|
||||||
"allowances_title": "Permissions",
|
"allowances_title": "Permissions",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user