Starting export implementation.
This commit is contained in:
parent
71276f9f4b
commit
e6847d0504
2 changed files with 10 additions and 3 deletions
|
@ -49,7 +49,8 @@ def list_inventory():
|
|||
breadcrumb=[{'label': 'Inventory', 'url': url_for('main.inventory_index')}],
|
||||
header=inventory_headers,
|
||||
rows=[{"id": item.id, "cells": [row_fn(item) for row_fn in inventory_headers.values()]} for item in inventory],
|
||||
entry_route = 'inventory_item'
|
||||
entry_route = 'inventory_item',
|
||||
table=inventory
|
||||
)
|
||||
|
||||
@main.route("/inventory/index")
|
||||
|
@ -205,6 +206,10 @@ def delete_inventory_item(id):
|
|||
except Exception as e:
|
||||
db.session.rollback()
|
||||
return jsonify({"success": False, "error": str(e)}), 400
|
||||
|
||||
@main.route("/api/inventory/export", methods=["GET"])
|
||||
def get_inventory_csv():
|
||||
return "Oh boy!"
|
||||
|
||||
@main.route("/inventory_available")
|
||||
def inventory_available():
|
||||
|
|
|
@ -7,10 +7,12 @@
|
|||
{% set createButtonLogic %}
|
||||
window.location.href = '/{{ entry_route }}/new';
|
||||
{% endset %}
|
||||
{% set exportButtonLogic %}
|
||||
{% endset %}
|
||||
{% set toolbarButtons %}
|
||||
<div class="btn-group">
|
||||
{{ buttons.render_button(id='export', icon='box-arrow-up', style='outline-primary rounded-start') }}
|
||||
{{ buttons.render_button(id='import', icon='box-arrow-in-down', style='outline-primary') }}
|
||||
{{ buttons.render_button(id='export', icon='box-arrow-up', style='outline-primary rounded-start', logic=exportButtonLogic) }}
|
||||
{{ buttons.render_button(id='import', icon='box-arrow-in-down', style='outline-primary', logic='alert("Not implemented yet!")') }}
|
||||
{{ buttons.render_button(id='create', icon='plus-lg', logic=createButtonLogic, style='outline-primary rounded-end') }}
|
||||
</div>
|
||||
{% endset %}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue