From 1ca93846494ec4211758fd60a8842a1c40f1d0c5 Mon Sep 17 00:00:00 2001 From: James England Date: Mon, 22 May 2017 19:11:46 -0500 Subject: [PATCH] created a mixin for the budget overview that will allow us to add new years without copying/pasting a good amount of content --- _src/fy2016-budget-overview.jade | 20 ++------------------ _src/fy2017-budget-overview.jade | 21 ++------------------- _src/mixins/budget-overview.jade | 22 ++++++++++++++++++++++ 3 files changed, 26 insertions(+), 37 deletions(-) create mode 100644 _src/mixins/budget-overview.jade diff --git a/_src/fy2016-budget-overview.jade b/_src/fy2016-budget-overview.jade index 2126cfbd..dab75fa3 100644 --- a/_src/fy2016-budget-overview.jade +++ b/_src/fy2016-budget-overview.jade @@ -1,19 +1,3 @@ -.container#chartContainer - style. +include mixins/budget-overview.jade - .row - .intro.col-md-8 - h1 FY2016 Budget Overview - p.description Click on a fund to see the departments that receive its funding. Click on that department to see its spending or revenue. To step out of the department, click ‘Budget’ until you reach the desired department. - - .row#chart(data-json-file = "data/fy2016/c4okc_fy2016_final.json") - table.row.treemap.table-striped#chart-table - thead - th Item - th Expense - tbody - -script(src="http://code.jquery.com/jquery-1.7.2.min.js",charset='utf-8') -script(src="http://d3js.org/d3.v3.min.js" ,charset='utf-8') -script(src="/js/data.js",charset='utf-8') -script(src="/js/okc-budget-tree.js",charset='utf-8') ++budgetOverview(2016,"data/fy2016/c4okc_fy2016_final.json") \ No newline at end of file diff --git a/_src/fy2017-budget-overview.jade b/_src/fy2017-budget-overview.jade index cedd8510..c3dcd282 100644 --- a/_src/fy2017-budget-overview.jade +++ b/_src/fy2017-budget-overview.jade @@ -1,20 +1,3 @@ -.container#chartContainer - style. +include mixins/budget-overview.jade - .row - .intro.col-md-8 - h1 FY2017 Budget Overview - p.description Click on a fund to see the departments that receive its funding. Click on that department to see its spending or revenue. To step out of the department, click ‘Budget’ until you reach the desired department. - - .row#chart(data-json-file = "data/fy2017/c4okc_fy2017.json") - table.row.treemap.table-striped#chart-table - thead - th Item - th Expense - tbody - -script(src="http://code.jquery.com/jquery-1.7.2.min.js",charset='utf-8') -script(src="http://d3js.org/d3.v3.min.js" ,charset='utf-8') -script(src="/js/data.js",charset='utf-8') -script(src="/js/okc-budget-tree.js",charset='utf-8') - ++budgetOverview(2017,"data/fy2017/c4okc_fy2017.json") \ No newline at end of file diff --git a/_src/mixins/budget-overview.jade b/_src/mixins/budget-overview.jade new file mode 100644 index 00000000..f47da6c2 --- /dev/null +++ b/_src/mixins/budget-overview.jade @@ -0,0 +1,22 @@ +mixin budgetOverview(myYear,dataFilePath) + + .container#chartContainer + style. + + .row + .intro.col-md-8 + h1 FY#{myYear} Budget Overview + + p.description Click on a fund to see the departments that receive its funding. Click on that department to see its spending or revenue. To step out of the department, click ‘Budget’ until you reach the desired department. + + .row#chart(data-json-file = "#{dataFilePath}") + table.row.treemap.table-striped#chart-table + thead + th Item + th Expense + tbody + + script(src="http://code.jquery.com/jquery-1.7.2.min.js",charset='utf-8') + script(src="http://d3js.org/d3.v3.min.js" ,charset='utf-8') + script(src="/js/data.js",charset='utf-8') + script(src="/js/okc-budget-tree.js",charset='utf-8') \ No newline at end of file