Use new checkboxinput for POC checkbox

This commit is contained in:
richard-dds
2018-08-14 20:47:36 -04:00
parent 4085c42c1c
commit 932922cfe6
7 changed files with 32 additions and 37 deletions

View File

@@ -1,37 +1,18 @@
{% 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 }}'>
{% macro CheckboxInput(field, inline=False) -%}
<checkboxinput 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>
{{ field() }}
{{ field.label }}
{% 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>
</checkboxinput>
{%- endmacro %}

View File

@@ -2,7 +2,7 @@
{% from "components/alert.html" import Alert %}
{% from "components/text_input.html" import TextInput %}
{% from "components/options_input.html" import OptionsInput %}
{% from "components/checkbox_input.html" import CheckboxInput %}
{% block subtitle %}
<h2>Designate a Workspace Owner</h2>
@@ -31,10 +31,9 @@
<em>This POC may be you.</em>
</p>
{{ f.am_poc() }}
{{ f.am_poc.label }}
{{ CheckboxInput(f.am_poc) }}
<template v-if="!amPOC" v-cloak>
<template v-if="!am_poc" v-cloak>
{{ TextInput(f.fname_poc,placeholder='First Name') }}
{{ TextInput(f.lname_poc,placeholder='Last Name') }}
{{ TextInput(f.email_poc,placeholder='jane@mail.mil', validation='email') }}