75 lines
No EOL
2.5 KiB
HTML
75 lines
No EOL
2.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.
|
|
{% set ids %}
|
|
{ids: [{% for row in active_worklog_rows %}{{ row['id'] }}, {% endfor %}]}
|
|
{% endset %}
|
|
{{ links.export_link(
|
|
'active_worklog',
|
|
'worklog',
|
|
ids
|
|
) }}
|
|
</h6>
|
|
{{ tables.render_table(
|
|
headers = active_worklog_headers,
|
|
rows = active_worklog_rows,
|
|
id = 'Active Worklog',
|
|
entry_route = 'worklog_item',
|
|
per_page = 10
|
|
)}}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
{% if (datasets['summary'][0]['values'] | sum) > 0 %}
|
|
<div class="col">
|
|
<div class="card">
|
|
<div class="card-body">
|
|
<h5 class="card-title">Inventory Summary</h5>
|
|
<div id="summary"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
<div class="row mt-2">
|
|
{% if (datasets['summary'][0]['values'] | sum) > 0 %}
|
|
<div class="col">
|
|
<div class="card">
|
|
<div class="card-body">
|
|
<h5 class="card-title">Work Summary</h5>
|
|
<div id="work_summary"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|
|
|
|
{% block script %}
|
|
{% if datasets['summary'] %}
|
|
const data = {{ datasets['summary']|tojson }};
|
|
const layout = { title: 'Summary' };
|
|
Plotly.newPlot('summary', data, layout)
|
|
{% endif %}
|
|
{% if datasets['work_summary'] %}
|
|
const work_data = {{ datasets['work_summary']|tojson }};
|
|
const work_layout = { title: 'Work Summary', xaxis: { tickangle: -45 } };
|
|
Plotly.newPlot('work_summary', work_data, work_layout);
|
|
{% endif %}
|
|
{% endblock %} |