Sfoglia il codice sorgente

Documentation - Remove ambiguity about ModelAdmin templates

- The modeladmin folder needs to be inside the templates folder of the relevant app.
- The way it was written makes it seem like /modeladmin/ should be placed in the project root directory.
Joe Howard 4 anni fa
parent
commit
4ab7080fb8

+ 1 - 0
CHANGELOG.txt

@@ -30,6 +30,7 @@ Changelog
  * User Group permissions will now show all custom object permissions in one row instead of a separate table (Kamil Marut)User Group permissions editing in the admin will now show all custom object permissions in one row instead of a separate table (Kamil Marut)
  * Create `ImageFileMixin` to extract shared file handling methods from `AbstractImage` and `AbstractRendition` (Fabien Le Frapper)
  * Add `before_delete_page` example to Hooks documentation (Jane Liu)
+ * Add clarity to modeladmin template override behaviour in the documentation (Joe Howard, Dan Swain)
  * Fix: Delete button is now correct colour on snippets and modeladmin listings (Brandon Murch)
  * Fix: Ensure that StreamBlock / ListBlock-level validation errors are counted towards error counts (Matt Westcott)
  * Fix: InlinePanel add button is now keyboard navigatable (Jesse Menn)

+ 1 - 0
CONTRIBUTORS.rst

@@ -542,6 +542,7 @@ Contributors
 * Wout De Puysseleir
 * Kamil Marut
 * Jane Liu
+* Joe Howard
 
 Translators
 ===========

+ 5 - 5
docs/reference/contrib/modeladmin/primer.rst

@@ -141,16 +141,16 @@ Overriding templates
 --------------------
 
 For all modeladmin views, Wagtail looks for templates in the following folders
-within your project, before resorting to the defaults:
+within your project or app, before resorting to the defaults:
 
-1. ``/modeladmin/app-name/model-name/``
-2. ``/modeladmin/app-name/``
-3. ``/modeladmin/``
+1. ``templates/modeladmin/app-name/model-name/``
+2. ``templates/modeladmin/app-name/``
+3. ``templates/modeladmin/``
 
 So, to override the template used by ``IndexView`` for example, you'd create a
 new ``index.html`` template and put it in one of those locations.  For example,
 if you wanted to do this for an ``ArticlePage`` model in a ``news`` app, you'd
-add your custom template as ``modeladmin/news/articlepage/index.html``.
+add your custom template as ``news/templates/modeladmin/news/articlepage/index.html``.
 
 For reference, ``modeladmin`` looks for templates with the following names for
 each view:

+ 1 - 0
docs/releases/2.15.rst

@@ -41,6 +41,7 @@ Other features
  * User Group permissions editing in the admin will now show all custom object permissions in one row instead of a separate table (Kamil Marut)
  * Create ``ImageFileMixin`` to extract shared file handling methods from ``AbstractImage`` and ``AbstractRendition`` (Fabien Le Frapper)
  * Add ``before_delete_page`` example to Hooks documentation (Jane Liu)
+ * Add clarity to modeladmin template override behaviour in the documentation (Joe Howard, Dan Swain)
 
 Bug fixes
 ~~~~~~~~~