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 // access
visibility = 'link_only'; // visible to anyone with the link: visibility = 'link_only'; // visible to anyone with the link:
voteChoices = 'only_yes'; // possible answers to a vote choice: only "yes", "yes, maybe, no" 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; passwordAccess = 0;
password = ''; password = '';
customUrl = ''; customUrl = '';
canModifyAnswers =1;// everybody, self, nobody (= just admin) canModifyAnswers = "self";// everybody, self, nobody (= just admin)
whoCanChangeAnswers = 'everybody';// 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 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 timeList: DateOption[] = timeOfDay; // ranges of time expressed as strings

View File

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