makinacorpus / django-leaflet

Use Leaflet in your Django projects
GNU Lesser General Public License v3.0
716 stars 282 forks source link

Custom file in PLUGINS does not end up in the adminsite #88

Open abusquets opened 9 years ago

abusquets commented 9 years ago

Hi,

I've done a test plugin for overwrite the L.Map.DjangoMap#_djAddLayers function.

I need to set a minZoom and a maxZoom for each baselayer.

But the js plugins aren't loaded when I try to modify an object (edit) in the admin area.

In my seetings.py I have:

.. 'PLUGINS': { 'prova': { 'js': [STATIC_URL+'prova.js'], 'auto-include': True, } } ..

leplatrem commented 9 years ago

Do you mean, it does not end up in the DOM in the adminsite ?

abusquets commented 9 years ago

I mean no js file

<script type="text/javascript" src="/static/prova.js"></script>

is added in the page code

<script type="text/javascript" src="/admin/jsi18n/"></script>
<link href="/static/leaflet/leaflet.css" type="text/css" media="screen" rel="stylesheet" />
<link href="/static/leaflet/draw/leaflet.draw.css" type="text/css" media="screen" rel="stylesheet" />
<script type="text/javascript" src="/static/admin/js/core.js"></script>
<script type="text/javascript" src="/static/admin/js/admin/RelatedObjectLookups.js"></script>
<script type="text/javascript" src="/static/admin/js/jquery.js"></script>
<script type="text/javascript" src="/static/admin/js/jquery.init.js"></script>
<script type="text/javascript" src="/static/admin/js/actions.js"></script>
<script type="text/javascript" src="/static/leaflet/leaflet.js"></script>
<script type="text/javascript" src="/static/leaflet/draw/leaflet.draw.js"></script>
<script type="text/javascript" src="/static/leaflet/leaflet.extras.js"></script>
<script type="text/javascript" src="/static/leaflet/leaflet.forms.js"></script>
<script type="text/javascript" src="/static/admin/js/calendar.js"></script>
<script type="text/javascript" src="/static/admin/js/admin/DateTimeShortcuts.js"></script>
<script type="text/javascript" src="/static/admin/js/collapse.js"></script>
techdragon commented 8 years ago

possibly related to #105