Changeset 2516

Show
Ignore:
Timestamp:
01/29/10 12:34:42 (7 weeks ago)
Author:
JensDiemer
Message:
  • Bugfix: PyLucid CSS doesn't load in every django admin views. work-a-round: use extrastyle instead of extrastyle, see:  http://code.djangoproject.com/ticket/12726
  • Seems that is better to use """jQuery(document).ready(function($) {...}""" instead of """$(document).ready(function() {...}"""
  • add "Django_media_prefix": settings.ADMIN_MEDIA_PREFIX into PyLucid context processor (For access django media files)
Location:
branches/0.9/pylucid_project
Files:
6 modified

Legend:

Unmodified
Added
Removed
  • branches/0.9/pylucid_project/apps/pylucid/context_processors.py

    r2377 r2516  
    5656 
    5757        "PyLucid_media_url": settings.MEDIA_URL + settings.PYLUCID.PYLUCID_MEDIA_DIR + "/", 
     58        "Django_media_prefix": settings.ADMIN_MEDIA_PREFIX, 
    5859 
    5960        "debug": settings.DEBUG, 
  • branches/0.9/pylucid_project/apps/pylucid/templates/admin/base_site.html

    r2449 r2516  
    22{% load i18n %} 
    33 
     4 
    45{% block title %}PyLucid - {{ title }}{% endblock %} 
    56 
    6 {% block extrahead %}{{ block.super }} 
    7 <!-- app_extrahead block start --> 
    8 {# stylesheets for all PyLucid views #} 
     7 
     8{% block extrastyle %}{{ block.super }} 
     9{% if debug %}<!-- ./apps/pylucid/templates/admin/base_site.html extrastyle block START -->{% endif %} 
     10<!-- 
     11    We should use extrahead instead of extrastyle if http://code.djangoproject.com/ticket/12726 fixed. 
     12    We doesn't need to add your own jquery, because django include it since http://code.djangoproject.com/changeset/12297 
     13--> 
     14<script type="text/javascript" src="{{ Django_media_prefix }}js/jquery.min.js" onerror="JavaScript:alert('Error loading file [{{ Django_media_prefix }}js/jquery.min.js] !');" ></script> 
     15 
     16{# stylesheets for all Django admin views #} 
    917<link rel="stylesheet" type="text/css" href="{{ PyLucid_media_url }}pylucid_admin.css" onerror="JavaScript:alert('Error loading file [{{ PyLucid_media_url }}pylucid_admin.css] !');"/> 
    10 <script type="text/javascript" src="{{ PyLucid_media_url }}jquery.js" onerror="JavaScript:alert('Error loading file [{{ PyLucid_media_url }}jquery.js] !');" ></script> 
    1118<script type="text/javascript" src="{{ PyLucid_media_url }}pylucid_js_tools.js"></script> 
    1219{% if debug %} 
     
    1724 
    1825{% include "admin_menu/includes/superfish_extrahead.html" %} 
    19 <!-- app_extrahead block end --> 
     26{% if debug %}<!-- ./apps/pylucid/templates/admin/base_site.html extrastyle block END -->{% endif %} 
    2027{% endblock %} 
     28 
    2129 
    2230{% block branding %}<h1>PyLucid</h1> 
    2331<!-- page_messages --> 
    2432{% endblock %} 
     33 
    2534 
    2635{% block pretitle %} 
     
    3241{% endblock %} 
    3342 
     43 
    3444{% block footer %} 
    3545<!-- app footer block start --> 
  • branches/0.9/pylucid_project/apps/pylucid_admin/templates/pylucid_admin/menu.html

    r2454 r2516  
    22{% load i18n %} 
    33 
    4 {% block extrahead %}{{ block.super }} 
     4{% block extrastyle %}{{ block.super }} 
    55<!-- pylucid admin menu extrahead block start --> 
    66<link rel="stylesheet" type="text/css" media="screen" href="{{ PyLucid_media_url }}superfish/superfish-vertical.css" /> 
  • branches/0.9/pylucid_project/media/PyLucid/pylucid_js_tools.js

    r2493 r2516  
    210210MAX_LENGTH = 100; 
    211211RESIZE_FACTOR = 1.3; 
    212 $(document).ready(function(){ 
     212jQuery(document).ready(function($) { 
    213213    /************************************************************************* 
    214214         * textarea resize buttons 
  • branches/0.9/pylucid_project/media/PyLucid/superfish/pylucid_superfish.js

    r2371 r2516  
    1 $(document).ready(function(){ 
     1jQuery(document).ready(function($) { 
    22  // 
    3   // initialise Superfish menu 
     3  // Initialize Superfish menu 
    44  //  
    55  $('ul.sf-menu').superfish({  
     
    88      speed:       100                              // faster animation speed 
    99  }); 
     10  log("superfish initialized."); 
    1011}); 
  • branches/0.9/pylucid_project/pylucid_plugins/admin_menu/templates/admin_menu/includes/superfish_extrahead.html

    r2136 r2516  
    1 <!-- admin_menu/includes/superfish_extrahead.html START --> 
     1{% if debug %}<!-- pylucid plugin ./admin_menu/includes/superfish_extrahead.html START -->{% endif %} 
    22<link rel="stylesheet" type="text/css" media="screen" href="{{ PyLucid_media_url }}superfish/superfish.css" onerror="JavaScript:alert('{{ PyLucid_media_url }}superfish/superfish.css');" /> 
    33<script type="text/javascript" src="{{ PyLucid_media_url }}superfish/superfish.js" onerror="JavaScript:alert('{{ PyLucid_media_url }}superfish/superfish.js');" ></script> 
     
    1818--> 
    1919</style> 
    20 <!-- admin_menu/includes/superfish_extrahead.html END --> 
     20{% if debug %}<!-- pylucid plugin ./admin_menu/includes/superfish_extrahead.html END -->{% endif %}