From dfb93716c1ffd63e55c3d9d1ea1ac54b9a70963b Mon Sep 17 00:00:00 2001 From: Daniel Rahamim Date: Fri, 24 Feb 2023 23:12:27 -0800 Subject: [PATCH] fix: Add item details to individual summary page (#33) * fix: Add item details to individual summary page * refactor: remove useless print statement --- src/invenflask/app.py | 4 +- src/invenflask/templates/single_history.html | 46 +++++++++++++++++++- 2 files changed, 47 insertions(+), 3 deletions(-) diff --git a/src/invenflask/app.py b/src/invenflask/app.py index 5c5af01..2992c89 100644 --- a/src/invenflask/app.py +++ b/src/invenflask/app.py @@ -473,12 +473,14 @@ def single_history(rq_type, item_id): if rq_type == 'asset': conn = get_db() + item_info = get_asset(item_id, 'edit') current = conn.execute( 'select * from checkouts where assetid = ?', (item_id,)) history = conn.execute( 'select * from history where assetid = ?', (item_id,)) conn.commit() if rq_type == 'staff': + item_info = get_staff(item_id) conn = get_db() current = conn.execute( 'select * from checkouts where staffid = ?', (item_id,)) @@ -486,4 +488,4 @@ def single_history(rq_type, item_id): 'select * from history where staffid = ?', (item_id,)) conn.commit() return render_template('single_history.html', hist_type=rq_type, - current=current, history=history) + current=current, history=history, item_info=item_info) diff --git a/src/invenflask/templates/single_history.html b/src/invenflask/templates/single_history.html index b60f373..9187984 100644 --- a/src/invenflask/templates/single_history.html +++ b/src/invenflask/templates/single_history.html @@ -3,7 +3,31 @@ {% block content %} {% if hist_type == 'staff' %}

Staff History

- + + + + + + + + + + + + + + + + + + + + + + +
First NameLast NameStaff IDDivisionDepartmentTitle
{{ item_info.first_name }}{{ item_info.last_name }}{{ item_info.id }}{{ item_info.division }}{{ item_info.department }}{{ item_info.title }}
+ +

Current Assets

@@ -21,7 +45,7 @@

Staff History

- +

History

@@ -41,9 +65,27 @@

Staff History

+ {% else %} +

Asset History

+ + + + + + + + + + + + + + + +
Radio IDTypeStatus
{{ item_info.id }}{{ item_info.asset_type }}{{ item_info.asset_status }}