link default values

This commit is contained in:
Baptiste Lemoine 2019-11-23 15:08:20 +01:00
parent f4108ee61b
commit c1935dbb87
2 changed files with 33 additions and 21 deletions

View File

@ -56,11 +56,11 @@ export class PollConfig {
// access
visibility = 'link_only'; // visible to anyone with the link:
voteChoices = 'only_yes'; // possible answers to a vote choice: only "yes", "yes, maybe, no"
expirationDate = ''; // expiracy date
expirationDate = new Date().toString().substr(0, 10); // expiracy date
passwordAccess = 0;
password = '';
customUrl = '';
canModifyAnswers =1;// everybody, self, nobody (= just admin)
canModifyAnswers = "self";// everybody, self, nobody (= just admin)
whoCanChangeAnswers = 'everybody';// everybody, self, nobody (= just admin)
dateList: DateOption[] = defaultDates; // sets of days as strings, config to set identical time for days in a special days poll
timeList: DateOption[] = timeOfDay; // ranges of time expressed as strings

View File

@ -2,7 +2,6 @@
{{"visibility.top_txt"|translate}}
</h1>
<section class="answers">
<h2>
{{"visibility.title"|translate}}
</h2>
@ -14,7 +13,7 @@
id="visible_people"
[(ngModel)]="config.visibility"
>
<option value="link">
<option value="link_only">
{{"visibility.visibility_link"|translate}}
</option>
<option value="only_me">
@ -37,7 +36,7 @@
<select
name="votes"
id="votes"
[(ngModel)]="config.visibility"
[(ngModel)]="config.voteChoices"
>
<option value="only_yes">
{{"visibility.votes_possible_single"|translate}}
@ -110,7 +109,10 @@
<sub class="instructions">
{{"visibility.access_instructions"|translate}}
</sub>
{{"visibility.access_want"|translate}}
<br>
<label for="passwordAccess">
{{"visibility.access_want"|translate}}
</label>
<select name="passwordAccess" id="passwordAccess" [(ngModel)]="config.passwordAccess">
<option value="0"> {{"visibility.access_want_no"|translate}}</option>
<option value="1"> {{"visibility.access_want_yes"|translate}}</option>
@ -120,24 +122,34 @@
{{"visibility.access_protect"|translate}}
</label>
<input type="password"
name="password"
id="password"
min="8"
*ngIf="!showCustomPassword"
[(ngModel)]="config.password">
<input type="password"
name="password_visible"
id="password_visible"
min="8"
*ngIf="showCustomPassword"
[(ngModel)]="config.password">
<button class="btn btn--default" (click)="showCustomPassword = !showCustomPassword">
{{"visibility.see_pass"|translate}}
</button>
<div class="enablepassword" *ngIf="config.passwordAccess">
<input type="password"
name="password"
id="password"
min="8"
*ngIf="!showCustomPassword"
[(ngModel)]="config.password">
<input type="text"
name="password_visible"
id="password_visible"
min="8"
*ngIf="showCustomPassword"
[(ngModel)]="config.password">
<button class="btn btn--default" (click)="showCustomPassword = !showCustomPassword">
{{"visibility.see_pass"|translate}}
</button>
</div>
</section>
<a [routerLink]="'/step/end'"
class="btn btn--primary">
{{"visibility.validate_btn"|translate}}
</a>
<div class="back">
<a [routerLink]="'/step/answers'"
class="btn btn--back">
Retour
</a>
</div>