Closed GoogleCodeExporter closed 8 years ago
Martin, thank you for your patch. I've considered a closer integration to the
Django admin before, but I don't
think that is even possible.
Original comment by mbonetti
on 14 Apr 2008 at 9:01
Another option to do this is by creating an empty rosetta model, after that you
can
just overwrite the admin/rosetta/translation url and it will work without
modifying
the admin templates.
The downside is that you'll have an empty table in the database though.
Original comment by Wolphie
on 29 Apr 2008 at 3:50
Alas that's the whole point: being able to enable and disable the application
without the need to sync db's
Original comment by mbonetti
on 29 Apr 2008 at 6:47
That is still possible, since you aren't going to use the table in the model you
won't have to sync the database to make it work.
Original comment by Wolphie
on 30 Apr 2008 at 1:15
Right, here is my final decision on this point: because it is no
straightforward way to do this, the only way this is
gonna happen is rosetta gets officially imported into Django as e.g.
django.contrib.admin.rosetta or if Django
adds a better way to integrate external apps into the admin.
Original comment by mbonetti
on 24 Jun 2008 at 7:35
if you want show only in applications list:
admin/index.html
{% if app_list|length != 1 %}
<div class="module">
<table>
<caption>{% trans "System Translations" %}</caption>
<tr class="row2">
<th scope="row">
<a href="translation/">
{% trans "Translations" %}
</a>
</th>
<td> </td>
<td> </td>
</tr>
</table>
</div>
{% endif %}
Original comment by cet...@gmail.com
on 16 Aug 2011 at 1:11
Another options is to use the 'django-admin-tools' package, or at least its
menu app. Then you can do:
yourproject/settings.py
ADMIN_TOOLS_MENU = 'yourapp.admin.CustomAdminMenu'
yourapp/admin.py
class CustomAdminMenu(Menu):
""" Custom Menu for admin site. """
def __init__(self, **kwargs):
Menu.__init__(self, **kwargs)
self.children += [
items.MenuItem(_('Dashboard'), reverse('admin:index')),
items.Bookmarks(),
items.AppList(
_('Applications'),
exclude=('django.contrib.*',)
),
items.AppList(
_('Administration'),
models=('django.contrib.*',)
),
items.MenuItem(_('Translations'), reverse('rosetta-home')),
]
def init_with_context(self, context):
"""Use this method if you need to access the request context."""
return super(CustomAdminMenu, self).init_with_context(context)
Original comment by anti...@gmail.com
on 2 Feb 2015 at 6:04
Oops, forgot a "from admin_tools.menu import items, Menu" there
Original comment by anti...@gmail.com
on 2 Feb 2015 at 6:17
Or using wp_admin:
settings.py
WPADMIN = { ....
'left': 'consulthelp.admin.CustomLeftMenu',
....
}
yourapp/admin.py
from wpadmin.menu import items
from wpadmin.menu.menus import BasicLeftMenu
class CustomLeftMenu(BasicLeftMenu):
""" Custom Menu for admin site. """
def init_with_context(self, context):
if self.is_user_allowed(context.get('request').user):
super(CustomLeftMenu, self).init_with_context(context)
self.children += [
items.MenuItem(
title=_('Translations'),
icon='fa-book',
url=reverse('rosetta-home'),
description=_('Translations'),
),
]
Original comment by anti...@gmail.com
on 2 Feb 2015 at 6:29
Original issue reported on code.google.com by
iusgent...@gmail.com
on 12 Apr 2008 at 10:30