Explorar o código

Fixes #13362: Limit displayed choice set list to 50 choices

Jeremy Stretch %!s(int64=2) %!d(string=hai) anos
pai
achega
4bb0388118
Modificáronse 1 ficheiros con 6 adicións e 1 borrados
  1. 6 1
      netbox/templates/extras/customfieldchoiceset.html

+ 6 - 1
netbox/templates/extras/customfieldchoiceset.html

@@ -55,12 +55,17 @@
                 <th>Label</th>
               </tr>
             </thead>
-            {% for value, label in object.choices %}
+            {% for value, label in object.choices|slice:":50" %}
               <tr>
                 <td>{{ value }}</td>
                 <td>{{ label }}</td>
               </tr>
             {% endfor %}
+            {% if object.choices|length > 50 %}
+              <tr>
+                <td colspan="2" class="text-muted">(Additional choices not displayed)</td>
+              </tr>
+            {% endif %}
           </table>
         </div>
       </div>