This commit is contained in:
@@ -145,6 +145,7 @@ class InventoryItemForm(CustomForm):
|
|||||||
shortener = FormField(ShortenerForm)
|
shortener = FormField(ShortenerForm)
|
||||||
_description_placeholder = "Insert Markdown here."
|
_description_placeholder = "Insert Markdown here."
|
||||||
description = TextAreaField('Description', [validators.optional(), validators.length(max=3000)], render_kw={"placeholder": _description_placeholder})
|
description = TextAreaField('Description', [validators.optional(), validators.length(max=3000)], render_kw={"placeholder": _description_placeholder})
|
||||||
|
location = StringField('Location')
|
||||||
def setup_defaults_add(self):
|
def setup_defaults_add(self):
|
||||||
setup_default_owner(self.inventory.form.owner.form.username)
|
setup_default_owner(self.inventory.form.owner.form.username)
|
||||||
self.inventory.form.public.render_kw = {"checked": "checked"}
|
self.inventory.form.public.render_kw = {"checked": "checked"}
|
||||||
@@ -426,6 +427,7 @@ def view_inventory(slug=None):
|
|||||||
fields = [
|
fields = [
|
||||||
("type", "Exclude type", list),
|
("type", "Exclude type", list),
|
||||||
("tags", "Tags", list),
|
("tags", "Tags", list),
|
||||||
|
("location", "Location", list),
|
||||||
]
|
]
|
||||||
q = {"type": {"$ne": "token"}}
|
q = {"type": {"$ne": "token"}}
|
||||||
template = "inventory.html"
|
template = "inventory.html"
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
<th>Public</th>
|
<th>Public</th>
|
||||||
<th>Name</th>
|
<th>Name</th>
|
||||||
<th>Type</th>
|
<th>Type</th>
|
||||||
|
<th>Location</th>
|
||||||
<th>Owner</th>
|
<th>Owner</th>
|
||||||
<th>User</th>
|
<th>User</th>
|
||||||
{% if can_audit %}
|
{% if can_audit %}
|
||||||
@@ -40,6 +41,7 @@
|
|||||||
<td>{% if item.inventory.public %}<i class="material-icons">check_circle</i>{% else %} {% endif %}</td>
|
<td>{% if item.inventory.public %}<i class="material-icons">check_circle</i>{% else %} {% endif %}</td>
|
||||||
<td><a href="/m/inventory/{{ item._id }}/view">{{ item | format_name }} {{ item.comment }}</a></td>
|
<td><a href="/m/inventory/{{ item._id }}/view">{{ item | format_name }} {{ item.comment }}</a></td>
|
||||||
<td>{{ item.type }}</td>
|
<td>{{ item.type }}</td>
|
||||||
|
<td>{{ item.location }}</td>
|
||||||
<td>{{ item | owner_link}}</td>
|
<td>{{ item | owner_link}}</td>
|
||||||
<td>{{ item | user_link}}</td>
|
<td>{{ item | user_link}}</td>
|
||||||
{% if can_audit %}
|
{% if can_audit %}
|
||||||
|
@@ -92,6 +92,11 @@
|
|||||||
<td>{{ form.shortener.slug }}</td>
|
<td>{{ form.shortener.slug }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td>Location</td>
|
||||||
|
<td>{{ form.location }}</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
@@ -119,6 +119,11 @@
|
|||||||
<td><a href="{{ item.external_link }}">External link</a></td>
|
<td><a href="{{ item.external_link }}">External link</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td>Location</td>
|
||||||
|
<td>{{ item.location }}</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td class="tooltip" data-tooltip="Unauthenticated user can see this in public list">Public</td>
|
<td class="tooltip" data-tooltip="Unauthenticated user can see this in public list">Public</td>
|
||||||
<td>{% if item.inventory.public %}<i class="material-icons">check_circle</i>{% endif %}</td>
|
<td>{% if item.inventory.public %}<i class="material-icons">check_circle</i>{% endif %}</td>
|
||||||
|
Reference in New Issue
Block a user