Merge pull request #159 from dod-ccpo/details-of-use-form

Details of use form
This commit is contained in:
patricksmithdds
2018-08-13 15:11:19 -04:00
committed by GitHub
9 changed files with 272 additions and 46 deletions

View File

@@ -1,32 +1,33 @@
{% from "components/icon.html" import Icon %}
{% macro OptionsInput(field, inline=False) -%}
<div class='usa-input {% if field.errors %}usa-input--error{% endif %}'>
<optionsinput name='{{ field.name }}' inline-template key='{{ field.name }}'>
<div class='usa-input {% if field.errors %}usa-input--error{% endif %}'>
<fieldset class="usa-input__choices {% if inline %}usa-input__choices--inline{% endif %}">
<legend>
{{ field.label | striptags}}
<fieldset v-on:change="onInput" class="usa-input__choices {% if inline %}usa-input__choices--inline{% endif %}">
<legend>
{{ field.label | striptags}}
{% if field.description %}
<span class='usa-input__help'>{{ field.description | safe }}</span>
{% endif %}
{% if field.description %}
<span class='usa-input__help'>{{ field.description | safe }}</span>
{% endif %}
{% if field.errors %}
{{ Icon('alert') }}
{% endif %}
</legend>
{{ field() }}
{% if field.errors %}
{{ Icon('alert') }}
{% for error in field.errors %}
<span class='usa-input__message'>{{ error }}</span>
{% endfor %}
{% endif %}
</legend>
{{ field() }}
{% if field.errors %}
{% for error in field.errors %}
<span class='usa-input__message'>{{ error }}</span>
{% endfor %}
{% endif %}
</fieldset>
</div>
</fieldset>
</div>
</optionsinput>
{%- endmacro %}

View File

@@ -6,6 +6,7 @@
validation='{{ validation }}'
{% if field.data %}initial-value='{{ field.data }}'{% endif %}
{% if field.errors %}v-bind:initial-errors='{{ field.errors }}'{% endif %}
key='{{ field.name }}'
inline-template>
<div

View File

@@ -17,32 +17,46 @@
) }}
{% endif %}
<details-of-use inline-template v-bind:initial-data='{{ f.data|tojson }}'>
<div>
<p>Wed like to know a little about how you plan to use JEDI Cloud services to process your request. Please answer the following questions to the best of your ability. Note that the CCPO does not directly help with migrating systems to JEDI Cloud. These questions are for learning about your cloud readiness and financial usage of the JEDI Cloud; your estimates will not be used for any department level reporting.</p>
<p><em>All fields are required, unless specified optional.</em></p>
<p>Wed like to know a little about how you plan to use JEDI Cloud services to process your request. Please answer the following questions to the best of your ability. Note that the CCPO does not directly help with migrating systems to JEDI Cloud. These questions are for learning about your cloud readiness and financial usage of the JEDI Cloud; your estimates will not be used for any department level reporting.</p>
<p><em>All fields are required, unless specified optional.</em></p>
<h2>General</h2>
{{ OptionsInput(f.dod_component) }}
{{ TextInput(f.jedi_usage, paragraph=True, placeholder="e.g. We are migrating XYZ application to the cloud so that...") }}
<h2>General</h2>
{{ OptionsInput(f.dod_component) }}
{{ TextInput(f.jedi_usage, paragraph=True, placeholder="e.g. We are migrating XYZ application to the cloud so that...") }}
<h2>Cloud Readiness</h2>
{{ TextInput(f.num_software_systems, validation='integer') }}
{{ OptionsInput(f.jedi_migration) }}
{{ OptionsInput(f.rationalization_software_systems) }}
{{ OptionsInput(f.technical_support_team) }}
{{ OptionsInput(f.organization_providing_assistance) }}
{{ OptionsInput(f.engineering_assessment) }}
{{ OptionsInput(f.data_transfers) }}
{{ OptionsInput(f.expected_completion_date) }}
{{ OptionsInput(f.cloud_native) }}
<h2>Cloud Readiness</h2>
{{ TextInput(f.num_software_systems, validation='integer') }}
{{ OptionsInput(f.jedi_migration) }}
<template v-if="jediMigrationOptionSelected">
<template v-if='isJediMigration' v-cloak>
{{ OptionsInput(f.rationalization_software_systems) }}
{{ OptionsInput(f.technical_support_team) }}
<template v-if="hasTechnicalSupportTeam">
{{ OptionsInput(f.organization_providing_assistance) }}
</template>
{{ OptionsInput(f.engineering_assessment) }}
{{ OptionsInput(f.data_transfers) }}
{{ OptionsInput(f.expected_completion_date) }}
</template>
<template v-else-if='!isJediMigration' v-cloak>
{{ OptionsInput(f.cloud_native) }}
</template>
</template>
<h2>Financial Usage</h2>
{{ TextInput(f.estimated_monthly_spend, validation='dollars') }}
<p>So this means you are spending approximately <b>$X</b> annually</p>
{{ TextInput(f.dollar_value, validation='dollars') }}
{{ TextInput(f.number_user_sessions, validation='integer') }}
{{ TextInput(f.average_daily_traffic, placeholder='Gigabytes per day', validation='gigabytes') }}
{{ TextInput(f.start_date, validation='date', placeholder='MM / DD / YYYY') }}
<h2>Financial Usage</h2>
{{ TextInput(f.estimated_monthly_spend, validation='dollars') }}
<p>So this means you are spending approximately <b>!{ annualSpendStr }</b> annually</p>
{{ TextInput(f.dollar_value, validation='dollars') }}
<template v-if="annualSpend > 1000000">
{{ TextInput(f.number_user_sessions, validation='integer') }}
{{ TextInput(f.average_daily_traffic, placeholder='Gigabytes per day', validation='gigabytes') }}
</template>
{{ TextInput(f.start_date, validation='date', placeholder='MM / DD / YYYY') }}
</div>
</details-of-use>
{% endblock %}