mirror of
https://framagit.org/framasoft/framadate/funky-framadate-front.git
synced 2023-08-25 13:53:14 +02:00
move buttons
This commit is contained in:
parent
1d9e6066e0
commit
6e61e49235
@ -90,20 +90,4 @@
|
||||
|
||||
<hr />
|
||||
</div>
|
||||
Url personnalisée:
|
||||
{{ form.value.custom_url }}
|
||||
<hr />
|
||||
<div class="column">
|
||||
<button class="btn btn--warning" (click)="askInitFormDefault()">
|
||||
<i class="fa fa-refresh"></i>
|
||||
Tout réinitialiser
|
||||
</button>
|
||||
<br />
|
||||
|
||||
<br />
|
||||
<button class="btn is-default" (click)="automaticSlug()">
|
||||
<i class="fa fa-refresh"></i>
|
||||
Slug automatique
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
|
@ -33,28 +33,12 @@ export class BaseConfigComponent {
|
||||
@Inject(DOCUMENT) private document: Document
|
||||
) {}
|
||||
|
||||
askInitFormDefault(): void {
|
||||
this.toastService.display('formulaire réinitialisé', 'info');
|
||||
}
|
||||
|
||||
public updateSlug(): void {
|
||||
const newValueFormatted = this.pollService.convertTextToSlug(this.form.value.title);
|
||||
console.log('newValueFormatted', newValueFormatted);
|
||||
this.form.patchValue({ custom_url: newValueFormatted });
|
||||
}
|
||||
|
||||
/**
|
||||
* set the poll custom_url from other data of the poll
|
||||
*/
|
||||
automaticSlug(): void {
|
||||
this.form.patchValue({
|
||||
custom_url:
|
||||
this.pollService.convertTextToSlug(this.form.value.title) +
|
||||
'_' +
|
||||
this.utilitiesService.makeUuid().substr(0, 12),
|
||||
});
|
||||
}
|
||||
|
||||
getErrorMessage(fieldControl) {
|
||||
return fieldControl.hasError('required')
|
||||
? 'You must enter a value'
|
||||
|
@ -91,7 +91,13 @@
|
||||
|
||||
<hr />
|
||||
<div class="main-box is-boxed">
|
||||
liste de jours :
|
||||
<h2>Dates</h2>
|
||||
<button class="btn button-help" mat-raised-button (click)="openSimple()">
|
||||
💁 Raccourcis
|
||||
</button>
|
||||
<app-shortcuts-help *ngIf="display"></app-shortcuts-help>
|
||||
<br />
|
||||
<br />
|
||||
<app-day-list
|
||||
[form]="form"
|
||||
[dateChoices]="dateChoices"
|
||||
|
@ -23,13 +23,6 @@
|
||||
(cdkDropListDropped)="dropDayItem($event)"
|
||||
>
|
||||
<div class="column">
|
||||
<h2>Dates</h2>
|
||||
<button class="btn button-help" mat-raised-button (click)="openSimple()">
|
||||
💁 Raccourcis
|
||||
</button>
|
||||
<app-shortcuts-help *ngIf="display"></app-shortcuts-help>
|
||||
<br />
|
||||
<br />
|
||||
<div
|
||||
*ngFor="let choice of dateChoices; index as id"
|
||||
class="date-choice padded"
|
||||
|
@ -12,6 +12,14 @@
|
||||
<i class="fa fa-save"></i>
|
||||
Enregistrer le sondage (sans vérifier)
|
||||
</button>
|
||||
<button class="btn btn--warning" (click)="askInitFormDefault()">
|
||||
<i class="fa fa-refresh"></i>
|
||||
Tout réinitialiser
|
||||
</button>
|
||||
<button class="btn is-default" (click)="automaticSlug()">
|
||||
<i class="fa fa-refresh"></i>
|
||||
Slug automatique
|
||||
</button>
|
||||
<main class="columns">
|
||||
<div class="column">
|
||||
<label class="label is-medium" for="kind">
|
||||
|
@ -39,6 +39,7 @@ export class FormComponent implements OnInit, AfterViewInit {
|
||||
public apiService: ApiService,
|
||||
public dateUtils: DateUtilitiesService,
|
||||
private router: Router,
|
||||
private utilitiesService: PollUtilitiesService,
|
||||
@Inject(DOCUMENT) private document: any
|
||||
) {}
|
||||
|
||||
@ -141,10 +142,9 @@ export class FormComponent implements OnInit, AfterViewInit {
|
||||
* add example values to the form, overrides defaults of PollConfiguration
|
||||
*/
|
||||
setDemoValues(): void {
|
||||
const title = 'le titre de démo oh oh ' + new Date().getTime();
|
||||
const title = 'le titre de démo __ ' + new Date().getTime();
|
||||
|
||||
// this.form.patchValue(this.pollService.poll);
|
||||
// this.form.patchValue({ creatorPseudo: 'Chuck Norris', creatorEmail: 'chucknorris@example.com' });
|
||||
this.form.patchValue({ creatorPseudo: 'Chuck Norris', creatorEmail: 'chucknorris@example.com' });
|
||||
|
||||
const dateStart = this.dateUtils.formateDateToInputStringNg(new Date());
|
||||
const dateEnd = this.dateUtils.formateDateToInputStringNg(this.dateUtils.addDaysToDate(5, new Date()));
|
||||
@ -158,6 +158,22 @@ export class FormComponent implements OnInit, AfterViewInit {
|
||||
});
|
||||
}
|
||||
|
||||
askInitFormDefault(): void {
|
||||
this.toastService.display('formulaire réinitialisé', 'info');
|
||||
}
|
||||
|
||||
/**
|
||||
* set the poll custom_url from other data of the poll
|
||||
*/
|
||||
automaticSlug(): void {
|
||||
this.form.patchValue({
|
||||
custom_url:
|
||||
this.pollService.convertTextToSlug(this.form.value.title) +
|
||||
'_' +
|
||||
this.utilitiesService.makeUuid().substr(0, 12),
|
||||
});
|
||||
}
|
||||
|
||||
goPreviousStep() {
|
||||
alert('todo');
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user