Sfoglia il codice sorgente

Add warning for legacy ASN field on site

jeremystretch 3 anni fa
parent
commit
0f5fe746e0
1 ha cambiato i file con 46 aggiunte e 45 eliminazioni
  1. 46 45
      netbox/templates/dcim/site.html

+ 46 - 45
netbox/templates/dcim/site.html

@@ -80,7 +80,14 @@
           </tr>
           </tr>
           <tr>
           <tr>
             <th scope="row">AS Number</th>
             <th scope="row">AS Number</th>
-            <td>{{ object.asn|placeholder }}</td>
+            <td>
+              {% if object.asn %}
+                <div class="float-end text-warning">
+                  <i class="mdi mdi-alert" title="This field will be removed in NetBox v3.2. Please migrate this data to ASN objects."></i>
+                </div>
+              {% endif %}
+              {{ object.asn|placeholder }}
+            </td>
           </tr>
           </tr>
           <tr>
           <tr>
             <th scope="row">Time Zone</th>
             <th scope="row">Time Zone</th>
@@ -128,50 +135,44 @@
             </td>
             </td>
           </tr>
           </tr>
           {# Legacy contact fields #}
           {# Legacy contact fields #}
-          {% with deprecation_warning="This field will be removed in a future release. Please migrate this data to contact objects." %}
-            {% if object.contact_name %}
-              <tr>
-                <th scope="row">Contact Name</th>
-                <td>
-                  {% if object.contact_name %}
-                    <div class="float-end text-warning">
-                      <i class="mdi mdi-alert" title="{{ deprecation_warning }}"></i>
-                    </div>
-                  {% endif %}
-                  {{ object.contact_name|placeholder }}
-                </td>
-              </tr>
-            {% endif %}
-            {% if object.contact_phone %}
-              <tr>
-                <th scope="row">Contact Phone</th>
-                <td>
-                  {% if object.contact_phone %}
-                    <div class="float-end text-warning">
-                      <i class="mdi mdi-alert" title="{{ deprecation_warning }}"></i>
-                    </div>
-                    <a href="tel:{{ object.contact_phone }}">{{ object.contact_phone }}</a>
-                  {% else %}
-                    <span class="text-muted">&mdash;</span>
-                  {% endif %}
-                </td>
-              </tr>
-            {% endif %}
-            {% if object.contact_email %}
-              <tr>
-                <th scope="row">Contact E-Mail</th>
-                <td>
-                  {% if object.contact_email %}
-                    <div class="float-end text-warning">
-                      <i class="mdi mdi-alert" title="{{ deprecation_warning }}"></i>
-                    </div>
-                    <a href="mailto:{{ object.contact_email }}">{{ object.contact_email }}</a>
-                  {% else %}
-                    <span class="text-muted">&mdash;</span>
-                  {% endif %}
-                </td>
-              </tr>
-            {% endif %}
+          {% with deprecation_warning="This field will be removed in NetBox v3.2. Please migrate this data to contact objects." %}
+            <tr>
+              <th scope="row">Contact Name</th>
+              <td>
+                {% if object.contact_name %}
+                  <div class="float-end text-warning">
+                    <i class="mdi mdi-alert" title="{{ deprecation_warning }}"></i>
+                  </div>
+                {% endif %}
+                {{ object.contact_name|placeholder }}
+              </td>
+            </tr>
+            <tr>
+              <th scope="row">Contact Phone</th>
+              <td>
+                {% if object.contact_phone %}
+                  <div class="float-end text-warning">
+                    <i class="mdi mdi-alert" title="{{ deprecation_warning }}"></i>
+                  </div>
+                  <a href="tel:{{ object.contact_phone }}">{{ object.contact_phone }}</a>
+                {% else %}
+                  <span class="text-muted">&mdash;</span>
+                {% endif %}
+              </td>
+            </tr>
+            <tr>
+              <th scope="row">Contact E-Mail</th>
+              <td>
+                {% if object.contact_email %}
+                  <div class="float-end text-warning">
+                    <i class="mdi mdi-alert" title="{{ deprecation_warning }}"></i>
+                  </div>
+                  <a href="mailto:{{ object.contact_email }}">{{ object.contact_email }}</a>
+                {% else %}
+                  <span class="text-muted">&mdash;</span>
+                {% endif %}
+              </td>
+            </tr>
           {% endwith %}
           {% endwith %}
         </table>
         </table>
       </div>
       </div>