Optional radio fields
This commit is contained in:
parent
4c0092a7c7
commit
305a36eef2
@ -16,6 +16,7 @@ class TaskOrderError(Exception):
|
|||||||
class TaskOrders(object):
|
class TaskOrders(object):
|
||||||
SECTIONS = {
|
SECTIONS = {
|
||||||
"app_info": [
|
"app_info": [
|
||||||
|
"portfolio_name",
|
||||||
"scope",
|
"scope",
|
||||||
"defense_component",
|
"defense_component",
|
||||||
"app_migration",
|
"app_migration",
|
||||||
|
@ -51,6 +51,7 @@ class AppInfoForm(CacheableForm):
|
|||||||
translate("forms.task_order.native_apps.label"),
|
translate("forms.task_order.native_apps.label"),
|
||||||
description=translate("forms.task_order.native_apps.description"),
|
description=translate("forms.task_order.native_apps.description"),
|
||||||
choices=[("yes", "Yes"), ("no", "No"), ("not_sure", "Not Sure")],
|
choices=[("yes", "Yes"), ("no", "No"), ("not_sure", "Not Sure")],
|
||||||
|
default="",
|
||||||
validators=[Optional()],
|
validators=[Optional()],
|
||||||
)
|
)
|
||||||
complexity = SelectMultipleField(
|
complexity = SelectMultipleField(
|
||||||
|
@ -67,8 +67,13 @@
|
|||||||
<h3 class="subheading">{{ "task_orders.new.review.reporting"| translate }} {{ TOEditLink(screen=1, anchor="reporting") }}</h3>
|
<h3 class="subheading">{{ "task_orders.new.review.reporting"| translate }} {{ TOEditLink(screen=1, anchor="reporting") }}</h3>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
{{ ReviewField(("forms.task_order.app_migration.label" | translate), ("forms.task_order.app_migration.{}".format(task_order.app_migration) | translate), filter="removeHtml") }}
|
{% if task_order.app_migration %}
|
||||||
{{ ReviewField(("forms.task_order.native_apps.label" | translate), ("forms.task_order.native_apps.{}".format(task_order.native_apps))| translate) }}
|
{{ ReviewField(("forms.task_order.app_migration.label" | translate), ("forms.task_order.app_migration.{}".format(task_order.app_migration) | translate), filter="removeHtml") }}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if task_order.native_apps %}
|
||||||
|
{{ ReviewField(("forms.task_order.native_apps.label" | translate), ("forms.task_order.native_apps.{}".format(task_order.native_apps))| translate) }}
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h4 class='task-order-form__heading'>{{ "task_orders.new.review.complexity"| translate }}</h4>
|
<h4 class='task-order-form__heading'>{{ "task_orders.new.review.complexity"| translate }}</h4>
|
||||||
@ -104,7 +109,9 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{ ReviewField(("forms.task_order.team_experience.label" |translate), ("forms.task_order.team_experience.{}".format(task_order.team_experience)) | translate) }}
|
{% if task_order.team_experience %}
|
||||||
|
{{ ReviewField(("forms.task_order.team_experience.label" |translate), ("forms.task_order.team_experience.{}".format(task_order.team_experience)) | translate) }}
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
|
@ -16,6 +16,7 @@ def test_section_completion_status():
|
|||||||
dict_keys = [k for k in TaskOrders.SECTIONS.keys()]
|
dict_keys = [k for k in TaskOrders.SECTIONS.keys()]
|
||||||
section = dict_keys[0]
|
section = dict_keys[0]
|
||||||
attrs = TaskOrders.SECTIONS[section].copy()
|
attrs = TaskOrders.SECTIONS[section].copy()
|
||||||
|
attrs.remove("portfolio_name")
|
||||||
task_order = TaskOrderFactory.create(**{k: None for k in attrs})
|
task_order = TaskOrderFactory.create(**{k: None for k in attrs})
|
||||||
leftover = attrs.pop()
|
leftover = attrs.pop()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user