diff --git a/inventory-app/inventory.py b/inventory-app/inventory.py index 2d6f89d..db03ac7 100644 --- a/inventory-app/inventory.py +++ b/inventory-app/inventory.py @@ -145,6 +145,7 @@ class InventoryItemForm(CustomForm): shortener = FormField(ShortenerForm) _description_placeholder = "Insert Markdown here." description = TextAreaField('Description', [validators.optional(), validators.length(max=3000)], render_kw={"placeholder": _description_placeholder}) + location = StringField('Location') def setup_defaults_add(self): setup_default_owner(self.inventory.form.owner.form.username) self.inventory.form.public.render_kw = {"checked": "checked"} @@ -426,6 +427,7 @@ def view_inventory(slug=None): fields = [ ("type", "Exclude type", list), ("tags", "Tags", list), + ("location", "Location", list), ] q = {"type": {"$ne": "token"}} template = "inventory.html" diff --git a/inventory-app/templates/inventory.html b/inventory-app/templates/inventory.html index e98e0b3..3d21ed2 100644 --- a/inventory-app/templates/inventory.html +++ b/inventory-app/templates/inventory.html @@ -19,6 +19,7 @@ Public Name Type + Location Owner User {% if can_audit %} @@ -40,6 +41,7 @@ {% if item.inventory.public %}check_circle{% else %} {% endif %} {{ item | format_name }} {{ item.comment }} {{ item.type }} + {{ item.location }} {{ item | owner_link}} {{ item | user_link}} {% if can_audit %} diff --git a/inventory-app/templates/inventory_edit.html b/inventory-app/templates/inventory_edit.html index e1e7e02..3b22aa0 100644 --- a/inventory-app/templates/inventory_edit.html +++ b/inventory-app/templates/inventory_edit.html @@ -92,6 +92,11 @@ {{ form.shortener.slug }} + + Location + {{ form.location }} + + diff --git a/inventory-app/templates/inventory_view.html b/inventory-app/templates/inventory_view.html index 31a86e1..64cbe36 100644 --- a/inventory-app/templates/inventory_view.html +++ b/inventory-app/templates/inventory_view.html @@ -119,6 +119,11 @@ External link + + Location + {{ item.location }} + + Public {% if item.inventory.public %}check_circle{% endif %}