Enhance inventory management by updating timestamp type to DateTime, adding stale worklog display on the index page, and improving template styles and scripts for better user experience.
This commit is contained in:
parent
0835248f34
commit
58754c71bd
7 changed files with 73 additions and 16 deletions
|
@ -22,7 +22,7 @@
|
|||
{% if cell.type == 'bool' %}
|
||||
{{ cell.html | safe }}
|
||||
{% elif cell.url %}
|
||||
<a href="{{ cell.url }}">{{ cell.text }}</a>
|
||||
<a class="link-success link-underline-opacity-0" href="{{ cell.url }}">{{ cell.text }}</a>
|
||||
{% else %}
|
||||
{{ cell.text or '-' }}
|
||||
{% endif %}
|
||||
|
|
|
@ -7,5 +7,31 @@
|
|||
<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 stale_pagination['items'] %}
|
||||
<div class="col">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Stale Worklogs</h5>
|
||||
<h6 class="card-subtitle mb-2 text-body-secondary">You have {{ stale_count }} worklogs
|
||||
that need attention!</h6>
|
||||
{{ tables.render_table(
|
||||
stale_worklog_headers,
|
||||
stale_worklog_rows,
|
||||
'index'
|
||||
)}}
|
||||
{{ tables.render_pagination(
|
||||
'index',
|
||||
stale_pagination['page'],
|
||||
stale_pagination['has_prev'],
|
||||
stale_pagination['has_next'],
|
||||
stale_pagination['total_pages'],
|
||||
page_variable='stale_worklog_page'
|
||||
)}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -14,9 +14,7 @@
|
|||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.6/dist/css/bootstrap.min.css" rel="stylesheet"
|
||||
integrity="sha384-4Q6Gf2aSP4eDXB8Miphtr37CMZZQ5oXLH2yaXMJ2w8e2ZtHTl7GptT4jmndRuHDT" crossorigin="anonymous">
|
||||
<style>
|
||||
{
|
||||
% block style %
|
||||
}
|
||||
{% block style %}
|
||||
|
||||
.sticky-top {
|
||||
position: sticky;
|
||||
|
@ -43,18 +41,16 @@
|
|||
background-color: white;
|
||||
}
|
||||
|
||||
{
|
||||
% endblock %
|
||||
}
|
||||
{% endblock %}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body class="bg-tertiary text-primary-emphasis">
|
||||
<nav class="navbar navbar-expand bg-body-tertiary border-bottom">
|
||||
<div class="container-fluid">
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-brand" href="{{ url_for('index') }}">
|
||||
Inventory Manager
|
||||
</span>
|
||||
</a>
|
||||
<button class="navbar-toggler">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
|
@ -76,6 +72,9 @@
|
|||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.6/dist/js/bootstrap.bundle.min.js"
|
||||
integrity="sha384-j1CDi7MgGQ12Z7Qab0qlWQ/Qqz24Gc6BM0thvEMVjHnfYGF0rmFCozFSxQBxwHKO"
|
||||
crossorigin="anonymous"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mark.js/8.11.1/mark.min.js"
|
||||
integrity="sha512-5CYOlHXGh6QpOFA/TeTylKLWfB3ftPsde7AnmhuitiTX4K5SqCLBeKro6sPS8ilsz1Q4NRx3v8Ko2IBiszzdww=="
|
||||
crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||
<script src="{{ url_for('static', filename='js/datalist.js') }}"></script>
|
||||
<script>
|
||||
const searchInput = document.querySelector('#search');
|
||||
|
|
|
@ -76,4 +76,14 @@ title=title,
|
|||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block script %}
|
||||
{% if query %}
|
||||
const query = "{{ query|e }}";
|
||||
if (query) {
|
||||
const instance = new Mark(document.querySelector("main"));
|
||||
instance.mark(query);
|
||||
}
|
||||
{% endif %}
|
||||
{% endblock %}
|
Loading…
Add table
Add a link
Reference in a new issue