Skip to content
Browse files

fixed 'admin menu'

  • Loading branch information...
1 parent a08a6f6 commit 384a50f82c61f16b57fb146b57a8c0005b40c38f Jonas Obrist committed Apr 3, 2011
Showing with 11 additions and 6 deletions.
  1. +11 −6 cms/cms_toolbar.py
View
17 cms/cms_toolbar.py
@@ -46,10 +46,15 @@ def get_items(self, context, request, **kwargs):
Anchor(LEFT, 'logo', _('django CMS'), 'https://www.django-cms.org'),
]
if is_staff:
+ edit_mode_switcher = Switcher(LEFT, 'editmode', 'edit', 'edit-off',
+ _('Edit mode'))
+
items.append(
- Switcher(LEFT, 'editmode', 'edit', 'edit-off', _('Edit mode'),
- session_key='cms_edit')
+ edit_mode_switcher
)
+
+ self.edit_mode = edit_mode_switcher.get_state(request)
+
if request.current_page:
has_states = request.current_page.last_page_states().exists()
if has_states:
@@ -126,21 +131,21 @@ def get_admin_menu(self, context, request, can_change, is_staff):
admin_items = [
ListItem('admin', _('Site Administration'),
reverse('admin:index'),
- 'cms/img/toolbar/icons/admin/admin.png'),
+ 'cms/images/toolbar/icons/icon_admin.png'),
]
if can_change:
admin_items.append(
ListItem('settings', _('Page Settings'),
_get_page_admin_url,
- 'cms/img/toolbar/icons/admin/page.png')
+ 'cms/images/toolbar/icons/icon_page.png')
)
if 'reversion' in settings.INSTALLED_APPS:
admin_items.append(
ListItem('history', _('View History'),
_get_page_history_url,
- 'cms/img/toolbar/icons/admin/history.png')
+ 'cms/images/toolbar/icons/icon_history.png')
)
- return List(RIGHT, 'admin', _('Admin'), 'cms/img/toolbar/icons/admin.png',
+ return List(RIGHT, 'admin', _('Admin'), 'cms/images/toolbar/icons/icon_admin.png',
items=admin_items)
def request_hook(self, request):

0 comments on commit 384a50f

Please sign in to comment.
Something went wrong with that request. Please try again.