Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

added a page settings button instead of publish if there is no title #2743

Merged
merged 1 commit into from

1 participant

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 11 additions and 3 deletions.
  1. +11 −3 cms/cms_toolbar.py
View
14 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
@@ -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)
Something went wrong with that request. Please try again.