plugo/_layouts/home.html

105 lines
3.6 KiB
HTML
Raw Normal View History

2022-03-05 15:50:21 +00:00
---
layout: default
---
2024-06-21 08:44:33 +00:00
<style>
{% for id in site.data.dead %}tr[data-id="{{id}}"]{% if forloop.last %}{% else %},{% endif %}
{% endfor %} {
background-color: #f8d7da !important;
}
</style>
2022-04-23 09:22:31 +00:00
<details open>
<summary>Show Map</summary>
2022-04-24 07:38:21 +00:00
<div width="740px" height="300px" id="map">
<nav id="filter-group" class="filter-group">
<input id="markers-zero" type="checkbox">
<label for="markers-zero"><span></span>Zero Powerbanks</label>
</nav>
</div>
2022-04-23 09:22:31 +00:00
</details>
2022-03-05 15:50:21 +00:00
2024-06-21 08:24:43 +00:00
<details open>
<summary>Show Number of Locations by Time</summary>
<div id="chart"></div>
</details>
<details open>
<summary>Show Number of Powerbanks by Time</summary>
<div id="chart2"></div>
</details>
<script src="https://d3js.org/d3.v7.min.js"></script>
<style>
.line {
fill: none;
stroke: steelblue;
stroke-width: 2px;
}
</style>
<script src="assets/chart.js"></script>
2022-03-07 07:19:44 +00:00
{{content}}
{% assign zeroPowerBankLocations = 0 %}
2022-03-05 15:50:21 +00:00
<table id="plugo-data">
<thead>
<tr>
<th>Address</th>
<th>Location Type</th>
<th><span title="Number of Powerbanks">Count</span></th>
<th>Date Added</th>
</tr>
</thead>
<tbody>
{% assign locations = site.data.plugo|sort:'state' %}
{% assign total = 0 %}
2024-06-21 08:44:33 +00:00
2022-03-05 15:50:21 +00:00
{% for row in locations %}
2024-06-21 08:44:33 +00:00
<tr id="{{row.id}}" data-id="{{row.id}}">
2022-03-29 12:49:28 +00:00
<td>
{%comment%}
2022-03-05 15:50:21 +00:00
{% assign state_lower_case = row.state|downcase %}
<!-- <td>{{site.data.city[city_lower_case] | default:row.city}}, {{site.data.state[state_lower_case] | default: row.state}}</td> -->
2022-03-29 12:49:28 +00:00
{%endcomment%}
{% include location.html data=row %}
2022-03-05 15:50:21 +00:00
</td>
<td>{{row.business}}</td>
2024-06-21 08:44:33 +00:00
<td>{{row.totalAvailablePowerbanks}}
{% if site.data.dead contains row.id %}💀{%endif%}
</td>
{% if row.totalAvailablePowerbanks == 0 %}
{% assign zeroPowerBankLocations = zeroPowerBankLocations | plus:1 %}
{% endif %}
2022-03-29 12:49:28 +00:00
<td data-sort="{{row.createdAt | date_to_xmlschema}}">{{row.createdAt | date_to_string}}</td>
2022-03-05 15:50:21 +00:00
{% assign total = total|plus:row.totalAvailablePowerbanks %}
<!-- <td>{%if row.isVisible %}☑{%else%}❌{%endif%}</td> -->
</tr>
{% endfor %}
</tbody>
</table>
<h3>Statistics</h3>
<ul>
<li>Total Available Powerbanks: {{total}}</li>
2024-06-21 08:51:01 +00:00
<li>Total Locations: {{locations|size}} out of which {{site.data.dead | size }} are dead (no powerbanks seen in 2 weeks)</li>
2024-06-21 08:44:33 +00:00
<li>{{zeroPowerBankLocations}} locations with zero powerbanks</li>
<li>Last Updated: {{site.time | date: "%Y-%m-%d %H:%M" }} IST</li>
<li>This page is automatically updated 5 times a day, at roughly 0930, 1230, 1530, 1830, 2130 IST</li>
<li>The map is also available in <a href="map.geojson">GeoJSON Format</a>. You can also view the underlying data directly at <a href="http://geojson.io/#data=data:text/x-url,https://captnemo.in/plugo/map.geojson">geojson.io</a>.
2022-03-05 15:50:21 +00:00
</ul>
<script src="https://code.jquery.com/jquery-3.6.0.slim.min.js" integrity="sha256-u7e5khyithlIdTpu22PHhENmPcRdFiHRjhAuHcs05RI=" crossorigin="anonymous"></script>
2022-03-07 06:16:30 +00:00
<script src="https://cdn.datatables.net/1.11.5/js/jquery.dataTables.js" integrity="sha256-04C2SeXF6JtsrsX+sFnI+gFdm56VJdhW49hWm4m+0io=" crossorigin="anonymous"></script>
2022-03-05 15:50:21 +00:00
<script>
let table = new DataTable('#plugo-data', {
"paging": false,
"autoWidth": false,
"info": false
});
</script>
2022-04-23 09:22:31 +00:00
<link rel="stylesheet" href="https://api.mapbox.com/mapbox-gl-js/v2.8.2/mapbox-gl.css" integrity="sha256-eQmEh0JSFrPkGN9Lge0CpB3ZMAiwuSBq9tQKMURq0do=" crossorigin="anonymous">
<script src="https://api.mapbox.com/mapbox-gl-js/v2.8.2/mapbox-gl.js" integrity="sha256-s0WzvUEKt3AVyIJQ7kE4w+yqDoZxIiMiW+dImDRo5/E=" crossorigin="anonymous"></script>
<link rel="stylesheet" type="text/css" href="/plugo/assets/style.css">
<script src="/plugo/map.js"></script>