From 72da5f36c361ee60a06ed969ad99ced7f6feb697 Mon Sep 17 00:00:00 2001 From: leigh-mil Date: Tue, 16 Jul 2019 16:50:28 -0400 Subject: [PATCH] Move common to review html into a fragment and delete unused submit confirmation macro and vue component --- js/components/submit_confirmation.js | 28 ----- js/index.js | 2 - templates/components/submit_confirmation.html | 38 ------- templates/fragments/task_order_review.html | 85 ++++++++++++++ templates/portfolios/task_orders/review.html | 107 +----------------- templates/task_orders/step_4.html | 86 +------------- 6 files changed, 90 insertions(+), 256 deletions(-) delete mode 100644 js/components/submit_confirmation.js delete mode 100644 templates/components/submit_confirmation.html create mode 100644 templates/fragments/task_order_review.html diff --git a/js/components/submit_confirmation.js b/js/components/submit_confirmation.js deleted file mode 100644 index c6836bb8..00000000 --- a/js/components/submit_confirmation.js +++ /dev/null @@ -1,28 +0,0 @@ -import checkboxinput from './checkbox_input' - -export default { - name: 'submit-confirmation', - - components: { - checkboxinput, - }, - - data: function() { - return { - valid: false, - checked: false, - } - }, - - methods: { - toggleValid: function() { - this.valid = !this.valid - }, - - handleClose: function() { - this.$root.closeModal(this.name) - this.checked = false - this.valid = false - }, - }, -} diff --git a/js/index.js b/js/index.js index 6472d5b5..5ea9ed13 100644 --- a/js/index.js +++ b/js/index.js @@ -35,7 +35,6 @@ import { isNotInVerticalViewport } from './lib/viewport' import DateSelector from './components/date_selector' import SidenavToggler from './components/sidenav_toggler' import BaseForm from './components/forms/base_form' -import SubmitConfirmation from './components/submit_confirmation' import DeleteConfirmation from './components/delete_confirmation' import NewEnvironment from './components/forms/new_environment' import EnvironmentRole from './components/environment_role' @@ -79,7 +78,6 @@ const app = new Vue({ SidenavToggler, BaseForm, DeleteConfirmation, - SubmitConfirmation, nestedcheckboxinput, NewEnvironment, EnvironmentRole, diff --git a/templates/components/submit_confirmation.html b/templates/components/submit_confirmation.html deleted file mode 100644 index 37295823..00000000 --- a/templates/components/submit_confirmation.html +++ /dev/null @@ -1,38 +0,0 @@ -{% from "components/alert.html" import Alert %} -{% from "components/checkbox_input.html" import CheckboxInput %} - -{% macro SubmitConfirmation(modal_id, submit_text, submit_action, form, task_order) %} - -
-
- -
-
-
- - {{ form.signature(**{"v-model": "checked"}) }} - {{ form.signature.label | safe }} - -
-
-
-
-
-
- {{ form.csrf_token }} - -
- -
-
-
-{% endmacro %} diff --git a/templates/fragments/task_order_review.html b/templates/fragments/task_order_review.html new file mode 100644 index 00000000..c15935d2 --- /dev/null +++ b/templates/fragments/task_order_review.html @@ -0,0 +1,85 @@ +{% from "components/icon.html" import Icon %} +{% from "components/semi_collapsible_text.html" import SemiCollapsibleText %} +{% from "components/totals_box.html" import TotalsBox %} + + +
+ {{ SemiCollapsibleText() }} + +
+ +
+ {{ "task_orders.review.review_your_task_order" | translate }} +
+

+ {{ "task_orders.review.check_paragraph" | translate }} +

+
+
+
+ {{ "task_orders.review.task_order_number" | translate }} +
+
{{task_order.number}}
+ +
+ +
+ {{ "task_orders.review.funding_summary" | translate }} +
+ + {% for clin in task_order.clins %} +
+ {{ "{}".format(clin.jedi_clin_type) | translate}} +
+ + + + + + + + + + + + + + + + + + + + +
{{ "task_orders.review.clins.amount" | translate }}{{ "task_orders.review.clins.obligated" | translate }}{{ "task_orders.review.clins.pop_start" | translate }}{{ "task_orders.review.clins.pop_end" | translate }}{{ "task_orders.review.clins.loa" | translate }}
{{ clin.obligated_amount | dollars }} + {% if clin.is_obligated() %} + {{ "common.yes" | translate }} + {% else %} + {{ "common.no" | translate }} + {% endif %} + {{ clin.start_date | formattedDate }}{{ clin.end_date | formattedDate }} + {% for loa in clin.loas %} + + {{ loa }} + +
+ {% endfor %} +
+ {% endfor %} + +
+ +
+ {{ "task_orders.review.supporting_document.title" | translate }} +
+ +
+ {{ TotalsBox(task_order=task_order) }} + +
+
diff --git a/templates/portfolios/task_orders/review.html b/templates/portfolios/task_orders/review.html index c1a7a0e5..55e6af75 100644 --- a/templates/portfolios/task_orders/review.html +++ b/templates/portfolios/task_orders/review.html @@ -1,111 +1,12 @@ -{% from "components/icon.html" import Icon %} -{% from "components/modal.html" import Modal %} -{% from "components/semi_collapsible_text.html" import SemiCollapsibleText %} {% from "components/sticky_cta.html" import StickyCTA %} -{% from "components/submit_confirmation.html" import SubmitConfirmation %} -{% from "components/totals_box.html" import TotalsBox %} {% extends 'portfolios/base.html' %} {% block portfolio_content %} - {% set submit_modal_id = "submit-to-1" %} - {% call Modal(name=submit_modal_id) %} - {{ - SubmitConfirmation( - modal_id=submit_modal_id, - submit_text="Confirm & Submit", - submit_action=url_for('task_orders.submit_task_order', task_order_id=task_order.id), - form=signature_form, - task_order=task_order, - ) - }} + + {% call StickyCTA(text="Task order details") %} + Edit {% endcall %} - {% call StickyCTA(text="Review Funding") %} - Edit - Submit task order - {% endcall %} - -
- - {{ SemiCollapsibleText() }} - -
- -
- {{ "task_orders.review.review_your_task_order" | translate }} -
-

- {{ "task_orders.review.check_paragraph" | translate }} -

-
-
-
- {{ "task_orders.review.task_order_number" | translate }} -
-
{{task_order.number}}
- -
- -
- {{ "task_orders.review.funding_summary" | translate }} -
- - {% for clin in task_order.clins %} -
- {{ "{}".format(clin.jedi_clin_type) | translate}} -
- - - - - - - - - - - - - - - - - - - - -
{{ "task_orders.review.clins.amount" | translate }}{{ "task_orders.review.clins.obligated" | translate }}{{ "task_orders.review.clins.pop_start" | translate }}{{ "task_orders.review.clins.pop_end" | translate }}{{ "task_orders.review.clins.loa" | translate }}
{{ clin.obligated_amount | dollars }} - {% if clin.is_obligated() %} - {{ "common.yes" | translate }} - {% else %} - {{ "common.no" | translate }} - {% endif %} - {{ clin.start_date | formattedDate }}{{ clin.end_date | formattedDate }} - {% for loa in clin.loas %} - - {{ loa }} - -
- {% endfor %} -
- {% endfor %} - -
- -
- {{ "task_orders.review.supporting_document.title" | translate }} -
- -
- {{ TotalsBox(task_order=task_order) }} - -
- -
+ {% include "fragments/task_order_review.html" %} {% endblock %} diff --git a/templates/task_orders/step_4.html b/templates/task_orders/step_4.html index 9acc87c6..65d1d2d7 100644 --- a/templates/task_orders/step_4.html +++ b/templates/task_orders/step_4.html @@ -1,9 +1,5 @@ {% extends "task_orders/builder_base.html" %} -{% from "components/icon.html" import Icon %} -{% from "components/semi_collapsible_text.html" import SemiCollapsibleText %} -{% from "components/totals_box.html" import TotalsBox %} - {% set action = url_for('task_orders.confirm_signature', task_order_id=task_order_id) %} {% set previous_button_link = url_for("task_orders.add_clins", task_order_id=task_order_id) %} @@ -16,85 +12,5 @@ {% endblock %} {% block to_builder_form_field %} -
- - {{ SemiCollapsibleText() }} - -
- -
- {{ "task_orders.review.review_your_task_order" | translate }} -
-

- {{ "task_orders.review.check_paragraph" | translate }} -

-
-
-
- {{ "task_orders.review.task_order_number" | translate }} -
-
{{task_order.number}}
- -
- -
- {{ "task_orders.review.funding_summary" | translate }} -
- - {% for clin in task_order.clins %} -
- {{ "{}".format(clin.jedi_clin_type) | translate}} -
- - - - - - - - - - - - - - - - - - - - -
{{ "task_orders.review.clins.amount" | translate }}{{ "task_orders.review.clins.obligated" | translate }}{{ "task_orders.review.clins.pop_start" | translate }}{{ "task_orders.review.clins.pop_end" | translate }}{{ "task_orders.review.clins.loa" | translate }}
{{ clin.obligated_amount | dollars }} - {% if clin.is_obligated() %} - {{ "common.yes" | translate }} - {% else %} - {{ "common.no" | translate }} - {% endif %} - {{ clin.start_date | formattedDate }}{{ clin.end_date | formattedDate }} - {% for loa in clin.loas %} - - {{ loa }} - -
- {% endfor %} -
- {% endfor %} - -
- -
- {{ "task_orders.review.supporting_document.title" | translate }} -
- -
- {{ TotalsBox(task_order=task_order) }} - -
-
+ {% include "fragments/task_order_review.html" %} {% endblock %}