{% if site_info is none %}
	<div
			hx-get="/e/sites/{{site.id}}/energy_management/totals?mem_id={{mem_id}}"
		 	hx-trigger="every 3s">
		<label>
			Calculating:
			<progress value="0" max="12">
				0 months
			</progress>
		</label>
  </div>
{% elif site_info.status == 'running' %}
	<label>
		Calculating:
		<progress value="{{site_info.progress}}" max="12">
			{{site_info.progress}} months
		</progress>
	</label>
{% else %}
	{% if site_info['problem']|length > 0 %}
		<pre>
			{{site_info['problem']}}
		</pre>
	{% endif %}
  <table>
		<caption>Last 12 months</caption>
		<thead>
			<tr>
				{% for title in site_info.titles %}
					<th>{{title}}</th>
				{% endfor %}
			</tr>
		</thead>
		<tbody>
			{% for row in site_info.rows %}
				<tr>
					{% for cell in row %}
						<td>{{cell}}</td>
					{% endfor %}
				</tr>
			{% endfor %}
		</tbody>
	</table>

	<h3>Log</h3>

	<ul>
		{% for line in site_info.log %}
			<li>>{{line}}</li>
		{% endfor %}
	</ul>
{% endif %}
