Kaynağa Gözat

Clean up display of tenant groups

jeremystretch 3 yıl önce
ebeveyn
işleme
7c14b8d97b

+ 3 - 7
netbox/templates/circuits/circuit.html

@@ -35,14 +35,10 @@
                     <tr>
                         <th scope="row">Tenant</th>
                         <td>
-                            {% if object.tenant %}
-                                {% if object.tenant.group %}
-                                    {{ object.tenant.group|linkify }} /
-                                {% endif %}
-                                {{ object.tenant|linkify }}
-                            {% else %}
-                                <span class="text-muted">None</span>
+                            {% if object.tenant.group %}
+                                {{ object.tenant.group|linkify }} /
                             {% endif %}
+                            {{ object.tenant|linkify|placeholder }}
                         </td>
                     </tr>
                     <tr>

+ 3 - 7
netbox/templates/dcim/cable.html

@@ -24,14 +24,10 @@
                         <tr>
                             <th scope="row">Tenant</th>
                             <td>
-                                {% if object.tenant %}
-                                    {% if object.tenant.group %}
-                                        {{ object.tenant.group|linkify }} /
-                                    {% endif %}
-                                    {{ object.tenant|linkify }}
-                                {% else %}
-                                    <span class="text-muted">None</span>
+                                {% if object.tenant.group %}
+                                    {{ object.tenant.group|linkify }} /
                                 {% endif %}
+                                {{ object.tenant|linkify|placeholder }}
                             </td>
                         </tr>
                         <tr>

+ 3 - 7
netbox/templates/dcim/device.html

@@ -76,14 +76,10 @@
                         <tr>
                             <th scope="row">Tenant</th>
                             <td>
-                                {% if object.tenant %}
-                                    {% if object.tenant.group %}
-                                        {{ object.tenant.group|linkify }} /
-                                    {% endif %}
-                                    {{ object.tenant|linkify }}
-                                {% else %}
-                                    <span class="text-muted">None</span>
+                                {% if object.tenant.group %}
+                                    {{ object.tenant.group|linkify }} /
                                 {% endif %}
+                                {{ object.tenant|linkify|placeholder }}
                             </td>
                         </tr>
                         <tr>

+ 7 - 11
netbox/templates/dcim/location.html

@@ -44,17 +44,13 @@
             <td>{{ object.parent|linkify|placeholder }}</td>
           </tr>
           <tr>
-              <th scope="row">Tenant</th>
-              <td>
-                  {% if object.tenant %}
-                      {% if object.tenant.group %}
-                          {{ object.tenant.group|linkify }} /
-                      {% endif %}
-                      {{ object.tenant|linkify }}
-                  {% else %}
-                      <span class="text-muted">None</span>
-                  {% endif %}
-              </td>
+            <th scope="row">Tenant</th>
+            <td>
+              {% if object.tenant.group %}
+                {{ object.tenant.group|linkify }} /
+              {% endif %}
+              {{ object.tenant|linkify|placeholder }}
+            </td>
           </tr>
           <tr>
             <th scope="row">Racks</th>

+ 3 - 7
netbox/templates/dcim/rack.html

@@ -64,14 +64,10 @@
                     <tr>
                         <th scope="row">Tenant</th>
                         <td>
-                            {% if object.tenant %}
-                                {% if object.tenant.group %}
-                                    {{ object.tenant.group|linkify }} /
-                                {% endif %}
-                                {{ object|linkify }}
-                            {% else %}
-                                <span class="text-muted">None</span>
+                            {% if object.tenant.group %}
+                                {{ object.tenant.group|linkify }} /
                             {% endif %}
+                            {{ object.tenant|linkify|placeholder }}
                         </td>
                     </tr>
                      <tr>

+ 3 - 7
netbox/templates/dcim/rackreservation.html

@@ -54,14 +54,10 @@
                     <tr>
                         <th scope="row">Tenant</th>
                         <td>
-                            {% if object.tenant %}
-                                {% if object.tenant.group %}
-                                    {{ object.tenant.group|linkify }} /
-                                {% endif %}
-                                {{ object.tenant|linkify }}
-                            {% else %}
-                                <span class="text-muted">None</span>
+                            {% if object.tenant.group %}
+                                {{ object.tenant.group|linkify }} /
                             {% endif %}
+                            {{ object.tenant|linkify|placeholder }}
                         </td>
                     </tr>
                     <tr>

+ 3 - 7
netbox/templates/dcim/site.html

@@ -58,14 +58,10 @@
           <tr>
             <th scope="row">Tenant</th>
             <td>
-              {% if object.tenant %}
-                {% if object.tenant.group %}
-                  {{ object.tenant.group|linkify }} /
-                {% endif %}
-                {{ object.tenant|linkify }}
-              {% else %}
-                <span class="text-muted">None</span>
+              {% if object.tenant.group %}
+                {{ object.tenant.group|linkify }} /
               {% endif %}
+              {{ object.tenant|linkify|placeholder }}
             </td>
           </tr>
           <tr>

+ 3 - 7
netbox/templates/ipam/aggregate.html

@@ -29,14 +29,10 @@
             <tr>
               <td>Tenant</td>
               <td>
-                {% if object.tenant %}
-                  {% if prefix.object.group %}
-                    {{ object.tenant.group|linkify }} /
-                  {% endif %}
-                  {{ object.tenant|linkify }}
-                {% else %}
-                  <span class="text-muted">None</span>
+                {% if object.tenant.group %}
+                  {{ object.tenant.group|linkify }} /
                 {% endif %}
+                {{ object.tenant|linkify|placeholder }}
               </td>
             </tr>
             <tr>

+ 3 - 7
netbox/templates/ipam/asn.html

@@ -29,14 +29,10 @@
             <tr>
               <td>Tenant</td>
               <td>
-                {% if object.tenant %}
-                  {% if object.tenant.group %}
-                    {{ object.tenant.group|linkify }} /
-                  {% endif %}
-                  {{ object.tenant|linkify }}
-                {% else %}
-                  <span class="text-muted">None</span>
+                {% if object.tenant.group %}
+                  {{ object.tenant.group|linkify }} /
                 {% endif %}
+                {{ object.tenant|linkify|placeholder }}
               </td>
             </tr>
             <tr>

+ 3 - 7
netbox/templates/ipam/ipaddress.html

@@ -36,14 +36,10 @@
                   <tr>
                       <th scope="row">Tenant</th>
                       <td>
-                          {% if object.tenant %}
-                              {% if object.tenant.group %}
-                                  {{ object.tenant.group|linkify }} /
-                              {% endif %}
-                              {{ object.tenant|linkify }}
-                          {% else %}
-                              <span class="text-muted">None</span>
+                          {% if object.tenant.group %}
+                              {{ object.tenant.group|linkify }} /
                           {% endif %}
+                          {{ object.tenant|linkify|placeholder }}
                       </td>
                   </tr>
                   <tr>

+ 3 - 7
netbox/templates/ipam/iprange.html

@@ -54,14 +54,10 @@
                 <tr>
                     <th scope="row">Tenant</th>
                     <td>
-                        {% if object.tenant %}
-                            {% if object.tenant.group %}
-                                {{ object.tenant.group|linkify }} /
-                            {% endif %}
-                            {{ object.tenant|linkify }}
-                        {% else %}
-                            <span class="text-muted">None</span>
+                        {% if object.tenant.group %}
+                            {{ object.tenant.group|linkify }} /
                         {% endif %}
+                        {{ object.tenant|linkify|placeholder }}
                     </td>
                 </tr>
                 <tr>

+ 3 - 7
netbox/templates/ipam/prefix.html

@@ -26,16 +26,12 @@
           </tr>
           <tr>
             <th scope="row">Tenant</th>
-            <td>
-              {% if object.tenant %}
+              <td>
                 {% if object.tenant.group %}
                   {{ object.tenant.group|linkify }} /
                 {% endif %}
-                {{ object.tenant|linkify }}
-              {% else %}
-                <span class="text-muted">None</span>
-              {% endif %}
-            </td>
+                {{ object.tenant|linkify|placeholder }}
+              </td>
           </tr>
           <tr>
             <th scope="row">Aggregate</th>

+ 3 - 7
netbox/templates/ipam/vlan.html

@@ -40,14 +40,10 @@
                         <tr>
                             <th scope="row">Tenant</th>
                             <td>
-                                {% if object.tenant %}
-                                    {% if object.tenant.group %}
-                                        {{ object.tenant.group|linkify }} /
-                                    {% endif %}
-                                    {{ object.tenant|linkify }}
-                                {% else %}
-                                    <span class="text-muted">None</span>
+                                {% if object.tenant.group %}
+                                    {{ object.tenant.group|linkify }} /
                                 {% endif %}
+                                {{ object.tenant|linkify|placeholder }}
                             </td>
                         </tr>
                         <tr>

+ 6 - 1
netbox/templates/ipam/vrf.html

@@ -20,7 +20,12 @@
                   </tr>
                   <tr>
                       <th scope="row">Tenant</th>
-                      <td>{{ object.tenant|linkify|placeholder }}</td>
+                      <td>
+                          {% if object.tenant.group %}
+                              {{ object.tenant.group|linkify }} /
+                          {% endif %}
+                          {{ object.tenant|linkify|placeholder }}
+                      </td>
                   </tr>
                   <tr>
                       <th scope="row">Unique IP Space</th>

+ 6 - 1
netbox/templates/virtualization/cluster.html

@@ -25,7 +25,12 @@
                 </tr>
                 <tr>
                     <th scope="row">Tenant</th>
-                    <td>{{ object.tenant|linkify }}</td>
+                    <td>
+                        {% if object.tenant.group %}
+                            {{ object.tenant.group|linkify }} /
+                        {% endif %}
+                        {{ object.tenant|linkify|placeholder }}
+                    </td>
                 </tr>
                 <tr>
                     <th scope="row">Site</th>

+ 3 - 7
netbox/templates/virtualization/virtualmachine.html

@@ -32,14 +32,10 @@
                     <tr>
                         <th scope="row">Tenant</th>
                         <td>
-                            {% if object.tenant %}
-                                {% if object.tenant.group %}
-                                    {{ object.tenant.group|linkify }} /
-                                {% endif %}
-                                {{ object.tenant|linkify }}
-                            {% else %}
-                                <span class="text-muted">None</span>
+                            {% if object.tenant.group %}
+                                {{ object.tenant.group|linkify }} /
                             {% endif %}
+                            {{ object.tenant|linkify|placeholder }}
                         </td>
                     </tr>
                     <tr>