Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Framasoft
Framadate
funky-framadate-front
Commits
4a89b715
Commit
4a89b715
authored
Mar 27, 2021
by
Tykayn
Committed by
tykayn
Mar 27, 2021
Browse files
date selector as question answers
parent
21040df2
Pipeline
#401836
passed with stage
in 3 minutes and 55 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/app/features/administration/form/form.component.html
View file @
4a89b715
...
...
@@ -24,7 +24,7 @@
</p>
<app-kind-select
[form]=
"form"
></app-kind-select>
<!--
<app-base-config [form]="form"></app-base-config>
-->
<app-base-config
[form]=
"form"
></app-base-config>
<!-- <app-date-select-->
<!-- *ngIf="form.value.configuration && form.value.configuration.isAboutDate"-->
<!-- [form]="form"-->
...
...
src/app/features/administration/form/form.component.ts
View file @
4a89b715
...
...
@@ -70,6 +70,7 @@ export class FormComponent implements OnInit {
label
:
[
''
,
[
Validators
.
required
]],
}),
]),
kind
:
[
''
,
[
Validators
.
required
]],
configuration
:
this
.
fb
.
group
({
areResultsPublic
:
[
true
,
[
Validators
.
required
]],
whoCanChangeAnswers
:
[
'
everybody
'
,
[
Validators
.
required
]],
...
...
@@ -77,6 +78,7 @@ export class FormComponent implements OnInit {
isOwnerNotifiedByEmailOnNewVote
:
[
false
,
[
Validators
.
required
]],
isOwnerNotifiedByEmailOnNewComment
:
[
false
,
[
Validators
.
required
]],
isMaybeAnswerAvailable
:
[
false
,
[
Validators
.
required
]],
isAboutDate
:
[
true
,
[
Validators
.
required
]],
isZeroKnoledge
:
[
false
,
[
Validators
.
required
]],
expiresDaysDelay
:
[
60
,
[
Validators
.
required
,
Validators
.
min
(
1
)]],
...
...
@@ -110,6 +112,8 @@ export class FormComponent implements OnInit {
creatorEmail
:
'
chucknorris@example.com
'
,
isAboutDate
:
true
,
// hasSeveralHours: true,
kind
:
'
date
'
,
// TODO aplatir les contrôles
configuration
:
{
whoCanChangeAnswers
:
'
everybody
'
,
isProtectedByPassword
:
false
,
...
...
src/app/features/administration/form/kind-select/kind-select.component.html
View file @
4a89b715
<div
class=
"kind-select form-field"
>
<div
class=
"kind-of-poll columns"
>
<div
class=
"column"
*ngIf=
"template_questions_answers"
>
<!-- version maquette questions réponses-->
{{ 'creation.want' | translate }}
<select
name=
"type"
id=
"type"
class=
"input"
>
<option
value=
"classic"
>
{{ 'creation.kind.classic' | translate }}
</option>
<option
value=
"date"
>
{{ 'creation.kind.date' | translate }}
</option>
</select>
{{ 'creation.choose_title' | translate }}
<input
type=
"text"
name=
"title"
class=
"input"
/>
<form
[formGroup]=
"form"
>
<div
class=
"kind-of-poll columns"
>
<div
class=
"column"
*ngIf=
"template_questions_answers"
>
<!-- version maquette questions réponses-->
<select
name=
"type"
id=
"type"
class=
"input"
formControlName=
"kind"
>
<option
[value]=
"'date'"
>
{{ 'creation.kind.date' | translate }}
</option>
<option
[value]=
"'classic'"
>
{{ 'creation.kind.classic' | translate }}
</option>
</select>
</div>
<!-- version avec un choix de bouton-->
<div
class=
"columns"
*ngIf=
"!template_questions_answers"
>
<div
class=
"column"
>
<button
class=
"btn-block btn"
[ngClass]=
"{ 'is-primary': form.value.configuration.isAboutDate }"
(click)=
"
form.patchValue({
configuration: {
isAboutDate: true
}
})
"
>
<i
class=
"fa fa-calendar"
></i>
{{ 'creation.kind.date' | translate }}
</button>
</div>
<div
class=
"column"
>
<button
class=
"btn-block btn btn-default"
[ngClass]=
"{ 'is-primary': !form.value.configuration.isAboutDate }"
(click)=
"
form.patchValue({
configuration: {
isAboutDate: false
}
})
"
>
<i
class=
"fa fa-stats"
></i>
{{ 'creation.kind.classic' | translate }}
</button>
</div>
</div>
</div>
<!-- version avec un choix de bouton-->
<div
class=
"column"
*ngIf=
"!template_questions_answers"
>
<button
class=
"btn-block btn"
[ngClass]=
"{ 'is-primary': form.value.configuration.isAboutDate }"
(click)=
"
form.patchValue({
configuration: {
isAboutDate: true
}
})
"
>
<i
class=
"fa fa-calendar"
></i>
{{ 'creation.kind.date' | translate }}
</button>
</div>
<div
class=
"column"
>
<button
class=
"btn-block btn btn-default"
[ngClass]=
"{ 'is-primary': !form.value.configuration.isAboutDate }"
(click)=
"
form.patchValue({
configuration: {
isAboutDate: false
}
})
"
>
<i
class=
"fa fa-stats"
></i>
{{ 'creation.kind.classic' | translate }}
</button>
</div>
</div>
</form>
</div>
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment