From c35da2d1240827546e27268e765defbeafc58a9f Mon Sep 17 00:00:00 2001 From: Adarsh Date: Thu, 6 Jul 2017 11:55:58 -0400 Subject: [PATCH 1/5] Update landing page view to return the building search results. --- blocnote/apps/landingPage/views.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/blocnote/apps/landingPage/views.py b/blocnote/apps/landingPage/views.py index 0e2608c..8a67462 100644 --- a/blocnote/apps/landingPage/views.py +++ b/blocnote/apps/landingPage/views.py @@ -2,12 +2,10 @@ from django.shortcuts import render from django.views import View -from blocnote.apps.financialInputs.models import FinancingOverview -from blocnote.apps.financialInputs.models import BillsOverview -from blocnote.apps.financialInputs.models import CustomerPreference -from blocnote.apps.financialInputs.models import CashBalance -from blocnote.apps.financialInputs.models import IncomeStatement -from blocnote.apps.financialInputs.models import LoanOptions +from blocnote.apps.financialInputs.models import ( + FinancingOverview, BillsOverview, CustomerPreference, CashBalance, IncomeStatement, LoanOptions +) +from blocnote.lib.fetch_data import get_building_data class Index(View): @@ -43,11 +41,13 @@ class Index(View): if_completed = False if len(not_saved_list) < len(self.models): if_started = True + building = get_building_data(building_id) context = { 'building_id': building_id, 'if_started': if_started, 'if_completed': if_completed, 'not_saved_list': not_saved_list, + 'building': building, } return render(request, 'landingPage/index.html', context=context) -- GitLab From 8e9e9ef3fedd84db50b8e87678e802791712d023 Mon Sep 17 00:00:00 2001 From: Adarsh Date: Thu, 6 Jul 2017 11:56:20 -0400 Subject: [PATCH 2/5] Update landing page frontend to display the buidling address. --- blocnote/apps/landingPage/templates/landingPage/index.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/blocnote/apps/landingPage/templates/landingPage/index.html b/blocnote/apps/landingPage/templates/landingPage/index.html index a089268..7eb738c 100644 --- a/blocnote/apps/landingPage/templates/landingPage/index.html +++ b/blocnote/apps/landingPage/templates/landingPage/index.html @@ -5,6 +5,9 @@

BLOCNOTE

+
+ {{ building.street_address }} +
-- GitLab From 5b4b8ca296545c80bc7feb6eeda7e6ac72d35edf Mon Sep 17 00:00:00 2001 From: Adarsh Date: Thu, 6 Jul 2017 12:02:03 -0400 Subject: [PATCH 3/5] Update budget views to return building address. --- blocnote/apps/budgetSimulator/views.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/blocnote/apps/budgetSimulator/views.py b/blocnote/apps/budgetSimulator/views.py index 2dddb39..dc119ff 100644 --- a/blocnote/apps/budgetSimulator/views.py +++ b/blocnote/apps/budgetSimulator/views.py @@ -7,7 +7,7 @@ from bpfin.back_end_call.back_end_budget import budget_simulation from blocnote.lib.fetch_data import ( get_financing_overview, get_customer_preference, get_utility_bill, get_annual_bills, get_income_statement, - get_growth_rate, get_liabilities, get_cash_balance, get_loan_options + get_growth_rate, get_liabilities, get_cash_balance, get_loan_options, get_building_data ) class Index(View): @@ -15,8 +15,10 @@ class Index(View): def get(self, request, building_id): """HTTP GET request.""" + building = get_building_data(building_id) context = { 'building_id': building_id, + 'building': building, } return render(request, 'budgetSimulator/index.html', context=context) -- GitLab From de9a93b975f87d52d3c74039f8ec401f656315d5 Mon Sep 17 00:00:00 2001 From: Adarsh Date: Thu, 6 Jul 2017 12:02:26 -0400 Subject: [PATCH 4/5] Update frontend for budget to display building address. --- .../apps/budgetSimulator/templates/budgetSimulator/index.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/blocnote/apps/budgetSimulator/templates/budgetSimulator/index.html b/blocnote/apps/budgetSimulator/templates/budgetSimulator/index.html index fdef3cc..fe5a48d 100644 --- a/blocnote/apps/budgetSimulator/templates/budgetSimulator/index.html +++ b/blocnote/apps/budgetSimulator/templates/budgetSimulator/index.html @@ -4,6 +4,9 @@
{% csrf_token %}

Budget Simulator

+
+ {{ building.street_address }} +
-- GitLab From 08870ce6d180f94b03f398a719e1529f10f8dffb Mon Sep 17 00:00:00 2001 From: Adarsh Date: Mon, 10 Jul 2017 12:20:47 -0400 Subject: [PATCH 5/5] Remove building id from views context. --- blocnote/apps/landingPage/views.py | 1 - 1 file changed, 1 deletion(-) diff --git a/blocnote/apps/landingPage/views.py b/blocnote/apps/landingPage/views.py index 8a67462..8120218 100644 --- a/blocnote/apps/landingPage/views.py +++ b/blocnote/apps/landingPage/views.py @@ -43,7 +43,6 @@ class Index(View): if_started = True building = get_building_data(building_id) context = { - 'building_id': building_id, 'if_started': if_started, 'if_completed': if_completed, 'not_saved_list': not_saved_list, -- GitLab