46 lines
1.5 KiB
HTML
46 lines
1.5 KiB
HTML
<!-- templates/index.html -->
|
|
{% extends "layout.html" %}
|
|
|
|
{% block title %}{{ title }}{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="container text-center">
|
|
<h1 class="display-4">Welcome to Inventory Manager</h1>
|
|
<p class="lead">Find out about all of your assets.</p>
|
|
<div class="row">
|
|
{% if active_worklog_rows %}
|
|
<div class="col">
|
|
<div class="card">
|
|
<div class="card-body">
|
|
<h5 class="card-title">Active Worklogs</h5>
|
|
<h6 class="card-subtitle mb-2 text-body-secondary">You have {{ active_count }} active worklogs.</h6>
|
|
{{ tables.render_table(
|
|
headers = active_worklog_headers,
|
|
rows = active_worklog_rows,
|
|
id = 'Active Worklog',
|
|
entry_route = 'worklog_entry',
|
|
per_page = 10
|
|
)}}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
{% if (datasets[0]['values'] | sum) > 0 %}
|
|
<div class="col">
|
|
<div class="card">
|
|
<div class="card-body">
|
|
<h5 class="card-title">Summary</h5>
|
|
<div id="summary"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|
|
|
|
{% block script %}
|
|
const data = {{ datasets|tojson }};
|
|
const layout = { title: 'Summary' };
|
|
Plotly.newPlot('summary', data, layout)
|
|
{% endblock %}
|