Browse Source

Rename users results.html template to index_results.html for consistency

Sage Abdullah 1 năm trước cách đây
mục cha
commit
5ae7b07eb8

+ 1 - 1
wagtail/users/templates/wagtailusers/users/index.html

@@ -10,7 +10,7 @@
 
 {% block listing %}
     <div id="listing-results" class="users">
-        {% include "wagtailusers/users/results.html" %}
+        {% include "wagtailusers/users/index_results.html" %}
     </div>
     {% trans "Select all users in listing" as select_all_text %}
     {% include 'wagtailadmin/bulk_actions/footer.html' with select_all_obj_text=select_all_text app_label=app_label model_name=model_name objects=page_obj %}

+ 0 - 0
wagtail/users/templates/wagtailusers/users/results.html → wagtail/users/templates/wagtailusers/users/index_results.html


+ 2 - 2
wagtail/users/tests/test_admin_views.py

@@ -175,7 +175,7 @@ class TestGroupUsersResultsView(WagtailTestUtils, TestCase):
     def test_simple(self):
         response = self.get()
         self.assertEqual(response.status_code, 200)
-        self.assertTemplateUsed(response, "wagtailusers/users/results.html")
+        self.assertTemplateUsed(response, "wagtailusers/users/index_results.html")
         self.assertContains(response, "testuser")
         # response should contain not page furniture
         self.assertNotContains(response, "Add a user")
@@ -283,7 +283,7 @@ class TestUserIndexResultsView(WagtailTestUtils, TestCase):
     def test_simple(self):
         response = self.get()
         self.assertEqual(response.status_code, 200)
-        self.assertTemplateUsed(response, "wagtailusers/users/results.html")
+        self.assertTemplateUsed(response, "wagtailusers/users/index_results.html")
         self.assertContains(response, "testuser")
         # response should not contain page furniture
         self.assertNotContains(response, "Add a user")

+ 1 - 1
wagtail/users/views/users.py

@@ -70,7 +70,7 @@ class Index(IndexView):
     """
 
     template_name = "wagtailusers/users/index.html"
-    results_template_name = "wagtailusers/users/results.html"
+    results_template_name = "wagtailusers/users/index_results.html"
     any_permission_required = ["add", "change", "delete"]
     permission_policy = ModelPermissionPolicy(User)
     model = User