blob: f43dc2399dfee4e42b672e121e6af456885086cd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
{% load i18n admin_tools_menu_tags %}
{% if menu.children %}
<script type="text/javascript" src="{{ media_url }}/admin_tools/js/utils.js"></script>
<script type="text/javascript" charset="utf-8">
// Load js files syncronously and conditionally
var js_files = [
{
src : '{{ media_url }}/admin_tools/js/jquery/jquery.min.js',
test: function() { return typeof(jQuery) == 'undefined'; }
},
{
src : '{{ media_url }}/admin_tools/js/json.min.js',
test: function() { return typeof(JSON.stringify) == 'undefined'; }
},
{
src : '{{ media_url }}/admin_tools/js/menu.js',
test: function() { return true; }
}{% for js in menu.Media.js %},
{
src : '{{ media_url }}/{{ js }}',
test: function() { return true; }
}{% endfor %}
];
loadScripts(js_files, function(){
jQuery(function($) {
{% if has_bookmark_item %}
process_bookmarks(
"{{ request.get_full_path }}",
"{{ title }}",
"{% trans 'Please enter a name for the bookmark' %}"
);
{% endif %}
});
});
</script>
{% comment %}
{% for item in menu.children %}
<ul class="navigation-menu">
{% admin_tools_render_menu_item item forloop.counter %}
{% ifequal item.css_classes|join:' ' "bookmark" %}
<li class="actions">
{% if bookmark %}
{% include "admin_tools/menu/remove_bookmark_form.html" %}
{% else %}
{% include "admin_tools/menu/add_bookmark_form.html" %}
{% endif %}
</li>
{% endifequal %}
</ul>
{% endfor %}
{% endcomment %}
{% for item in menu.children %}
<ul class="navigation-menu">
{% admin_tools_render_menu_item item forloop.counter %}
</ul>
{% ifequal item.css_classes|join:' ' "bookmark" %}
{% if bookmark %}
{% include "admin_tools/menu/remove_bookmark_form.html" %}
{% else %}
{% include "admin_tools/menu/add_bookmark_form.html" %}
{% endif %}
{% endifequal %}
{% endfor %}
{% endif %}
|