From c4651332a2ef97d2dc5d4a1388e9b5fbefe5fda3 Mon Sep 17 00:00:00 2001 From: leigh-mil Date: Wed, 24 Jul 2019 10:36:00 -0400 Subject: [PATCH] Move clin fields into macro --- templates/task_orders/step_3.html | 475 +++++++++++++++--------------- 1 file changed, 232 insertions(+), 243 deletions(-) diff --git a/templates/task_orders/step_3.html b/templates/task_orders/step_3.html index 433ae7a5..bfb29b54 100644 --- a/templates/task_orders/step_3.html +++ b/templates/task_orders/step_3.html @@ -50,20 +50,80 @@ {% endmacro %} -{% macro CLINFields(fields, index) %} +{% macro CLINFields(fields=None, index=None) %}
- {{ OptionsInput(fields.jedi_clin_type, watch=True) }} + {% if fields %} + {{ OptionsInput(fields.jedi_clin_type, watch=True) }} + {% else %} + +
+
+ +
+ {{ 'task_orders.form.clin_type_label' | translate }} +
+
+ +
+
+
+ {% endif %}
- {{ TextInput(fields.number, watch=True) }} + {% if fields %} + {{ TextInput(fields.number, watch=True) }} + {% else %} + +
+ + + + + + + + + +
+
+ {% endif %}
@@ -82,253 +142,182 @@
- {{ DatePicker(fields.start_date, watch=True, optional=False) }} - {{ DatePicker(fields.end_date, watch=True, optional=False) }} - {{ TextInput(fields.obligated_amount, validation='dollars', watch=True) }} + {% if fields %} + {{ DatePicker(fields.start_date, watch=True, optional=False) }} + {{ DatePicker(fields.end_date, watch=True, optional=False) }} + {{ TextInput(fields.obligated_amount, validation='dollars', watch=True) }} + {% else %} + +
+ +
+ {{ 'task_orders.form.pop_start' | translate }} +
+
+ +
+ + +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ {{ Icon("ok", classes="icon--green") }} +
+
+
+
+ + +
+ +
+ {{ 'task_orders.form.pop_end' | translate }} +
+
+ +
+ + +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ {{ Icon("ok", classes="icon--green") }} +
+
+
+
+ + +
+ + + + + + + + + +
+
+ {% endif %}
{% endmacro %} {% block to_builder_form_field %} - -
- {{ TOFormStepHeader('task_orders.form.base_clin_title' | translate, 'task_orders.form.base_clin_description' | translate, task_order.number) }} +
+ {{ TOFormStepHeader('task_orders.form.base_clin_title' | translate, 'task_orders.form.base_clin_description' | translate, task_order.number) }} - {% for clin in form.clins %} - {{ CLINFields(clin, index=loop.index - 1) }} - {% endfor %} + {% for clin in form.clins %} + {{ CLINFields(clin, index=loop.index - 1) }} + {% endfor %} -
- -
-
-
- -
-
- -
- {{ 'task_orders.form.clin_type_label' | translate }} -
-
- -
-
-
-
-
- -
- - - - - - - - - -
-
-
-
- -
-
- -
- {{ 'task_orders.form.loa_label' | translate }} -
-
- {{ LOAInput() }} -
-
- - -
- -
- {{ 'task_orders.form.pop_start' | translate }} -
-
- -
- - -
- - -
- -
- - -
- -
- - -
- -
- {{ Icon("ok", classes="icon--green") }} -
-
-
-
- - -
- -
- {{ 'task_orders.form.pop_end' | translate }} -
-
- -
- - -
- - -
- -
- - -
- -
- - -
- -
- {{ Icon("ok", classes="icon--green") }} -
-
-
-
- - -
- - - - - - - - - -
-
-
-
+
+ {{ CLINFields() }}