From 8133698c8b0303a983a6b06fc1a55a1e329ba8c1 Mon Sep 17 00:00:00 2001 From: Adarsh Murthy Date: Wed, 10 May 2017 11:48:19 -0400 Subject: [PATCH] Fix loan options UI. Display message to select fund if fund not already selected. Display table and all buttons only once fund is selected. --- .../static/financialInputs/scripts/app.js | 21 +++++++++++++++++-- .../financialInputs/loanOptions.html | 9 ++++++-- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/blocnote/apps/financialInputs/static/financialInputs/scripts/app.js b/blocnote/apps/financialInputs/static/financialInputs/scripts/app.js index 964c36c..a2b42fe 100644 --- a/blocnote/apps/financialInputs/static/financialInputs/scripts/app.js +++ b/blocnote/apps/financialInputs/static/financialInputs/scripts/app.js @@ -1324,6 +1324,13 @@ function getLoanOptionsTable() { }, }).then(res => { if (res.payload.load) { + document.querySelector('#no-fund-msg').innerHTML = ''; + document.querySelector('#save-loan-options').innerHTML = ` + + `; + document.querySelector('#add-loan-options-row').innerHTML = ` + + `; loadLoanOptionsColumnHeadings(); if (res.payload.status.length > 0) { var lenders = res.payload.lenders; @@ -1332,13 +1339,23 @@ function getLoanOptionsTable() { loadLoanOptionsTextBox('Required NOI DSCR', 'required-noi-dscr', res.payload.noi); loadLoanOptionsTextBox('Required Cash DSCR', 'required-cash-dscr', res.payload.cash); for (var index = 0; index < LoansList.length; index++) { - addLoanOptionsRow(lenders,LoansList[index].lender,LoansList[index].interest_rate,LoansList[index].duration,LoansList[index].max_loan_amount); + addLoanOptionsRow(lenders, + LoansList[index].lender, + LoansList[index].interest_rate, + LoansList[index].duration, + LoansList[index].max_loan_amount + ); } } else { loadLoanOptionsTextBox('Required NOI DSCR', 'required-noi-dscr', ''); loadLoanOptionsTextBox('Required Cash DSCR', 'required-cash-dscr', ''); - addLoanOptionsRow(lenders,LoansList[0].lender,LoansList[0].interest_rate,LoansList[0].duration,LoansList[0].max_loan_amount); + addLoanOptionsRow(lenders, + LoansList[0].lender, + LoansList[0].interest_rate, + LoansList[0].duration, + LoansList[0].max_loan_amount + ); } } } diff --git a/blocnote/apps/financialInputs/templates/financialInputs/loanOptions.html b/blocnote/apps/financialInputs/templates/financialInputs/loanOptions.html index 08bddcc..034b398 100644 --- a/blocnote/apps/financialInputs/templates/financialInputs/loanOptions.html +++ b/blocnote/apps/financialInputs/templates/financialInputs/loanOptions.html @@ -2,6 +2,9 @@

Loan Options

+
+ Please select a Fund to see loan options. +
@@ -16,14 +19,16 @@
- +
+
- +
+
-- GitLab