Commits

Mark Lavin committed 9d4ead0

Renaming templatetag library to make it clear this comes from django-selectable.

Comments (0)

Files changed (4)

example/core/templates/base.html

+{% load selectable_tags %}
 <html lang="en">
 <head>
     <meta charset="utf-8">
         </form>
     {% endblock %}
     </div>
-    {% load jquery_libraries %}
     {% include_jquery_libs %}
-    <!-- <script src="{{ STATIC_URL }}js/bootstrap.min.js"></script> -->
+    <script src="{{ STATIC_URL }}js/bootstrap.min.js"></script>
     {{ form.media.js }}
     {% block extra-js %}{% endblock %}
 </body>

example/templates/admin/base_site.html

 {% extends "admin/base.html" %}
 {% block title %}{{ title }} | Django-Selectable Example Site{% endblock title %}
 {% block extrahead %}
+    {% load selectable_tags %}
 <link rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/themes/ui-lightness/jquery-ui.css" type="text/css" />
-    {% load jquery_libraries %}
     {% include_jquery_libs %}
 {% endblock %}
 {% block branding %}

selectable/templatetags/jquery_libraries.py

-# -*- encoding: utf-8 -*-
-from django import template
-from django.template import Library
-from django.conf import settings
-
-register = template.Library()
-
-@register.simple_tag
-def include_jquery_libs():
-    SCRIPT_TAG = '<script type="text/javascript" src="%s"></script>'
-
-    try:
-        jquery_url = settings.JQUERY_URL
-    except:
-        jquery_url = '//ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js'
-
-    try:
-        jquery_ui_url = settings.JQUERY_UI_URL
-    except:
-        jquery_ui_url = '//ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js'
-
-    script_libs = SCRIPT_TAG % jquery_url
-    script_libs += '\n'
-    script_libs += SCRIPT_TAG % jquery_ui_url
-    return script_libs
-
-

selectable/templatetags/selectable_tags.py

+# -*- encoding: utf-8 -*-
+from django import template
+from django.template import Library
+from django.conf import settings
+
+register = template.Library()
+
+@register.simple_tag
+def include_jquery_libs():
+    SCRIPT_TAG = '<script type="text/javascript" src="%s"></script>'
+
+    try:
+        jquery_url = settings.JQUERY_URL
+    except:
+        jquery_url = '//ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js'
+
+    try:
+        jquery_ui_url = settings.JQUERY_UI_URL
+    except:
+        jquery_ui_url = '//ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js'
+
+    script_libs = SCRIPT_TAG % jquery_url
+    script_libs += '\n'
+    script_libs += SCRIPT_TAG % jquery_ui_url
+    return script_libs
+
+
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.