Commits

David Jean Louis committed e1a09bc

Move the menu and dashboard template dirs in a "admin_tools" directory to
avoid name conflicts with other apps, for example: django-cms (see:
http://github.com/digi604/django-cms-2.0/issues/issue/397/).

  • Participants
  • Parent commits d63818c

Comments (0)

Files changed (48)

File admin_tools/dashboard/models.py

 
     ``template``
         The template to use to render the dashboard.
-        Default value: 'dashboard/dashboard.html'
+        Default value: 'admin_tools/dashboard/dashboard.html'
 
     ``columns``
         An integer that represents the number of columns for the dashboard.
         Dashboard constructor.
         """
         self.title = kwargs.get('title', _('Dashboard'))
-        self.template = kwargs.get('template', 'dashboard/dashboard.html')
+        self.template = kwargs.get('template', 'admin_tools/dashboard/dashboard.html')
         self.columns = kwargs.get('columns', 2)
         self.children = kwargs.get('children', [])
 
 
     ``template``
         The template to use to render the module.
-        Default value: 'dashboard/module.html'.
+        Default value: 'admin_tools/dashboard/module.html'.
     """
     def __init__(self, **kwargs):
         self.enabled = kwargs.get('enabled', True)
         self.css_classes = kwargs.get('css_classes', [])
         self.pre_content = kwargs.get('pre_content')
         self.post_content = kwargs.get('post_content')
-        self.template = kwargs.get('template', 'dashboard/module.html')
+        self.template = kwargs.get('template', 'admin_tools/dashboard/module.html')
         self.children = kwargs.get('children', [])
 
     def init_with_context(self, context):
         super(LinkListDashboardModule, self).__init__(**kwargs)
         self.title = kwargs.get('title', _('Links'))
         self.template = kwargs.get('template',
-                                   'dashboard/modules/link_list.html')
+                                   'admin_tools/dashboard/modules/link_list.html')
         self.layout = kwargs.get('layout', 'stacked')
 
 
         super(AppListDashboardModule, self).__init__(**kwargs)
         self.title = kwargs.get('title', _('Applications'))
         self.template = kwargs.get('template',
-                                   'dashboard/modules/app_list.html')
+                                   'admin_tools/dashboard/modules/app_list.html')
         self.include_list = kwargs.get('include_list', [])
         self.exclude_list = kwargs.get('exclude_list', [])
 
         super(ModelListDashboardModule, self).__init__(**kwargs)
         self.title = kwargs.get('title', '')
         self.template = kwargs.get('template',
-                                   'dashboard/modules/model_list.html')
+                                   'admin_tools/dashboard/modules/model_list.html')
         self.include_list = kwargs.get('include_list', [])
         self.exclude_list = kwargs.get('exclude_list', [])
 
         super(RecentActionsDashboardModule, self).__init__(**kwargs)
         self.title = kwargs.get('title', _('Recent Actions'))
         self.template = kwargs.get('template',
-                                   'dashboard/modules/recent_actions.html')
+                                   'admin_tools/dashboard/modules/recent_actions.html')
         self.include_list = kwargs.get('include_list', [])
         self.exclude_list = kwargs.get('exclude_list', [])
         self.limit = kwargs.get('limit', 10)
     def __init__(self, **kwargs):
         super(FeedDashboardModule, self).__init__(**kwargs)
         self.title = kwargs.get('title', _('RSS Feed'))
-        self.template = kwargs.get('template', 'dashboard/modules/feed.html')
+        self.template = kwargs.get('template', 'admin_tools/dashboard/modules/feed.html')
         self.feed_url = kwargs.get('feed_url')
         self.limit = kwargs.get('limit')
 

File admin_tools/dashboard/templates/admin_tools/dashboard/css.html

+<link rel="stylesheet" href="{{ media_url }}/admin_tools/css/dashboard.css" type="text/css" media="screen, projection"/>
+<!--[if lt IE 8]>
+<link rel="stylesheet" href="{{ media_url }}/admin_tools/css/dashboard-ie.css" type="text/css" media="screen, projection"/>
+<![endif]-->
+{% for css in css_files %}
+<link rel="stylesheet" href="{{ media_url }}/{{ css }}" type="text/css" media="screen, projection"/>{% endfor %}

File admin_tools/dashboard/templates/admin_tools/dashboard/dashboard.html

+{% load i18n admin_tools_dashboard_tags %}
+<script type="text/javascript" charset="utf-8">
+    // load jquery if it's not loaded yet
+    if (typeof jQuery == 'undefined') {
+        var script_url = '{{ media_url }}/admin_tools/js/jquery/jquery-1.4.1.min.js';
+        document.write(unescape('%3Cscript src="' + script_url + '" type="text/javascript"%3E%3C/script%3E'));
+    }
+</script>
+<script type="text/javascript" charset="utf-8">
+    // load jquery ui if it's not loaded yet
+    if (typeof jQuery.ui == 'undefined') {
+        var script_url = '{{ media_url }}/admin_tools/js/jquery/jquery-ui-1.8rc1.custom.min.js';
+        document.write(unescape('%3Cscript src="' + script_url + '" type="text/javascript"%3E%3C/script%3E'));
+    }
+</script>
+<script type="text/javascript" charset="utf-8">
+    // load json if it's not loaded yet
+    if (typeof JSON == 'undefined') {
+        var script_url = '{{ media_url }}/admin_tools/js/json.min.js';
+        document.write(unescape('%3Cscript src="' + script_url + '" type="text/javascript"%3E%3C/script%3E'));
+    }
+</script>
+<script type="text/javascript" charset="utf-8">
+    // load jquery cookie if it's not loaded yet
+    if (typeof jQuery.cookie == 'undefined') {
+        var script_url = '{{ media_url }}/admin_tools/js/jquery/jquery.cookie.min.js';
+        document.write(unescape('%3Cscript src="' + script_url + '" type="text/javascript"%3E%3C/script%3E'));
+    }
+</script>
+<script type="text/javascript" src="{{ media_url }}/admin_tools/js/jquery/jquery.dashboard.js"></script>
+{% if dashboard.Media.js %}
+{% for js in dashboard.Media.js %}
+<script type="text/javascript" src="{{ media_url }}/{{ js }}"></script>{% endfor %}
+{% endif %}
+
+{% if dashboard.title %}
+<h1 class="dashboard-title">{{ dashboard.title }}</h1>
+{% endif %}
+
+<script type="text/javascript">
+// <![CDATA[
+jQuery(function($) {
+    jQuery.getJSON(
+        '{% url admin-tools-dashboard-get-preferences %}',
+        function(data) {
+            $('#{{ dashboard.get_id }}').dashboard({
+                'columns': {{ dashboard.columns }},
+                'load_preferences_function': function(options) {
+                    return data;
+                },
+                'save_preferences_function': function(options, preferences) {
+                    jQuery.post(
+                        '{% url admin-tools-dashboard-set-preferences %}',
+                        { data: JSON.stringify(preferences) }
+                    );
+                }
+            });
+         }
+    );
+});
+//]]>
+</script>
+
+<div id="dashboard-panel">
+    <h3><a href="#">{% trans "Modules" %}</a></h3>
+    {% if has_disabled_modules %}
+    <ul>
+        {% spaceless %}
+        {% for module in dashboard.children %}
+        {% if not module.enabled %}
+        <li><a href="#" rel="module_{{ forloop.counter }}" class="addlink add-dashboard-module">{{ module.title }}</a></li>
+        {% endif %}
+        {% endfor %}
+        {% endspaceless %}
+    </ul>
+    {% endif %}
+</div>
+<div id="{{ dashboard.get_id }}" class="dashboard-container">
+    {% for module in dashboard.children %}
+{% admin_tools_render_dashboard_module module forloop.counter %}{% endfor %}
+</div>

File admin_tools/dashboard/templates/admin_tools/dashboard/dashboard.txt

+from django.utils.translation import ugettext_lazy as _
+from django.core.urlresolvers import reverse
+from admin_tools.dashboard.models import *
+
+
+# to activate your index dashboard add the following to your settings.py:
+#
+# ADMIN_TOOLS_INDEX_DASHBOARD = '{{ project }}.{{ file }}.CustomIndexDashboard'
+
+class CustomIndexDashboard(Dashboard):
+    """
+    Custom index dashboard for {{ project }}.
+    """ 
+    def __init__(self, **kwargs):
+        Dashboard.__init__(self, **kwargs)
+
+        # append a link list module for "quick links"
+        self.children.append(LinkListDashboardModule(
+            title=_('Quick links'),
+            layout='inline',
+            draggable=False,
+            deletable=False,
+            collapsible=False,
+            children=[
+                {
+                    'title': _('Return to site'),
+                    'url': '/',
+                },
+                {
+                    'title': _('Change password'),
+                    'url': reverse('admin:password_change'),
+                },
+                {
+                    'title': _('Log out'),
+                    'url': reverse('admin:logout')
+                },
+            ]
+        ))
+
+        # append an app list module for "Applications"
+        self.children.append(AppListDashboardModule(
+            title=_('Applications'),
+            exclude_list=('django.contrib',),
+        ))
+
+        # append an app list module for "Administration"
+        self.children.append(AppListDashboardModule(
+            title=_('Administration'),
+            include_list=('django.contrib',),
+        ))
+
+        # append a recent actions module
+        self.children.append(RecentActionsDashboardModule(
+            title=_('Recent Actions'),
+            limit=5
+        ))
+
+        # append a feed module
+        self.children.append(FeedDashboardModule(
+            title=_('Latest Django News'),
+            feed_url='http://www.djangoproject.com/rss/weblog/',
+            limit=5
+        ))
+
+        # append another link list module for "support". 
+        self.children.append(LinkListDashboardModule(
+            title=_('Support'),
+            children=[
+                {
+                    'title': _('Django documentation'),
+                    'url': 'http://docs.djangoproject.com/',
+                    'external': True,
+                },
+                {
+                    'title': _('Django "django-users" mailing list'),
+                    'url': 'http://groups.google.com/group/django-users',
+                    'external': True,
+                },
+                {
+                    'title': _('Django irc channel'),
+                    'url': 'irc://irc.freenode.net/django',
+                    'external': True,
+                },
+            ]
+        ))
+
+    def init_with_context(self, context):
+        """
+        Use this method if you need to access the request context.
+        """
+        pass
+
+
+# to activate your app index dashboard add the following to your settings.py:
+#
+# ADMIN_TOOLS_APP_INDEX_DASHBOARD = '{{ project }}.{{ file }}.CustomAppIndexDashboard'
+
+class CustomAppIndexDashboard(AppIndexDashboard):
+    """
+    Custom app index dashboard for {{ project }}.
+    """ 
+    def __init__(self, *args, **kwargs):
+        AppIndexDashboard.__init__(self, *args, **kwargs)
+
+        # we disable title because its redundant with the model list module
+        self.title = ''
+
+        # append a model list module
+        self.children.append(ModelListDashboardModule(
+            title=self.app_title,
+            include_list=self.models,
+        ))
+
+        # append a recent actions module
+        self.children.append(RecentActionsDashboardModule(
+            title=_('Recent Actions'),
+            include_list=self.get_app_content_types(),
+        ))
+
+    def init_with_context(self, context):
+        """
+        Use this method if you need to access the request context.
+        """
+        pass

File admin_tools/dashboard/templates/admin_tools/dashboard/dashboard_app_index.txt

+from django.utils.translation import ugettext_lazy as _
+from django.core.urlresolvers import reverse
+from admin_tools.dashboard.models import *
+
+# create your custom modules here if you want, for example:
+#
+# class CustomDashboardModule(DashboardModule):
+#     pass
+#
+{% if warning %}
+# WARNING: you've changed the default file name 'dashboard.py' to '{{ file }}.py',
+# so, you will need to tell django-admin-tools about this, just add this line
+# to your settings.py file:
+# ADMIN_TOOLS_APP_INDEX_DASHBOARD_MODULE = '{{ file }}'
+{% endif %}
+# Your {{ app }} dashboard class
+class {{ app|capfirst }}Dashboard(AppIndexDashboard):
+    """
+    Document your custom app index dashboard.
+    """ 
+    def __init__(self, app_title, models, *args, **kwargs):
+        super(CustomAppIndexDashboard, self).__init__(*args, **kwargs)
+
+        # append your modules here, example:
+        # self.append(RecentActionsDashboardModule(
+        #     title=_('Recent Actions'),
+        #     limit=5,
+        #     include_list=models,
+        # ))

File admin_tools/dashboard/templates/admin_tools/dashboard/dummy.html

+{% extends template %}

File admin_tools/dashboard/templates/admin_tools/dashboard/module.html

+{% if not module.is_empty %}
+    <div{% if index %} id="module_{{ index }}"{% endif %} class="{{ module.render_css_classes }}">
+        <h2>{{ module.title }}</h2>
+        <div class="dashboard-module-content">
+            {% spaceless %}
+            {% if module.pre_content %}
+            <p>{{ module.pre_content }}</p>
+            {% endif %}
+            {% block module_content %}
+            {% for child in module.children %}
+            {{ child }}
+            {% endfor %}
+            {% endblock %}
+            {% if module.post_content %}
+            <p>{{ module.post_content }}</p>
+            {% endif %}
+            {% endspaceless %}
+        </div>
+    </div>
+{% endif %}

File admin_tools/dashboard/templates/admin_tools/dashboard/modules/app_list.html

+{% extends "admin_tools/dashboard/module.html" %}
+{% load i18n %}
+{% block module_content %}
+        {% for child in module.children %}
+        <h3><a href="{{ child.url }}">{{ child.title }}</a></h3>
+        <ul>
+            {% for model in child.models %}
+            {% spaceless %}
+            <li>
+                {% if model.change_url %}<a href="{{ model.change_url }}">{{ model.title }}</a>{% else %}{{ model.title }}{% endif %}
+                {% if model.add_url or model.change_url %}
+                <ul>
+                    {% if model.add_url %}<li><a class="addlink" href="{{ model.add_url }}"><span class="icon">{% trans "Add" %}</span></a></li>{% endif %}
+                    {% if model.change_url %}<li><a class="changelink" href="{{ model.change_url }}"><span class="icon">{% trans "Change" %}</span></a></li>{% endif %}
+                </ul>
+                {% endif %}
+            </li>
+            {% endspaceless %}
+            {% endfor %}
+        </ul>
+        {% endfor %}
+{% endblock %}

File admin_tools/dashboard/templates/admin_tools/dashboard/modules/feed.html

+{% extends "admin_tools/dashboard/module.html" %}
+{% block module_content %}
+<ul>
+    {% spaceless %}
+    {% for child in module.children %}
+    <li class="{% cycle 'odd' 'even' %}">
+        {% if child.date %}<span class="float-right">{{ child.date|date }}&nbsp;</span>{% endif %}
+        {% if child.warning %}<span class="warning">{{ child.title }}</span>{% else %}<a class="external-link" href="{{ child.url }}">{{ child.title }}</a>{% endif %}
+    </li>
+    {% endfor %}
+    {% endspaceless %}
+</ul>
+{% endblock %}

File admin_tools/dashboard/templates/admin_tools/dashboard/modules/model_list.html

+{% extends "admin_tools/dashboard/module.html" %}
+{% load i18n %}
+{% block module_content %}
+        <ul>
+            {% for child in module.children %}
+            {% spaceless %}
+            <li>
+                {% if child.change_url %}<a href="{{ child.change_url }}">{{ child.title }}</a>{% else %}{{ child.title }}{% endif %}
+                {% if child.add_url or child.change_url %}
+                <ul>
+                    {% if child.add_url %}<li><a class="addlink" href="{{ child.add_url }}"><span class="icon">{% trans "Add" %}</span></a></li>{% endif %}
+                    {% if child.change_url %}<li><a class="changelink" href="{{ child.change_url }}"><span class="icon">{% trans "Change" %}</span></a></li>{% endif %}
+                </ul>
+                {% endif %}
+            </li>
+            {% endspaceless %}
+            {% endfor %}
+        </ul>
+{% endblock %}

File admin_tools/dashboard/templates/admin_tools/dashboard/modules/recent_actions.html

+{% extends "admin_tools/dashboard/module.html" %}
+{% load i18n %}
+{% block module_content %}
+<ul>
+    {% spaceless %}
+    {% for child in module.children %}
+    <li class="{% cycle 'odd' 'even' %}">
+        <span class="float-right">{{ child.action_time|date }}</span>
+        {% if child.is_deletion %}
+        <span class="deletelink">{% if child.content_type %}{% filter capfirst %}{% trans child.content_type.name %}{% endfilter %}&nbsp;{% endif %}{{ child.object_repr }}</span>
+        {% else %}
+        <a href="{% url admin:index %}{{ child.get_admin_url }}" class="{% if child.is_addition %} addlink{% endif %}{% if child.is_change %} changelink{% endif %}">{% if child.content_type %}{% filter capfirst %}{% trans child.content_type.name %}{% endfilter %}&nbsp;{% endif %}{{ child.object_repr }}</a>
+        {% endif %}
+    </li>
+    {% endfor %}
+    {% endspaceless %}
+</ul>
+{% endblock %}

File admin_tools/dashboard/templates/admin_tools/dashboard/preferences_form.html

+{% extends "admin/base_site.html" %}
+
+{% block content %}
+
+<form action="." method="POST">
+    {{ form.as_p }}
+    <p><input type="submit" value="Save" /></p>
+</form>
+
+{% endblock %}

File admin_tools/dashboard/templates/dashboard/css.html

-<link rel="stylesheet" href="{{ media_url }}/admin_tools/css/dashboard.css" type="text/css" media="screen, projection"/>
-<!--[if lt IE 8]>
-<link rel="stylesheet" href="{{ media_url }}/admin_tools/css/dashboard-ie.css" type="text/css" media="screen, projection"/>
-<![endif]-->
-{% for css in css_files %}
-<link rel="stylesheet" href="{{ media_url }}/{{ css }}" type="text/css" media="screen, projection"/>{% endfor %}

File admin_tools/dashboard/templates/dashboard/dashboard.html

-{% load i18n admin_tools_dashboard_tags %}
-<script type="text/javascript" charset="utf-8">
-    // load jquery if it's not loaded yet
-    if (typeof jQuery == 'undefined') {
-        var script_url = '{{ media_url }}/admin_tools/js/jquery/jquery-1.4.1.min.js';
-        document.write(unescape('%3Cscript src="' + script_url + '" type="text/javascript"%3E%3C/script%3E'));
-    }
-</script>
-<script type="text/javascript" charset="utf-8">
-    // load jquery ui if it's not loaded yet
-    if (typeof jQuery.ui == 'undefined') {
-        var script_url = '{{ media_url }}/admin_tools/js/jquery/jquery-ui-1.8rc1.custom.min.js';
-        document.write(unescape('%3Cscript src="' + script_url + '" type="text/javascript"%3E%3C/script%3E'));
-    }
-</script>
-<script type="text/javascript" charset="utf-8">
-    // load json if it's not loaded yet
-    if (typeof JSON == 'undefined') {
-        var script_url = '{{ media_url }}/admin_tools/js/json.min.js';
-        document.write(unescape('%3Cscript src="' + script_url + '" type="text/javascript"%3E%3C/script%3E'));
-    }
-</script>
-<script type="text/javascript" charset="utf-8">
-    // load jquery cookie if it's not loaded yet
-    if (typeof jQuery.cookie == 'undefined') {
-        var script_url = '{{ media_url }}/admin_tools/js/jquery/jquery.cookie.min.js';
-        document.write(unescape('%3Cscript src="' + script_url + '" type="text/javascript"%3E%3C/script%3E'));
-    }
-</script>
-<script type="text/javascript" src="{{ media_url }}/admin_tools/js/jquery/jquery.dashboard.js"></script>
-{% if dashboard.Media.js %}
-{% for js in dashboard.Media.js %}
-<script type="text/javascript" src="{{ media_url }}/{{ js }}"></script>{% endfor %}
-{% endif %}
-
-{% if dashboard.title %}
-<h1 class="dashboard-title">{{ dashboard.title }}</h1>
-{% endif %}
-
-<script type="text/javascript">
-// <![CDATA[
-jQuery(function($) {
-    jQuery.getJSON(
-        '{% url admin-tools-dashboard-get-preferences %}',
-        function(data) {
-            $('#{{ dashboard.get_id }}').dashboard({
-                'columns': {{ dashboard.columns }},
-                'load_preferences_function': function(options) {
-                    return data;
-                },
-                'save_preferences_function': function(options, preferences) {
-                    jQuery.post(
-                        '{% url admin-tools-dashboard-set-preferences %}',
-                        { data: JSON.stringify(preferences) }
-                    );
-                }
-            });
-         }
-    );
-});
-//]]>
-</script>
-
-<div id="dashboard-panel">
-    <h3><a href="#">{% trans "Modules" %}</a></h3>
-    {% if has_disabled_modules %}
-    <ul>
-        {% spaceless %}
-        {% for module in dashboard.children %}
-        {% if not module.enabled %}
-        <li><a href="#" rel="module_{{ forloop.counter }}" class="addlink add-dashboard-module">{{ module.title }}</a></li>
-        {% endif %}
-        {% endfor %}
-        {% endspaceless %}
-    </ul>
-    {% endif %}
-</div>
-<div id="{{ dashboard.get_id }}" class="dashboard-container">
-    {% for module in dashboard.children %}
-{% admin_tools_render_dashboard_module module forloop.counter %}{% endfor %}
-</div>

File admin_tools/dashboard/templates/dashboard/dashboard.txt

-from django.utils.translation import ugettext_lazy as _
-from django.core.urlresolvers import reverse
-from admin_tools.dashboard.models import *
-
-
-# to activate your index dashboard add the following to your settings.py:
-#
-# ADMIN_TOOLS_INDEX_DASHBOARD = '{{ project }}.{{ file }}.CustomIndexDashboard'
-
-class CustomIndexDashboard(Dashboard):
-    """
-    Custom index dashboard for {{ project }}.
-    """ 
-    def __init__(self, **kwargs):
-        Dashboard.__init__(self, **kwargs)
-
-        # append a link list module for "quick links"
-        self.children.append(LinkListDashboardModule(
-            title=_('Quick links'),
-            layout='inline',
-            draggable=False,
-            deletable=False,
-            collapsible=False,
-            children=[
-                {
-                    'title': _('Return to site'),
-                    'url': '/',
-                },
-                {
-                    'title': _('Change password'),
-                    'url': reverse('admin:password_change'),
-                },
-                {
-                    'title': _('Log out'),
-                    'url': reverse('admin:logout')
-                },
-            ]
-        ))
-
-        # append an app list module for "Applications"
-        self.children.append(AppListDashboardModule(
-            title=_('Applications'),
-            exclude_list=('django.contrib',),
-        ))
-
-        # append an app list module for "Administration"
-        self.children.append(AppListDashboardModule(
-            title=_('Administration'),
-            include_list=('django.contrib',),
-        ))
-
-        # append a recent actions module
-        self.children.append(RecentActionsDashboardModule(
-            title=_('Recent Actions'),
-            limit=5
-        ))
-
-        # append a feed module
-        self.children.append(FeedDashboardModule(
-            title=_('Latest Django News'),
-            feed_url='http://www.djangoproject.com/rss/weblog/',
-            limit=5
-        ))
-
-        # append another link list module for "support". 
-        self.children.append(LinkListDashboardModule(
-            title=_('Support'),
-            children=[
-                {
-                    'title': _('Django documentation'),
-                    'url': 'http://docs.djangoproject.com/',
-                    'external': True,
-                },
-                {
-                    'title': _('Django "django-users" mailing list'),
-                    'url': 'http://groups.google.com/group/django-users',
-                    'external': True,
-                },
-                {
-                    'title': _('Django irc channel'),
-                    'url': 'irc://irc.freenode.net/django',
-                    'external': True,
-                },
-            ]
-        ))
-
-    def init_with_context(self, context):
-        """
-        Use this method if you need to access the request context.
-        """
-        pass
-
-
-# to activate your app index dashboard add the following to your settings.py:
-#
-# ADMIN_TOOLS_APP_INDEX_DASHBOARD = '{{ project }}.{{ file }}.CustomAppIndexDashboard'
-
-class CustomAppIndexDashboard(AppIndexDashboard):
-    """
-    Custom app index dashboard for {{ project }}.
-    """ 
-    def __init__(self, *args, **kwargs):
-        AppIndexDashboard.__init__(self, *args, **kwargs)
-
-        # we disable title because its redundant with the model list module
-        self.title = ''
-
-        # append a model list module
-        self.children.append(ModelListDashboardModule(
-            title=self.app_title,
-            include_list=self.models,
-        ))
-
-        # append a recent actions module
-        self.children.append(RecentActionsDashboardModule(
-            title=_('Recent Actions'),
-            include_list=self.get_app_content_types(),
-        ))
-
-    def init_with_context(self, context):
-        """
-        Use this method if you need to access the request context.
-        """
-        pass

File admin_tools/dashboard/templates/dashboard/dashboard_app_index.txt

-from django.utils.translation import ugettext_lazy as _
-from django.core.urlresolvers import reverse
-from admin_tools.dashboard.models import *
-
-# create your custom modules here if you want, for example:
-#
-# class CustomDashboardModule(DashboardModule):
-#     pass
-#
-{% if warning %}
-# WARNING: you've changed the default file name 'dashboard.py' to '{{ file }}.py',
-# so, you will need to tell django-admin-tools about this, just add this line
-# to your settings.py file:
-# ADMIN_TOOLS_APP_INDEX_DASHBOARD_MODULE = '{{ file }}'
-{% endif %}
-# Your {{ app }} dashboard class
-class {{ app|capfirst }}Dashboard(AppIndexDashboard):
-    """
-    Document your custom app index dashboard.
-    """ 
-    def __init__(self, app_title, models, *args, **kwargs):
-        super(CustomAppIndexDashboard, self).__init__(*args, **kwargs)
-
-        # append your modules here, example:
-        # self.append(RecentActionsDashboardModule(
-        #     title=_('Recent Actions'),
-        #     limit=5,
-        #     include_list=models,
-        # ))

File admin_tools/dashboard/templates/dashboard/dummy.html

-{% extends template %}

File admin_tools/dashboard/templates/dashboard/module.html

-{% if not module.is_empty %}
-    <div{% if index %} id="module_{{ index }}"{% endif %} class="{{ module.render_css_classes }}">
-        <h2>{{ module.title }}</h2>
-        <div class="dashboard-module-content">
-            {% spaceless %}
-            {% if module.pre_content %}
-            <p>{{ module.pre_content }}</p>
-            {% endif %}
-            {% block module_content %}
-            {% for child in module.children %}
-            {{ child }}
-            {% endfor %}
-            {% endblock %}
-            {% if module.post_content %}
-            <p>{{ module.post_content }}</p>
-            {% endif %}
-            {% endspaceless %}
-        </div>
-    </div>
-{% endif %}

File admin_tools/dashboard/templates/dashboard/modules/app_list.html

-{% extends "dashboard/module.html" %}
-{% load i18n %}
-{% block module_content %}
-        {% for child in module.children %}
-        <h3><a href="{{ child.url }}">{{ child.title }}</a></h3>
-        <ul>
-            {% for model in child.models %}
-            {% spaceless %}
-            <li>
-                {% if model.change_url %}<a href="{{ model.change_url }}">{{ model.title }}</a>{% else %}{{ model.title }}{% endif %}
-                {% if model.add_url or model.change_url %}
-                <ul>
-                    {% if model.add_url %}<li><a class="addlink" href="{{ model.add_url }}"><span class="icon">{% trans "Add" %}</span></a></li>{% endif %}
-                    {% if model.change_url %}<li><a class="changelink" href="{{ model.change_url }}"><span class="icon">{% trans "Change" %}</span></a></li>{% endif %}
-                </ul>
-                {% endif %}
-            </li>
-            {% endspaceless %}
-            {% endfor %}
-        </ul>
-        {% endfor %}
-{% endblock %}

File admin_tools/dashboard/templates/dashboard/modules/feed.html

-{% extends "dashboard/module.html" %}
-{% block module_content %}
-<ul>
-    {% spaceless %}
-    {% for child in module.children %}
-    <li class="{% cycle 'odd' 'even' %}">
-        {% if child.date %}<span class="float-right">{{ child.date|date }}&nbsp;</span>{% endif %}
-        {% if child.warning %}<span class="warning">{{ child.title }}</span>{% else %}<a class="external-link" href="{{ child.url }}">{{ child.title }}</a>{% endif %}
-    </li>
-    {% endfor %}
-    {% endspaceless %}
-</ul>
-{% endblock %}

File admin_tools/dashboard/templates/dashboard/modules/model_list.html

-{% extends "dashboard/module.html" %}
-{% load i18n %}
-{% block module_content %}
-        <ul>
-            {% for child in module.children %}
-            {% spaceless %}
-            <li>
-                {% if child.change_url %}<a href="{{ child.change_url }}">{{ child.title }}</a>{% else %}{{ child.title }}{% endif %}
-                {% if child.add_url or child.change_url %}
-                <ul>
-                    {% if child.add_url %}<li><a class="addlink" href="{{ child.add_url }}"><span class="icon">{% trans "Add" %}</span></a></li>{% endif %}
-                    {% if child.change_url %}<li><a class="changelink" href="{{ child.change_url }}"><span class="icon">{% trans "Change" %}</span></a></li>{% endif %}
-                </ul>
-                {% endif %}
-            </li>
-            {% endspaceless %}
-            {% endfor %}
-        </ul>
-{% endblock %}

File admin_tools/dashboard/templates/dashboard/modules/recent_actions.html

-{% extends "dashboard/module.html" %}
-{% load i18n %}
-{% block module_content %}
-<ul>
-    {% spaceless %}
-    {% for child in module.children %}
-    <li class="{% cycle 'odd' 'even' %}">
-        <span class="float-right">{{ child.action_time|date }}</span>
-        {% if child.is_deletion %}
-        <span class="deletelink">{% if child.content_type %}{% filter capfirst %}{% trans child.content_type.name %}{% endfilter %}&nbsp;{% endif %}{{ child.object_repr }}</span>
-        {% else %}
-        <a href="{% url admin:index %}{{ child.get_admin_url }}" class="{% if child.is_addition %} addlink{% endif %}{% if child.is_change %} changelink{% endif %}">{% if child.content_type %}{% filter capfirst %}{% trans child.content_type.name %}{% endfilter %}&nbsp;{% endif %}{{ child.object_repr }}</a>
-        {% endif %}
-    </li>
-    {% endfor %}
-    {% endspaceless %}
-</ul>
-{% endblock %}

File admin_tools/dashboard/templates/dashboard/preferences_form.html

-{% extends "admin/base_site.html" %}
-
-{% block content %}
-
-<form action="." method="POST">
-    {{ form.as_p }}
-    <p><input type="submit" value="Save" /></p>
-</form>
-
-{% endblock %}

File admin_tools/dashboard/templatetags/admin_tools_dashboard_tags.py

 from admin_tools.dashboard.utils import get_dashboard
 
 register = template.Library()
-tag_func = register.inclusion_tag('dashboard/dummy.html', takes_context=True)
+tag_func = register.inclusion_tag('admin_tools/dashboard/dummy.html', takes_context=True)
 
 
 def admin_tools_render_dashboard(context, location='index', dashboard=None):
         dashboard = get_dashboard(context, location)
 
     context.update({
-        'template' : 'dashboard/css.html',
+        'template' : 'admin_tools/dashboard/css.html',
         'css_files': dashboard.Media.css,
         'media_url': get_media_url(),
     })

File admin_tools/dashboard/views.py

             return HttpResponse('false')
     else:
         form = DashboardPreferencesForm(user=request.user, instance=preferences)
-    return direct_to_template(request, 'dashboard/preferences_form.html', {
+    return direct_to_template(request, 'admin_tools/dashboard/preferences_form.html', {
         'form': form,   
     })
 

File admin_tools/menu/models.py

         A string representing the path to template to use to render the menu.
         As for any other template, the path must be relative to one of the 
         directories of your ``TEMPLATE_DIRS`` setting.
-        Default value: "menu/menu.html".
+        Default value: "admin_tools/menu/menu.html".
     
     ``children``
         A list of children menu items. All children items mus be instances of
         """
         Menu constructor.
         """
-        self.template = kwargs.get('template', 'menu/menu.html')
+        self.template = kwargs.get('template', 'admin_tools/menu/menu.html')
         self.children = kwargs.get('children', [])
 
     def init_with_context(self, context):
 
     ``template``
         The template to use to render the menu item.
-        Default value: 'menu/item.html'.
+        Default value: 'admin_tools/menu/item.html'.
 
     ``children``
         A list of children menu items. All children items must be instances of
         self.accesskey = kwargs.get('accesskey')
         self.description = kwargs.get('description')
         self.enabled = kwargs.get('enabled', True)
-        self.template = kwargs.get('template', 'menu/item.html')
+        self.template = kwargs.get('template', 'admin_tools/menu/item.html')
         self.children = kwargs.get('children', [])
 
     def init_with_context(self, context):

File admin_tools/menu/templates/admin_tools/menu/add_bookmark_form.html

+<form id="bookmark-form" action="{% url admin-tools-menu-add-bookmark %}" method="POST">
+    <input type="hidden" name="next" value="{% firstof url request.get_full_path|urlencode %}" />
+    <input type="hidden" name="url" value="{% firstof url request.get_full_path|urlencode %}" />
+    <input type="hidden" name="title" value="{{ title }}" />
+    <button id="bookmark-button" type="submit">Add</button>
+</form>

File admin_tools/menu/templates/admin_tools/menu/css.html

+<link rel="stylesheet" href="{{ media_url }}/admin_tools/css/menu.css" type="text/css" media="screen, projection"/>
+<!--[if lt IE 8]>
+<link rel="stylesheet" href="{{ media_url }}/admin_tools/css/menu-ie.css" type="text/css" media="screen, projection"/>
+<![endif]-->
+{% for css in css_files %}
+<link rel="stylesheet" href="{{ media_url }}/{{ css }}" type="text/css" media="screen, projection"/>{% endfor %}

File admin_tools/menu/templates/admin_tools/menu/delete_confirm.html

+{% extends "admin/base_site.html" %}
+
+{% block content %}
+
+<p>Are you sure you want to delete this bookmark?</p>
+
+<p>{{ bookmark.name }} - {{ bookmark.url }}</p>
+
+<form action="." method="POST">
+    <p><input type="submit" value="Delete" /></p>
+</form>
+
+{% endblock %}

File admin_tools/menu/templates/admin_tools/menu/dummy.html

+{% extends template %}

File admin_tools/menu/templates/admin_tools/menu/form.html

+{% extends "admin/base_site.html" %}
+
+{% block content %}
+
+<form action="." method="POST">
+    {{ form.as_p }}
+    <p><input type="submit" value="Save" /></p>
+</form>
+
+{% endblock %}

File admin_tools/menu/templates/admin_tools/menu/item.html

+{% load admin_tools_menu_tags %}
+{% spaceless %}
+<li class="menu-item{% ifequal index 1 %} first{% endifequal %}{% if not item.enabled %} disabled{% endif %}{% if item.css_classes %} {{ item.css_classes|join:' ' }}{% endif %}">
+    <a{% if item.url and item.enabled %} href="{{ item.url }}"{% endif %}{% if item.description %} title="{{ item.description }}"{% endif %}{% if item.accesskey %} accesskey="{{ item.accesskey }}"{% endif %}>{% if item.children %}<span class="icon"></span>{% endif %}{{ item.title }}</a>
+    {% if item.children %}
+    <ul>
+        {% for child_item in item.children %}
+        {% admin_tools_render_menu_item child_item %}
+        {% endfor %}
+    </ul>
+    {% endif %}
+</li>
+{% endspaceless %}

File admin_tools/menu/templates/admin_tools/menu/menu.html

+{% load i18n admin_tools_menu_tags %}
+{% if menu.children %}
+<script type="text/javascript" charset="utf-8">
+    // load jquery if it's not loaded yet
+    if (typeof jQuery == 'undefined') {
+        var jquery_url = '{{ media_url }}/admin_tools/js/jquery/jquery-1.4.1.min.js';
+        document.write(unescape('%3Cscript src="' + jquery_url + '" type="text/javascript"%3E%3C/script%3E'));
+    }
+</script>
+<script type="text/javascript" charset="utf-8">
+    // load json if it's not loaded yet
+    if (typeof JSON == 'undefined') {
+        var script_url = '{{ media_url }}/admin_tools/js/json.min.js';
+        document.write(unescape('%3Cscript src="' + script_url + '" type="text/javascript"%3E%3C/script%3E'));
+    }
+</script>
+<script type="text/javascript" charset="utf-8" src="{{ media_url }}/admin_tools/js/menu.js"></script>
+<!--[if IE 6]>
+<script type="text/javascript">
+jQuery(document).ready(function() {
+    jQuery('#navigation-menu').children('li').hover(
+        function() { jQuery(this).addClass('over'); },
+        function() { jQuery(this).removeClass('over'); }
+    });
+});
+</script>
+<![endif]-->
+{% if has_bookmark_item %}
+<script type="text/javascript">
+jQuery(function($) {
+        process_bookmarks("{{ request.get_full_path }}", "{{ title }}", "{% trans 'Please enter a name for the bookmark' %}");
+});
+</script>
+
+{% if bookmark %}
+{% include "admin_tools/menu/remove_bookmark_form.html" %}
+{% else %}
+{% include "admin_tools/menu/add_bookmark_form.html" %}
+{% endif %}
+
+{% endif %}
+<ul id="navigation-menu">
+    {% for item in menu.children %}{% admin_tools_render_menu_item item forloop.counter %}{% endfor %}
+</ul>
+{% endif %}

File admin_tools/menu/templates/admin_tools/menu/menu.txt

+from django.core.urlresolvers import reverse
+from django.utils.translation import ugettext_lazy as _
+from admin_tools.menu.models import *
+
+# to activate your custom menu add the following to your settings.py:
+#
+# ADMIN_TOOLS_MENU = '{{ project }}.{{ file }}.CustomMenu'
+
+class CustomMenu(Menu):
+    """
+    Custom Menu for {{ project }} admin site.
+    """
+    def __init__(self, **kwargs):
+        Menu.__init__(self, **kwargs)
+        self.children.append(MenuItem(
+            title=_('Dashboard'),
+            url=reverse('admin:index')
+        ))
+        self.children.append(AppListMenuItem(
+            title=_('Applications'),
+            exclude_list=('django.contrib',)
+        ))
+        self.children.append(AppListMenuItem(
+            title=_('Administration'),
+            include_list=('django.contrib',)
+        ))
+
+    def init_with_context(self, context):
+        """
+        Use this method if you need to access the request context.
+        """
+        pass

File admin_tools/menu/templates/admin_tools/menu/remove_bookmark_form.html

+<form id="bookmark-form" action="{% url admin-tools-menu-remove-bookmark bookmark.id %}" method="POST">
+    <input type="hidden" name="next" value="{% firstof url request.get_full_path|urlencode %}" />
+    <button id="bookmark-button" class="bookmarked" type="submit">Remove</button>
+</form>

File admin_tools/menu/templates/menu/add_bookmark_form.html

-<form id="bookmark-form" action="{% url admin-tools-menu-add-bookmark %}" method="POST">
-    <input type="hidden" name="next" value="{% firstof url request.get_full_path|urlencode %}" />
-    <input type="hidden" name="url" value="{% firstof url request.get_full_path|urlencode %}" />
-    <input type="hidden" name="title" value="{{ title }}" />
-    <button id="bookmark-button" type="submit">Add</button>
-</form>

File admin_tools/menu/templates/menu/css.html

-<link rel="stylesheet" href="{{ media_url }}/admin_tools/css/menu.css" type="text/css" media="screen, projection"/>
-<!--[if lt IE 8]>
-<link rel="stylesheet" href="{{ media_url }}/admin_tools/css/menu-ie.css" type="text/css" media="screen, projection"/>
-<![endif]-->
-{% for css in css_files %}
-<link rel="stylesheet" href="{{ media_url }}/{{ css }}" type="text/css" media="screen, projection"/>{% endfor %}

File admin_tools/menu/templates/menu/delete_confirm.html

-{% extends "admin/base_site.html" %}
-
-{% block content %}
-
-<p>Are you sure you want to delete this bookmark?</p>
-
-<p>{{ bookmark.name }} - {{ bookmark.url }}</p>
-
-<form action="." method="POST">
-    <p><input type="submit" value="Delete" /></p>
-</form>
-
-{% endblock %}

File admin_tools/menu/templates/menu/dummy.html

-{% extends template %}

File admin_tools/menu/templates/menu/form.html

-{% extends "admin/base_site.html" %}
-
-{% block content %}
-
-<form action="." method="POST">
-    {{ form.as_p }}
-    <p><input type="submit" value="Save" /></p>
-</form>
-
-{% endblock %}

File admin_tools/menu/templates/menu/item.html

-{% load admin_tools_menu_tags %}
-{% spaceless %}
-<li class="menu-item{% ifequal index 1 %} first{% endifequal %}{% if not item.enabled %} disabled{% endif %}{% if item.css_classes %} {{ item.css_classes|join:' ' }}{% endif %}">
-    <a{% if item.url and item.enabled %} href="{{ item.url }}"{% endif %}{% if item.description %} title="{{ item.description }}"{% endif %}{% if item.accesskey %} accesskey="{{ item.accesskey }}"{% endif %}>{% if item.children %}<span class="icon"></span>{% endif %}{{ item.title }}</a>
-    {% if item.children %}
-    <ul>
-        {% for child_item in item.children %}
-        {% admin_tools_render_menu_item child_item %}
-        {% endfor %}
-    </ul>
-    {% endif %}
-</li>
-{% endspaceless %}

File admin_tools/menu/templates/menu/menu.html

-{% load i18n admin_tools_menu_tags %}
-{% if menu.children %}
-<script type="text/javascript" charset="utf-8">
-    // load jquery if it's not loaded yet
-    if (typeof jQuery == 'undefined') {
-        var jquery_url = '{{ media_url }}/admin_tools/js/jquery/jquery-1.4.1.min.js';
-        document.write(unescape('%3Cscript src="' + jquery_url + '" type="text/javascript"%3E%3C/script%3E'));
-    }
-</script>
-<script type="text/javascript" charset="utf-8">
-    // load json if it's not loaded yet
-    if (typeof JSON == 'undefined') {
-        var script_url = '{{ media_url }}/admin_tools/js/json.min.js';
-        document.write(unescape('%3Cscript src="' + script_url + '" type="text/javascript"%3E%3C/script%3E'));
-    }
-</script>
-<script type="text/javascript" charset="utf-8" src="{{ media_url }}/admin_tools/js/menu.js"></script>
-<!--[if IE 6]>
-<script type="text/javascript">
-jQuery(document).ready(function() {
-    jQuery('#navigation-menu').children('li').hover(
-        function() { jQuery(this).addClass('over'); },
-        function() { jQuery(this).removeClass('over'); }
-    });
-});
-</script>
-<![endif]-->
-{% if has_bookmark_item %}
-<script type="text/javascript">
-jQuery(function($) {
-        process_bookmarks("{{ request.get_full_path }}", "{{ title }}", "{% trans 'Please enter a name for the bookmark' %}");
-});
-</script>
-
-{% if bookmark %}
-{% include "menu/remove_bookmark_form.html" %}
-{% else %}
-{% include "menu/add_bookmark_form.html" %}
-{% endif %}
-
-{% endif %}
-<ul id="navigation-menu">
-    {% for item in menu.children %}{% admin_tools_render_menu_item item forloop.counter %}{% endfor %}
-</ul>
-{% endif %}

File admin_tools/menu/templates/menu/menu.txt

-from django.core.urlresolvers import reverse
-from django.utils.translation import ugettext_lazy as _
-from admin_tools.menu.models import *
-
-# to activate your custom menu add the following to your settings.py:
-#
-# ADMIN_TOOLS_MENU = '{{ project }}.{{ file }}.CustomMenu'
-
-class CustomMenu(Menu):
-    """
-    Custom Menu for {{ project }} admin site.
-    """
-    def __init__(self, **kwargs):
-        Menu.__init__(self, **kwargs)
-        self.children.append(MenuItem(
-            title=_('Dashboard'),
-            url=reverse('admin:index')
-        ))
-        self.children.append(AppListMenuItem(
-            title=_('Applications'),
-            exclude_list=('django.contrib',)
-        ))
-        self.children.append(AppListMenuItem(
-            title=_('Administration'),
-            include_list=('django.contrib',)
-        ))
-
-    def init_with_context(self, context):
-        """
-        Use this method if you need to access the request context.
-        """
-        pass

File admin_tools/menu/templates/menu/remove_bookmark_form.html

-<form id="bookmark-form" action="{% url admin-tools-menu-remove-bookmark bookmark.id %}" method="POST">
-    <input type="hidden" name="next" value="{% firstof url request.get_full_path|urlencode %}" />
-    <button id="bookmark-button" class="bookmarked" type="submit">Remove</button>
-</form>

File admin_tools/menu/templatetags/admin_tools_menu_tags.py

 from admin_tools.menu.utils import get_admin_menu
 
 register = template.Library()
-tag_func = register.inclusion_tag('menu/dummy.html', takes_context=True)
+tag_func = register.inclusion_tag('admin_tools/menu/dummy.html', takes_context=True)
 
 def admin_tools_render_menu(context, menu=None):
     """
         menu = get_admin_menu()
 
     context.update({
-        'template': 'menu/css.html',
+        'template': 'admin_tools/menu/css.html',
         'css_files': menu.Media.css,
         'media_url': get_media_url(),
     })

File admin_tools/menu/views.py

                 if request.POST.get('next'):
                     return HttpResponseRedirect(request.POST.get('next'))
                 return HttpResponse('Added')
-            return direct_to_template(request, 'menu/remove_bookmark_form.html', {
+            return direct_to_template(request, 'admin_tools/menu/remove_bookmark_form.html', {
                 'bookmark': bookmark,
                 'url': bookmark.url,
             });
     else:
         form = BookmarkForm(user=request.user)
-    return direct_to_template(request, 'menu/form.html', {
+    return direct_to_template(request, 'admin_tools/menu/form.html', {
         'form': form,   
         'title': 'Add Bookmark',
     })
             return HttpResponse('Saved')
     else:
         form = BookmarkForm(user=request.user, instance=bookmark)
-    return direct_to_template(request, 'menu/form.html', {
+    return direct_to_template(request, 'admin_tools/menu/form.html', {
         'form': form,   
         'title': 'Edit Bookmark',
     })
             if request.POST.get('next'):
                 return HttpResponseRedirect(request.POST.get('next'))
             return HttpResponse('Deleted')
-        return direct_to_template(request, 'menu/add_bookmark_form.html', {
+        return direct_to_template(request, 'admin_tools/menu/add_bookmark_form.html', {
             'url': request.POST.get('next'),
             'title': '**title**' #This gets replaced on the javascript side
         });
-    return direct_to_template(request, 'menu/delete_confirm.html', {
+    return direct_to_template(request, 'admin_tools/menu/delete_confirm.html', {
         'bookmark': bookmark,
         'title': 'Delete Bookmark',
     })