Minor fix in CRUDKit build_href: We don't necessarily only want to link to CRUDKit blueprints.
This commit is contained in:
parent
d8e8790987
commit
15d0de44fe
4 changed files with 11 additions and 11 deletions
|
|
@ -43,7 +43,7 @@ def init_listing_routes(app):
|
|||
{"field": "model"},
|
||||
{"field": "device_type.description", "label": "Device Type"},
|
||||
{"field": "condition"},
|
||||
{"field": "owner.label", "label": "Contact", "link": {"endpoint": "user.get_item", "params": {"id": "{owner.id}"}}},
|
||||
{"field": "owner.label", "label": "Contact", "link": {"endpoint": "entry.entry", "params": {"id": "{owner.id}", "model": "user"}}},
|
||||
{"field": "location.label", "label": "Room"},
|
||||
]
|
||||
elif model.lower() == 'user':
|
||||
|
|
@ -60,7 +60,7 @@ def init_listing_routes(app):
|
|||
{"field": "label", "label": "Full Name"},
|
||||
{"field": "last_name"},
|
||||
{"field": "first_name"},
|
||||
{"field": "supervisor.label", "label": "Supervisor", "link": {"endpoint": "user.get_item", "params": {"id": "{supervisor.id}"}}},
|
||||
{"field": "supervisor.label", "label": "Supervisor", "link": {"endpoint": "entry.entry", "params": {"id": "{supervisor.id}", "model": "user"}}},
|
||||
{"field": "staff", "format": "yesno"},
|
||||
{"field": "active", "format": "yesno"},
|
||||
]
|
||||
|
|
@ -80,8 +80,8 @@ def init_listing_routes(app):
|
|||
"complete",
|
||||
]}
|
||||
columns = [
|
||||
{"field": "work_item.label", "label": "Work Item", "link": {"endpoint": "inventory.get_item", "params": {"id": "{work_item.id}"}}},
|
||||
{"field": "contact.label", "label": "Contact", "link": {"endpoint": "user.get_item", "params": {"id": "{contact.id}"}}},
|
||||
{"field": "work_item.label", "label": "Work Item", "link": {"endpoint": "entry.entry", "params": {"id": "{work_item.id}", "model": "inventory"}}},
|
||||
{"field": "contact.label", "label": "Contact", "link": {"endpoint": "entry.entry", "params": {"id": "{contact.id}", "model": "user"}}},
|
||||
{"field": "start_time", "format": "datetime"},
|
||||
{"field": "end_time", "format": "datetime"},
|
||||
{"field": "complete", "format": "yesno"},
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
<tbody>
|
||||
{% if rows %}
|
||||
{% for row in rows %}
|
||||
<tr onclick="location.href='{{ url_for( 'crudkit.' + kwargs['object_class'] + '.get_item', id=row.id) }}'" style="cursor: pointer;" class="{{ row.class or '' }}">
|
||||
<tr onclick="location.href='{{ url_for( 'entry.entry', model=kwargs['object_class'], id=row.id) }}'" style="cursor: pointer;" class="{{ row.class or '' }}">
|
||||
{% for cell in row.cells %}
|
||||
{% if cell.href %}
|
||||
<td class="{{ cell.class or '' }}"><a href="{{ cell.href }}" class="link-success link-underline link-underline-opacity-0 fw-semibold">{{ cell.text if cell.text is not none else '-' }}</a></td>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<img src="{{ url_for('static', filename=field['value_label']) }}" alt="{{ value }}"
|
||||
{% if field['attrs'] %}{% for k,v in field['attrs'].items() %}
|
||||
{{k}}{% if v is not sameas true %}="{{ v }}"{% endif %}
|
||||
{% endfor %}{% endif %}>
|
||||
{% if value %}
|
||||
<img src="{{ url_for('static', filename=field['value_label']) }}" alt="{{ value }}" {% if field['attrs'] %}{% for k,v in
|
||||
field['attrs'].items() %} {{k}}{% if v is not sameas true %}="{{ v }}" {% endif %} {% endfor %}{% endif %}>
|
||||
{% endif %}
|
||||
Loading…
Add table
Add a link
Reference in a new issue