From 1853e2dbf2e290ec04e3389d523bbe4bad94a42e Mon Sep 17 00:00:00 2001 From: Curtis Maloney Date: Tue, 11 Sep 2018 03:00:34 +1000 Subject: [2.1.x] Refs #20910 -- Replaced snippet directive with code-block. Backport of c49ea6f5911296dcb40190c905e38b43cdc7c7a3 from master --- docs/ref/contrib/admin/index.txt | 20 ++++++++++---------- docs/ref/contrib/admin/javascript.txt | 8 ++++---- 2 files changed, 14 insertions(+), 14 deletions(-) (limited to 'docs/ref/contrib') diff --git a/docs/ref/contrib/admin/index.txt b/docs/ref/contrib/admin/index.txt index 216db7937b..ffc0ecca73 100644 --- a/docs/ref/contrib/admin/index.txt +++ b/docs/ref/contrib/admin/index.txt @@ -2933,8 +2933,8 @@ instantiate any other Python class) and register your models and ``ModelAdmin`` subclasses with it instead of with the default site. Finally, update :file:`myproject/urls.py` to reference your :class:`AdminSite` subclass. -.. snippet:: - :filename: myapp/admin.py +.. code-block:: python + :caption: myapp/admin.py from django.contrib.admin import AdminSite @@ -2947,8 +2947,8 @@ update :file:`myproject/urls.py` to reference your :class:`AdminSite` subclass. admin_site.register(MyModel) -.. snippet:: - :filename: myproject/urls.py +.. code-block:: python + :caption: myproject/urls.py from django.urls import path @@ -2976,24 +2976,24 @@ You can override the default ``django.contrib.admin.site`` by setting the to the dotted import path of either a ``AdminSite`` subclass or a callable that returns a site instance. -.. snippet:: - :filename: myproject/admin.py +.. code-block:: python + :caption: myproject/admin.py from django.contrib import admin class MyAdminSite(admin.AdminSite): ... -.. snippet:: - :filename: myproject/apps.py +.. code-block:: python + :caption: myproject/apps.py from django.contrib.admin.apps import AdminConfig class MyAdminConfig(AdminConfig): default_site = 'myproject.admin.MyAdminSite' -.. snippet:: - :filename: myproject/settings.py +.. code-block:: python + :caption: myproject/settings.py INSTALLED_APPS = [ ... diff --git a/docs/ref/contrib/admin/javascript.txt b/docs/ref/contrib/admin/javascript.txt index 52374800b4..bf94655f38 100644 --- a/docs/ref/contrib/admin/javascript.txt +++ b/docs/ref/contrib/admin/javascript.txt @@ -31,8 +31,8 @@ In your custom ``change_form.html`` template, extend the {% endblock %} -.. snippet:: javascript - :filename: app/static/app/formset_handlers.js +.. code-block:: javascript + :caption: app/static/app/formset_handlers.js (function($) { $(document).on('formset:added', function(event, $row, formsetName) { @@ -69,8 +69,8 @@ namespace, just listen to the event triggered from there. For example: {% endblock %} -.. snippet:: javascript - :filename: app/static/app/unregistered_handlers.js +.. code-block:: javascript + :caption: app/static/app/unregistered_handlers.js django.jQuery(document).on('formset:added', function(event, $row, formsetName) { // Row added -- cgit v1.3