2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2024-11-25 08:41:51 +00:00

docm on JS files

This commit is contained in:
Philip Sargent 2021-05-05 17:56:05 +01:00
parent d374779c47
commit c3c222e045
2 changed files with 66 additions and 0 deletions

33
media/js/readme.txt Normal file
View File

@ -0,0 +1,33 @@
settings.JSLIB_URL == /JAVASCRIPT/
links to JS files are in the ../templates/*.html files
but _also_, and peculiarly, in the troggle/admin.py files
e.g.
class TroggleModelAdmin(admin.ModelAdmin):
def save_model(self, request, obj, form, change):
"""overriding admin save to fill the new_since parsing_field"""
obj.new_since_parsing=True
obj.save()
class Media:
js = ('jquery/jquery.min.js','js/QM_helper.js')
NB any *Admin class is used in the Django control panel only.
templates/editentrance.html:
{% extends "cavebase.html" %}
{% block title %}Edit Entrance{% endblock %}
{% block extraheaders %}
<link rel="stylesheet" href="{{ settings.JSLIB_URL }}jquery-ui/css/lightness/jquery-ui.css" type="text/css" media="all" />
<script src="{{ settings.JSLIB_URL }}jquery-ui/jquery-ui.min.js" type="text/javascript"></script>
<!--<script src="{{ settings.TINY_MCE_MEDIA_URL }}tiny_mce.js" type="text/javascript"></script>-->
{% endblock %}
{% block content %}
etc
{% endblock %}

33
media/jslib/readme.txt Normal file
View File

@ -0,0 +1,33 @@
settings.JSLIB_URL == /JAVASCRIPT/
links to JS files are in the ../templates/*.html files
but _also_, and peculiarly, in the troggle/admin.py files
e.g.
class TroggleModelAdmin(admin.ModelAdmin):
def save_model(self, request, obj, form, change):
"""overriding admin save to fill the new_since parsing_field"""
obj.new_since_parsing=True
obj.save()
class Media:
js = ('jquery/jquery.min.js','js/QM_helper.js')
NB any *Admin class is used in the Django control panel only.
templates/editentrance.html:
{% extends "cavebase.html" %}
{% block title %}Edit Entrance{% endblock %}
{% block extraheaders %}
<link rel="stylesheet" href="{{ settings.JSLIB_URL }}jquery-ui/css/lightness/jquery-ui.css" type="text/css" media="all" />
<script src="{{ settings.JSLIB_URL }}jquery-ui/jquery-ui.min.js" type="text/javascript"></script>
<!--<script src="{{ settings.TINY_MCE_MEDIA_URL }}tiny_mce.js" type="text/javascript"></script>-->
{% endblock %}
{% block content %}
etc
{% endblock %}