Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #2743 from digi604/fix-2704

added a page settings button instead of publish if there is no title
  • Loading branch information...
commit 5b5c36d23d7c9181f4aab44e1e141d1dae770a9c 2 parents b57c975 + cb4d347
Patrick Lauber digi604 authored
Showing with 11 additions and 3 deletions.
  1. +11 −3 cms/cms_toolbar.py
14 cms/cms_toolbar.py
View
@@ -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
@@ -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
@@ -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()
@@ -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)
Please sign in to comment.
Something went wrong with that request. Please try again.