Skip to content

Commit

Permalink
Merge pull request #2743 from digi604/fix-2704
Browse files Browse the repository at this point in the history
added a page settings button instead of publish if there is no title
  • Loading branch information
digi604 committed Feb 27, 2014
2 parents b57c975 + cb4d347 commit 5b5c36d
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions cms/cms_toolbar.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
from cms.api import get_page_draft
from cms.constants import TEMPLATE_INHERITANCE_MAGIC
from cms.constants import TEMPLATE_INHERITANCE_MAGIC, RIGHT
from cms.exceptions import LanguageError
from cms.models import Title
from cms.toolbar.items import TemplateItem
Expand Down Expand Up @@ -101,7 +101,7 @@ def add_admin_menu(self):
for site in sites_queryset:
sites_menu.add_link_item(site.name, url='http://%s' % site.domain,
active=site.pk == self.current_site.pk)
# admin
# admin
admin_menu.add_sideframe_item(_('Administration'), url=reverse('admin:index'))
admin_menu.add_break(ADMINISTRATION_BREAK)
# cms users
Expand Down Expand Up @@ -140,7 +140,7 @@ def populate(self):
self.change_admin_menu()
if self.page:
self.add_page_menu()
# history menu
# history menu
if self.page and self.toolbar.edit_mode:
self.add_history_menu()
self.change_language_menu()
Expand Down Expand Up @@ -330,6 +330,14 @@ def add_page_menu(self):
current_page_menu.add_modal_item(_('Delete page'), url=delete_url, close_on_url=self.toolbar.URL_CHANGE,
on_close=on_delete_redirect_url, disabled=not_edit_mode)

if not self.title:
self.toolbar.add_button(
_("Page settings"),
"%s?language=%s" % (reverse('admin:cms_page_change', args=[self.page.pk]), self.toolbar.language),
side=self.toolbar.RIGHT,
extra_classes=["cms_btn-action"],
)

def add_history_menu(self):
# history menu
history_menu = self.toolbar.get_or_create_menu('history', _('History'), position=2)
Expand Down

0 comments on commit 5b5c36d

Please sign in to comment.