1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Fixes #9843: Fix rendering of custom field values (regression from #9647)

This commit is contained in:
jeremystretch
2022-07-26 11:09:51 -04:00
parent 7631722f97
commit d442f8fd60
2 changed files with 11 additions and 10 deletions

View File

@ -105,6 +105,7 @@ Custom field UI visibility has no impact on API operation.
* [#9765](https://github.com/netbox-community/netbox/issues/9765) - Report correct segment count under cable trace UI view
* [#9794](https://github.com/netbox-community/netbox/issues/9794) - Fix link to connect a rear port to a circuit termination
* [#9818](https://github.com/netbox-community/netbox/issues/9818) - Fix circuit side selection when connecting a cable to a circuit termination
* [#9843](https://github.com/netbox-community/netbox/issues/9843) - Fix rendering of custom field values (regression from #9647)
* [#9844](https://github.com/netbox-community/netbox/issues/9844) - Fix interface api request when creating/editing L2VPN termination
### Plugins API

View File

@ -1,26 +1,26 @@
{% if field.type == 'integer' and value is not None %}
{% if customfield.type == 'integer' and value is not None %}
{{ value }}
{% elif field.type == 'longtext' and value %}
{% elif customfield.type == 'longtext' and value %}
{{ value|markdown }}
{% elif field.type == 'boolean' and value == True %}
{% elif customfield.type == 'boolean' and value == True %}
{% checkmark value true="True" %}
{% elif field.type == 'boolean' and value == False %}
{% elif customfield.type == 'boolean' and value == False %}
{% checkmark value false="False" %}
{% elif field.type == 'url' and value %}
{% elif customfield.type == 'url' and value %}
<a href="{{ value }}">{{ value|truncatechars:70 }}</a>
{% elif field.type == 'json' and value %}
{% elif customfield.type == 'json' and value %}
<pre>{{ value|json }}</pre>
{% elif field.type == 'multiselect' and value %}
{% elif customfield.type == 'multiselect' and value %}
{{ value|join:", " }}
{% elif field.type == 'object' and value %}
{% elif customfield.type == 'object' and value %}
{{ value|linkify }}
{% elif field.type == 'multiobject' and value %}
{% elif customfield.type == 'multiobject' and value %}
{% for object in value %}
{{ object|linkify }}{% if not forloop.last %}<br />{% endif %}
{% endfor %}
{% elif value %}
{{ value }}
{% elif field.required %}
{% elif customfield.required %}
<span class="text-warning"><i class="mdi mdi-alert"></i> Not defined</span>
{% else %}
{{ ''|placeholder }}