فهرست منبع

Fixes #4090: Render URL custom fields as links under object view

Jeremy Stretch 6 سال پیش
والد
کامیت
2296cdc222
2فایلهای تغییر یافته به همراه5 افزوده شده و 4 حذف شده
  1. 1 0
      docs/release-notes/version-2.7.md
  2. 4 4
      netbox/templates/inc/custom_fields_panel.html

+ 1 - 0
docs/release-notes/version-2.7.md

@@ -3,6 +3,7 @@
 ## Bug Fixes
 ## Bug Fixes
 
 
 * [#4089](https://github.com/netbox-community/netbox/issues/4089) - Selection of power outlet type during bulk update is optional
 * [#4089](https://github.com/netbox-community/netbox/issues/4089) - Selection of power outlet type during bulk update is optional
+* [#4090](https://github.com/netbox-community/netbox/issues/4090) - Render URL custom fields as links under object view
 * [#4091](https://github.com/netbox-community/netbox/issues/4091) - Fix filtering of objects by custom fields using UI search form
 * [#4091](https://github.com/netbox-community/netbox/issues/4091) - Fix filtering of objects by custom fields using UI search form
 * [#4099](https://github.com/netbox-community/netbox/issues/4099) - Linkify interfaces on global interfaces list
 * [#4099](https://github.com/netbox-community/netbox/issues/4099) - Linkify interfaces on global interfaces list
 
 

+ 4 - 4
netbox/templates/inc/custom_fields_panel.html

@@ -9,13 +9,13 @@
                     <tr>
                     <tr>
                         <td>{{ field }}</td>
                         <td>{{ field }}</td>
                         <td>
                         <td>
-                            {% if field.type == 300 and value == True %}
+                            {% if field.type == 'boolean' and value == True %}
                                 <i class="glyphicon glyphicon-ok text-success" title="True"></i>
                                 <i class="glyphicon glyphicon-ok text-success" title="True"></i>
-                            {% elif field.type == 300 and value == False %}
+                            {% elif field.type == 'boolean' and value == False %}
                                 <i class="glyphicon glyphicon-remove text-danger" title="False"></i>
                                 <i class="glyphicon glyphicon-remove text-danger" title="False"></i>
-                            {% elif field.type == 500 and value %}
+                            {% elif field.type == 'url' and value %}
                                 <a href="{{ value }}">{{ value|truncatechars:70 }}</a>
                                 <a href="{{ value }}">{{ value|truncatechars:70 }}</a>
-                            {% elif field.type == 200 or value %}
+                            {% elif field.type == 'integer' or value %}
                                 {{ value }}
                                 {{ value }}
                             {% elif field.required %}
                             {% elif field.required %}
                                 <span class="text-warning">Not defined</span>
                                 <span class="text-warning">Not defined</span>