Jelajahi Sumber

#19002: Display boolean attributes as checkmarks (#19168)

Jeremy Stretch 11 bulan lalu
induk
melakukan
3444dc503d
1 mengubah file dengan 7 tambahan dan 1 penghapusan
  1. 7 1
      netbox/templates/dcim/moduletype.html

+ 7 - 1
netbox/templates/dcim/moduletype.html

@@ -75,7 +75,13 @@
             {% for k, v in object.attributes.items %}
             {% for k, v in object.attributes.items %}
               <tr>
               <tr>
                 <th scope="row">{{ k }}</th>
                 <th scope="row">{{ k }}</th>
-                <td>{{ v|placeholder }}</td>
+                <td>
+                  {% if v is True or v is False %}
+                    {% checkmark v %}
+                  {% else %}
+                    {{ v|placeholder }}
+                  {% endif %}
+                </td>
               </tr>
               </tr>
             {% endfor %}
             {% endfor %}
           </table>
           </table>