diff --git a/src/registrar/templates/admin/change_list_results.html b/src/registrar/templates/admin/change_list_results.html index a9c5e5b4d..9ee3f9f59 100644 --- a/src/registrar/templates/admin/change_list_results.html +++ b/src/registrar/templates/admin/change_list_results.html @@ -17,53 +17,45 @@ Load our custom filters to extract info from the django generated markup. -{# .gov - hardcode the select all checkbox #} - -
- - - - -
-
- -{# .gov - don't let django generate the select all checkbox #} -{% for header in result_headers|slice:"1:" %} +{% if results.0.form %} + {# .gov - hardcode the select all checkbox #} + +
+ + + + +
+
+ + {# .gov - don't let django generate the select all checkbox #} + {% for header in result_headers|slice:"1:" %} + + {% if header.sortable %} + {% if header.sort_priority > 0 %} +
+ + {% if num_sorted_fields > 1 %}{{ header.sort_priority }}{% endif %} + +
+ {% endif %} + {% endif %} +
{% if header.sortable %}{{ header.text|capfirst }}{% else %}{{ header.text|capfirst }}{% endif %}
+
+ {% endfor %} - - {% if header.sortable %} - {% if header.sort_priority > 0 %} -
- - {% if num_sorted_fields > 1 %}{{ header.sort_priority }}{% endif %} - -
- {% endif %} - {% endif %} -
{% if header.sortable %}{{ header.text|capfirst }}{% else %}{{ header.text|capfirst }}{% endif %}
-
-{% endfor %} + + + - - - + {% comment %} + .gov - hardcode the row checkboxes using the custom filters to extract + the value attribute's value, and a label based on the anchor elements's + text. Then edit the for loop to keep django from generating the row select + checkboxes. + {% endcomment %} -{% comment %} -{% for result in results %} -{% if result.form.non_field_errors %} - {{ result.form.non_field_errors }} -{% endif %} -{% for item in result %}{{ item }}{% endfor %} -{% endfor %} -{% endcomment %} - -{% comment %} -.gov - hardcode the row checkboxes using the custom filters to extract -the value attribute's value, and a label based on the anchor elements's -text. Then edit the for loop to keep django from generating the row select -checkboxes. -{% endcomment %} -{% for result in results %} + {% for result in results %} {% if result.form.non_field_errors %} {{ result.form.non_field_errors }} {% endif %} @@ -82,7 +74,37 @@ checkboxes. {{ item }} {% endfor %} -{% endfor %} + {% endfor %} + +{% else %} {# results doesn't have a form as its first element #} + + {% for header in result_headers %} + + {% if header.sortable %} + {% if header.sort_priority > 0 %} +
+ + {% if num_sorted_fields > 1 %}{{ header.sort_priority }}{% endif %} + +
+ {% endif %} + {% endif %} +
{% if header.sortable %}{{ header.text|capfirst }}{% else %}{{ header.text|capfirst }}{% endif %}
+
+ {% endfor %} + + + + + + {% for result in results %} + {% if result.form.non_field_errors %} + {{ result.form.non_field_errors }} + {% endif %} + {% for item in result %}{{ item }}{% endfor %} + {% endfor %} + +{% endif %}