From efb623af0bcb47d510501c282e1326b11343a29c Mon Sep 17 00:00:00 2001 From: luxagraf Date: Sat, 22 Sep 2012 22:27:04 -0400 Subject: site reorg --- .../templates/admin_tools/dashboard/css.html | 2 + .../templates/admin_tools/dashboard/dashboard.html | 79 ++++++++++++ .../templates/admin_tools/dashboard/dashboard.txt | 141 +++++++++++++++++++++ .../admin_tools/dashboard/dashboard_app_index.txt | 29 +++++ .../templates/admin_tools/dashboard/dummy.html | 1 + .../templates/admin_tools/dashboard/module.html | 7 + .../admin_tools/dashboard/modules/app_list.html | 58 +++++++++ .../admin_tools/dashboard/modules/column.html | 9 ++ .../admin_tools/dashboard/modules/feed.html | 21 +++ .../admin_tools/dashboard/modules/group.html | 33 +++++ .../admin_tools/dashboard/modules/link_list.html | 21 +++ .../admin_tools/dashboard/modules/model_list.html | 26 ++++ .../dashboard/modules/module_group.html | 10 ++ .../dashboard/modules/recent_actions.html | 26 ++++ .../admin_tools/dashboard/preferences_form.html | 10 ++ 15 files changed, 473 insertions(+) create mode 100644 app/lib/grappelli/templates/admin_tools/dashboard/css.html create mode 100644 app/lib/grappelli/templates/admin_tools/dashboard/dashboard.html create mode 100644 app/lib/grappelli/templates/admin_tools/dashboard/dashboard.txt create mode 100644 app/lib/grappelli/templates/admin_tools/dashboard/dashboard_app_index.txt create mode 100644 app/lib/grappelli/templates/admin_tools/dashboard/dummy.html create mode 100644 app/lib/grappelli/templates/admin_tools/dashboard/module.html create mode 100644 app/lib/grappelli/templates/admin_tools/dashboard/modules/app_list.html create mode 100644 app/lib/grappelli/templates/admin_tools/dashboard/modules/column.html create mode 100644 app/lib/grappelli/templates/admin_tools/dashboard/modules/feed.html create mode 100644 app/lib/grappelli/templates/admin_tools/dashboard/modules/group.html create mode 100644 app/lib/grappelli/templates/admin_tools/dashboard/modules/link_list.html create mode 100644 app/lib/grappelli/templates/admin_tools/dashboard/modules/model_list.html create mode 100644 app/lib/grappelli/templates/admin_tools/dashboard/modules/module_group.html create mode 100644 app/lib/grappelli/templates/admin_tools/dashboard/modules/recent_actions.html create mode 100644 app/lib/grappelli/templates/admin_tools/dashboard/preferences_form.html (limited to 'app/lib/grappelli/templates/admin_tools/dashboard') diff --git a/app/lib/grappelli/templates/admin_tools/dashboard/css.html b/app/lib/grappelli/templates/admin_tools/dashboard/css.html new file mode 100644 index 0000000..0c69fd1 --- /dev/null +++ b/app/lib/grappelli/templates/admin_tools/dashboard/css.html @@ -0,0 +1,2 @@ +{% for css in css_files %} +{% endfor %} diff --git a/app/lib/grappelli/templates/admin_tools/dashboard/dashboard.html b/app/lib/grappelli/templates/admin_tools/dashboard/dashboard.html new file mode 100644 index 0000000..76aaa1e --- /dev/null +++ b/app/lib/grappelli/templates/admin_tools/dashboard/dashboard.html @@ -0,0 +1,79 @@ +{% load i18n admin_tools_dashboard_tags %} + + + + + +{% if dashboard.Media.js %} + {% for js in dashboard.Media.js %} + + {% endfor %} +{% endif %} + +
+
+ {% for module in dashboard.children %} + {% if "column_1" in module.css_classes %} + {% admin_tools_render_dashboard_module module forloop.counter %} + {% endif %} + {% endfor %} +
+
+ {% for module in dashboard.children %} + {% if "column_2" in module.css_classes %} + {% admin_tools_render_dashboard_module module forloop.counter %} + {% endif %} + {% endfor %} +
+
+ {% for module in dashboard.children %} + {% if "column_3" in module.css_classes %} + {% admin_tools_render_dashboard_module module forloop.counter %} + {% endif %} + {% endfor %} +
+
diff --git a/app/lib/grappelli/templates/admin_tools/dashboard/dashboard.txt b/app/lib/grappelli/templates/admin_tools/dashboard/dashboard.txt new file mode 100644 index 0000000..4417070 --- /dev/null +++ b/app/lib/grappelli/templates/admin_tools/dashboard/dashboard.txt @@ -0,0 +1,141 @@ +from django.utils.translation import ugettext_lazy as _ +from django.core.urlresolvers import reverse +from admin_tools.dashboard import modules, Dashboard, AppIndexDashboard + +# 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(modules.LinkList( + # 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') + # }, + # ] + #)) + + self.children.append(modules.LinkList( + column=1, + title=_('Media Management'), + children=[ + { + 'title': _('Django FileBrowser'), + 'url': '/admin/filebrowser/browse/', + 'external': False, + }, + ] + )) + + # append an app list module for "Administration" + self.children.append(modules.AppList( + title=_('Administration'), + include_list=('django.contrib',), + css_classes=['collapse', 'open'], + )) + + # append an app list module for "Applications" + self.children.append(modules.AppList( + title=_('Applications'), + exclude_list=('django.contrib',), + css_classes=['collapse', 'open'], + )) + + # append a recent actions module + self.children.append(modules.RecentActions( + column=2, + title=_('Recent Actions'), + limit=5 + )) + + # append a feed module + self.children.append(modules.Feed( + column=2, + title=_('Latest Django News'), + feed_url='http://www.djangoproject.com/rss/weblog/', + limit=5 + )) + + # append another link list module for "support". + self.children.append(modules.LinkList( + column=2, + 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(modules.ModelList( + title=_(self.app_title), + models=self.models, + )) + + # append a recent actions module + self.children.append(modules.RecentActions( + column=2, + 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 diff --git a/app/lib/grappelli/templates/admin_tools/dashboard/dashboard_app_index.txt b/app/lib/grappelli/templates/admin_tools/dashboard/dashboard_app_index.txt new file mode 100644 index 0000000..0574dfc --- /dev/null +++ b/app/lib/grappelli/templates/admin_tools/dashboard/dashboard_app_index.txt @@ -0,0 +1,29 @@ +from django.utils.translation import ugettext_lazy as _ +from django.core.urlresolvers import reverse +from admin_tools.dashboard import modules, AppIndexDashboard + +# create your custom modules here if you want, for example: +# +# class CustomDashboardModule(modules.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(modules.RecentActionsDashboardModule( + # title=_('Recent Actions'), + # limit=5, + # include_list=models, + # )) diff --git a/app/lib/grappelli/templates/admin_tools/dashboard/dummy.html b/app/lib/grappelli/templates/admin_tools/dashboard/dummy.html new file mode 100644 index 0000000..f04fcf5 --- /dev/null +++ b/app/lib/grappelli/templates/admin_tools/dashboard/dummy.html @@ -0,0 +1 @@ +{% extends template %} diff --git a/app/lib/grappelli/templates/admin_tools/dashboard/module.html b/app/lib/grappelli/templates/admin_tools/dashboard/module.html new file mode 100644 index 0000000..85f55f8 --- /dev/null +++ b/app/lib/grappelli/templates/admin_tools/dashboard/module.html @@ -0,0 +1,7 @@ +{% if not module.is_empty %} + {% block module_content %} + {% for child in module.children %} + {{ child }} + {% endfor %} + {% endblock %} +{% endif %} diff --git a/app/lib/grappelli/templates/admin_tools/dashboard/modules/app_list.html b/app/lib/grappelli/templates/admin_tools/dashboard/modules/app_list.html new file mode 100644 index 0000000..8cbd4a7 --- /dev/null +++ b/app/lib/grappelli/templates/admin_tools/dashboard/modules/app_list.html @@ -0,0 +1,58 @@ +{% extends "admin_tools/dashboard/module.html" %} +{% load i18n %} +{% block module_content %} +
+ + {% if module.title %} + {% if subindex %} +

{{ module.title }}

+ {% else %} +

{{ module.title }}

+ {% endif %} + {% endif %} + +{% spaceless %} + {% if module.pre_content %} +

{{ module.pre_content }}

+ {% endif %} + {% for child in module.children %} + +
+ {% if subindex %} +

{{ child.title }}

+ {% else %} +

{{ child.title }}

+ {% endif %} + + {% for model in child.models %} +
+ {% if model.change_url %} + {{ model.title }} + {% else %} + {{ model.title }} + {% endif %} + {% if model.add_url or model.change_url %} + + {% endif %} +
+ {% endfor %} + +
+ {% endfor %} + {% if module.post_content %} +

{{ module.post_content }}

+ {% endif %} +{% endspaceless %} +
+{% endblock %} diff --git a/app/lib/grappelli/templates/admin_tools/dashboard/modules/column.html b/app/lib/grappelli/templates/admin_tools/dashboard/modules/column.html new file mode 100644 index 0000000..8df8268 --- /dev/null +++ b/app/lib/grappelli/templates/admin_tools/dashboard/modules/column.html @@ -0,0 +1,9 @@ +{% extends "dashboard/module.html" %} +{% load i18n admin_tools_dashboard_tags %} +{% block module_content %} +
+ {% for child in module.children %} + {% admin_tools_render_dashboard_module child forloop.counter %} + {% endfor %} +
+{% endblock %} \ No newline at end of file diff --git a/app/lib/grappelli/templates/admin_tools/dashboard/modules/feed.html b/app/lib/grappelli/templates/admin_tools/dashboard/modules/feed.html new file mode 100644 index 0000000..3deec4e --- /dev/null +++ b/app/lib/grappelli/templates/admin_tools/dashboard/modules/feed.html @@ -0,0 +1,21 @@ +{% extends "admin_tools/dashboard/module.html" %} +{% block module_content %} +{% if subindex %} +
+

{{ module.title }}

+{% else %} +
+

{{ module.title }}

+{% endif %} +
    + {% spaceless %} + {% for child in module.children %} +
  • + {% if child.date %}{{ child.date|date }} {% endif %} + {% if child.warning %}{{ child.title }}{% else %}{{ child.title }}{% endif %} +
  • + {% endfor %} + {% endspaceless %} +
+
+{% endblock %} diff --git a/app/lib/grappelli/templates/admin_tools/dashboard/modules/group.html b/app/lib/grappelli/templates/admin_tools/dashboard/modules/group.html new file mode 100644 index 0000000..144c82f --- /dev/null +++ b/app/lib/grappelli/templates/admin_tools/dashboard/modules/group.html @@ -0,0 +1,33 @@ +{% extends "admin_tools/dashboard/module.html" %} +{% load admin_tools_dashboard_tags %} +{% block module_content %} +
+ {% spaceless %} + {% if module.title %} +

{{ module.title }}

+ {% endif %} + {% ifequal module.display "tabs" %} +
+
    + {% for sub_module in module.children %} + {% if not sub_module.is_empty %}{% endif %} + {% endfor %} +
+ {% for sub_module in module.children %} + {% admin_tools_render_dashboard_module sub_module index forloop.counter %} + {% endfor %} +
+ {% endifequal %} + {% ifequal module.display "accordion" %} + {% for sub_module in module.children %} + {% if not sub_module.is_empty %}{{ sub_module.title }}{% endif %} + {% admin_tools_render_dashboard_module sub_module index forloop.counter %} + {% endfor %} + {% else %} + + {% endifequal %} + + + {% endspaceless %} +
+{% endblock %} diff --git a/app/lib/grappelli/templates/admin_tools/dashboard/modules/link_list.html b/app/lib/grappelli/templates/admin_tools/dashboard/modules/link_list.html new file mode 100644 index 0000000..97b357e --- /dev/null +++ b/app/lib/grappelli/templates/admin_tools/dashboard/modules/link_list.html @@ -0,0 +1,21 @@ +{% extends "admin_tools/dashboard/module.html" %} +{% block module_content %} + +{% endblock %} diff --git a/app/lib/grappelli/templates/admin_tools/dashboard/modules/model_list.html b/app/lib/grappelli/templates/admin_tools/dashboard/modules/model_list.html new file mode 100644 index 0000000..7431f8f --- /dev/null +++ b/app/lib/grappelli/templates/admin_tools/dashboard/modules/model_list.html @@ -0,0 +1,26 @@ +{% extends "admin_tools/dashboard/module.html" %} +{% load i18n %} +{% block module_content %} +
+ {% if module.title %} + {% if subindex %} +

{{ module.title }}

+ {% else %} +

{{ module.title }}

+ {% endif %} + {% endif %} + + {% for child in module.children %} +
+ {% if child.change_url %}{{ child.title }}{% else %}{{ child.title }}{% endif %} + + {% if child.add_url or child.change_url %} + + {% endif %} +
+ {% endfor %} +
+{% endblock %} diff --git a/app/lib/grappelli/templates/admin_tools/dashboard/modules/module_group.html b/app/lib/grappelli/templates/admin_tools/dashboard/modules/module_group.html new file mode 100644 index 0000000..8e0f256 --- /dev/null +++ b/app/lib/grappelli/templates/admin_tools/dashboard/modules/module_group.html @@ -0,0 +1,10 @@ +{% extends "dashboard/module.html" %} +{% load i18n admin_tools_dashboard_tags %} +{% block module_content %} +
+

{{ module.title }}

+ {% for sub_module in module.children %} + {% admin_tools_render_dashboard_module sub_module forloop.counter %} + {% endfor %} +
+{% endblock %} diff --git a/app/lib/grappelli/templates/admin_tools/dashboard/modules/recent_actions.html b/app/lib/grappelli/templates/admin_tools/dashboard/modules/recent_actions.html new file mode 100644 index 0000000..0b7bb9e --- /dev/null +++ b/app/lib/grappelli/templates/admin_tools/dashboard/modules/recent_actions.html @@ -0,0 +1,26 @@ +{% extends "admin_tools/dashboard/module.html" %} +{% load i18n %} +{% block module_content %} +{% if subindex %} +
+

{% trans 'Recent Actions' %}

+
+

{% trans 'My Actions' %}

+{% else %} +
+

{% trans 'Recent Actions' %}

+
+

{% trans 'My Actions' %}

+{% endif %} + {% if module.children %} + + {% else %} +

{% trans 'None Available' %}

+ {% endif %} +
+
+{% endblock %} diff --git a/app/lib/grappelli/templates/admin_tools/dashboard/preferences_form.html b/app/lib/grappelli/templates/admin_tools/dashboard/preferences_form.html new file mode 100644 index 0000000..7da463a --- /dev/null +++ b/app/lib/grappelli/templates/admin_tools/dashboard/preferences_form.html @@ -0,0 +1,10 @@ +{% extends "admin/base_site.html" %} + +{% block content %} + +
+ {{ form.as_p }} +

+
+ +{% endblock %} -- cgit v1.2.3-70-g09d2