Skip to content
This repository has been archived by the owner on Jan 28, 2023. It is now read-only.

Templating the Budget Overview with Mixins #138

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 2 additions & 18 deletions _src/fy2016-budget-overview.jade
Original file line number Diff line number Diff line change
@@ -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")
21 changes: 2 additions & 19 deletions _src/fy2017-budget-overview.jade
Original file line number Diff line number Diff line change
@@ -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")
22 changes: 22 additions & 0 deletions _src/mixins/budget-overview.jade
Original file line number Diff line number Diff line change
@@ -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')