From efb623af0bcb47d510501c282e1326b11343a29c Mon Sep 17 00:00:00 2001 From: luxagraf Date: Sat, 22 Sep 2012 22:27:04 -0400 Subject: site reorg --- .../admin_tools/menu/add_bookmark_form.html | 9 +++ .../grappelli/templates/admin_tools/menu/css.html | 1 + .../templates/admin_tools/menu/delete_confirm.html | 13 +++++ .../templates/admin_tools/menu/dummy.html | 1 + .../grappelli/templates/admin_tools/menu/form.html | 10 ++++ .../grappelli/templates/admin_tools/menu/item.html | 15 +++++ .../grappelli/templates/admin_tools/menu/menu.html | 64 ++++++++++++++++++++++ .../grappelli/templates/admin_tools/menu/menu.txt | 32 +++++++++++ .../admin_tools/menu/remove_bookmark_form.html | 7 +++ 9 files changed, 152 insertions(+) create mode 100644 app/lib/grappelli/templates/admin_tools/menu/add_bookmark_form.html create mode 100644 app/lib/grappelli/templates/admin_tools/menu/css.html create mode 100644 app/lib/grappelli/templates/admin_tools/menu/delete_confirm.html create mode 100644 app/lib/grappelli/templates/admin_tools/menu/dummy.html create mode 100644 app/lib/grappelli/templates/admin_tools/menu/form.html create mode 100644 app/lib/grappelli/templates/admin_tools/menu/item.html create mode 100644 app/lib/grappelli/templates/admin_tools/menu/menu.html create mode 100644 app/lib/grappelli/templates/admin_tools/menu/menu.txt create mode 100644 app/lib/grappelli/templates/admin_tools/menu/remove_bookmark_form.html (limited to 'app/lib/grappelli/templates/admin_tools/menu') diff --git a/app/lib/grappelli/templates/admin_tools/menu/add_bookmark_form.html b/app/lib/grappelli/templates/admin_tools/menu/add_bookmark_form.html new file mode 100644 index 0000000..e0fcf2a --- /dev/null +++ b/app/lib/grappelli/templates/admin_tools/menu/add_bookmark_form.html @@ -0,0 +1,9 @@ +{% url admin-tools-menu-add-bookmark as form_url %} +{% if form_url %} +
+ + + + +
+{% endif %} diff --git a/app/lib/grappelli/templates/admin_tools/menu/css.html b/app/lib/grappelli/templates/admin_tools/menu/css.html new file mode 100644 index 0000000..71aefdb --- /dev/null +++ b/app/lib/grappelli/templates/admin_tools/menu/css.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/lib/grappelli/templates/admin_tools/menu/delete_confirm.html b/app/lib/grappelli/templates/admin_tools/menu/delete_confirm.html new file mode 100644 index 0000000..e32a678 --- /dev/null +++ b/app/lib/grappelli/templates/admin_tools/menu/delete_confirm.html @@ -0,0 +1,13 @@ +{% extends "admin/base_site.html" %} + +{% block content %} + +

Are you sure you want to delete this bookmark?

+ +

{{ bookmark.name }} - {{ bookmark.url }}

+ +
+

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

+
+ +{% endblock %} diff --git a/app/lib/grappelli/templates/admin_tools/menu/item.html b/app/lib/grappelli/templates/admin_tools/menu/item.html new file mode 100644 index 0000000..9bf8bbd --- /dev/null +++ b/app/lib/grappelli/templates/admin_tools/menu/item.html @@ -0,0 +1,15 @@ +{% load admin_tools_menu_tags %} +{% spaceless %} +{% if not item.is_empty %} + +{% endif %} +{% endspaceless %} diff --git a/app/lib/grappelli/templates/admin_tools/menu/menu.html b/app/lib/grappelli/templates/admin_tools/menu/menu.html new file mode 100644 index 0000000..f43dc23 --- /dev/null +++ b/app/lib/grappelli/templates/admin_tools/menu/menu.html @@ -0,0 +1,64 @@ +{% load i18n admin_tools_menu_tags %} +{% if menu.children %} + + + {% comment %} + {% for item in menu.children %} + + {% endfor %} + {% endcomment %} + {% for item in menu.children %} + + {% 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 %} diff --git a/app/lib/grappelli/templates/admin_tools/menu/menu.txt b/app/lib/grappelli/templates/admin_tools/menu/menu.txt new file mode 100644 index 0000000..72d20da --- /dev/null +++ b/app/lib/grappelli/templates/admin_tools/menu/menu.txt @@ -0,0 +1,32 @@ +from django.core.urlresolvers import reverse +from django.utils.translation import ugettext_lazy as _ +from admin_tools.menu import items, Menu + +# 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(items.MenuItem( + title=_('Dashboard'), + url=reverse('admin:index') + )) + self.children.append(items.AppList( + title=_('Applications'), + models=('add.your.app.models.here',) + )) + self.children.append(items.AppList( + title=_('Administration'), + models=('django.contrib',) + )) + + 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/menu/remove_bookmark_form.html b/app/lib/grappelli/templates/admin_tools/menu/remove_bookmark_form.html new file mode 100644 index 0000000..7d9567f --- /dev/null +++ b/app/lib/grappelli/templates/admin_tools/menu/remove_bookmark_form.html @@ -0,0 +1,7 @@ +{% url admin-tools-menu-remove-bookmark bookmark.id as form_url %} +{% if form_url %} +
+ + +
+{% endif %} -- cgit v1.2.3-70-g09d2