Files
old-spike/client/dashboard/energy/energy.rt

38 lines
1.3 KiB
Plaintext
Raw Normal View History

2016-03-04 13:59:34 -06:00
<rt-require dependency="./graph/graph.component" as="EnergyGraph"/>
<rt-require dependency="./table/table.component" as="EnergyTable"/>
2016-02-22 14:36:07 -06:00
<div id="energy_view">
2016-03-04 13:59:34 -06:00
<div class="alert alert-warning" rt-if="this.loading_energy_data">
2016-02-29 18:20:00 -06:00
Retrieving energy data...
2016-02-22 14:36:07 -06:00
</div>
<div rt-if="this.props.view === 'graph'">
<h4>Select Data</h4>
<div class="btn-group" role="group">
<button
2016-02-29 18:20:00 -06:00
data-param="graph_attr"
2016-02-22 14:36:07 -06:00
data-value="consumption"
2016-03-04 13:59:34 -06:00
rt-class="{active: this.props.graph_attr === 'consumption'}"
onClick="{this.setParam.bind(this)}"
2016-02-22 14:36:07 -06:00
type="button" class="btn btn-primary">Consumption</button>
<button
2016-02-29 18:20:00 -06:00
data-param="graph_attr"
2016-02-22 14:36:07 -06:00
data-value="production"
2016-03-04 13:59:34 -06:00
rt-class="{active: this.props.graph_attr === 'production'}"
onClick="{this.setParam.bind(this)}"
2016-02-22 14:36:07 -06:00
type="button" class="btn btn-primary">Production</button>
</div>
</div>
2016-03-04 13:59:34 -06:00
<EnergyGraph
rt-if="this.props.view === 'graph'"
house="{this.props.house}"
state_manager="{this.props.state_manager}"
graph_attr="{this.props.graph_attr}"
year="{this.props.year}" ></EnergyGraph>
<EnergyTable
rt-if="this.props.view === 'table'"
state_manager="{this.props.state_manager}"
house="{this.props.house}"
graph_attr="{this.props.graph_attr}"
year="{this.props.year}" ></EnergyTable>
2016-02-22 14:36:07 -06:00
</div>