/
assets.html
76 lines (68 loc) · 3.07 KB
/
assets.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
{% extends "base.html" %}
{% set active_page = "assets" %}
{% block title %} Asset listing {% endblock %}
{% block divs %}
<div class="container-fluid">
<div class="row">
<div class="col-sm-12">
<h3>Asset overview</h3>
<table class="table table-striped table-responsive paginate">
<thead>
<tr>
<th>Name</th>
<th class="text-right no-sort">Location</th>
<th class="text-right">Asset id</th>
<th class="text-right">Account</th>
<th class="text-right no-sort">Sensors</th>
<th class="text-right no-sort">
{% if user_can_create_assets %}
<form action="/assets/new" method="get">
<button class="btn btn-sm btn-responsive btn-success create-button" type="submit">Create new
asset</button>
</form>
{% endif %}
</th>
</tr>
</thead>
<tbody>
{% for asset in assets: %}
<tr>
<td>
<i class="{{ asset.generic_asset_type.name | asset_icon }} left-icon"><a
href="/assets/{{ asset.id }}" alt="View this asset">{{ asset.name }}</a></i>
</td>
<td class="text-right">
{% if asset.latitude and asset.longitude %}
LAT: {{ "{:,.4f}".format( asset.latitude ) }} LONG:
{{ "{:,.4f}".format( asset.longitude ) }}
{% endif %}
</td>
<td class="text-right">
{{ asset.id }}
</td>
<td class="text-right">
{% if asset.owner %}
{{ asset.owner.name }}
{% else %}
PUBLIC
{% endif %}
</td>
<td class="text-right">
{{ asset.sensors | length }}
</td>
<td class="text-right">
<!-- <form action="../../analytics" method="get">-->
<!-- <input type="hidden" name="resource" value="{{ asset.name }}">-->
<!-- <button class="btn btn-sm btn-responsive btn-info" type="submit">Analyse this-->
<!-- asset</button>-->
<!-- </form>-->
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
{% block paginate_tables_script %} {{ super() }} {% endblock %}
{% endblock%}