Repository: cfpb/wagtail-inventory (language: python)

Issue:
Columns misaligned when using Wagtail 2.15
The upgrade to Wagtail 2.15 caused the columns in the results table to be misaligned. The header has an extra item at the beginning of the row (for selecting all for bulk actions). And it would appear that `allow_navigation=0` to prevent users from navigating away from the page doesn't work since https://github.com/wagtail/wagtail/commit/e93b21036e7425531edb49bc2526f47afc9c57e1

## Screenshots
<img width="1039" alt="WagtailInventoryIssue" src="https://user-images.githubusercontent.com/5952/150041966-afa7a5f0-98df-4a82-b60d-a76e972d5aae.png">


I am honestly not sure what the expected behavior should be for these. I "fixed" the `allow_navigation` issue in my fork by overriding the `_list_explore.html` to comment out `{% block page_navigation %}`

And I elected to make bulk actions work by adding the following code to search.html: 

```
{% block extra_js %}
   {{ block.super }}
   <script>
       window.wagtailConfig.BULK_ACTION_ITEM_TYPE = 'PAGE';
   </script>
   <script defer src="{% versioned_static 'wagtailadmin/js/bulk-actions.js' %}"></script>
{% endblock %}
```

And then in the results section, I added `show_bulk_actions=1` to the _list_explore include and then added the last 2 lines to get the footer which appears when you select one or more of the bulk actions checkboxes.

```
{% include "wagtailinventory/_list_explore.html" with show_bulk_actions=1 show_parent=1 %}
{% include "wagtailadmin/shared/pagination_nav.html" with items=pages %}
{% trans "Select all pages in listing" as select_all_text %}
{% include 'wagtailadmin/bulk_actions/footer.html' with select_all_obj_text=select_all_text app_label='wagtailcore' model_name='page' objects=pages %}
```

If you would like to tell me how you would like these 2 items resolved, I could submit a PR - but it may be faster for your team to decide and then put in place whatever fix you have decided on.


Discussion / hints:
I have looked at this today, and played around with some options. Will bring what you have found, as well as what I have found, to the team tomorrow or Monday. 

Not sure we need to worry too much about navigation. Is it needed on the inventory page? No. Does it hurt to have it there? Eh... not really either. Also not much of a great way with the implementation from Wagtail to disable it effectively, as you have seen. Which leads me to lean towards just adapting to supporting it being there. 

The only other option that I can see off-hand, would be for us to make our own listings template that mimics closely to Wagtails, but this then adds a set of maintenance to this project that I don't think is necessary, just to avoid not having the navigation column. 

I think it probably also makes sense to bring in bulk actions, as there may be some use cases for having them.

Will report back when I get feedback from the team. 

Fix patch:
diff --git a/README.rst b/README.rst
index 24eb82d..4f15306 100644
--- a/README.rst
+++ b/README.rst
@@ -20,7 +20,7 @@ Install the package using pip:
 .. code-block:: bash
 
   $ pip install wagtail-inventory
- 
+
 Add ``wagtailinventory`` as an installed app in your Django settings:
 
 .. code-block:: python
@@ -52,8 +52,8 @@ Compatibility
 This code has been tested for compatibility with:
 
 * Python 3.6+
-* Django 2.2 (LTS), 3.1 (current)
-* Wagtail 2.7 (LTS), 2.10 (current)
+* Django 3.2 (LTS)
+* Wagtail 2.15 (LTS), 2.16 (current)
 
 It should be compatible with all intermediate versions, as well.
 If you find that it is not, please `file an issue <https://github.com/cfpb/wagtail-inventory/issues/new>`_.
diff --git a/setup.py b/setup.py
index 6f9d17f..24b5871 100644
--- a/setup.py
+++ b/setup.py
@@ -3,7 +3,7 @@
 
 install_requires = [
     "tqdm==4.15.0",
-    "wagtail>=2.7,<3",
+    "wagtail>=2.15,<3",
 ]
 
 
@@ -25,7 +25,7 @@
     description="Lookup Wagtail pages by block content",
     long_description=open("README.rst", "r", encoding="utf-8").read(),
     license="CCO",
-    version="1.3",
+    version="1.4",
     version_format="{tag}.dev{commitcount}+{gitsha}",
     include_package_data=True,
     packages=find_packages(),
diff --git a/tox.ini b/tox.ini
index 033918a..80fd9f4 100644
--- a/tox.ini
+++ b/tox.ini
@@ -2,8 +2,8 @@
 skipsdist=True
 envlist=
     lint,
-    py{36}-dj22-wag{27,latest}
-    py{39}-dj{22,32}-wag{latest}
+    py{36}-dj32-wag{215,latest}
+    py{39}-dj32-wag{215,latest}
 
 [testenv]
 install_command=pip install -e ".[testing]" -U {opts} {packages}
@@ -20,10 +20,9 @@ basepython=
 
 deps=
     mock>=1.0.0
-    dj22:  Django>=2.2,<2.3
     dj32:  Django>=3.2,<3.3
-    wag27: wagtail>=2.7,<2.8
-    waglatest: wagtail>=2.10,<3
+    wag215: wagtail>=2.15,<2.16
+    waglatest: wagtail>=2.15,<3
 
 [testenv:lint]
 basepython=python3.9
diff --git a/wagtailinventory/templates/wagtailinventory/_list_explore_inventory.html b/wagtailinventory/templates/wagtailinventory/_list_explore_inventory.html
new file mode 100644
index 0000000..ada7f14
--- /dev/null
+++ b/wagtailinventory/templates/wagtailinventory/_list_explore_inventory.html
@@ -0,0 +1,4 @@
+{% extends 'wagtailadmin/pages/listing/_list_explore.html' %}
+
+{% block page_navigation %}
+{% endblock %}
diff --git a/wagtailinventory/templates/wagtailinventory/search.html b/wagtailinventory/templates/wagtailinventory/search.html
index 4b4e617..43361a9 100644
--- a/wagtailinventory/templates/wagtailinventory/search.html
+++ b/wagtailinventory/templates/wagtailinventory/search.html
@@ -28,6 +28,14 @@
 </style>
 {% endblock %}
 
+{% block extra_js %}
+   {{ block.super }}
+   <script>
+       window.wagtailConfig.BULK_ACTION_ITEM_TYPE = 'PAGE';
+   </script>
+   <script defer src="{% versioned_static 'wagtailadmin/js/bulk-actions.js' %}"></script>
+{% endblock %}
+
 {% block content %}
 {% trans "Block Inventory" as header_str %}
 {% include "wagtailadmin/shared/header.html" with title=header_str icon="placeholder" %}
@@ -54,8 +62,10 @@ <h2>
         {% endblocktrans %}
       </h2>
 
-      {% include "wagtailadmin/pages/listing/_list_explore.html" with show_parent=1 allow_navigation=0 %}
+      {% include "wagtailinventory/_list_explore_inventory.html" with show_parent=1 show_bulk_actions=1 %}
       {% include "wagtailadmin/shared/pagination_nav.html" with items=pages %}
+      {% trans "Select all pages in listing" as select_all_text %}
+      {% include 'wagtailadmin/bulk_actions/footer.html' with select_all_obj_text=select_all_text app_label='wagtailcore' model_name='page' objects=pages %}
     </div>
   {% else %}
     <div class="nice-padding">


Test patch:
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 8fb6771..f7254cb 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -32,16 +32,16 @@ jobs:
     strategy:
       matrix:
         toxenv:
-            - py36-dj22-wag27
-            - py36-dj22-waglatest
-            - py39-dj22-waglatest
+            - py36-dj32-wag215
+            - py36-dj32-waglatest
+            - py39-dj32-wag215
             - py39-dj32-waglatest
         include:
-          - toxenv: py36-dj22-wag27
+          - toxenv: py36-dj32-wag215
             python-version: 3.6
-          - toxenv: py36-dj22-waglatest
+          - toxenv: py36-dj32-waglatest
             python-version: 3.6
-          - toxenv: py39-dj22-waglatest
+          - toxenv: py39-dj32-wag215
             python-version: 3.9
           - toxenv: py39-dj32-waglatest
             python-version: 3.9