Merge pull request #1047 from dod-ccpo/optional-tag
Add optional label to inputs
This commit is contained in:
commit
7f4e200bc3
@ -86,7 +86,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
&__title {
|
&__title {
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
&-inline {
|
&-inline {
|
||||||
@ -378,8 +377,7 @@ select {
|
|||||||
margin-left: $gap * 4;
|
margin-left: $gap * 4;
|
||||||
|
|
||||||
.usa-input {
|
.usa-input {
|
||||||
input,
|
input {
|
||||||
label {
|
|
||||||
max-width: 12rem;
|
max-width: 12rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{% from "components/icon.html" import Icon %}
|
{% from "components/icon.html" import Icon %}
|
||||||
{% from "components/tooltip.html" import Tooltip %}
|
{% from "components/tooltip.html" import Tooltip %}
|
||||||
|
|
||||||
{% macro MultiCheckboxInput(field, other_input_field=None, tooltip=None, inline=False) -%}
|
{% macro MultiCheckboxInput(field, other_input_field=None, tooltip=None, inline=False, optional=True) -%}
|
||||||
<multicheckboxinput
|
<multicheckboxinput
|
||||||
v-cloak
|
v-cloak
|
||||||
name='{{ field.name }}'
|
name='{{ field.name }}'
|
||||||
@ -24,6 +24,9 @@
|
|||||||
<legend>
|
<legend>
|
||||||
<div class="usa-input__title">
|
<div class="usa-input__title">
|
||||||
{{ field.label | striptags }}
|
{{ field.label | striptags }}
|
||||||
|
{% if optional %}
|
||||||
|
<span class="usa-input-label-helper">(optional)</span>
|
||||||
|
{% endif %}
|
||||||
{% if tooltip %}{{ Tooltip(tooltip) }}{% endif %}
|
{% if tooltip %}{{ Tooltip(tooltip) }}{% endif %}
|
||||||
{% if not field.description %}
|
{% if not field.description %}
|
||||||
{{ validation_icons }}
|
{{ validation_icons }}
|
||||||
|
@ -28,6 +28,9 @@
|
|||||||
<legend>
|
<legend>
|
||||||
<div class="usa-input__title{% if not field.description %}-inline{% endif %}">
|
<div class="usa-input__title{% if not field.description %}-inline{% endif %}">
|
||||||
{{ field.label | striptags}}
|
{{ field.label | striptags}}
|
||||||
|
{% if optional %}
|
||||||
|
<span class="usa-input-label-helper">(optional)</span>
|
||||||
|
{% endif %}
|
||||||
{% if tooltip %}{{ Tooltip(tooltip) }}{% endif %}
|
{% if tooltip %}{{ Tooltip(tooltip) }}{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -40,6 +40,9 @@
|
|||||||
<label for={{field.name}}>
|
<label for={{field.name}}>
|
||||||
<div class="usa-input__title">
|
<div class="usa-input__title">
|
||||||
{{ label }}
|
{{ label }}
|
||||||
|
{% if optional %}
|
||||||
|
<span class="usa-input-label-helper">(optional)</span>
|
||||||
|
{% endif %}
|
||||||
{% if tooltip and not disabled %}
|
{% if tooltip and not disabled %}
|
||||||
{{ Tooltip(tooltip, tooltip_title) }}
|
{{ Tooltip(tooltip, tooltip_title) }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -22,9 +22,9 @@
|
|||||||
{{ TextInput(form.email, validation='email', optional=False) }}
|
{{ TextInput(form.email, validation='email', optional=False) }}
|
||||||
{{ PhoneInput(form.phone_number, form.phone_ext, phone_optional=False) }}
|
{{ PhoneInput(form.phone_number, form.phone_ext, phone_optional=False) }}
|
||||||
|
|
||||||
{{ OptionsInput(form.service_branch) }}
|
{{ OptionsInput(form.service_branch, optional=False) }}
|
||||||
{{ OptionsInput(form.citizenship) }}
|
{{ OptionsInput(form.citizenship, optional=False) }}
|
||||||
{{ OptionsInput(form.designation) }}
|
{{ OptionsInput(form.designation, optional=False) }}
|
||||||
|
|
||||||
|
|
||||||
<div class="usa-input">
|
<div class="usa-input">
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
{{ portfolio_form.csrf_token }}
|
{{ portfolio_form.csrf_token }}
|
||||||
<div class='form-row'>
|
<div class='form-row'>
|
||||||
<div class='form-col form-col--half'>
|
<div class='form-col form-col--half'>
|
||||||
{{ TextInput(portfolio_form.name, validation="portfolioName") }}
|
{{ TextInput(portfolio_form.name, validation="portfolioName", optional=False) }}
|
||||||
</div>
|
</div>
|
||||||
<div class='edit-portfolio-name action-group'>
|
<div class='edit-portfolio-name action-group'>
|
||||||
{{ SaveButton(text='Save', additional_classes='usa-button-big') }}
|
{{ SaveButton(text='Save', additional_classes='usa-button-big') }}
|
||||||
|
@ -25,8 +25,8 @@
|
|||||||
</p>
|
</p>
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<div class="form-col form-col--two-thirds">
|
<div class="form-col form-col--two-thirds">
|
||||||
{{ TextInput(application_form.name) }}
|
{{ TextInput(application_form.name, optional=False) }}
|
||||||
{{ TextInput(application_form.description, paragraph=True) }}
|
{{ TextInput(application_form.description, paragraph=True, optional=False) }}
|
||||||
</div>
|
</div>
|
||||||
<div class="form-col form-col--third">
|
<div class="form-col form-col--third">
|
||||||
{% if user_can(permissions.DELETE_APPLICATION) %}
|
{% if user_can(permissions.DELETE_APPLICATION) %}
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
<form id="portfolio-create" action="{{ url_for('portfolios.create_portfolio') }}" method="POST">
|
<form id="portfolio-create" action="{{ url_for('portfolios.create_portfolio') }}" method="POST">
|
||||||
{{ form.csrf_token }}
|
{{ form.csrf_token }}
|
||||||
|
|
||||||
{{ TextInput(form.name) }}
|
{{ TextInput(form.name, optional=False) }}
|
||||||
{{ OptionsInput(form.defense_component, optional=False) }}
|
{{ OptionsInput(form.defense_component, optional=False) }}
|
||||||
{{ TextInput(form.description, paragraph=True) }}
|
{{ TextInput(form.description, paragraph=True) }}
|
||||||
|
|
||||||
|
@ -143,7 +143,7 @@ forms:
|
|||||||
first_name_label: First name
|
first_name_label: First name
|
||||||
funding: Funding
|
funding: Funding
|
||||||
last_name_label: Last name
|
last_name_label: Last name
|
||||||
phone_number_label: Phone number (optional)
|
phone_number_label: Phone number
|
||||||
portfolio_mgmt: Portfolio management
|
portfolio_mgmt: Portfolio management
|
||||||
reporting: Reporting
|
reporting: Reporting
|
||||||
portfolio:
|
portfolio:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user