diff --git a/js/components/toggler.js b/js/components/toggler.js new file mode 100644 index 00000000..74093dd3 --- /dev/null +++ b/js/components/toggler.js @@ -0,0 +1,24 @@ +export default { + name: 'toggler', + + data: function () { + return { + isVisible: false + } + }, + + render: function (createElement) { + return createElement( this.$vnode.data.tag, [ + this.$scopedSlots.default({ + isVisible: this.isVisible, + toggle: this.toggle + }) + ]) + }, + + methods: { + toggle: function (e) { + this.isVisible = !this.isVisible + } + } +} diff --git a/js/index.js b/js/index.js index 3881a313..fa8d072a 100644 --- a/js/index.js +++ b/js/index.js @@ -8,14 +8,15 @@ import checkboxinput from './components/checkbox_input' import DetailsOfUse from './components/forms/details_of_use' import poc from './components/forms/poc' import financial from './components/forms/financial' +import toggler from './components/toggler' import NewProject from './components/forms/new_project' Vue.use(VTooltip) - const app = new Vue({ el: '#app-root', components: { + toggler, optionsinput, textinput, checkboxinput, diff --git a/styles/core/_variables.scss b/styles/core/_variables.scss index 8a1db5c6..fd101e90 100644 --- a/styles/core/_variables.scss +++ b/styles/core/_variables.scss @@ -24,7 +24,7 @@ $lead-font-size: 2rem; $title-font-size: 5.2rem; $h1-font-size: 4rem; $h2-font-size: 3rem; -$h3-font-size: 2rem; +$h3-font-size: 2.3rem; $h4-font-size: 1.7rem; $h5-font-size: 1.5rem; $h6-font-size: 1.3rem; diff --git a/styles/elements/_tables.scss b/styles/elements/_tables.scss index e1602dfd..a1dd7427 100644 --- a/styles/elements/_tables.scss +++ b/styles/elements/_tables.scss @@ -8,6 +8,28 @@ @include panel-margin; min-width: 100%; + th, td { + &.table-cell--align-right { + text-align: right; + } + + &.table-cell--shrink { + width: 1%; + } + + &.table-cell--expand { + width: 100%; + } + + &.table-cell--hide-small { + display: none; + + @include media($medium-screen) { + display: table-cell; + } + } + } + tbody { tr { th, @@ -29,32 +51,12 @@ border-bottom-style: solid; } } - - .table-cell--align-right { - text-align: right; - } - - .table-cell--shrink { - width: 1%; - } - - .table-cell--expand { - width: 100%; - } - - .table-cell--hide-small { - display: none; - - @include media($medium-screen) { - display: table-cell; - } - } } } thead { tr { - th { + th, td { @include block-list-header; display: table-cell; } diff --git a/styles/sections/_reports.scss b/styles/sections/_reports.scss index 77383d8c..cc72ca73 100644 --- a/styles/sections/_reports.scss +++ b/styles/sections/_reports.scss @@ -6,13 +6,20 @@ } .funding-summary-row__col { - @include grid-pad; @include media($medium-screen) { + @include grid-pad; flex-grow: 1; display: flex; flex-direction: row; flex-basis: 50%; + + &:first-child { + padding-left: 0; + } + &:last-child { + padding-right: 0; + } } align-items: stretch; @@ -171,3 +178,102 @@ } } } + + +.spend-table { + .spend-table__header { + @include panel-base; + @include panel-theme-default; + border-bottom: 0; + display: flex; + flex-direction: row; + flex-wrap: wrap; + justify-content: space-between; + align-items: center; + padding: $gap * 2; + + .spend-table__title { + @include h3; + margin: 0; + flex: 2; + } + + .spend-table__month-select { + margin: 0; + flex: 1; + } + } + + table { + th, td { + white-space: nowrap; + + button { + margin: 0; + } + + &.current-month { + background-color: $color-aqua-lightest; + } + + &.previous-month { + opacity: 0.65; + } + + &.meter-cell { + padding-left: 0; + + @include media($medium-screen) { + min-width: 12rem; + } + + meter { + width: 100%; + height: 3rem; + background: $color-white; + position: relative; + display: none; + + @include media($medium-screen) { + display: block; + } + + &::-webkit-meter-bar { + background: $color-white; + } + + &::before { + content: attr(title); + position: absolute; + top: .5rem; + left: $gap; + @include h5; + color: $color-white; + } + } + } + } + + .spend-table__workspace { + th, td { + font-weight: bold; + } + } + + .spend-table__project { + .spend-table__project__toggler { + @include icon-link-color($color-black-light, $color-gray-lightest); + margin-left: -$gap; + + .icon { + @include icon-size(12); + margin-right: $gap; + } + } + + .spend-table__project__env { + margin-left: $gap; + } + } + } +} diff --git a/templates/workspace_reports.html b/templates/workspace_reports.html index 46f72b1c..25be9041 100644 --- a/templates/workspace_reports.html +++ b/templates/workspace_reports.html @@ -1,6 +1,7 @@ {% extends "base_workspace.html" %} {% from "components/alert.html" import Alert %} +{% from "components/icon.html" import Icon %} {% block workspace_content %} @@ -85,4 +86,109 @@ +
Spending scope | +April 2018 | +May 2018 | +June 2018 | ++ + + + |
---|---|---|---|---|
Workspace Total | +$58,000 | +$60,000 | +$62,000 | +
+ |
+
+ + | +$29,000 | +$30,000 | +$31,000 | +
+ |
+
{{ Icon('link') }} Production | +$14,000 | +$15,000 | +$16,000 | ++ |
{{ Icon('link') }} Development | +$12,000 | +$13,000 | +$14,000 | ++ |
+ + | +$29,000 | +$30,000 | +$31,000 | +
+ |
+
{{ Icon('link') }} Production | +$14,000 | +$15,000 | +$16,000 | ++ |
{{ Icon('link') }} Development | +$12,000 | +$13,000 | +$14,000 | ++ |