WIP
This commit is contained in:
parent
529ec532dc
commit
4085c42c1c
@ -1,4 +1,4 @@
|
|||||||
from wtforms.fields import StringField, RadioField
|
from wtforms.fields import StringField, BooleanField
|
||||||
from wtforms.fields.html5 import EmailField
|
from wtforms.fields.html5 import EmailField
|
||||||
from wtforms.validators import Required, Email, Length, Optional
|
from wtforms.validators import Required, Email, Length, Optional
|
||||||
from .forms import ValidatedForm
|
from .forms import ValidatedForm
|
||||||
@ -19,11 +19,10 @@ class POCForm(ValidatedForm):
|
|||||||
return super().validate(*args, **kwargs)
|
return super().validate(*args, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
am_poc = RadioField(
|
am_poc = BooleanField(
|
||||||
"I am the technical POC.",
|
"I am the technical POC.",
|
||||||
choices=[("yes", "Yes"), ("no", "No")],
|
|
||||||
default="no",
|
|
||||||
validators=[Required()],
|
validators=[Required()],
|
||||||
|
default=False
|
||||||
)
|
)
|
||||||
|
|
||||||
fname_poc = StringField("POC First Name", validators=[Required()])
|
fname_poc = StringField("POC First Name", validators=[Required()])
|
||||||
|
37
templates/components/checkbox_input.html
Normal file
37
templates/components/checkbox_input.html
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
{% from "components/icon.html" import Icon %}
|
||||||
|
{% from "components/tooltip.html" import Tooltip %}
|
||||||
|
|
||||||
|
{% macro OptionsInput(field, tooltip, inline=False) -%}
|
||||||
|
<optionsinput name='{{ field.name }}' inline-template key='{{ field.name }}'>
|
||||||
|
<div class='usa-input {% if field.errors %}usa-input--error{% endif %}'>
|
||||||
|
|
||||||
|
<fieldset v-on:change="onInput" class="usa-input__choices {% if inline %}usa-input__choices--inline{% endif %}">
|
||||||
|
<legend>
|
||||||
|
<div class="usa-input__title">
|
||||||
|
{{ field.label | striptags}}
|
||||||
|
{% if tooltip %}{{ Tooltip(tooltip) }}{% endif %}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% if field.description %}
|
||||||
|
<span class='usa-input__help'>{{ field.description | safe }}</span>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if field.errors %}
|
||||||
|
{{ Icon('alert',classes="icon-validation") }}
|
||||||
|
{% endif %}
|
||||||
|
</legend>
|
||||||
|
|
||||||
|
{{ field() }}
|
||||||
|
|
||||||
|
{% if field.errors %}
|
||||||
|
{% for error in field.errors %}
|
||||||
|
<span class='usa-input__message'>{{ error }}</span>
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
</fieldset>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</optionsinput>
|
||||||
|
|
||||||
|
{%- endmacro %}
|
@ -31,7 +31,8 @@
|
|||||||
<em>This POC may be you.</em>
|
<em>This POC may be you.</em>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
{{ OptionsInput(f.am_poc) }}
|
{{ f.am_poc() }}
|
||||||
|
{{ f.am_poc.label }}
|
||||||
|
|
||||||
<template v-if="!amPOC" v-cloak>
|
<template v-if="!amPOC" v-cloak>
|
||||||
{{ TextInput(f.fname_poc,placeholder='First Name') }}
|
{{ TextInput(f.fname_poc,placeholder='First Name') }}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user