diff --git a/src/app/config/PollConfig.ts b/src/app/config/PollConfig.ts index 3cd871e0..e0a79319 100644 --- a/src/app/config/PollConfig.ts +++ b/src/app/config/PollConfig.ts @@ -56,8 +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 + passwordAccess = 0; password = ''; customUrl = ''; + canModifyAnswers =1;// 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 diff --git a/src/app/pages/visibility/visibility.component.html b/src/app/pages/visibility/visibility.component.html index e87e7972..ffb85272 100644 --- a/src/app/pages/visibility/visibility.component.html +++ b/src/app/pages/visibility/visibility.component.html @@ -31,9 +31,9 @@

{{"visibility.votes"|translate}}

- - {{"visibility.votes_possible"|translate}} - + +
+ + + + + + +
-

+

{{"visibility.access"|translate}} -

- {{"visibility.access_want"|translate}} - {{"visibility.access_want_yes"|translate}} - {{"visibility.access_want_no"|translate}} - {{"visibility.access_protect"|translate}} + + + + + {{"visibility.access_instructions"|translate}} + + {{"visibility.access_want"|translate}} + + + + + + +
-C'est parfait! + + {{"visibility.validate_btn"|translate}} + diff --git a/src/app/pages/visibility/visibility.component.ts b/src/app/pages/visibility/visibility.component.ts index ab66c675..0deeea9e 100644 --- a/src/app/pages/visibility/visibility.component.ts +++ b/src/app/pages/visibility/visibility.component.ts @@ -8,12 +8,24 @@ import {ConfigService} from '../../config.service'; styleUrls: ['./visibility.component.scss'] }) export class VisibilityComponent extends BaseComponent implements OnInit { + showCustomPassword = false; constructor(public config: ConfigService) { super(config); } ngOnInit() { + this.config.customUrl = this.makeUuid(); + } + + /** + * generate unique id to have a default url for future poll + */ + makeUuid() { + return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { + var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8); + return v.toString(16); + }); } } diff --git a/src/assets/i18n/fr.json b/src/assets/i18n/fr.json index e0d93f28..bc0d6e64 100644 --- a/src/assets/i18n/fr.json +++ b/src/assets/i18n/fr.json @@ -84,12 +84,15 @@ "modfiy_their": "leur vote", "modfiy_everyone": "tous les votes", "access": "Accès au sondage", + "access_url": "Les votants pourront y accéder via cette adresse :", + "access_url_key": "URL", + "see_pass": "voir", + "access_instructions": "peut contenir des lettres, chiffres et des tirets", "access_want": "Je", "access_want_yes": "souhaite", "access_want_no": "n'ai pas besoin", "access_protect": "qu’il soit protégé par un mot de passe.", - "access_url": "Les votants pourront y accéder via cette adresse :", - "access_url_key": "URL" + "validate_btn": "Créer ce sondage !" }, "admin": { "deletion": "Tout supprimer",