mirror of
https://framagit.org/framasoft/framadate/funky-framadate-front.git
synced 2023-08-25 13:53:14 +02:00
autofill creation var in env
This commit is contained in:
parent
52ff89f1f5
commit
3dc7555747
@ -64,8 +64,9 @@ export class PollService implements Resolve<Poll> {
|
|||||||
private fb: FormBuilder
|
private fb: FormBuilder
|
||||||
) {
|
) {
|
||||||
this.createFormGroup();
|
this.createFormGroup();
|
||||||
if (environment.autofill) {
|
if (environment.autofill_creation) {
|
||||||
this.setDemoValues();
|
this.setDemoValues();
|
||||||
|
this.toastService.display('auto fill de création fait');
|
||||||
} else {
|
} else {
|
||||||
this.calendar = [new Date()];
|
this.calendar = [new Date()];
|
||||||
}
|
}
|
||||||
@ -381,7 +382,7 @@ export class PollService implements Resolve<Poll> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
askInitFormDefault(): void {
|
askInitFormDefault(): void {
|
||||||
this.initFormDefault(false);
|
this.initFormDefault(environment.autofill_creation);
|
||||||
this.toastService.display('formulaire réinitialisé');
|
this.toastService.display('formulaire réinitialisé');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ export class StorageService {
|
|||||||
public choices: Choice[] = [];
|
public choices: Choice[] = [];
|
||||||
|
|
||||||
constructor(public dateUtilities: DateUtilitiesService, private toastService: ToastService) {
|
constructor(public dateUtilities: DateUtilitiesService, private toastService: ToastService) {
|
||||||
if (environment.autofill) {
|
if (environment.autofill_participation) {
|
||||||
this.toastService.display('autofill des sondages utilisateur');
|
this.toastService.display('autofill des sondages utilisateur');
|
||||||
this.userPolls.push(new Poll(new Owner(), 'Démo: Anniversaire de tonton Patrick', 'aujourdhui-ou-demain'));
|
this.userPolls.push(new Poll(new Owner(), 'Démo: Anniversaire de tonton Patrick', 'aujourdhui-ou-demain'));
|
||||||
this.userPolls.push(new Poll(new Owner(), 'Démo: Atelier cuisine du quartier', 'aujourdhui-ou-demain'));
|
this.userPolls.push(new Poll(new Owner(), 'Démo: Atelier cuisine du quartier', 'aujourdhui-ou-demain'));
|
||||||
@ -71,7 +71,7 @@ export class StorageService {
|
|||||||
this.vote_stack = new Stack();
|
this.vote_stack = new Stack();
|
||||||
|
|
||||||
for (const choice of choices_list) {
|
for (const choice of choices_list) {
|
||||||
if (environment.autofill) {
|
if (environment.autofill_participation) {
|
||||||
console.log('autofill au hasard des votes à ce sondage');
|
console.log('autofill au hasard des votes à ce sondage');
|
||||||
this.toastService.display('autofill au hasard des votes à ce sondage');
|
this.toastService.display('autofill au hasard des votes à ce sondage');
|
||||||
const defaultvalue = Math.random() > 0.75 ? 'yes' : '';
|
const defaultvalue = Math.random() > 0.75 ? 'yes' : '';
|
||||||
|
@ -54,12 +54,15 @@
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="column">
|
<div class="column">
|
||||||
<app-errors-list [form]="pollService.form"></app-errors-list>
|
<button class="btn is-primary" (click)="createPoll()">
|
||||||
|
<i class="fa fa-save"></i>
|
||||||
|
Enregistrer le sondage
|
||||||
|
</button>
|
||||||
<button class="btn is-primary" (click)="createPoll()" [disabled]="!pollService.form.valid">
|
<button class="btn is-primary" (click)="createPoll()" [disabled]="!pollService.form.valid">
|
||||||
<i class="fa fa-save"></i>
|
<i class="fa fa-save"></i>
|
||||||
Enregistrer le sondage
|
Enregistrer le sondage
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<app-errors-list [form]="pollService.form"></app-errors-list>
|
||||||
</div>
|
</div>
|
||||||
|
@ -7,44 +7,32 @@
|
|||||||
</h2>
|
</h2>
|
||||||
<div class="columns">
|
<div class="columns">
|
||||||
<div class="column">
|
<div class="column">
|
||||||
<label for="title">Titre</label>
|
<div>
|
||||||
|
<label for="title">Titre</label>
|
||||||
|
</div>
|
||||||
<input
|
<input
|
||||||
class="input-lg"
|
class="input-lg"
|
||||||
#title
|
#title
|
||||||
[placeholder]="'creation.choose_title_placeholder' | translate"
|
[placeholder]="'creation.choose_title_placeholder' | translate"
|
||||||
formControlName="title"
|
formControlName="title"
|
||||||
aria-placeholder="Quel resto ce soir ?"
|
(keyup)="pollService.updateSlug()"
|
||||||
placeholder="Quel resto ce soir ?"
|
(blur)="pollService.updateSlug()"
|
||||||
id="title"
|
id="title"
|
||||||
autofocus="autofocus"
|
autofocus="autofocus"
|
||||||
required
|
required
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<!-- (keyup)="pollService.updateSlug()"-->
|
|
||||||
<!-- (blur)="pollService.updateSlug()"-->
|
|
||||||
<div class="column is-narrow">
|
|
||||||
<button
|
|
||||||
mat-button
|
|
||||||
*ngIf="title.value"
|
|
||||||
matSuffix
|
|
||||||
mat-icon-button
|
|
||||||
aria-label="Clear"
|
|
||||||
(click)="title.value = ''"
|
|
||||||
>
|
|
||||||
<i class="fa fa-close"></i>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
<div class="poll-description">
|
<div class="poll-description">
|
||||||
<div class="columns">
|
<div class="columns">
|
||||||
<div class="column">
|
<div class="column">
|
||||||
<label for="descr">Description (optionnel)</label>
|
<label for="descr">Description (optionnel)</label>
|
||||||
<div class="rich-text-toggle">
|
<!-- <div class="rich-text-toggle">-->
|
||||||
<label for="richTextMode">mode de saisie avancée</label>
|
<!-- <label for="richTextMode">mode de saisie avancée</label>-->
|
||||||
|
|
||||||
<mat-checkbox formControlName="richTextMode" id="richTextMode"></mat-checkbox>
|
<!-- <mat-checkbox formControlName="richTextMode" id="richTextMode"></mat-checkbox>-->
|
||||||
</div>
|
<!-- </div>-->
|
||||||
<div class="rich-toolbar" *ngIf="pollService.form.value.richTextMode">
|
<div class="rich-toolbar" *ngIf="pollService.form.value.richTextMode">
|
||||||
richTextMode activé
|
richTextMode activé
|
||||||
</div>
|
</div>
|
||||||
@ -77,7 +65,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
slug: {{ pollService.form.value.custom_url }}
|
|
||||||
</form>
|
</form>
|
||||||
<div class="columns">
|
<div class="columns">
|
||||||
<div class="column"></div>
|
<div class="column"></div>
|
||||||
|
@ -16,7 +16,8 @@ export const environment = {
|
|||||||
production: true,
|
production: true,
|
||||||
display_routes: true,
|
display_routes: true,
|
||||||
showDemoWarning: true,
|
showDemoWarning: true,
|
||||||
autofill: false,
|
autofill_creation: true,
|
||||||
|
autofill_participation: true,
|
||||||
autoSendNewPoll: false,
|
autoSendNewPoll: false,
|
||||||
interval_days_default: 7,
|
interval_days_default: 7,
|
||||||
expiresDaysDelay: 60,
|
expiresDaysDelay: 60,
|
||||||
|
@ -10,10 +10,11 @@ endpoints.baseHref = apiV1.baseHref;
|
|||||||
export const environment = {
|
export const environment = {
|
||||||
frontDomain: 'http://127.0.0.1:4200',
|
frontDomain: 'http://127.0.0.1:4200',
|
||||||
production: false,
|
production: false,
|
||||||
display_routes: true,
|
display_routes: false, // demo paths to test polls
|
||||||
autofill: true,
|
autofill_creation: true,
|
||||||
|
autofill_participation: true,
|
||||||
// autofill: false,
|
// autofill: false,
|
||||||
showDemoWarning: true,
|
showDemoWarning: false,
|
||||||
autoSendNewPoll: false,
|
autoSendNewPoll: false,
|
||||||
interval_days_default: 7,
|
interval_days_default: 7,
|
||||||
expiresDaysDelay: 60,
|
expiresDaysDelay: 60,
|
||||||
|
@ -1,5 +1,14 @@
|
|||||||
@charset "UTF-8";
|
@charset "UTF-8";
|
||||||
|
|
||||||
|
app-step-one,
|
||||||
|
app-step-two,
|
||||||
|
app-step-three,
|
||||||
|
app-step-four,
|
||||||
|
app-step-five {
|
||||||
|
padding: 2em 1em;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
input,
|
input,
|
||||||
select,
|
select,
|
||||||
textarea {
|
textarea {
|
||||||
@ -244,15 +253,19 @@ mat-checkbox {
|
|||||||
.pi-chevron-left:after {
|
.pi-chevron-left:after {
|
||||||
content: '<';
|
content: '<';
|
||||||
}
|
}
|
||||||
|
|
||||||
.pi-chevron-right:after {
|
.pi-chevron-right:after {
|
||||||
content: '>';
|
content: '>';
|
||||||
}
|
}
|
||||||
|
|
||||||
.p-datepicker-month {
|
.p-datepicker-month {
|
||||||
margin-right: 1em;
|
margin-right: 1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.p-datepicker-weeknumber span {
|
.p-datepicker-weeknumber span {
|
||||||
border-right: 1px solid $legend_color;
|
border-right: 1px solid $legend_color;
|
||||||
}
|
}
|
||||||
|
|
||||||
.p-datepicker-today span {
|
.p-datepicker-today span {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
border: solid 1px $legend_color;
|
border: solid 1px $legend_color;
|
||||||
@ -262,6 +275,7 @@ mat-checkbox {
|
|||||||
padding: 1em;
|
padding: 1em;
|
||||||
width: 3.5em;
|
width: 3.5em;
|
||||||
transition: all ease 0.5s;
|
transition: all ease 0.5s;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background: mix($white, $legend_color);
|
background: mix($white, $legend_color);
|
||||||
color: $white;
|
color: $white;
|
||||||
|
Loading…
Reference in New Issue
Block a user